結果

問題 No.988 N×Mマス計算(総和)
ユーザー kotatsugamekotatsugame
提出日時 2020-02-07 04:24:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 294 bytes
コンパイル時間 475 ms
コンパイル使用メモリ 64,400 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-20 11:25:14
合計ジャッジ時間 3,209 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#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;
}
0