結果
問題 |
No.1343 Dividing Digit
|
ユーザー |
|
提出日時 | 2021-01-16 15:50:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 436 bytes |
コンパイル時間 | 1,789 ms |
コンパイル使用メモリ | 169,220 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-27 18:47:19 |
合計ジャッジ時間 | 3,122 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 22 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) int main(){ int n,k; cin>>n>>k; vector<int>a(n); ll wa=0; rep(i,n){ cin>>a[i]; wa+=a[i]; } ll sum=0; ll bai=1; rep(i,n){ sum+=bai*a[n-i-1]; sum%=wa; bai*=k; } ll ans=sum%wa; //cout<<sum<<endl; cout<<ans<<endl; return 0; }