結果
| 問題 |
No.1343 Dividing Digit
|
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2021-06-08 17:57:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 420 bytes |
| コンパイル時間 | 5,043 ms |
| コンパイル使用メモリ | 338,760 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-26 21:15:06 |
| 合計ジャッジ時間 | 6,633 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 WA * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_int mp;
int main(){
int N,K;
cin>>N>>K;
vector<int> A(N);
int s=0;
for(int i=0;i<N;i++){
cin>>A[i];
s+=A[i];
}
int ans=0;
int temp=1;
for(int i=N-1;i>=0;i--){
ans=(ans+temp*A[i])%s;
temp=(temp*K)%s;
}
cout<<ans<<endl;
}
ytft