結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
hanorver
|
| 提出日時 | 2015-08-27 23:11:25 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 666 bytes |
| コンパイル時間 | 767 ms |
| コンパイル使用メモリ | 57,688 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-29 13:31:16 |
| 合計ジャッジ時間 | 1,661 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
#include<iostream>
#include<string>
#include<cstdlib>
int main() {
std::string str[2];
int a[2][3] = {0};
std::cin >> str[0] >> str[1];
for (int i = 0; i < 2; i++) {
int count = 0;
while(str[i].size() != 0) {
if (str[i].front() == '.'){
count++;
}else {
a[i][count] = a[i][count] * 10 + (str[i][0] - '0');
}
str[i].erase(str[i].begin());
}
}
bool old = false;
if (a[0][0] == a[1][0]) {
if (a[0][1] == a[1][1]) {
if (a[0][2] >= a[1][2]) {
old = true;
}
} else if (a[0][1] >= a[1][1]) {
old = true;
}
} else if(a[0][0] >= a[1][0]){
old = true;
}
std::cout << (old ? "YES" : "NO") << std::endl;
return 0;
}
hanorver