結果
問題 |
No.138 化石のバージョン
|
ユーザー |
![]() |
提出日時 | 2018-04-07 19:42:39 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 447 ms |
コンパイル使用メモリ | 60,352 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 11:07:01 |
合計ジャッジ時間 | 1,437 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
コンパイルメッセージ
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; }