結果

問題 No.201 yukicoderじゃんけん
ユーザー j6jhonj6jhon
提出日時 2015-05-17 13:26:48
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 660 bytes
コンパイル時間 410 ms
コンパイル使用メモリ 54,908 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 09:22:16
合計ジャッジ時間 1,496 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;


int main(void){
	string S_A,P_A,X_A,S_B,P_B,X_B,ans;
	string ss_a,ss_b;
	int i_a, i_b;

	cin >> S_A >> P_A >> X_A;
	cin >> S_B >> P_B >> X_B;
	if(P_A.length()>P_B.length()) {
		ans = S_A;
	} else if(P_A.length()<P_B.length()) {
		ans = S_B;
	} else if(P_A == P_B){
		ans = "-1";
	} else {
		for(int i=0;i<P_A.length();i++){
			ss_a = P_A.substr(i,1);
			ss_b = P_B.substr(i,1);
			i_a = atoi(ss_a.c_str());
			i_b = atoi(ss_b.c_str());
			if(i_a > i_b) {
				ans = S_A;
				break;
			} else if(i_a < i_b){
				ans = S_B;
				break;
			}
		}
	}
	cout << ans << endl;
	return 0;
}
0