結果
| 問題 | 
                            No.138 化石のバージョン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-05-22 19:47:40 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 1,298 bytes | 
| コンパイル時間 | 934 ms | 
| コンパイル使用メモリ | 90,448 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-20 12:50:52 | 
| 合計ジャッジ時間 | 1,939 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 33 | 
ソースコード
#include <iostream>		//cin, cout
#include <vector>		//vector
#include <algorithm>	//sort,min,max,count
#include <string>		//string,getline, to_string
#include <cstdlib>		//abs(int)
#include <utility>		//swap, pair
#include <deque>		//deque
#include <climits>		//INT_MAX
#include <bitset>		//bitset
#include <cmath>		//sqrt, ceil. M_PI, pow, sin
#include <ios>			//fixed
#include <iomanip>		//setprecision
#include <sstream>		//stringstream
using namespace std;
inline vector<string> Split_String(const string& str, const char key) {
	vector<string> result;
	stringstream SS(str);
	string temp;
	while (getline(SS, temp, key)) {
		result.push_back(temp);
	}
	return(result);
}
int main() {
	string S1, S2;
	cin >> S1 >> S2;
	vector<string> A = Split_String(S1, '.');
	vector<string> B = Split_String(S2, '.');
	vector<int> a(6);
	a[0] = stoi(A[0]);
	a[1] = stoi(A[1]);
	a[2] = stoi(A[2]);
	a[3] = stoi(B[0]);
	a[4] = stoi(B[1]);
	a[5] = stoi(B[2]);
	if (a[3] < a[0]) {
		cout << "YES" << endl;
	}
	else if (a[3] > a[0]) {
		cout << "NO" << endl;
	}
	else {
		if (a[4] < a[1]) {
			cout << "YES" << endl;
		}
		else if (a[4] > a[1]) {
			cout << "NO" << endl;
		}
		else {
			if (a[5] <= a[2]) {
				cout << "YES" << endl;
			}
			else {
				cout << "NO" << endl;
			}
		}
	}
	return 0;
}