結果

問題 No.201 yukicoderじゃんけん
ユーザー kpinkcat
提出日時 2023-08-09 01:38:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 620 bytes
コンパイル時間 1,387 ms
コンパイル使用メモリ 118,236 KB
最終ジャッジ日時 2025-02-16 00:14:53
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<cctype>
#include<set>
#include<bitset>
#include<math.h>
#include<map>
#include<queue>
#include<iomanip>
using namespace std;

int main(){
    string sa, pa, xa, sb, pb, xb;
    cin >> sa >> pa >> xa >> sb >> pb >> xb;
    if (pa.size() > pb.size()) cout << sa << endl;
    else if (pa.size() < pb.size()) cout << sb << endl;
    else {
        vector<vector<string>> v(2);
        v[0] = {pa, sa};
        v[1] = {pb, sb};
        sort(v.begin(), v.end());
        if (v[0][0] == v[1][0]) cout << -1 << endl;
        else cout << v[1][1] << endl;
    }
}
0