제출 #138279

#제출 시각아이디문제언어결과실행 시간메모리
138279wzy자리 배치 (IOI18_seats)C++11
11 / 100
1993 ms33016 KiB
#include "seats.h" #include <bits/stdc++.h> using namespace std; const int N = 10005; std::vector<int> r; int posX[N] ,posY[N]; int H , W; void give_initial_chart(int Hw, int Ww, std::vector<int> R, std::vector<int> C) { H = Hw, W = Ww; for(int i = 0 ; i < R.size() ; i ++){ posX[i] = R[i]; posY[i] = C[i]; } } int swap_seats(int a, int b) { swap(posX[a] , posX[b]); swap(posY[a] , posY[b]); int minvlX = 1000000000 , maxvlX = -1; int minvlY = 1000000000 , maxvlY = -1; int cnt = 0; for(int i = 0 ; i < H*W ; i++){ minvlX = min(minvlX , posX[i]) , maxvlX = max(maxvlX , posX[i]); minvlY = min(minvlY , posY[i]) , maxvlY = max(maxvlY , posY[i]); if((abs(minvlX - maxvlX ) + 1 ) * (abs(minvlY - maxvlY) + 1) == i + 1){ cnt++; } } return cnt; }

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

seats.cpp: In function 'void give_initial_chart(int, int, std::vector<int>, std::vector<int>)':
seats.cpp:10:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0 ; 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...