# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
152943 | 2019-09-10T15:53:55 Z | Ruxandra985 | popa (BOI18_popa) | C++14 | 15 ms | 504 KB |
#include <cstdio> #include "popa.h" /// daca iese asa sunt zeita si intuitia mea este aur:) int solve (int n , int *l , int *r){ /// return root int i,lant,root; int bgn[1010] , ed[1010] , tt[1010] , fii[1010]; for (i=1;i<=n;i++){ tt[i] = l[i] = r[i] = -1; /// reset all } /// separam in lanturi lant = 1; bgn[1] = ed[1] = 1; for (i=2;i<=n;i++){ /// n - 1 if (query(bgn[lant]-1 , i-1 , i-1 , i-1)){ /// i apartine lantului curent ed[lant]++; tt[i-1] = i; } else { /// incepem alt lant lant++; bgn[lant] = ed[lant] = i; } } /// mai bine obtin l si r din tt /// cum reusesc eu sa conectez aceste lanturi /// uniunile dintre lanturi se fac clar la nivelul lui ed /// pentru ca au indici consecutivi in s root = ed[1]; for (i=2;i<=lant;i++){ /// ce fac cu lantul asta /// daca pot sa il unesc pe ed[i-1] cu ed[i] if (query(ed[i-1]-1 , ed[i]-1 , ed[i-1]-1,ed[i-1]-1)){ tt[ed[i]] = ed[i-1]; /// unesti intervalele astea } else { /// daca nu pot cu aia , il fac pe ed[i] radacina tt[root] = ed[i]; root = ed[i]; ed[i]--; } } for (i=1;i<=n;i++){ if (tt[i]!=-1){ if (l[tt[i]]==-1) l[tt[i]] = i-1; else r[tt[i]] = i-1; } } return root-1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 504 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 15 ms | 500 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 13 ms | 444 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |