結果
問題 |
No.721 Die tertia (ディエ・テルツィア)
|
ユーザー |
👑 |
提出日時 | 2022-08-09 22:18:37 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,103 bytes |
コンパイル時間 | 910 ms |
コンパイル使用メモリ | 79,336 KB |
最終ジャッジ日時 | 2025-01-30 19:50:38 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
#include <iostream> #include <list> #include <vector> #include <string> #include <stdio.h> #include <stdint.h> #include <iomanip> using namespace std; using uint = unsigned int; using ll = long long; #define CIN( LL , A ) LL A; cin >> A #define GETLINE( A ) string A; getline( cin , A ) #define FOR_ITR( ARRAY , ITR , END ) for( auto ITR = ARRAY .begin() , END = ARRAY .end() ; ITR != END ; ITR ++ ) int main() { CIN( string , T ); ll Y = stoi( T.substr( 0 , 4 ) ); ll M = stoi( T.substr( 5 , 2 ) ); ll D = stoi( T.substr( 8 , 2 ) ); bool b = true; const ll day[13] = { 0 , 31 , 28 + ( Y % 400 == 0 ? 1 : Y % 100 == 0 ? 0 : Y % 4 == 0 ? 1 : 0 ) , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 }; if( D + 2 <= day[ M ] ){ b = false; D += 2; } else if( D + 1 == day[ M ] ){ D = 1; } else { D = 2; } if( b ){ if( M == 12 ){ M = 1; } else { b = false; M++; } } if( b ){ Y++; } cout << Y << "/" << to_string( M + 100 ).substr( 1 ) << "/" << to_string( D + 100 ).substr( 1 ) << endl; return 0; }