# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
845339 | 2023-09-06T13:13:07 Z | vjudge1 | Datum (COCI20_datum) | C++ | 27 ms | 544 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,es; 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')); f=0; es = yil; if((((yil / 1000) + (((yil/100) % 10)*10))) < ay || ((((yil % 10) * 10) + ((yil/10) % 10)) <= gun && (((yil / 1000) + (((yil/100) % 10)*10))) == ay)){ yil++; } 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 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 27 ms | 544 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 504 KB | Output is correct |
8 | Correct | 1 ms | 348 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
10 | Correct | 27 ms | 344 KB | Output is correct |