답안 #371417

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
371417 2021-02-26T15:14:05 Z leinad2 커다란 상품 (IOI17_prize) C++17
20 / 100
93 ms 6124 KB
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
int A[200010];
vector<int>B[200010];
int find_best(int n)
{
  int c=0;
    while(1)
    {
      c++;if(c>=500)return 1;
        int a=0, b=n-1;
        while(a<b)
        {
            int m=a+b>>1;
            vector<int>v;
            if(B[m].size())v=B[m];
            else v=ask(m);
            B[m]=v;
            if(v[0]+v[1]==0)return m;
            if(v[1]>A[m+1])a=m+1;
            else b=m;
        }
        vector<int>v;
        if(B[a].size())v=B[a];
        else v=ask(a);
        B[a]=v;
        if(v[0]+v[1]==0)return a;
        for(int i=0;i<=a;i++)A[i]++;
    }
}

Compilation message

prize.cpp: In function 'int find_best(int)':
prize.cpp:15:20: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   15 |             int m=a+b>>1;
      |                   ~^~
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 5072 KB Output is correct
2 Correct 4 ms 4972 KB Output is correct
3 Correct 4 ms 4972 KB Output is correct
4 Correct 4 ms 4972 KB Output is correct
5 Correct 4 ms 4972 KB Output is correct
6 Correct 4 ms 5100 KB Output is correct
7 Correct 4 ms 4972 KB Output is correct
8 Correct 4 ms 4972 KB Output is correct
9 Correct 4 ms 4972 KB Output is correct
10 Correct 4 ms 4972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 4972 KB Output is correct
2 Correct 4 ms 5100 KB Output is correct
3 Correct 4 ms 4972 KB Output is correct
4 Correct 4 ms 5100 KB Output is correct
5 Correct 4 ms 4972 KB Output is correct
6 Correct 4 ms 4972 KB Output is correct
7 Correct 4 ms 4972 KB Output is correct
8 Correct 4 ms 5100 KB Output is correct
9 Correct 4 ms 4972 KB Output is correct
10 Correct 4 ms 4972 KB Output is correct
11 Correct 9 ms 5740 KB Output is correct
12 Correct 10 ms 5868 KB Output is correct
13 Correct 5 ms 5100 KB Output is correct
14 Correct 12 ms 5100 KB Output is correct
15 Correct 49 ms 5992 KB Output is correct
16 Correct 16 ms 5900 KB Output is correct
17 Correct 93 ms 6124 KB Output is correct
18 Correct 4 ms 5100 KB Output is correct
19 Correct 74 ms 5868 KB Output is correct
20 Correct 37 ms 5484 KB Output is correct
21 Correct 58 ms 5924 KB Output is correct
22 Correct 51 ms 5868 KB Output is correct
23 Correct 6 ms 5740 KB Output is correct
24 Correct 11 ms 5740 KB Output is correct
25 Correct 33 ms 5900 KB Output is correct
26 Correct 46 ms 5868 KB Output is correct
27 Correct 5 ms 5612 KB Output is correct
28 Correct 9 ms 5868 KB Output is correct
29 Correct 13 ms 5868 KB Output is correct
30 Correct 4 ms 4972 KB Output is correct
31 Correct 88 ms 5996 KB Output is correct
32 Correct 6 ms 5740 KB Output is correct
33 Correct 4 ms 4972 KB Output is correct
34 Correct 68 ms 5868 KB Output is correct
35 Correct 5 ms 5840 KB Output is correct
36 Correct 69 ms 5868 KB Output is correct
37 Correct 11 ms 5740 KB Output is correct
38 Correct 6 ms 5740 KB Output is correct
39 Correct 55 ms 5868 KB Output is correct
40 Correct 4 ms 4972 KB Output is correct
41 Correct 38 ms 5900 KB Output is correct
42 Correct 36 ms 5868 KB Output is correct
43 Correct 41 ms 5868 KB Output is correct
44 Correct 61 ms 5868 KB Output is correct
45 Correct 54 ms 5868 KB Output is correct
46 Correct 87 ms 5996 KB Output is correct
47 Correct 48 ms 5868 KB Output is correct
48 Correct 27 ms 5868 KB Output is correct
49 Correct 68 ms 5868 KB Output is correct
50 Correct 4 ms 4972 KB Output is correct
51 Correct 46 ms 5932 KB Output is correct
52 Correct 79 ms 5996 KB Output is correct
53 Correct 4 ms 4972 KB Output is correct
54 Correct 60 ms 5888 KB Output is correct
55 Correct 74 ms 5996 KB Output is correct
56 Correct 4 ms 4972 KB Output is correct
57 Correct 34 ms 5868 KB Output is correct
58 Incorrect 80 ms 5868 KB answer is not correct
59 Halted 0 ms 0 KB -