Submission #61959

#TimeUsernameProblemLanguageResultExecution timeMemory
61959khsoo01popa (BOI18_popa)C++11
100 / 100
141 ms704 KiB
#include<bits/stdc++.h> #include"popa.h" using namespace std; int solve (int N, int *Left, int *Right) { for(int i=0;i<N;i++) { Left[i] = Right[i] = -1; } vector<int> S; S.push_back(0); for(int i=1;i<N;i++) { int T; while(!S.empty()) { T = S.back(); if(query(T, T, T, i)) { Left[i] = Right[T]; Right[T] = i; break; } else S.pop_back(); } if(S.empty()) { Left[i] = T; } S.push_back(i); } return S[0]; }

Compilation message (stderr)

popa.cpp: In function 'int solve(int, int*, int*)':
popa.cpp:23:12: warning: 'T' may be used uninitialized in this function [-Wmaybe-uninitialized]
    Left[i] = T;
    ~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...