結果
| 問題 |
No.721 Die tertia (ディエ・テルツィア)
|
| コンテスト | |
| ユーザー |
Tqk
|
| 提出日時 | 2018-08-03 22:29:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,852 bytes |
| コンパイル時間 | 1,318 ms |
| コンパイル使用メモリ | 160,644 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-19 17:29:37 |
| 合計ジャッジ時間 | 1,938 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 15 |
ソースコード
#include "bits/stdc++.h"
//#include <iostream>
//#include <vector>
//#include <string>
using namespace std;
#define repi(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)
#define rep(i,n) repi(i,0,n)
#define repi_(i,a,b) for(int i=(a), i##_len=(b); i<=i##_len; ++i)
#define rep_(i,n) repi_(i,0,n)
#define all(x) (x).begin(),(x).end()
#define vsort(v) sort((v).begin(), (v).end())
#define gsort(v) tsort(v); reverse((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())
#define siz(v) ((int)(v).size())
#define ers(v, n) (v).erase((v).begin() + n)
#define cnt(v, n) count(all(v), n)
#define vmin(v) *min_element(v.begin(), v.end())
#define vmax(v) *max_element(v.begin(), v.end())
#define contain(q) !q.empty()
#define cont(q) !q.empty()
//#define qpop(q, a, b) a=q.back().first;b=q.back().second;q.pop()
//#define pqpop(p, a, b) a=q.top().first;b=q.top().second;q.pop()
#define el "\n"
#define sp " "
#define co(x) cout<<(x)<<el
#define coc(c, a, b) if(c)co((a));else co((b))
#define cosp(x) cout<<(x)<<' '
#define YES(c) coc(c,"YES", "NO")
#define Yes(c) coc(c,"Yes", "No")
#define yes(c) coc(c,"yes", "no")
#define POSSIBLE(c) coc(c, "POSSIBLE", "IMPOSSIBLE")
#define Possible(c) coc(c, "Possible", "Impossible")
#define possible(c) coc(c, "possible", "impossible")
#define inf INT_MAX
#define pb push_back
#define pq priority_queue
#define np next_permutation
#ifdef tqktmp_2
#define gc() getchar(); getchar()
#else
#define gc() 1
#endif
const unsigned int bf0 = (1 << 0);
const unsigned int bf1 = (1 << 1);
const unsigned int bf2 = (1 << 2);
const unsigned int bf3 = (1 << 3);
const unsigned int bf4 = (1 << 4);
const unsigned int bf5 = (1 << 5);
const unsigned int bf6 = (1 << 6);
const unsigned int bf7 = (1 << 7);
typedef long long lint;
typedef vector<int> ivec; typedef vector<string> svec;
typedef vector<vector<int>> ivvec;
typedef pair<int, int> P;
const int
dx8[8] = { 0,1,1,1,0,-1,-1,-1 },
dy8[8] = { 1,1,0,-1,-1,-1,0,1 },
dx4[4] = { 0,1,0,-1 },
dy4[4] = { 1,0,-1,0 };
template<class T>inline bool maxi(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>inline bool mini(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
#define P3 pair<P, lint>
inline int f(string s, int n) {
return s[n] - '0';
}
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
int ds[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
bool uru = 0;
lint y, m, d;
string s; cin >> s;
y = f(s, 0) * 1000 + f(s, 1) * 100 + f(s, 2) * 10 + f(s, 3);
m = f(s, 5) * 10 + f(s, 6);
d = f(s, 8) * 10 + f(s, 9);
if (!(y % 4))uru = 1;
if (!(y % 100)) uru = 0;
if (!(y % 400))uru = 1;
if (uru)ds[1] = 29;
d += 2;
if (d > ds[m - 1]) {
d = 1; m++;
if (m > 12) {
m = 1; y++;
}
}
cout << y << "/" << setfill('0') << setw(2) << m << "/" << setfill('0') << setw(2) << d << el;
gc();
}
Tqk