結果
問題 |
No.138 化石のバージョン
|
ユーザー |
![]() |
提出日時 | 2015-08-27 23:02:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 668 bytes |
コンパイル時間 | 589 ms |
コンパイル使用メモリ | 57,268 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 15:01:49 |
合計ジャッジ時間 | 1,227 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 24 WA * 9 |
ソースコード
#include<iostream> #include<string> #include<cstdlib> int main() { std::string str[2]; int a[2][3]; 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 + std::atoi(str[i].c_str()); } 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[0][1]){ old = true; } std::cout << (old ? "YES" : "NO") << std::endl; return 0; }