結果
| 問題 | 
                            No.138 化石のバージョン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             eyeSharp
                         | 
                    
| 提出日時 | 2019-10-29 19:46:44 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,217 bytes | 
| コンパイル時間 | 1,223 ms | 
| コンパイル使用メモリ | 158,948 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-09-14 21:35:28 | 
| 合計ジャッジ時間 | 2,227 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 WA * 8 | 
ソースコード
/*
    No.138 化石のバージョン
    https://yukicoder.me/problems/no/138
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    // A.B.C
    string first, second;
    cin >> first;
    cin >> second;
    if (first == second) {
        cout << "YES" << endl;
        return 0;
    } else {
        if (first[0] > second[0]) {
            cout << "YES" << endl;
            return 0;
        } else if (first[0] < second[0]) {
            cout << "NO" << endl;
            return 0;
        } else {
            // A is same
            if (first[2] > second[2]) {
                cout << "YES" << endl;
                return 0;
            } else if (first[2] < second[2]) {
                cout << "NO" << endl;
                return 0;
            } else {
                // B is same
                if (first[4] > second[4]) {
                    cout << "YES" << endl;
                    return 0;
                } else if (first[4] < second[4]) {
                    cout << "NO" << endl;
                    return 0;
                } else {
                    // C is same
                }
            }
        }
    }
    return 0;
}
            
            
            
        
            
eyeSharp