結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
mayoko_
|
| 提出日時 | 2015-01-29 23:28:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 756 bytes |
| コンパイル時間 | 903 ms |
| コンパイル使用メモリ | 72,420 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-29 12:52:21 |
| 合計ジャッジ時間 | 1,914 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:23:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | scanf("%d.%d.%d", s1, s1+1, s1+2);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:24:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
24 | scanf("%d.%d.%d", s2, s2+1, s2+2);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#define INF 1000000000
using namespace std;
typedef long long ll;
int main(void) {
int s1[3], s2[3];
scanf("%d.%d.%d", s1, s1+1, s1+2);
scanf("%d.%d.%d", s2, s2+1, s2+2);
for (int i = 0; i < 3; i++) {
if (s1[i] > s2[i]) {
cout << "YES" << endl;
return 0;
} else if (s1[i] < s2[i]) {
break;
} else if (i == 2) {
cout << "YES" << endl;
return 0;
}
}
cout << "NO" << endl;
return 0;
}
mayoko_