結果
| 問題 |
No.434 占い
|
| コンテスト | |
| ユーザー |
Kmcode1
|
| 提出日時 | 2016-10-14 23:08:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 549 bytes |
| コンパイル時間 | 1,643 ms |
| コンパイル使用メモリ | 161,752 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-22 09:47:40 |
| 合計ジャッジ時間 | 2,586 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 4 WA * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%s", buf);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int t;
char buf[100002];
vector<int> v;
int main(){
cin >> t;
while (t--){
scanf("%s", buf);
v.clear();
int siz = strlen(buf);
for (int i = 0; i < siz; i++){
v.push_back(buf[i] - '0');
}
while (v.size()>1){
vector<int> tmp;
int pr = -1;
for (int i = 0; i + 1 < v.size(); i++){
int F = v[i] + v[i + 1];
if (F >= 10){
F %= 10;
F++;
}
if(pr!=F)tmp.push_back(F);
pr = F;
}
v = tmp;
tmp.clear();
}
printf("%d\n", v[0]);
}
return 0;
}
Kmcode1