Submission #238542

# Submission time Handle Problem Language Result Execution time Memory
238542 2020-06-11T18:12:45 Z Borbi Datum (COCI20_datum) C++14
0 / 50
5 ms 384 KB
#include <bits/stdc++.h>

using namespace std;

char str[20];
char new_s[20];

bool check()
{
	bool fl = false;
	for(int i = 6; i <= 9; i++)
	{
		if(str[i] > new_s[i]) return false;
		if(str[i] != new_s[i]) fl = true;
	}
	for(int i = 3; i <= 4; i++)
	{
		if(str[i] > new_s[i]) return false;
	
		if(str[i] != new_s[i]) fl = true;
	}
	for(int i = 0; i <= 1; i++)
	{
		if(str[i] > new_s[i]) return false;
	
		if(str[i] != new_s[i]) fl = true;
	}
	return fl;
}

int main()
{
	cin >> str;

	new_s[2] = new_s[5] = new_s[10] = '.';
	for(char i = '0'; i <= '9'; i++)
	{
		for(char j = '0'; j <= '9'; j++)
		{
			for(char z = '0'; z <= '9'; z++)
			{
				for(char h = '0'; h <= '9'; h++)
				{
					new_s[9] = new_s[0] = h; new_s[1] = new_s[8] = z; new_s[3] = new_s[7] = j; new_s[4] = new_s[6] = i;
					if(check())
					{
						for(int i = 0; i <= 10; i++)
						{
							cout << new_s[i];
						}
						cout << "\n";
						return 0;
					}
				}
			}
		}
	}

	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB Output isn't correct
2 Incorrect 4 ms 384 KB Output isn't correct
3 Incorrect 5 ms 384 KB Output isn't correct
4 Incorrect 5 ms 256 KB Output isn't correct
5 Incorrect 4 ms 256 KB Output isn't correct
6 Incorrect 5 ms 384 KB Output isn't correct
7 Incorrect 5 ms 256 KB Output isn't correct
8 Incorrect 5 ms 256 KB Output isn't correct
9 Incorrect 4 ms 256 KB Output isn't correct
10 Incorrect 4 ms 384 KB Output isn't correct