제출 #1039488

#제출 시각아이디문제언어결과실행 시간메모리
1039488ArthuroWich삶의 질 (IOI10_quality)C++17
60 / 100
5050 ms35096 KiB
#include "quality.h" #include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; int ans = INT_MAX, med, n, m; int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { int n = R, m = C, med = H*W/2, ans = INT_MAX; for (int j1 = 0; j1 < m; j1++) { int j2 = j1+W-1; if (j2 >= m) { break; } indexed_set c; for (int i = 0; i < H; i++) { for (int j = j1; j <= j2; j++) { c.insert({Q[i][j], i*C+j}); } } pair<int, int> p = *c.find_by_order(med); ans = min(ans, p.first); for (int i2 = H; i2 < R; i2++) { int i1 = i2-H; for (int j = j1; j <= j2; j++) { c.erase({Q[i1][j], i1*C+j}); } for (int j = j1; j <= j2; j++) { c.insert({Q[i2][j], i2*C+j}); } p = *c.find_by_order(med); ans = min(ans, p.first); } } return ans; }

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

quality.cpp: In function 'int rectangle(int, int, int, int, int (*)[3001])':
quality.cpp:10:6: warning: unused variable 'n' [-Wunused-variable]
   10 |  int n = R, m = C, med = H*W/2, ans = INT_MAX;
      |      ^
#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...