結果

問題 No.138 化石のバージョン
ユーザー けーむけーむ
提出日時 2020-01-24 14:29:30
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,627 bytes
コンパイル時間 1,120 ms
コンパイル使用メモリ 145,044 KB
実行使用メモリ 4,484 KB
最終ジャッジ日時 2023-10-12 04:07:48
合計ジャッジ時間 2,828 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
4,348 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 1 ms
4,352 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,352 KB
testcase_16 AC 2 ms
4,352 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,352 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,348 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 1 ms
4,348 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 2 ms
4,348 KB
testcase_34 AC 2 ms
4,352 KB
testcase_35 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:57:5: warning: ‘cc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (bc >= cc) {
     ^~
main.cpp:53:5: warning: ‘cb’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (bb < cb) {
     ^~
main.cpp:45:5: warning: ‘ca’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (ba < ca) {
     ^~
main.cpp:57:5: warning: ‘bc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (bc >= cc) {
     ^~
main.cpp:53:5: warning: ‘bb’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (bb < cb) {
     ^~
main.cpp:45:5: warning: ‘ba’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (ba < ca) {
     ^~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    string bs, cs;
    cin >> bs >> cs;
    ll ba, bb, bc, bcnt = 0;
    rep(i, len(bs)) {
        if (bs[i] == '.') {
            bcnt++;
        }
        else {
            if (bcnt == 0) ba = ba * 10 + (bs[i] - '0');
            else if (bcnt == 1) bb = bb * 10 + (bs[i] - '0');
            else bc = bc * 10 + (bs[i] - '0');
        }
    }
    ll ca, cb, cc, ccnt = 0;
    rep(i, len(cs)) {
        if (cs[i] == '.') {
            ccnt++;
        }
        else {
            if (ccnt == 0) ca = ca * 10 + (cs[i] - '0');
            else if (ccnt == 1) cb = cb * 10 + (cs[i] - '0');
            else cc = cc * 10 + (cs[i] - '0');
        }
    }
    if (ba > ca) {
        cout << "YES" << endl;
        return 0;
    }
    if (ba < ca) {
        cout << "NO" << endl;
        return 0;
    }
    if (bb > cb) {
        cout << "YES" << endl;
        return 0;
    }
    if (bb < cb) {
        cout << "NO" << endl;
        return 0;
    }
    if (bc >= cc) {
        cout << "YES" << endl;
        return 0;
    }
    else {
        cout << "NO" << endl;
    }
    return 0;
}
0