結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
かぼちゃ
|
| 提出日時 | 2018-04-07 19:41:37 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 413 bytes |
| コンパイル時間 | 487 ms |
| コンパイル使用メモリ | 60,280 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 11:06:59 |
| 合計ジャッジ時間 | 1,546 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 WA * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d.%d.%d",&a1,&b1,&c1);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:12:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d.%d.%d",&a2,&b2,&c2);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#define ALL(x) (x).begin(),(x).end()
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);
string ans = "NO";
if(a1 > a2)ans = "YES";
if(a1 == a2 && b1 > b2)ans = "YES";
if(a1 == a2 && b1 == b2 && c1 > c2)ans = "YES";
cout << ans << endl;
return 0;
}
かぼちゃ