結果

問題 No.441 和か積
ユーザー olpheolphe
提出日時 2016-11-11 22:28:48
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 53,880 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 02:21:54
合計ジャッジ時間 1,173 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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