結果

問題 No.138 化石のバージョン
コンテスト
ユーザー koyumeishi
提出日時 2015-01-30 16:28:50
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 869 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 509 ms
コンパイル使用メモリ 103,400 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-07 19:00:21
合計ジャッジ時間 1,191 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
using namespace std;

struct ver{
	string a;
	string b;
	string c;

	ver(char* aa, char* bb, char* cc){
		a = string(aa);
		b = string(bb);
		c = string(cc);
	}

	bool operator==(const ver &x){
		if(a != x.a) return false;
		if(b != x.b) return false;
		if(c != x.c) return false;
		return true;
	}

	bool operator<(const ver &x){
		if(a<x.a) return true;
		else if(a>x.a) return false;
		else if(b<x.b) return true;
		else if(b>x.b) return false;
		else if(c<x.c) return true;
		else return false;
	}

};

int main(){

	char a[10],b[10],c[10];
	scanf("%s.%s.%s", a,b,c);
	ver x(a,b,c);

	scanf("%s.%s.%s", a,b,c);
	ver y(a,b,c);

	cout << ((y<x || y==x) ? "YES":"NO") << endl;

	return 0;
}
0