답안 #71630

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
71630 2018-08-25T09:18:43 Z test(#2228, jh05013) 일하는 개미 (FXCUP3_ant) C++
90 / 100
4 ms 596 KB
#include "ant.h"

int paramin(int s, int e){ // Add more parameters as you need
    int mid, ans;
    while(s <= e){
        mid = (s+e)/2;
        // Predicate here
        bool pred = (DeliverCount(mid) >= 1);
        // Predicate ends
        if(pred) e=mid-1, ans=mid;
        else s=mid+1;
    }
    return ans;
}

int FindK() {
    int maxd = DeliverCount(99999999);
	return paramin(99999999/(maxd+1), 99999999/maxd);
}

Compilation message

ant.cpp: In function 'int paramin(int, int)':
ant.cpp:13:12: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return ans;
            ^~~
ant.cpp: In function 'int FindK()':
ant.cpp:18:49: warning: 'ans' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return paramin(99999999/(maxd+1), 99999999/maxd);
                                                 ^
# 결과 실행 시간 메모리 Grader output
1 Partially correct 3 ms 256 KB Partially correct : C = 27
2 Partially correct 4 ms 488 KB Partially correct : C = 27
3 Correct 3 ms 488 KB Correct
4 Partially correct 3 ms 596 KB Partially correct : C = 27
5 Correct 2 ms 596 KB Correct