結果
問題 |
No.432 占い(Easy)
|
ユーザー |
![]() |
提出日時 | 2020-02-21 19:02:34 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 380 bytes |
コンパイル時間 | 386 ms |
コンパイル使用メモリ | 29,696 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-08 19:57:15 |
合計ジャッジ時間 | 1,344 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#include<stdio.h> #include<string.h> int main() { int t; scanf("%d", &t); int i, n; char s[1003]; int a[1003]; for (; t > 0; t--) { scanf("%s", s); n = strlen(s); for (i = 0; i < n; i++) a[i] = s[i] - '0'; while (n > 1) { n--; for (i = 0; i < n; i++) a[i] = (a[i] + a[i + 1]) / 10 + (a[i] + a[i + 1]) % 10; } printf("%d\n", a[0]); } return 0; }