結果

問題 No.441 和か積
ユーザー olpheolphe
提出日時 2016-11-11 22:31:17
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 517 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 51,336 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 22:07:25
合計ジャッジ時間 1,980 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 1 ms
4,376 KB
testcase_32 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:20: warning: NULL used in arithmetic [-Wpointer-arith]
   if (num[0][i] == NULL) {
                    ^~~~
main.cpp:16:20: warning: NULL used in arithmetic [-Wpointer-arith]
   if (num[1][i] == NULL) {
                    ^~~~

ソースコード

diff #

#include "iostream"
using namespace std;

char num[2][100];
int a, b;

int main() {
	cin >> num[0] >> num[1];
	for (int i = 0; i < 100; i++) {
		if (num[0][i] == NULL) {
			a = i;
			break;
		}
	}
	for (int i = 0; i < 100; i++) {
		if (num[1][i] == NULL) {
			b = i;
			break;
		}
	}
	if (a > 1)a = 3;
	else a = num[0][0]-'0';
	if (b > 1)b = 3;
	else b = num[1][0]-'0';
	if ((a == b&&a == 2)||(a==b&&a==0))cout << "E";
	else if (a == 1 || b == 1||a==0||b==0)cout << "S";
	else cout << "P";
	cout << "\n";
	return 0;
}
0