結果
| 問題 |
No.1343 Dividing Digit
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-14 22:42:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 572 bytes |
| コンパイル時間 | 279 ms |
| コンパイル使用メモリ | 39,040 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 10:33:05 |
| 合計ジャッジ時間 | 1,350 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | WA * 22 |
ソースコード
#include <stdio.h>
#include <math.h>
int keta(int N,int keta,int K){
for(int i =0;i<=keta;i++){
N*=keta;
}
return keta;
}
int read(){
int x=0; char c;
while(((c=getchar())>'9' || c<'0')&&c!='-');
const int f=(c=='-')&&(c=getchar());
while(x=x*10-48+c,(c=getchar())>='0'&&c<='9');
return f?-x:x;
}
int main(void){
int N=read();
int K=read();
int x = 0;
int y = 0;
int buf = 0;
for(int i = 0;i<N;i++){
x += (pow(K,N-1-i)*(buf=read()));
y +=buf;
}
printf("%d",x%y);
return 0;
}