結果
| 問題 |
No.1343 Dividing Digit
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-16 13:05:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 2,000 ms |
| コード長 | 236 bytes |
| コンパイル時間 | 1,561 ms |
| コンパイル使用メモリ | 165,324 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-27 13:03:37 |
| 合計ジャッジ時間 | 2,738 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
#include<bits/stdc++.h>
#define int long long
using namespace std;
int N,K,A[1<<20],sum,ans;
signed main(){
cin>>N>>K;
for(int i=0;i<N;i++)cin>>A[i],sum+=A[i];
for(int i=0;i<N;i++)ans=(ans*K+A[i])%sum;
cout<<ans<<endl;
}