結果

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <sstream>
#include <algorithm>
using namespace std;


int main()
{
	string in;
	int temp;
	vector<int> v;

	for (int i = 0; i < 2; ++i)
	{
		getline(cin,in);
		replace(in.begin(),in.end(),'.',' ');
		stringstream ss(in);
	
		while(!ss.eof()){
			ss>>temp;
			v.push_back(temp);
			ss.ignore();
		}
	}

	int a,b,c,aa,bb,cc;
	a = v.at(0);
	b = v.at(1);
	c = v.at(2);
	aa = v.at(3);
	bb = v.at(4);
	cc = v.at(5);

	if (a<aa)
	{
		cout<<"NO"<<endl;
	}else if (a>aa)
	{
		cout<<"YES"<<endl;
	}else if (a==aa)
	{
		if (b<bb)
		{
			cout<<"NO"<<endl;
		}else if (b>bb)
		{
			cout<<"YES"<<endl;
		}else if (b==bb)
		{
			if (c<cc)
			{
				cout<<"NO"<<endl;
			}else if (c>cc)
			{
				cout<<"YES"<<endl;
			}else if (c==cc)
			{
				cout<<"YES"<<endl;
			}
		}
	}

	return 0;
}
0