結果
| 問題 |
No.988 N×Mマス計算(総和)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-07 04:24:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 294 bytes |
| コンパイル時間 | 471 ms |
| コンパイル使用メモリ | 63,784 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 06:50:25 |
| 合計ジャッジ時間 | 2,644 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 RE * 11 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
7 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int N,M;
char op;
long A[100],B[100];
long K,ans;
main()
{
cin>>N>>M>>K;
cin>>op;
long Bs=0;
for(int j=0;j<M;j++)
{
cin>>B[j];
(Bs+=B[j])%=K;
}
for(int i=0;i<N;i++)
{
cin>>A[i];
(ans+=op=='+'?A[i]*M+Bs:A[i]*Bs)%=K;
}
cout<<ans<<endl;
}