Submission #348150

#TimeUsernameProblemLanguageResultExecution timeMemory
348150juggernaut자리 배치 (IOI18_seats)C++14
Compilation error
0 ms0 KiB
#include"seats.h"
#include<bits/stdc++.h>
using namespace std;
#ifdef EVAL
#else
#include"grader.cpp"
#endif
vector<pair<int,int>>v;
int h,w;
void give_initial_chart(int H,int W,vector<int>x,vector<int>y){
    h=H,w=W;
    for(int i=0;i<h*w;i++)v.push_back({x[i],y[i]});
}
int swap_seats(int a,int b){
    swap(v[a],v[b]);
    int cnt=0,l=2e9,r=0,u=2e9,d=0;
    for(int i=0;i<h*w;i++){
        l=min(l,v[i].first);
        r=max(r,v[i].first);
        u=min(u,v[i].second);
        d=max(d,v[i].second);
        if((r-l+1)*(d-u+1)==i+1)cnt++;
    }
  if(cnt>n+m)exit(1);
    return cnt;
}

Compilation message (stderr)

seats.cpp: In function 'int swap_seats(int, int)':
seats.cpp:24:10: error: 'n' was not declared in this scope
   24 |   if(cnt>n+m)exit(1);
      |          ^
seats.cpp:24:12: error: 'm' was not declared in this scope
   24 |   if(cnt>n+m)exit(1);
      |            ^