Submission #95962

# Submission time Handle Problem Language Result Execution time Memory
95962 2019-02-04T17:53:51 Z MohamedAhmed0 Sticks (POI11_pat) C++14
28 / 100
1000 ms 4600 KB
#include <bits/stdc++.h>

using namespace std;

const int MAXK = 55 ;
const int MAXN = 1e6+10 ;
int arr[MAXK][MAXN] , sz[MAXK];
int k ;

int readInt () {
	bool minus = false;
	int result = 0;
	char ch;
	ch = getchar();
	while (true) {
		if (ch == '-') break;
		if (ch >= '0' && ch <= '9') break;
		ch = getchar();
	}
	if (ch == '-') minus = true; else result = ch-'0';
	while (true) {
		ch = getchar();
		if (ch < '0' || ch > '9') break;
		result = result*10 + (ch - '0');
	}
	if (minus)
		return -result;
	else
		return result;
}

int main()
{
    int n ;
    n = readInt();
    for(int i = 0 ; i < n ; ++i)
    {
        sz[i] = readInt();
        for(int j = 0 ; j < sz[i] ; ++j)
            arr[i][j] = readInt();
    }
    for(int i = 0 ; i < n ; ++i)
    {
        for(int i2 = 0 ; i2 < sz[i] ; ++i2)
        {
            int a = arr[i][i2] ;
            for(int j = i+1 ; j < n ; ++j)
            {
                for(int j2 = 0 ; j2 < sz[j] ; ++j2)
                {
                    int b = arr[j][j2] ;
                    for(int k = j+1 ; k < n ; ++k)
                    {
                        for(int k2 = 0 ; k2 < sz[k] ; ++k2)
                        {
                            int c = arr[k][k2] ;
                            if(a < b+c && b < a+c && c < a+b)
                                return printf("%d %d %d %d %d %d" , i+1 , a , j+1 , b , k+1 , c) , 0 ;
                        }
                    }
                }
            }
        }
    }
    return printf("NIE") , 0 ;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Oczekiwano NIE
# Verdict Execution time Memory Grader output
1 Correct 17 ms 264 KB Oczekiwano NIE
2 Execution timed out 1078 ms 504 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Correct 100 ms 376 KB Oczekiwano NIE
2 Execution timed out 1067 ms 504 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1066 ms 376 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1062 ms 504 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1066 ms 632 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 40 ms 2424 KB Output is correct
2 Execution timed out 1077 ms 1684 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 39 ms 2552 KB Output is correct
2 Execution timed out 1076 ms 1784 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 179 ms 4600 KB Output is correct
2 Execution timed out 1073 ms 1912 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 135 ms 4600 KB Output is correct
2 Execution timed out 1084 ms 2296 KB Time limit exceeded
3 Halted 0 ms 0 KB -