結果

問題 No.138 化石のバージョン
ユーザー ShibuyapShibuyap
提出日時 2020-01-20 09:50:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 928 bytes
コンパイル時間 1,853 ms
コンパイル使用メモリ 167,952 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-02 22:17:54
合計ジャッジ時間 3,345 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("YES");}else{puts("NO");}
#define MAX_N 200005

int main() {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    int m = t.size();
    int x = 0;
    int y = 0;
    int z = 0;
    rep(i,n){
        if(s[i] != '.'){
            z *= 10;
            z += s[i] - '0';
        }else{
            x *= 101;
            x += z;
            z = 0;
        }
    }
    x *= 101;
    x += z;
    z = 0;
    rep(i,m){
        if(t[i] != '.'){
            z *= 10;
            z += t[i] - '0';
        }else{
            y *= 101;
            y += z;
            z = 0;
        }
    }
    y *= 101;
    y += z;
    z = 0;
    
    if(y <= x)yn;
    
    return 0;
}
 
 
0