Submission #845170

# Submission time Handle Problem Language Result Execution time Memory
845170 2023-09-06T12:25:00 Z vjudge1 Datum (COCI20_datum) C++
40 / 50
27 ms 524 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 % 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

datum.cpp: In function 'int main()':
datum.cpp:129:14: warning: unused variable 'b' [-Wunused-variable]
  129 |  long long a,b,c,d,e,f,gun,ay,yil,es;
      |              ^
datum.cpp:129:16: warning: unused variable 'c' [-Wunused-variable]
  129 |  long long a,b,c,d,e,f,gun,ay,yil,es;
      |                ^
datum.cpp:129:18: warning: unused variable 'd' [-Wunused-variable]
  129 |  long long a,b,c,d,e,f,gun,ay,yil,es;
      |                  ^
datum.cpp:129:20: warning: unused variable 'e' [-Wunused-variable]
  129 |  long long a,b,c,d,e,f,gun,ay,yil,es;
      |                    ^
datum.cpp:129:35: warning: variable 'es' set but not used [-Wunused-but-set-variable]
  129 |  long long a,b,c,d,e,f,gun,ay,yil,es;
      |                                   ^~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 27 ms 524 KB Output isn't correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Incorrect 27 ms 512 KB Output isn't correct