結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー donkorin_donkorin_
提出日時 2018-09-09 21:06:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,504 bytes
コンパイル時間 2,339 ms
コンパイル使用メモリ 166,872 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-25 18:56:34
合計ジャッジ時間 2,516 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(a);i>(b);--i)
#define eper(i,a,b) for(int i=(a);i>=b;--i)
#define pb push_back
#define mp make_pair
#define INF (1<<30)-1
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
#define vii vector<int>
#define vll vector<long long>
using namespace std;
typedef long long ll;
typedef pair<int,int> Pii;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}

string today;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    cin >> today;
    int yy, mm, dd;
    yy = stoi(today.substr(0, 4));
    mm = stoi(today.substr(5, 2));
    dd = stoi(today.substr(8, 2));
    dd+=2;
    if ((yy % 4 == 0) ^ (yy % 100 == 0) ^ (yy % 400 == 0)) {
        if (mm != 2 && dd > 31) mm++, dd = dd - 31;
        else if (mm == 2 && dd > 29) mm++, dd = dd - 29; 
    }
    if (dd > 31) mm++, dd = dd - 31;
    if (mm > 12) yy++, mm = mm - 12;
    string ans = to_string(yy);
    ans += "/";
    if (mm < 10) ans += "0" + to_string(mm);
    else ans += to_string(mm);
    ans += "/";
    if (dd < 10) ans += "0" + to_string(dd);
    else ans += to_string(dd);
    cout << ans << endl;
    return 0;
}
0