Submission #799765

# Submission time Handle Problem Language Result Execution time Memory
799765 2023-07-31T23:55:25 Z Liudas The Big Prize (IOI17_prize) C++17
20 / 100
62 ms 336 KB
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;
int find_best(int N){
    int step = sqrt(N);
    int s = 1;
    int ans = 0;
    int l = 0, r = N - 1;
    for(int i = 0; i < N && s; i += step){
        int p = min(r, i + step);
        int t = 1;
        for(; p >= i && t; p --){
            auto k = ask(p);
            t = k[0];
            s = k[0] + k[1];
            //cout << p << " " << k[0] << " " << k[1] << endl;
        }
        l = p + 1;
    }
    return l;
}

Compilation message

prize.cpp: In function 'int find_best(int)':
prize.cpp:7:9: warning: unused variable 'ans' [-Wunused-variable]
    7 |     int ans = 0;
      |         ^~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 292 KB Output is correct
2 Correct 5 ms 208 KB Output is correct
3 Correct 3 ms 208 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
5 Correct 3 ms 292 KB Output is correct
6 Correct 3 ms 292 KB Output is correct
7 Correct 3 ms 292 KB Output is correct
8 Correct 2 ms 288 KB Output is correct
9 Correct 4 ms 208 KB Output is correct
10 Correct 3 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 208 KB Output is correct
2 Correct 3 ms 296 KB Output is correct
3 Correct 3 ms 288 KB Output is correct
4 Correct 4 ms 208 KB Output is correct
5 Correct 2 ms 296 KB Output is correct
6 Correct 2 ms 336 KB Output is correct
7 Correct 3 ms 208 KB Output is correct
8 Correct 3 ms 208 KB Output is correct
9 Correct 2 ms 296 KB Output is correct
10 Correct 8 ms 208 KB Output is correct
11 Incorrect 62 ms 208 KB Incorrect
12 Halted 0 ms 0 KB -