結果
問題 |
No.138 化石のバージョン
|
ユーザー |
![]() |
提出日時 | 2016-09-05 16:24:33 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 533 ms |
コンパイル使用メモリ | 65,264 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-15 20:28:18 |
合計ジャッジ時間 | 1,488 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 18 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%d.%d.%d\n", &a[0], &a[1], &a[2]); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:17:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%d.%d.%d", &b[0], &b[1], &b[2]); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<iostream> #include<algorithm> #include<stdio.h> #include<stdlib.h> #include<vector> #include<string> #include<sstream> #include<math.h> using namespace std; int main(){ int a[3]; int b[3]; scanf("%d.%d.%d\n", &a[0], &a[1], &a[2]); scanf("%d.%d.%d", &b[0], &b[1], &b[2]); for(int i=0; i<3; i++){ if( a[i] < b[i] ){ cout << "NO" << endl; return 0; } } if( a[2] == b[2] ) cout << "NO" << endl; else cout << "YES" << endl; return 0; }