답안 #71814

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
71814 2018-08-25T16:21:25 Z Give_Me_Vita(#2255, gs13105) 일하는 개미 (FXCUP3_ant) C++17
90 / 100
3 ms 468 KB
#include "ant.h"

int FindK()
{
    int f = 75000000;
    int t = DeliverCount(f);

    int s, g;
    if(t == 0)
    {
        s = f + 1;
        g = 99999999;
    }
    else if(t == 1)
    {
        s = f / 2 + 1;
        g = f;
    }
    else
    {
        s = 1;
        g = f / 2;
    }

    while(s < g)
    {
        int x = (s + g) / 2;

        int t = DeliverCount(x);

        if(t > 1)
            g = x - 1;
        else if(t == 1)
            g = x;
        else
            s = x + 1;
    }
	return s;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 3 ms 248 KB Partially correct : C = 27
2 Correct 2 ms 356 KB Correct
3 Partially correct 2 ms 408 KB Partially correct : C = 27
4 Partially correct 2 ms 468 KB Partially correct : C = 27
5 Partially correct 2 ms 468 KB Partially correct : C = 27