結果

問題 No.201 yukicoderじゃんけん
ユーザー yuma220284
提出日時 2019-10-13 11:05:42
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 485 bytes
コンパイル時間 1,693 ms
コンパイル使用メモリ 160,172 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 13:32:25
合計ジャッジ時間 2,408 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

int yurufuwa(string X, string Y) {
	if (X.size() > Y.size()) return 1;
	if (X.size() < Y.size()) return -1;
	for (int i = 0; i < X.size(); i++) {
		if (X[i] > Y[i]) return 1;
		if (X[i] < Y[i]) return -1;
	}
	return 0;
}

int main() {
	string SA, PA, XA, SB, PB, XB;
	cin >> SA >> PA >> XA >> SB >> PB >> XB;
	if (yurufuwa(PA, PB) == 1) cout << SA << endl;
	else if (yurufuwa(PA, PB) == -1) cout << SB << endl;
	else cout << -1 << endl;
}
0