Submission #309367

#TimeUsernameProblemLanguageResultExecution timeMemory
309367amunduzbaev로봇 (IOI13_robots)C++14
0 / 100
1 ms384 KiB
#include "robots.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; int putaway(int wet, int smt, int T, int we[], int sm[], int wt[], int st[]) { int t=T; sort(we,we+wet); sort(sm,sm+smt); /* for(int i=0;i<wet;i++) cout<<we[i]<<" "; cout<<"\n"; for(int i=0;i<smt;i++) cout<<sm[i]<<" "; cout<<" \n \n"; for(int i=0;i<t;i++) cout<<wt[i]<<" \n"<<st[i]<<"\n"; cout<<"\n"; */ for(int i=0;i<t;i++){ if(wet&&smt){ if(wt[i]>we[wet-1]&&st[i]>sm[smt-1]) return -1; }else if(wet){ if(wt[i]>we[wet-1]) return -1; }else if(st[i]>sm[smt-1]) return -1; } if(wet&&smt) if((we[0]>=wt[1]&&sm[0]>=st[0])||(we[0]>=wt[0]&&sm[0]>=st[1])) return 1; if(wet==t) if(wt[0]<=we[1]&&wt[1]<=we[0]||wt[1]<=we[1]&&wt[0]<=we[0]) return 1; if(smt==t) if(st[0]<=sm[1]&&st[1]<=sm[0]||st[1]<=sm[1]&&st[0]<=sm[0]) return 1; return 2; }

Compilation message (stderr)

robots.cpp: In function 'int putaway(int, int, int, int*, int*, int*, int*)':
robots.cpp:36:24: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   36 |         if(wt[0]<=we[1]&&wt[1]<=we[0]||wt[1]<=we[1]&&wt[0]<=we[0]) return 1;
      |            ~~~~~~~~~~~~^~~~~~~~~~~~~~
robots.cpp:39:24: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   39 |         if(st[0]<=sm[1]&&st[1]<=sm[0]||st[1]<=sm[1]&&st[0]<=sm[0]) return 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...