結果

問題 No.138 化石のバージョン
ユーザー tkzw_21tkzw_21
提出日時 2015-01-29 23:25:55
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 544 bytes
コンパイル時間 1,716 ms
コンパイル使用メモリ 157,300 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 12:52:03
合計ジャッジ時間 2,865 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:18:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   18 |         scanf("%d.%d.%d",&a,&b,&c);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~
main.cpp:20:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |         scanf("%d.%d.%d",&d,&e,&f);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
#define MOD 1000000007

using namespace std;

typedef pair<int,int> P;
typedef pair<int,pair<int,int>> PP;
typedef long long LL;

const double EPS = 1e-8;
const int INF = 1e9;

int dy[] = {0,1,0,-1};
int dx[] = {1,0,-1,0};

int main(void) {
	int a,b,c;
	scanf("%d.%d.%d",&a,&b,&c);
	int d,e,f;
	scanf("%d.%d.%d",&d,&e,&f);

	if(a > d){
		cout << "YES" << endl;
	}else if(a == d && b > e){
		cout << "YES" << endl;
	}else if(a==d && b==e && c >= f){
		cout << "YES" << endl;
	}else 
		cout << "NO" << endl;

	return 0;
}
0