結果

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

ソースコード

diff #

#include<cstdio>
#include<iostream>
#include<queue>
#include<algorithm>
#include<string>

using namespace std;



int main(){
	string sa,sb,pa,pb;
	char xa, xb; //どうでもよい

	cin >> sa >> pa >> xa >> sb >> pb >> xb;
	if (pa.length() > pb.length()){
		cout << sa << endl;
	}
	else if (pa == pb){
		puts("-1");
	}
	else if(pa.length()<pb.length()){
		cout << sb << endl;
	}else
    {
    	
        int i = 0;
        while (i < pa.size())
        {
            if (pa[i] != pb[i])
            {
                //cout << (pa[i] > pb[i] ? sa : sb )<< endl;
                if(pa[i]>pb[i]){
                	cout<<sa<<endl;
                }else{
                	cout<<sb<<endl;
                }
                return 0;
            }
            i++;
        }
        cout << -1 << endl;
}
	return 0;
}
0