# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
846107 |
2023-09-07T10:14:59 Z |
vjudge1 |
Datum (COCI20_datum) |
C++11 |
|
75 ms |
492 KB |
#include <bits/stdc++.h>
#define lg(a) (31 - __builtin_clz((a)))
// #define endl ("\n")
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define vi vector<int>
#define st first
#define nd second
#define all(aa) aa.begin(), aa.end()
#define rall(aa) aa.rbegin(), aa.rend()
#define forn(i, n) for(int i=0;i<n;i++)
#define trav(e, x) for(auto& e:x)
#define until(n, v) (int) (lower_bound(v.begin(), v.end(), n)-v.begin()) //# of elements < n
#define after(n, v) (int) (v.end()-upper_bound(v.begin(), v.end(), n)) //# of elements > n
#define sameas(n, v) (int) (upper_bound(v.begin(), v.end(), n) - lower_bound(v.begin(), v.end(), n)) //# of elements ==n
typedef long long ll;
using namespace std;
/*
*/
vector<int> mm{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
void solve(){
string s; cin >> s;
for(auto &e : s)
e-='0';
int d = 10*s[0] + s[1], m = 10*s[3] + s[4] , y = 1000*s[6] + 100*s[7] + 10*s[8] + s[9];
vector<tuple<int, int, int>> pal;
pal.pb({2092, 02, 29});
for(int mon=1; mon <= 12; mon++){
for(int day = 1; day <= mm[mon] ;day++){
int year = 1000*(mon%10) + 100*(mon/10) + 10 * (day%10) + (day/10);
pal.pb({year, mon, day});
}
}
// cout<<pal.size()<<endl;
sort(all(pal));
tuple<int, int, int> given = {y, m, d};
for(auto date: pal){
if(date > given){
int day = get<2>(date), mon = get<1>(date), year = get<0>(date);
cout<<day/10<<day%10<<'.'<<mon/10<<mon%10<<'.'<<(year/1000)<<(year/100)%10<<year/10%10<<year%10<<'.'<<endl;
break;
}
}
}
int main(){
int test;
cin >> test;
while (test--){
solve();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
75 ms |
344 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
5 |
Correct |
1 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
8 |
Correct |
0 ms |
344 KB |
Output is correct |
9 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
10 |
Incorrect |
75 ms |
492 KB |
Output isn't correct |