Submission #597419

#TimeUsernameProblemLanguageResultExecution timeMemory
597419AryamanRtunjayJob Scheduling (CEOI12_jobs)C++17
Compilation error
0 ms0 KiB
#include <stdio.h> #define maxN 100001 using namespace std struct Cell { int id; Cell* next; }; Cell* Req[maxN]; int Cn[maxN], m, n, d; bool Test(int k) { int dd = 1, r = 0; for(int x = 1; x<=n; x++) { if(Cn[x] == 0) continue; if(dd<x-d) {dd=x-d; r=0;} dd+=(Cn[x] + r)/k; r = (Cn[x]+r%k); if(dd>x+1 || dd == x+1 && r>0) return false; } return true; }

Compilation message (stderr)

jobs.cpp:4:20: error: expected ';' before 'struct'
    4 | using namespace std
      |                    ^
      |                    ;
    5 | 
    6 | struct Cell {
      | ~~~~~~              
jobs.cpp: In function 'bool Test(int)':
jobs.cpp:21:32: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   21 |         if(dd>x+1 || dd == x+1 && r>0) return false;
      |                      ~~~~~~~~~~^~~~~~