結果
問題 |
No.721 Die tertia (ディエ・テルツィア)
|
ユーザー |
|
提出日時 | 2020-04-10 18:57:21 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 822 bytes |
コンパイル時間 | 921 ms |
コンパイル使用メモリ | 77,596 KB |
最終ジャッジ日時 | 2025-01-09 15:43:58 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <iostream> #include <iomanip> #include <vector> void solve() { int y, m, d; { char tmp; std::cin >> y >> tmp >> m >> tmp >> d; } std::vector<int> mons{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; if (y % 400 == 0 || (y % 100 != 0 && y % 4 == 0)) ++mons[1]; --m, --d; for (int i = 0; i < 2; ++i) { ++d; if (d == mons[m]) { ++m; d = 0; } if (m == 12) { ++y; m = 0; } } ++m, ++d; std::cout << y << "/" << std::setw(2) << std::setfill('0') << m << "/" << std::setw(2) << std::setfill('0') << d << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }