結果

問題 No.201 yukicoderじゃんけん
ユーザー Yang33Yang33
提出日時 2016-01-04 18:51:18
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 614 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 56,452 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 15:05:23
合計ジャッジ時間 1,164 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string.h>
using namespace std;
int main(void)
{
	int i, j=0, len1, len2;
	char name1[110], name2[110], te1[3], te2[3];
	char p1[10010], p2[10010];

	cin >> name1 >> p1 >> te1;
	cin >> name2 >> p2 >> te2;

	len1 = strlen(p1);
	len2 = strlen(p2);
	if (len1 > len2)cout << name1;
	else if (len1 < len2)cout << name2;
	else {
		for (i = 0; i < len1; i++) {
			if (p1[i] > p2[i]) {
				cout << name1 << endl;
				j = 1;
				break;
			}
			else if (p1[i] < p2[i]) {
				cout << name2 << endl;
				j = 1;
				break;
			}
		}
	if(p1[len1-1]==p2[len2-1]&&j==0)cout << -1<<endl;

	}

	return 0;
}
0