結果
| 問題 | No.988 N×Mマス計算(総和) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-08 23:49:21 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 570 bytes |
| 記録 | |
| コンパイル時間 | 925 ms |
| コンパイル使用メモリ | 181,868 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-09 07:23:43 |
| 合計ジャッジ時間 | 2,367 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 3 WA * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,m,k; cin>>n>>m>>k;
string op; cin>>op;
vector<int> va(n);
vector<int> vb(m);
rep(i,m) cin>>vb[i];
rep(i,n) cin>>va[i];
ll ans=0;
if(op=="+"){
ll a=accumulate(va.begin(),va.end(),0);
ll b=accumulate(vb.begin(),vb.end(),0);
ans=(ll)(a*m+b*n)%k;
} else {
ll a=accumulate(va.begin(),va.end(),0);
ll b=accumulate(vb.begin(),vb.end(),0);
ans=(ll)(a*b)%k;
}
cout<<ans<<endl;
}