結果
問題 |
No.138 化石のバージョン
|
ユーザー |
![]() |
提出日時 | 2020-07-28 22:01:47 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,008 bytes |
コンパイル時間 | 908 ms |
コンパイル使用メモリ | 98,176 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-28 20:59:19 |
合計ジャッジ時間 | 1,704 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 19 WA * 14 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <iomanip> #include <stack> #include <algorithm> #include <string> #include <map> #include <iterator> #include <set> #include <queue> using namespace std; vector<string> split(string s, const string &delimiter) { size_t pos_start = 0, pos_end, delim_len = delimiter.length(); string token; vector<string> res; while ((pos_end = s.find(delimiter, pos_start)) != string::npos) { token = s.substr(pos_start, pos_end - pos_start); pos_start = pos_end + delim_len; res.push_back(token); } res.push_back(s.substr(pos_start)); return res; } int main() { string s1, s2; cin >> s1 >> s2; vector<string> ss1 = split(s1, "."); vector<string> ss2 = split(s2, "."); string result = "NO"; for (int i = 0; i < 3; ++i) { if (stoi(ss1[i]) >= stoi(ss2[i])) { result = "YES"; } } cout << result << endl; return 0; }