結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2016-03-21 17:16:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,139 bytes |
| コンパイル時間 | 664 ms |
| コンパイル使用メモリ | 85,836 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-29 13:52:54 |
| 合計ジャッジ時間 | 1,756 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 138.cc: No.138 化石のバージョン - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
/* typedef */
/* global variables */
/* subroutines */
void read_ver(string &s, int &a, int &b, int &c) {
a = b = c = 0;
int pos = 0;
while (pos < s.size() && s[pos] != '.') a = 10 * a + s[pos++] - '0';
pos++;
while (pos < s.size() && s[pos] != '.') b = 10 * b + s[pos++] - '0';
pos++;
while (pos < s.size()) c = 10 * c + s[pos++] - '0';
}
/* main */
int main() {
string s0, s1;
cin >> s0 >> s1;
int a0, b0, c0, a1, b1, c1;
read_ver(s0, a0, b0, c0);
read_ver(s1, a1, b1, c1);
//printf("%d.%d.%d <-> %d.%d.%d\n", a0, b0, c0, a1, b1, c1);
bool ans =
a0 > a1 || (a0 == a1 && (b0 > b1 || (b0 == b1 && c0 >= c1)));
cout << (ans ? "YES" : "NO") << endl;
return 0;
}
tnakao0123