답안 #238444

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
238444 2020-06-11T10:46:17 Z vankata Datum (COCI20_datum) C++14
25 / 50
65 ms 384 KB
#include<bits/stdc++.h>
using namespace std;
void print(int a,int b,int c)
{
    if(a<10)cout<<0;
    cout<<a;
    cout<<".";
    if(b<10)cout<<0;
    cout<<b;
    cout<<".";
    if(c<1000)cout<<0;
    cout<<c;
    cout<<".\n";
}
void solve()
{
    string s;
    cin>>s;
    int d,a,b,l,i;
    int m;
    int y;
    d = (s[0]-'0')*10+(s[1]-'0');
    m = (s[3]-'0')*10+(s[4]-'0');
    y = (((s[6]-'0')*10+(s[7]-'0'))*10+(s[8]-'0'))*10+(s[9]-'0');
    for(i=y;i<=9999;i++)
    {
        l=i;
        a=l%10;
        a*=10;
        l/=10;
        a+=l%10;
        l/=10;

        b=l%10;
        l/=10;
        b*=10;
        b+=l%10;

        if(a&&b)
        {
            if(b==2)
            {
                if(i%4==0)
                {
                    if(a>29)continue;
                }
                else
                    if(a>28)continue;
            }
            else if(b==1||b==3||b==5||b==7||b==8||b==10||b==12)
            {
                if(a>31)continue;
            }
            else if(b>12)continue;
            else if(a>30)continue;
        }
        else continue;
        if(i==y)
        {
            if(b>=m)
            {
                if(a<=d)continue;
            }
            else continue;
        }
        print(a,b,i);
        break;
    }
}
int main()
{
    int n;
    cin>>n;
    while(n--)solve();
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Incorrect 64 ms 384 KB Output isn't correct
3 Correct 5 ms 384 KB Output is correct
4 Incorrect 5 ms 384 KB Output isn't correct
5 Incorrect 5 ms 384 KB Output isn't correct
6 Correct 4 ms 256 KB Output is correct
7 Incorrect 5 ms 256 KB Output isn't correct
8 Correct 5 ms 256 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Incorrect 65 ms 384 KB Output isn't correct