Submission #86288

#TimeUsernameProblemLanguageResultExecution timeMemory
86288kraljlavova1Kocka (COCI18_kocka)C++11
70 / 70
171 ms2284 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...