Submission #793019

# Submission time Handle Problem Language Result Execution time Memory
793019 2023-07-25T12:32:23 Z Trisanu_Das Kocka (COCI18_kocka) C++17
70 / 70
82 ms 4300 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]
   11 |   if(i<n or i>=2*n and i<3*n){
      |             ~~~~~~~^~~~~~~~~
kocka.cpp:12:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   12 |    if(polje[i]==-1 && polje[i+n]!=-1 || polje[i+n]==-1 && polje[i]!=-1){
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 316 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 70 ms 3620 KB Output is correct
2 Correct 75 ms 4136 KB Output is correct
3 Correct 76 ms 4132 KB Output is correct
4 Correct 53 ms 2980 KB Output is correct
5 Correct 75 ms 4148 KB Output is correct
6 Correct 76 ms 4128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 71 ms 3876 KB Output is correct
2 Correct 53 ms 2992 KB Output is correct
3 Correct 82 ms 4300 KB Output is correct
4 Correct 54 ms 3116 KB Output is correct
5 Correct 75 ms 4132 KB Output is correct
6 Correct 71 ms 3880 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 69 ms 3712 KB Output is correct
2 Correct 53 ms 2988 KB Output is correct
3 Correct 77 ms 4268 KB Output is correct
4 Correct 76 ms 4144 KB Output is correct
5 Correct 76 ms 4136 KB Output is correct
6 Correct 53 ms 2976 KB Output is correct