結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー mine691
提出日時 2019-03-16 00:27:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 1,519 ms
コンパイル使用メモリ 165,204 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-01 22:10:38
合計ジャッジ時間 2,299 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 15 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int Y, M, D;

int main()
{
    string s;
    cin >> s;
    sscanf(s.c_str(), "%d/%d/%d", &Y, &M, &D);
    D += 2;
    if (days[M] < D)
    {
        D -= days[M];
        M++;
        if (12 < M)
        {
            Y++;
            M = 1;
        }
    }

    printf("%04d/%02d/%02d\n", Y, M, D);
}
0