結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
focus
|
| 提出日時 | 2018-01-23 22:06:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 531 bytes |
| コンパイル時間 | 645 ms |
| コンパイル使用メモリ | 58,716 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-29 14:44:28 |
| 合計ジャッジ時間 | 1,970 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d.%d.%d",&A1,&B1,&C1);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:9:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d.%d.%d",&A2,&B2,&C2);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
int A1,B1,C1,A2,B2,C2;
scanf("%d.%d.%d",&A1,&B1,&C1);
scanf("%d.%d.%d",&A2,&B2,&C2);
if(A1>A2){
cout << "YES";
}
else if(A1==A2){
if(B1>B2){
cout << "YES";
}
else if(B1==B2){
if(C1>=C2) cout << "YES";
else cout << "NO";
}
else{
cout << "NO";
}
}
else cout << "NO";
return 0;
}
focus