結果
問題 |
No.138 化石のバージョン
|
ユーザー |
|
提出日時 | 2018-02-26 21:31:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 587 bytes |
コンパイル時間 | 653 ms |
コンパイル使用メモリ | 56,656 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 20:13:32 |
合計ジャッジ時間 | 1,799 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 WA * 1 |
ソースコード
#include <iostream> #include <string> using namespace std; int main() { string S0, S1; double s0, s1; cin >> S0 >> S1; s0 = stod(S0.substr(0, S0.rfind('.'))); s1 = stod(S1.substr(0, S1.rfind('.'))); if(s1 > s0) { cout << "NO" << endl; return 0; } else if(s1 < s0) { cout << "YES" << endl; } else { s0 = stod(S0.substr(S0.find('.') + 1, S0.length() - S0.find('.') + 1)); s1 = stod(S1.substr(S1.find('.') + 1, S1.length() - S1.find('.') + 1)); if(s1 > s0) { cout << "NO" << endl; return 0; } else { cout << "YES" << endl; return 0; } } }