結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー KKT89KKT89
提出日時 2019-11-16 19:19:13
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 573 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 73,704 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-25 08:32:52
合計ジャッジ時間 1,397 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 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 <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%4||(y%400&&y%100==0))&&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