結果
問題 |
No.138 化石のバージョン
|
ユーザー |
![]() |
提出日時 | 2017-08-10 07:01:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 762 bytes |
コンパイル時間 | 674 ms |
コンパイル使用メモリ | 64,512 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 02:00:39 |
合計ジャッジ時間 | 1,840 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 19 WA * 14 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <sstream> using namespace std; //split(string,区切り文字) vector<string> split(const string& i, char del) { istringstream stream(i); string field; vector<string> result; while (getline(stream, field, del)) { result.push_back(field); } return result; } int sp(const string&i, int num){ int a = stoi(split(i,'.')[num]); return a; } int main(){ string m,n; cin >> m >> n; if (sp(m,0) >= sp(n,0)) { cout << "YES" << "\n"; }else{ if (sp(m,1) >= sp(n,1)) { cout << "YES" << "\n"; }else{ if (sp(m,2) >= sp(n,2)) { cout << "YES" << "\n"; }else{ cout << "NO" << "\n"; } } } return 0; }