結果
問題 |
No.432 占い(Easy)
|
ユーザー |
![]() |
提出日時 | 2020-03-01 12:44:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 428 bytes |
コンパイル時間 | 1,746 ms |
コンパイル使用メモリ | 168,208 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 20:33:36 |
合計ジャッジ時間 | 2,313 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 14 WA * 8 |
ソースコード
#include<bits/stdc++.h> int main(){ int q;std::cin>>q; for(int i=0;i<q;i++){ std::string s;std::cin>>s; int n=s.length(); std::vector<int>a(n); for(int i=0;i<n;i++)a.at(i)=s.at(i)-'0'; for(int i=n-1;i>=0;i--){ for(int j=0;j<i;j++){ a.at(j)+=a.at(j+1); a.at(j)%=9; } } std::cout<<a.at(0)<<std::endl; } }