結果
| 問題 | No.432 占い(Easy) |
| コンテスト | |
| ユーザー |
hanorver
|
| 提出日時 | 2016-10-14 22:28:33 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 459 bytes |
| 記録 | |
| コンパイル時間 | 406 ms |
| コンパイル使用メモリ | 74,624 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-16 10:12:32 |
| 合計ジャッジ時間 | 1,404 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
hanorver