結果
| 問題 |
No.8083 12歳
|
| コンテスト | |
| ユーザー |
waidotto
|
| 提出日時 | 2023-01-02 03:34:40 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 613 bytes |
| コンパイル時間 | 1,945 ms |
| コンパイル使用メモリ | 193,680 KB |
| 最終ジャッジ日時 | 2025-02-09 22:55:21 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 WA * 360 |
ソースコード
#include <bits/stdc++.h>
bool isLeapYear(int y) {
if(y % 400 == 0) return true;
if(y % 100 == 0) return false;
if(y % 4 == 0) return true;
return false;
}
//Iverson bracket
int I(bool b) {
return b ? 1 : 0;
}
int numberOfDays(int y) {
return 365 + I(isLeapYear(y));
}
int main(void) {
using namespace std;
int Y, N, D;
cin >> Y >> N >> D;
int consumedPossibleBirthdays = D + I(D >= 334) * (I(isLeapYear(Y - 12)) - I(isLeapYear(Y + 1)));
cout << min(N, consumedPossibleBirthdays) << ' ' << min(N, numberOfDays(Y - 12) - consumedPossibleBirthdays) << '\n';
return 0;
}
waidotto