結果

問題 No.138 化石のバージョン
ユーザー zaichu
提出日時 2015-12-22 21:55:14
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 679 bytes
コンパイル時間 1,601 ms
コンパイル使用メモリ 162,560 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 13:42:19
合計ジャッジ時間 2,818 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
	string data1,data2;
	cin >> data1 >> data2;
	string tmp = "";
	vector<int> x;
	vector<int> y;
	for(int i = 0; i < data1.size(); i++){
		if(data1[i] != '.')	tmp += data1[i];
		else{
			x.push_back(stoi(tmp));
			tmp = "";
		}
	}
	x.push_back(stoi(tmp));
	tmp = "";
	for(int i = 0; i < data2.size(); i++){
		if(data2[i] != '.')	tmp += data2[i];
		else{
			y.push_back(stoi(tmp));
			tmp = "";
		}		
	}
	y.push_back(stoi(tmp));
	for(int i = 0; i < 3; i++){
		if(x[i] > y[i]){
			cout << "YES" << endl;
			return 0;
		}else if(x[i] < y[i]){
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}
0