結果
| 問題 |
No.721 Die tertia (ディエ・テルツィア)
|
| コンテスト | |
| ユーザー |
troro_kelp
|
| 提出日時 | 2018-08-12 16:54:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 713 bytes |
| コンパイル時間 | 647 ms |
| コンパイル使用メモリ | 79,148 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-24 07:23:24 |
| 合計ジャッジ時間 | 1,392 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <map>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <bitset>
#include <functional>
using namespace std;
const constexpr int INF = 1e9;
long long N;
int y, m, d;
string s;
int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
void solve(){
if((y % 4 == 0) ^ (y % 100 == 0) ^ (y % 400 == 0)) days[2]=29;
d+=2;
if(days[m]<d){
d-=days[m];
m++;
if(m>12){
y++;
m=1;
}
}
printf("%04d/%02d/%02d\n", y, m, d);
}
int main() {
scanf("%d/%d/%d", &y, &m, &d);
solve();
return 0;
}
troro_kelp