結果
問題 | No.138 化石のバージョン |
ユーザー |
![]() |
提出日時 | 2016-05-03 01:29:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 947 bytes |
コンパイル時間 | 1,048 ms |
コンパイル使用メモリ | 85,608 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 13:56:29 |
合計ジャッジ時間 | 1,854 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
#include <iostream> #include <cmath> #include <string> #include <vector> #include <map> #include <list> #include <deque> #include <algorithm> using namespace std; int versionCheck(vector<int> list0, vector<int>list1){ bool flag = false; if (list0[0] > list1[0]) { //古い flag = true; return flag; } if (list0[0] == list1[0]) { if (list0[1] > list1[1]) { //古い flag = true; return flag; } if (list0[1] == list1[1]) { if (list0[2] >= list1[2]) { //古い flag = true; return flag; } } } return flag; } int main() { int a0, b0, c0; int a1, b1, c1; scanf("%d.%d.%d", &a0, &b0, &c0); scanf("%d.%d.%d", &a1, &b1, &c1); vector<int>list0; vector<int>list1; list0.push_back(a0); list0.push_back(b0); list0.push_back(c0); list1.push_back(a1); list1.push_back(b1); list1.push_back(c1); if (versionCheck(list0, list1)) cout << "YES" << endl; else cout << "NO" << endl; return 0; }