結果

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

ソースコード

diff #

#include <iostream>
#include <sstream>

using namespace std;

int main(int argc, const char* argv[])
{
	string ver1, ver2;
	cin >> ver1 >> ver2;
	for (auto&& c : ver1)
		if (c == '.') c = ' ';
	for (auto&& c : ver2)
		if (c == '.') c = ' ';
	stringstream s;
	s << ver1 << endl << ver2 << endl;
	int A[3], B[3];
	for (auto&& a : A) s >> a;
	for (auto&& b : B) s >> b;
	for (int i = 0; i < 3; i++) {
		if (A[i] < B[i]) {
			cout << "NO" << endl;
			return 0;
		}
		if (A[i] > B[i]) break;
	}
	cout << "YES" << endl;
	return 0;
}
0