| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 845081 | vjudge1 | Datum (COCI20_datum) | C++17 | 3 ms | 348 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
using namespace std;
#define int long long
 
#ifndef ONLINE_JUDGE
    #define OPEN freopen(".in", "r", stdin); \
                 freopen(".out", "w", stdout);
#else
    #define OPEN void(23);
#endif
bool check(int a, int b, int c, string &str)
{
    bool ok = true;
    if(b <= 0 || 13 <= b) ok = false;
    else if(b == 2) ok &= (1 <= a && a <= 28 + (c % 4 == 0));
    else if(b <= 6) ok &= (1 <= a && a <= 30 + (b & 1));
    else ok &= (1 <= a && 30 + !(b & 1));
    if(!ok) return false;
    int val = 0;
    for(int i = 6; i <= 9; i++) val = val * 10 + str[i] - '0';
    if(val == c)
    {
        val = 0;
        for(int i = 3; i <= 4; i++) val = val * 10 + str[i] - '0';
        if(val > b) return false;
        else if(val == b)
        {
            val = 0;
            for(int i = 0; i <= 1; i++) val = val * 10 + str[i] - '0';
            if(val < a) return true;
            return false;
        } 
        else return true;
    }
    if(b == 2) return a <= 28 + (c % 4 == 0);
    if(b <= 6) return a <= 30 + (b & 1);
    return a <= 30 + !(b & 1);
}
void solve()
{
    string str; cin >> str;
    int val = 0;
    for(int i = 6; i <= 9; i++) val = val * 10 + str[i] - '0';
    for(int k = val; k <= 9999; k++)
    {
        int first = 0;
        int _k = k;
        for(int i = 9; i >= 8; i--) first = first * 10 + _k % 10, _k /= 10;
    
        int second = 0;
        for(int i = 7; i >= 6; i--) second = second * 10 + _k % 10, _k /= 10;
        if(check(first, second, k, str))
        {
            if(first < 10) cout << 0;
            cout << first << '.';
            if(second < 10) cout << 0;
            cout << second << '.';
            if(k < 0) cout << 0;
            if(k < 10) cout << 0;
            if(k < 100) cout << 0;
            if(k < 1000) cout << 0;
            cout << k << '.';
            cout << "\n";
            return;
        }
    }
    return;
}
int32_t main()
{
    OPEN;
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int t = 1; cin >> t;
    while(t--)
    {
        solve();
    }
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
