結果
問題 |
No.933 おまわりさんこいつです
|
ユーザー |
![]() |
提出日時 | 2019-11-30 17:13:52 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 386 bytes |
コンパイル時間 | 1,171 ms |
コンパイル使用メモリ | 65,240 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 01:28:22 |
合計ジャッジ時間 | 1,960 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 3 |
ソースコード
#include<iostream> #include<cstring> #include<vector> #include<algorithm> using namespace std; typedef long long ll; int main(){ int n; cin>>n; vector<ll>p(n); for(int i=0;i<n;i++){ cin>>p[i]; } sort(p.begin(),p.end()); ll ans=1; if(p[0]==0){ cout<<0<<endl; } for(int i=0;i<n;i++){ p[i]%=9; ans*=p[i]; ans%=9; } if(ans==0)cout<<9<<endl; else cout<<ans<<endl; }