結果

問題 No.138 化石のバージョン
ユーザー teramurateramura
提出日時 2016-06-11 17:02:39
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,019 bytes
コンパイル時間 661 ms
コンパイル使用メモリ 56,952 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 18:48:53
合計ジャッジ時間 1,271 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 1 ms
5,376 KB
testcase_14 WA -
testcase_15 AC 2 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
testcase_28 AC 1 ms
5,376 KB
testcase_29 WA -
testcase_30 AC 1 ms
5,376 KB
testcase_31 WA -
testcase_32 AC 1 ms
5,376 KB
testcase_33 WA -
testcase_34 AC 1 ms
5,376 KB
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<string>
using namespace std;

int main()
{
    string ver_K,ver_N;
    cin>>ver_K;
    cin>>ver_N;

    if(ver_K.substr(0,ver_K.find(".")) < ver_N.substr(0,ver_N.find("."))){
        cout<<"NO"<<endl;
        return 0;
    }
    else if(ver_K.substr(0,ver_K.find(".")) > ver_N.substr(0,ver_N.find("."))){
        cout<<"YES"<<endl;
        return 0;
    }


    if(ver_K.substr(ver_K.find(".")+1,ver_K.rfind(".")-ver_K.find(".")) < ver_N.substr(ver_N.find(".")+1,ver_N.rfind(".")-ver_N.find("."))){
        cout<<"NO"<<endl;
        return 0;
    }
    else if(ver_K.substr(ver_K.find(".")+1,ver_K.rfind(".")-ver_K.find(".")) > ver_N.substr(ver_N.find(".")+1,ver_N.rfind(".")-ver_N.find("."))){
        cout<<"YES"<<endl;
        return 0;
    }


    if(ver_K.substr(ver_K.rfind(".")+1) < ver_N.substr(ver_N.rfind(".")+1)){
        cout<<"NO"<<endl;
    }
    else if(ver_K.substr(ver_K.rfind(".")+1) > ver_N.substr(ver_N.rfind(".")+1)){
        cout<<"YES"<<endl;
    }


    return 0;
}
0