結果
| 問題 |
No.721 Die tertia (ディエ・テルツィア)
|
| コンテスト | |
| ユーザー |
yuma220284
|
| 提出日時 | 2019-05-30 21:52:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 570 bytes |
| コンパイル時間 | 1,085 ms |
| コンパイル使用メモリ | 159,596 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-17 16:09:33 |
| 合計ジャッジ時間 | 1,793 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 3 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main() {
int Y, M, D, X[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
char C;
cin >> Y >> C >> M >> C >> D;
if (M == 2 && D == 27) {
if ((Y % 4 == 0 && Y % 100 == 0) || Y % 400) cout << Y << "/02/29" << endl;
else cout << Y << "/03/01";
}
else {
D += 2;
if (D > X[M]) {
D -= X[M];
M++;
}
if (M > 12) {
M = M % 12;
Y++;
}
cout << Y << "/" << std::setfill('0') << std::right << std::setw(2) << M << "/" << std::setfill('0') << std::right << std::setw(2) << D << endl;
}
}
yuma220284