제출 #95610

#제출 시각아이디문제언어결과실행 시간메모리
95610jeffGap (APIO16_gap)C++14
0 / 100
68 ms1324 KiB
#include <bits/stdc++.h>
#include "gap.h"
using namespace std;

long long findGap(int T, int N) {
    long long l, r, y, z, ls = -1, rs = 0, a, b, i;
    MinMax(0, 1000000000000000000, &y, &z);
    for (i = 0; b < z; ++i) {
        a = y + (z - y) / (N - 1) * i;
        b = y + (z - y) / (N - 1) * (i + 1);
        if (a >= b) continue;
        MinMax(a, b, &l, &r);
        if (l < 0 && r < 0) continue;
        if (ls > -1) rs = max(rs, l - ls);
        ls = r;
    }
	return rs;
}

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:8:19: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized]
     for (i = 0; b < z; ++i) {
                 ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...