結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー takayukitakayuki
提出日時 2018-08-03 22:50:38
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 834 bytes
コンパイル時間 696 ms
コンパイル使用メモリ 81,680 KB
実行使用メモリ 4,368 KB
最終ジャッジ日時 2023-10-19 21:33:27
合計ジャッジ時間 1,466 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<vector>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<queue>
#include<map>
#include<iomanip>
using namespace std;

int main(void){
  int YYYY=0;
  int MM=0;
  int DD=0;
  int MOD=0;
  char s;

  cin>>YYYY>>s>>MM>>s>>DD;
  std::cout<<YYYY<<std::endl;
  std::cout<<MM<<std::endl; 
  std::cout<<DD<<std::endl; 

  if(YYYY%4==0 && MM==2&& !(YYYY%100==0 && YYYY%400!=0)){
   DD+=2; 
   if(DD>29){
    DD%=29;
	MM+=1;
   }
  }
  else {
    DD+=2;
    if(MM==2)MOD=28; 
	else if(MM==4 || MM==6 || MM==9 || MM==11)MOD=30;  
	else MOD=31;
   
    if(DD>MOD){
     DD%=MOD;
     MM+=1; 
	}
    else;
	if(MM==13){
	 YYYY++;
	 MM=1;
	}
	else;
  }
 if(MM<10)std::cout<<YYYY<<"/"<<"0"<<MM<<"/"<<DD<<std::endl;
 else std::cout<<YYYY<<"/"<<MM<<"/"<<DD<<std::endl;
}

0