Submission #998994

# Submission time Handle Problem Language Result Execution time Memory
998994 2024-06-15T03:41:16 Z vjudge1 Datum (COCI20_datum) C++17
0 / 50
140 ms 452 KB
#include <bits/stdc++.h>
using namespace std;

int days[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

map<int, string> str;
map<string, int> num;
vector<int> vec;

void solve(){
    string s;
    cin >> s;

    string DD = s.substr(0, 2);
    string MM = s.substr(3, 2);
    int Y = ((((((s[6] - '0') * 10) + (s[7] - '0')) * 10) + (s[8] - '0')) * 10) + (s[9] - '0');
    
    for (int year = Y; year < 10000; year ++){
        string y = to_string(year);
        while (y.size() < 4) y = '0' + y;
        
        string d, m;
        d += y[3];
        d += y[2];
        m += y[1];
        m += y[0];

        if (m == "00" or m > "12") continue;
        int mo = (m[0] - '0') * 10 + (m[1] - '0');
        if (d == "00" or to_string(days[mo - 1]) < d) continue;

        if (year > Y or (year == Y and (m > MM or (m == MM and d > DD)))){
            cout << d << '.' << m << '.' << y << endl;
            return;
        }
    }
}

int main(){
    
    int t;
    cin >> t;

    while (t--)
        solve();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Incorrect 109 ms 448 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Incorrect 0 ms 348 KB Output isn't correct
8 Incorrect 0 ms 348 KB Output isn't correct
9 Incorrect 0 ms 348 KB Output isn't correct
10 Incorrect 140 ms 452 KB Output isn't correct