結果
| 問題 | No.988 N×Mマス計算(総和) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-01 14:14:26 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 651 bytes |
| 記録 | |
| コンパイル時間 | 344 ms |
| コンパイル使用メモリ | 76,648 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-03-27 19:38:55 |
| 合計ジャッジ時間 | 1,334 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 3 WA * 16 |
ソースコード
#include <iostream>
#include<string>
using namespace std;
int main(void){
int n, m, k, ans = 0;
string ope;
int b = 0, a = 0, btmp;
cin >> n >> m >> k >> ope;
for(int i = 0; i < m; i++){
cin >> btmp;
b += btmp;
b %= k;
}
if (ope == "*"){
for(int i = 0; i < n; i++){
cin >> a;
ans += a * b;
ans %= k;
}
}
else{
int atmp;
for(int i = 0; i < n; i++){
cin >> atmp;
a += atmp;
a %= k;
}
ans = a * m + b * n;
ans %= k;
}
cout << ans << endl;
return 0;
}