제출 #1039968

#제출 시각아이디문제언어결과실행 시간메모리
1039968Ice_man삶의 질 (IOI10_quality)C++14
0 / 100
0 ms604 KiB
/** ____ ____ ____ __________________ ____ ____ ____ ||I || ||c || ||e || || || ||M || ||a || ||n || ||__|| ||__|| ||__|| ||________________|| ||__|| ||__|| ||__|| |/__\| |/__\| |/__\| |/________________\| |/__\| |/__\| |/__\| */ #include <iostream> #include <chrono> #include "quality.h" #define maxn 3005 #define maxlog 20 #define INF 1000000010 #define LINF 1000000000000000005 #define endl '\n' #define pb(x) push_back(x) #define X first #define Y second #define control cout<<"passed"<<endl; #pragma GCC optimize("O3" , "Ofast" , "unroll-loops" , "fast-math") #pragma GCC target("avx2") using namespace std; typedef unsigned long long ull; typedef pair <int, int> pii; typedef long long ll; typedef pair <ll, ll> pll; typedef pair <int, ll> pil; typedef pair <ll, int> pli; typedef long double pd; std::chrono::high_resolution_clock::time_point startT, currT; constexpr double TIME_MULT = 1; double timePassed() { using namespace std::chrono; currT = high_resolution_clock::now(); double time = duration_cast<duration<double>>(currT - startT).count(); return time * TIME_MULT; } int pref[maxn][maxn]; int a[maxn][maxn]; int n, m, h, w; bool check(int x) { for(int i = 1; i <= n; i++) for(int j = 1; j <= m; j++) { pref[i][j] = 0; pref[i][j] = pref[i][j - 1] + pref[i - 1][j] - pref[i - 1][j - 1]; if(x >= a[i][j]) pref[i][j]++; } for(int i = 1; i <= n; i++) for(int j = 1; j <= m; j++) if(i - h >= 0 && j - w >= 0) { int pom = pref[i][j] + pref[i - h][j - w] - pref[i - h][j] - pref[i][j - w]; if(pom * 2 >= h * w) return true; } return false; } int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { n = R; m = C; h = H; w = W; for(int i = 1; i <= n; i++) for(int j = 1; j <= m; j++) a[i][j] = Q[i][j]; int l = 1, r = n * m; int ans = 0; while(l <= r) { int mid = (l + r) / 2; if(check(mid) == true) { r = mid - 1; ans = mid; } else l = mid + 1; } return l; } /**int main() { #ifdef ONLINE_JUDGE /// promeni freopen("taxi.in", "r", stdin); freopen("taxi.out", "w", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(nullptr); startT = std::chrono::high_resolution_clock::now(); read(); solve(); return 0; } */

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

quality.cpp: In function 'int rectangle(int, int, int, int, int (*)[3001])':
quality.cpp:94:9: warning: variable 'ans' set but not used [-Wunused-but-set-variable]
   94 |     int ans = 0;
      |         ^~~
#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...