結果

問題 No.231 めぐるはめぐる (1)
ユーザー focusfocus
提出日時 2018-02-21 01:43:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 612 ms
コンパイル使用メモリ 69,148 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-10-11 20:30:17
合計ジャッジ時間 3,639 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstdio>
using namespace std;
int main(){
    string s1,s2,a1,a2;
    char none;
    bool flag=false;
    cin >> s1 >> a1 >> none >> s2 >> a2 >> none;
    if(a1.size()==a2.size()){
        for(int i=0;i<a1.size();i++){
            if(a1[i]<a2[i]){
                cout << s2;
                flag = true;
                break;
            }
            else if(a1[i]>a2[i]){
                cout << s1;
                flag = true;
                break;
            }
        }
    }
    else if(a1.size()>a2.size()){
        cout << s1;
    }
    else{
        cout << s2;
    }
    if(!flag)   cout << -1;
    return 0;
}
0