結果

問題 No.138 化石のバージョン
ユーザー teramura
提出日時 2016-06-11 17:44:38
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,046 bytes
コンパイル時間 667 ms
コンパイル使用メモリ 57,176 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 12:58:27
合計ジャッジ時間 2,142 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<string>
#include<cstdlib>
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