結果

問題 No.138 化石のバージョン
ユーザー ry0u_yd
提出日時 2015-07-09 20:50:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,307 bytes
コンパイル時間 958 ms
コンパイル使用メモリ 74,400 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 13:26:17
合計ジャッジ時間 1,923 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

vector<string> split(const string &str, char delim) {
    vector<string> res;
    size_t current = 0, found;
    while((found = str.find_first_of(delim, current)) != string::npos) {
        res.push_back(string(str, current, found - current));
        current = found + 1;
    }
    res.push_back(string(str, current, str.size() - current));
    return res;
}

int main() {
    string s,t;
    cin >> s >> t;

    vector<string> v = split(s,'.');
    vector<string> v2 = split(t,'.');

    stringstream ss;
    rep(i,v.size()) {
        string ret = v[i];
        REP(j,v[i].size(),3) {
            ret = "0" + ret;
        }

        ss << ret;
    }

    stringstream ss2;
    rep(i,v2.size()) {
        string ret = v2[i];
        REP(j,v2[i].size(),3) {
            ret = "0" + ret;
        }

        ss2 << ret;
    }

    if(ss.str() >= ss2.str()) {
        cout << "YES" << endl;
    }else {
        cout << "NO" << endl;
    }

    return 0;
}
0