結果
問題 | No.432 占い(Easy) |
ユーザー |
![]() |
提出日時 | 2016-10-14 22:28:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 459 bytes |
コンパイル時間 | 533 ms |
コンパイル使用メモリ | 64,256 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 07:10:43 |
合計ジャッジ時間 | 1,453 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
#include <iostream> #include <string> void solve(){ std::string s; std::cin >> s; while(s.length() != 1){ std::string s2; for(int i = 0; i < s.length() - 1; ++i){ int t = (s[i] - '0') + (s[i + 1] - '0'); if(t / 10 != 0){ t = t % 10 + t / 10; } s2 += t + '0'; } s = s2; } std::cout << s << std::endl; } int main() { int test_case; std::cin >> test_case; for(int i = 0; i < test_case; ++i){ solve(); } return 0; }