結果
問題 |
No.138 化石のバージョン
|
ユーザー |
![]() |
提出日時 | 2015-02-16 12:25:15 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 611 bytes |
コンパイル時間 | 831 ms |
コンパイル使用メモリ | 70,464 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 13:04:43 |
合計ジャッジ時間 | 2,052 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:19:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | scanf("%d.%d.%d", &a[0], &a[1], &a[2]); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:20:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 20 | scanf("%d.%d.%d", &b[0], &b[1], &b[2]); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <vector> #include <queue> #include <deque> #include <stack> #include <algorithm> #include <functional> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <cctype> #include <string> using namespace std; int main() { int a[3], b[3]; scanf("%d.%d.%d", &a[0], &a[1], &a[2]); scanf("%d.%d.%d", &b[0], &b[1], &b[2]); bool yes = true; for (int i = 0; i < 3; i++) { if (a[i] == b[i]) continue; if (a[i] < b[i]) yes = false; break; } if (yes) { std::cout << "YES" << std::endl; }else { std::cout << "NO" << std::endl; } }