結果
| 問題 | No.779 Heisei |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-30 20:39:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,111 bytes |
| 記録 | |
| コンパイル時間 | 828 ms |
| コンパイル使用メモリ | 94,024 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 11:10:25 |
| 合計ジャッジ時間 | 1,551 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
コンパイルメッセージ
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 (7 < d) { return true; }
return false;
}
if (y == 2019) {
if (m < 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;
}