結果

問題 No.1317 月曜日の朝、WAを出した
ユーザー kotatsugamekotatsugame
提出日時 2020-12-14 02:05:46
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 39 ms / 1,500 ms
コード長 398 bytes
コンパイル時間 520 ms
コンパイル使用メモリ 65,060 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 04:37:28
合計ジャッジ時間 1,132 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 38 ms
4,348 KB
testcase_02 AC 39 ms
4,348 KB
testcase_03 AC 38 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~
main.cpp: In function 'int main()':
main.cpp:20:38: warning: 'id' may be used uninitialized [-Wmaybe-uninitialized]
   20 |                 cout<<(A[id]==0&&B[id]==sum?"Yes":"No")<<endl;
      |                                  ~~~~^
main.cpp:13:21: note: 'id' was declared here
   13 |                 int id;
      |                     ^~

ソースコード

diff #

#include<iostream>
using namespace std;
int N;
int A[6],B[6];
main()
{
	cin>>N;
	for(;N--;)
	{
		for(int i=0;i<6;i++)cin>>A[i];
		for(int i=0;i<6;i++)cin>>B[i];
		string x;cin>>x;
		int id;
		if(x=="WA")id=1;
		else if(x=="TLE")id=2;
		else if(x=="MLE")id=3;
		else if(x=="OLE")id=4;
		else if(x=="RE")id=5;
		int sum=B[1]+B[2]+B[3]+B[4]+B[5];
		cout<<(A[id]==0&&B[id]==sum?"Yes":"No")<<endl;
	}
}
0