제출 #720579

#제출 시각아이디문제언어결과실행 시간메모리
720579veehz자리 배치 (IOI18_seats)C++17
11 / 100
4053 ms33488 KiB
#include "seats.h" #include<bits/stdc++.h> using namespace std; vector<int> r,c; void give_initial_chart(int H, int W, vector<int> R, vector<int> C) { r=R,c=C; } int swap_seats(int a, int b) { swap(r[a],r[b]); swap(c[a],c[b]); int min_r = r[0], max_r = r[0], min_c = c[0], max_c = c[0]; int cnt = 1; for(int i=1;i<r.size();i++) { min_r = min(min_r, r[i]); max_r = max(max_r, r[i]); min_c = min(min_c, c[i]); max_c = max(max_c, c[i]); // cerr << (max_r - min_r) * (max_c - min_c) << ' ' << i+1 << endl; if((max_r - min_r + 1) * (max_c - min_c + 1) == i + 1) cnt++; } return cnt; }

컴파일 시 표준 에러 (stderr) 메시지

seats.cpp: In function 'int swap_seats(int, int)':
seats.cpp:18:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |   for(int i=1;i<r.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...