結果
| 問題 |
No.138 化石のバージョン
|
| コンテスト | |
| ユーザー |
hiyokko2
|
| 提出日時 | 2015-01-29 23:28:12 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,017 bytes |
| コンパイル時間 | 1,091 ms |
| コンパイル使用メモリ | 84,348 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-29 12:52:12 |
| 合計ジャッジ時間 | 1,788 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:42:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
42 | scanf("%d.%d.%d", &A0, &B0, &C0);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:43:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
43 | scanf("%d.%d.%d", &A1, &B1, &C1);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999;
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define EPS 1e-10
typedef long long ll;
using namespace std;
typedef pair<int, int> P;
double distanceAB(double xa, double ya, double xb, double yb);
/*
class Target
{
public:
vector <string> draw(int n)
{
}
};
*/
int main()
{
int A0, B0, C0, A1, B1, C1, kaseki_ver, ver;
scanf("%d.%d.%d", &A0, &B0, &C0);
scanf("%d.%d.%d", &A1, &B1, &C1);
kaseki_ver = 1000000 * A0 + 1000 * B0 + C0;
ver = 1000000 * A1 + 1000 * B1 + C1;
if (ver <= kaseki_ver)
{
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
return 0;
}
double distanceAB(double xa, double ya, double xb, double yb)
{
return sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));
}
hiyokko2