QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22563. סכימת סכומים

Statistics

$N$ פרות $(1 \le N \le 50,000)$ ממוספרות בנוחות $1..N$ לומדות הצפנה. למדו דוגמאות ויוצרות משלהן! חסרות ניסיון, האלגוריתם פשוט:

פרה $i$ מקבלת התחלה $C_i$ $(0 \le C_i < 90,000,000)$, וכולן במקביל:

  • תחילה כל אחת מסכמת מספרי $N-1$ האחרות.
  • כשכולן סיימו, כל אחת מחליפה מספרה בסכום שחישבה. נגד מספרים גדולים שומרות שארית מודולו $98,765,431$.

בנובמבר סיפרו לאייל הקורא Canmuu, שהתרשם.

בערב חג מולד ערפילי אמר:

״קל מדי לפצח! חזרו $T$ פעמים $(1 \le T \le 1,414,213,562)$״.

מתוסכלות מחזרות רבות ומשעממות, אחרי שעות ויכוח עם Canmuu הסכימו: אתם מחשבים מספרים לאחר ההצפנה!

*10 ההגשות הראשונות יקבלו משוב נוסף.

קלט

קראו קלט תקני.

  • שורה 1: שלמים $N$, $T$ ברווח.
  • שורות $2..N+1$: שורה $i+1$, שלם יחיד $C_i$.

פלט

כתבו פלט תקני.

  • שורות $1..N$: שורה $i$, שלם יחיד, מספר פרה $i$ בסוף מודולו $98,765,431$.

דוגמאות

קלט 1

3 4
1
0
4

פלט 1

26
25
29

הערה

שלוש פרות, התחלה $1$, $0$, $4$, ארבע חזרות.

טבלת המספרים בכל סיבוב:

סיבוב פרה $1$ פרה $2$ פרה $3$
$0$ $1$ $0$ $4$
$1$ $4$ $5$ $1$
$2$ $6$ $5$ $9$
$3$ $14$ $15$ $11$
$4$ $26$ $25$ $29$

תודות: Neal Wu, 2007

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.