結果
| 問題 |
No.988 N×Mマス計算(総和)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-01 14:13:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 653 bytes |
| コンパイル時間 | 509 ms |
| コンパイル使用メモリ | 64,812 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-06 08:00:32 |
| 合計ジャッジ時間 | 1,963 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 %= 100;
}
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;
}