Submission #86288

# Submission time Handle Problem Language Result Execution time Memory
86288 2018-11-26T00:52:51 Z kraljlavova1 Kocka (COCI18_kocka) C++11
70 / 70
171 ms 2284 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int polje[4*n];
	for(int i=0;i<4*n;i++){
		cin>>polje[i];
	}
	for(int i=0;i<3*n;i++){
		if(i<n or i>=2*n and i<3*n){
			if(polje[i]==-1 && polje[i+n]!=-1 || polje[i+n]==-1 && polje[i]!=-1){
				cout<<"NE";
				return 0;
			}
			else if(polje[i]+polje[i+n]>=n){
				cout<<"NE";
				return 0;
			}
		}
	}
	cout<<"DA";
	return 0;
}

Compilation message

kocka.cpp: In function 'int main()':
kocka.cpp:11:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   if(i<n or i>=2*n and i<3*n){
             ~~~~~~~^~~~~~~~~
kocka.cpp:12:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
    if(polje[i]==-1 && polje[i+n]!=-1 || polje[i+n]==-1 && polje[i]!=-1){
       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 3 ms 380 KB Output is correct
3 Correct 3 ms 456 KB Output is correct
4 Correct 3 ms 628 KB Output is correct
5 Correct 3 ms 628 KB Output is correct
6 Correct 4 ms 628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 628 KB Output is correct
2 Correct 3 ms 628 KB Output is correct
3 Correct 3 ms 628 KB Output is correct
4 Correct 3 ms 628 KB Output is correct
5 Correct 3 ms 628 KB Output is correct
6 Correct 3 ms 628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 136 ms 2144 KB Output is correct
2 Correct 153 ms 2144 KB Output is correct
3 Correct 151 ms 2144 KB Output is correct
4 Correct 98 ms 2228 KB Output is correct
5 Correct 149 ms 2228 KB Output is correct
6 Correct 148 ms 2228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 152 ms 2228 KB Output is correct
2 Correct 130 ms 2228 KB Output is correct
3 Correct 155 ms 2228 KB Output is correct
4 Correct 105 ms 2228 KB Output is correct
5 Correct 148 ms 2228 KB Output is correct
6 Correct 139 ms 2228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 136 ms 2284 KB Output is correct
2 Correct 101 ms 2284 KB Output is correct
3 Correct 171 ms 2284 KB Output is correct
4 Correct 148 ms 2284 KB Output is correct
5 Correct 152 ms 2284 KB Output is correct
6 Correct 131 ms 2284 KB Output is correct