結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー KKT89KKT89
提出日時 2019-11-16 18:48:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 665 ms
コンパイル使用メモリ 73,532 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-25 07:59:04
合計ジャッジ時間 2,052 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 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 2 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 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	char c;
	int y,m,d; cin >> y >> c >>  m >> c >> d;
	d++;
	if(d>31||((m==4||m==6||m==9||m==11)&&d>30)||(m==2&&d>29)||(y%400!=0&&(y%4!=0||y%100))&&m==2&&d>28){
		m++;
		d=1;
	}
	if(m==13){
		m=1;y++;
	}
	d++;
	if(d>31||((m==4||m==6||m==9||m==11)&&d>30)||(m==2&&d>29)||(y%4||(y%400&&y%100==0))&&m==2&&d>28){
		m++;
		d=1;
	}
	if(m==13){
		m=1;y++;
	}
	printf("%04d/%02d/%02d\n",y,m,d);
} 
0