結果

問題 No.201 yukicoderじゃんけん
ユーザー somo_6somo_6
提出日時 2015-05-08 23:24:54
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 502 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 59,224 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 20:38:15
合計ジャッジ時間 1,245 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>

using namespace std;

struct person
{
	string name;
	string yuruhuwa;
	string hand;
};
int main()
{
	person player[2];
	for(auto &p : player)
	{
		cin >> p.name >> p.yuruhuwa >> p.hand;
	}
	if(player[0].yuruhuwa==player[1].yuruhuwa){
		cout << "-1" << endl;
		return 0;
	}
	person win = max(player[0],player[1],
		[](const person& a,const person& b){
			return a.yuruhuwa.length()<b.yuruhuwa.length()||a.yuruhuwa<b.yuruhuwa;
		}
	);
	cout << win.name << endl;
}
0