結果

問題 No.138 化石のバージョン
ユーザー weakenweaken
提出日時 2020-10-08 07:44:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 910 bytes
コンパイル時間 1,884 ms
コンパイル使用メモリ 195,740 KB
最終ジャッジ日時 2025-01-15 03:27:01
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define precise(i) fixed << setprecision(i)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int conv(char ch) { return (int)(ch - '0'); }

bool isOlder(string old, string now) {
  vector<int> o, n;
  for (int i = 0; i < 5; i += 2) {
    o.emplace_back(old[i]);
    n.emplace_back(now[i]);
  }

  if (o[0] > n[0]) {
    return true;
  } else if (o[0] < n[0]) {
    return false;
  } else {
    if (o[1] > n[1]) {
      return true;
    } else if (o[1] < n[1]) {
      return false;
    } else {
      if (o[2] > n[2]) {
        return true;
      } else {
        return false;
      }
    }
  }
  return false;
}

int main() {
  fastIO;

  string fossil, cur;
  cin >> fossil >> cur;

  if (isOlder(fossil, cur))
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';

  return 0;
}
0