Submission #770277

#TimeUsernameProblemLanguageResultExecution timeMemory
770277boyliguanhanSeats (IOI18_seats)C++17
11 / 100
4073 ms24120 KiB
#include "seats.h" #pragma GCC optimize(2) #include<bits/stdc++.h> using namespace std; vector<int> x, y; void give_initial_chart(int H, int W, vector<int> R, vector<int> C) { x=R,y=C; } int swap_seats(int a, int b) { int ans = 0; swap(x[a],x[b]); swap(y[a],y[b]); int A=1e7,B=0,C=1e7,D=0; for(int i = 0; i < x.size(); i++) { A = min(A,x[i]); B = max(B,x[i]); C = min(C,y[i]); D = max(D,y[i]); int dis = (B-A+1)*(D-C+1); if(dis==i+1) ans++; } return ans; }

Compilation message (stderr)

seats.cpp: In function 'int swap_seats(int, int)':
seats.cpp:14:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for(int i = 0; i < x.size(); i++) {
      |                    ~~^~~~~~~~~~
#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...