結果
問題 |
No.432 占い(Easy)
|
ユーザー |
![]() |
提出日時 | 2018-12-08 19:12:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 339 bytes |
コンパイル時間 | 428 ms |
コンパイル使用メモリ | 31,616 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 06:11:59 |
合計ジャッジ時間 | 1,455 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#include <stdio.h> int main() { int Test; scanf("%d", &Test); while (Test--){ char S[1010]; scanf ("%s",S); int l = 0; while (S[l]) l++; for (int i=l;i>=2;i--){ for (int j=0;j<i-1;j++){ int u = S[j] - '0' + S[j+1] - '0'; if (u >= 10) u -= 9; S[j] = u + '0'; } } putchar(S[0]); puts(""); } return 0; }