| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 845055 | vjudge1 | Datum (COCI20_datum) | C++17 | 1064 ms | 468 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/* Author : Mychecksdead  */
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD (1000000000+7)
#define MOD1 (998244353)
#define pb push_back
#define all(x) x.begin(), x.end()
#define en cout << '\n'
const int N = 1e6+100, M = 1e5+10, K = 18;
string pr(int a, int tp){
  string res = to_string(a);
  if(tp==0 || tp==1) if(res.length() == 2) return res; else return "0"+res;
  if(res.length() == 4) return res;
  if(res.length() == 3) return "0"+res;
  if(res.length() == 2) return "00"+res;
  return "000"+res;
}
bool check(array<int, 3>a ){
  string s = pr(a[0], 0) + pr(a[1],  1) + pr(a[2], 2);
  for(int i = 0; i < s.length()/2; ++i) if(s[i] != s[s.length()-1-i]) return false;
  return 1;
}
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
array<int, 3> a;
void solve(){
  string s; cin >> s;
  a[0] = (s[0]-'0')*10 + (s[1]-'0');
  a[1] = (s[3]-'0')*10 + (s[4]-'0');
  a[2] = (s[6]-'0')*1000 + (s[7]-'0')*100 + (s[8]-'0')*10 + (s[9]-'0');
  while(true){
    // cout << a[0] << ' ' << a[1] << ' ' << a[2] << '\n';
    if(a[0] < month[a[1] - 1]) a[0]++;
    else if(a[0] >= month[a[1] - 1]){
      if(a[1] == 12){
        a[0] = 1, a[1] = 1;
        a[2]++;
      }else if(a[1] == 2){
        if(a[2] % 4 == 0){
          if(a[0] == 29){
            a[0] = 1;
            a[1]++;
          }else{
            a[0]++;
          }
        }else{
          a[0] = 1;
          a[1]++;
        }
      }else{
        a[1]++;
        a[0] = 1;
      }
    }
    if(check(a)){
      cout << pr(a[0], 0) << '.' << pr(a[1], 1) << '.' << pr(a[2], 2) << '.';
      return;
    }
  }
}
int main(){
  cin.tie(0); ios::sync_with_stdio(0);
  int tt = 1, aa;
  // freopen("in.txt", "r", stdin);
  // freopen("out.txt", "w", stdout);
  cin >> tt;
  while(tt--){
    solve();
    en;
  }
  cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" seconds\n";
  return 0;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
