結果
| 問題 | No.779 Heisei |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-30 20:36:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,111 bytes |
| 記録 | |
| コンパイル時間 | 915 ms |
| コンパイル使用メモリ | 93,644 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 11:04:35 |
| 合計ジャッジ時間 | 1,638 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 3 |
コンパイルメッセージ
main.cpp: In function 'bool Heisei(int, int, int)':
main.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
38 | }
| ^
ソースコード
#define _USE_MATH_DEFINES
#include <iostream> //cin, cout
#include <vector> //vector
#include <algorithm> //sort,min,max,count
#include <string> //string,getline, to_string
#include <ios> //fixed
#include <iomanip> //setprecision
#include <utility> //swap, pair
#include <cstdlib> //abs(int)
#include <cmath> //sqrt,ceil,M_PI, pow, sin
#include <sstream> //stringstream,getline
#include <numeric> //gcd, accumlate
#include <deque> //deque
#include <random> //randam_device
#include <limits> //numeric_limits
using namespace std;
constexpr long long int D_MOD = 1000000007;
inline bool Heisei(int y, int m, int d) {
//受け取った日付が平成かどうか判定する
if (y < 1989) { return false; }
if (1990 <= y && y <= 2018) { return true; }
if (2019 < y) { return false; }
if (y == 1989) {
if (1 < m) { return true; }
if (8 < d) { return true; }
return false;
}
if (y == 2019) {
if (y < 5) { return true; }
return false;
}
}
int main() {
int Y, M, D;
cin >> Y >> M >> D;
if (Heisei(Y, M, D)) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
return 0;
}