Submission #434058

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4340582021-06-20 14:33:22frodakcinSeats (IOI18_seats)C++11
11 / 100
4078 ms102444 KiB
#include "seats.h"
#include <cassert>
#include <algorithm>
template<typename T> bool ckmax(T& a, const T& b) {return b>a?a=b,1:0;}
template<typename T> bool ckmin(T& a, const T& b) {return b<a?a=b,1:0;}
const int INF = 0x3f3f3f3f;
int H, W, N, ans;
std::vector<int> R, C;
//Subtasks 1, 2, 4
std::vector<int> maxr, minr, maxc, minc;
int calc(int u, int v)
{
for(int i=u;i<v;++i)
if(i+1 == (maxr[i+1]-minr[i+1])*(maxc[i+1]-minc[i+1]))
--ans;
for(int i=u;i<v;++i)
{
minr[i+1]=std::min(minr[i], R[i]);
maxr[i+1]=std::max(maxr[i], R[i]+1);
minc[i+1]=std::min(minc[i], C[i]);
maxc[i+1]=std::max(maxc[i], C[i]+1);
if(i+1 == (maxr[i+1]-minr[i+1])*(maxc[i+1]-minc[i+1]))
++ans;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

seats.cpp: In constructor 'ST::ST(int)':
seats.cpp:39:7: warning: 'ST::S' will be initialized after [-Wreorder]
   39 |   int S;
      |       ^
seats.cpp:38:20: warning:   'std::vector<int> ST::v' [-Wreorder]
   38 |   std::vector<int> v;
      |                    ^
seats.cpp:40:3: warning:   when initialized here [-Wreorder]
   40 |   ST(int _S=0): S(_S), v(_S*4, 0) {}
      |   ^~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...