結果

問題 No.441 和か積
ユーザー pengin_2000
提出日時 2020-02-21 18:41:54
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 28,032 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-08 19:56:17
合計ジャッジ時間 1,646 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<string.h>
int main()
{
	char a[202], b[202];
	scanf("%s%s", a, b);
	if (strlen(a) > 1)
	{
		if (strlen(b) > 1)
			printf("P\n");
		else if (b[0] > '1')
			printf("P\n");
		else
			printf("S\nS");
	}
	else if (strlen(b) > 1)
	{
		if (a[0] > '1')
			printf("P\n");
		else
			printf("S\n");
	}
	else
	{
		int x = a[0] - '0';
		int y = b[0] - '0';
		if (x + y > x* y)
			printf("S\n");
		else if (x + y < x * y)
			printf("P\n");
		else
			printf("E\n");
	}
	return 0;
}
0