結果

問題 No.201 yukicoderじゃんけん
ユーザー willowoooo
提出日時 2015-05-04 00:01:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 579 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 58,968 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 18:02:54
合計ジャッジ時間 1,066 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

void solve1(){
	string a, b;
	string Pa, Pb;
	string Xa, Xb;
	cin >> a >> Pa >> Xa;
	cin >> b >> Pb >> Xb;

	
	if (Pa.size() > Pb.size()){
		cout << a;
		return;
	}
	else if (Pb.size() > Pa.size()){
		cout << b;
		return;
	}
	else if (Pa.size() == Pb.size()){

		for (int i = 0; i < Pa.size(); i++)
		{
			if (Pa[i] > Pb[i])
			{
				cout << a;
				return;
			}
			else if (Pa[i]<Pb[i])
			{
				
				cout << b;
				return;
			}
		}
		cout << "-1" << endl;
	}

}


int main(){
	solve1();
	return 0;
}
0