結果
| 問題 |
No.1343 Dividing Digit
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-16 15:47:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 394 bytes |
| コンパイル時間 | 1,445 ms |
| コンパイル使用メモリ | 169,840 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-27 18:43:27 |
| 合計ジャッジ時間 | 2,467 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
rep(i,n){
sum+=pow(k,i)*a[n-i-1];
}
ll ans=sum%wa;
//cout<<sum<<endl;
cout<<ans<<endl;
return 0;
}