結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー C6218expressswallowC6218expressswallow
提出日時 2018-08-03 22:35:37
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,041 bytes
コンパイル時間 668 ms
コンパイル使用メモリ 73,128 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 21:29:03
合計ジャッジ時間 1,389 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include<algorithm>
#include <vector>
#include<string>
#include<cmath>
#include<cstdio>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define max(x,y) (((x)>(y)) ? x:y)
#define min(x,y) (((x)<(y)) ? x:y)
#define FOR(a,b,c) for(b=(c);b<(a);b++)
#define ender {return 0;}
#define tosasuretu(a) (a*(a+1)/2)
inline long kaizyo(long);
int main() {
	int y, m, d;
	char a;
	cin >> y >> a >> m >> a >> d;
	d += 2;
	int maxd;
	switch (m) {
	case 2:
		maxd = 28;
		if (y % 4 == 0) {
			if (y % 100 != 0) {
				maxd = 29;
			}
			if (y % 400 == 0) {
				maxd = 29;
			}
		}
		break;
	case 4:
	case 6:
	case 9:
	case 11:
		maxd = 30;
		break;
	default:
		maxd = 31;
		break;
	}
	if (maxd < d) {
		m += 1;
		d -= maxd;
		if (m > 12) {
			m -= 12;
			y++;
		}
	}
	cout << y << "/";
	if (m < 10) {
		cout << "0";
	}
	cout << m << "/";
	if (d < 10) {
		cout << "0";
	}
	cout << d;
	return 0;
}

inline long kaizyo(long x) {
	long ans = 1;
	for (int z = 0; z < x; z++) {
		ans *= (x - z);
	}
	return ans;
}


0