# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
845137 | 2023-09-06T12:12:28 Z | vjudge1 | Datum (COCI20_datum) | C++ | 27 ms | 500 KB |
#include<bits/stdc++.h> using namespace std; long long kontrol (long long day , long long month, long long year){ if(month == 1){ if(day <= 31 && day > 0){ return 1; } else{ return 0; } } if(month == 2){ if(year % 4 == 0){ if(day <= 29 && day > 0){ return 1; } else{ return 0; } } else{ if(day <= 28 && day > 0){ return 1; } else{ return 0; } } } if(month == 3){ if(day <= 31 && day > 0){ return 1; } else{ return 0; } } if(month == 4){ if(day <= 30 && day > 0){ return 1; } else{ return 0; } } if(month == 5){ if(day <= 31 && day > 0){ return 1; } else{ return 0; } } if(month == 6){ if(day <= 30 && day > 0){ return 1; } else{ return 0; } } if(month == 7){ if(day <= 31 && day > 0){ return 1; } else{ return 0; } } if(month == 8){ if(day <= 31 && day > 0){ return 1; } else{ return 0; } } if(month == 9){ if(day <= 30 && day > 0){ return 1; } else{ return 0; } } if(month == 10){ if(day <= 31 && day > 0){ return 1; } else{ return 0; } } if(month == 11){ if(day <= 30 && day > 0){ return 1; } else{ return 0; } } if(month == 12){ if(day <= 31 && day > 0){ return 1; } else{ return 0; } } if(month > 12){ return 0; } return 0; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); long long a,b,c,d,e,f,gun,ay,yil,enb; string kel; cin>>a; while(a--){ cin>>kel; gun = ((kel[0] - '0') * 10) + (kel[1] - '0'); ay = ((kel[3] - '0') * 10) + (kel[4] - '0'); yil = ((kel[6] - '0') * 1000) + ((kel[7] - '0')*100) + ((kel[8] - '0') * 10) + ((kel[9] - '0')); if(kontrol(gun+1,ay,yil) == 1 && (gun+1) <= (((yil % 10) * 10) + ((yil/10) % 10)) && (ay + 1) <= (((yil / 1000) + (((yil/100) % 10)*10)))){ gun+=1; } else{ if(kontrol(1,ay+1,yil) == 1 && (ay + 1) <= (((yil / 1000) + (((yil/100) % 10)*10))) && (1) <= (((yil % 10) * 10) + ((yil/10) % 10))){ ay+=1; gun=1; } else{ yil+=1; } } f=0; f = kontrol(((yil % 10) * 10) + ((yil/10) % 10),((yil / 1000) + (((yil/100) % 10)*10)),yil); while(f == 0){ yil++; f = kontrol((((yil % 10) * 10) + ((yil/10) % 10)),((yil / 1000) + (((yil/100) % 10)*10)),yil); } cout<<((yil % 10))<<((yil/10) % 10)<<"."<<(((yil/100) % 10))<<(yil / 1000)<<"."<<yil/1000<<(yil/100) % 10<<(yil/10) % 10<<yil % 10<<".\n"; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Incorrect | 26 ms | 344 KB | Output isn't correct |
3 | Incorrect | 1 ms | 344 KB | Output isn't correct |
4 | Incorrect | 0 ms | 344 KB | Output isn't correct |
5 | Incorrect | 0 ms | 344 KB | Output isn't correct |
6 | Correct | 0 ms | 344 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 1 ms | 344 KB | Output is correct |
9 | Correct | 1 ms | 500 KB | Output is correct |
10 | Incorrect | 27 ms | 344 KB | Output isn't correct |