Submission #561954

# Submission time Handle Problem Language Result Execution time Memory
561954 2022-05-13T23:20:46 Z aryan12 Broken Device (JOI17_broken_device) C++17
0 / 100
44 ms 2372 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

void Anna(int N, long long X, int K, int P[])
{
    set<int> already_taken;
    for(int i = 0; i < K; i++)
    {
        already_taken.insert(P[i]);
    }
    long long cnt = 0;
    // cout << "X = " << X << "\n";
    for(long long i = 0; i < N; i += 2)
    {
        if(cnt >= 60)
        {
            Set(i, 0);
            Set(i + 1, 0);
            continue;
        }
        long long bit_set = (1LL << cnt) & X;
        // cout << "bit_set = " << bit_set << "\n";
        cnt++;
        if(already_taken.count(i) || already_taken.count(i + 1))
        {
            cnt--;
            Set(i, 0);
            Set(i + 1, 0);
            // cout << "nothing: 00\n";
        }
        else if(bit_set != 0 && !already_taken.count(i))
        {
            Set(i, 1);
            Set(i + 1, 0);
            // cout << "10\n";
        }
        else if(bit_set != 0 && !already_taken.count(i + 1))
        {
            Set(i, 0);
            Set(i + 1, 1);
            // cout << "01\n";
        }
        else
        {
            Set(i, 1);
            Set(i + 1, 1);
            // cout << "11\n";
        }
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;

long long Bruno(int N, int A[])
{
    // for(long long i = 0; i < N; i++)
    // {
    //     cout << A[i] << " ";
    // }
    // cout << "\n";
    // cout << "\n\n\n\n\n\n\n\n\n\n\n\n BRUNO TURN\n";
    long long ans = 0, cur_bit = 0;
    for(int i = 0; i < 120; i += 2)
    {
        // cout << "received: " << A[i] << " " << A[i + 1] << "\n";
        if(A[i] == 0 && A[i + 1] == 0)
        {
            continue;
        }
        if(A[i] == 0 || A[i + 1] == 0)
        {
            // cout << "cur_bit = " << cur_bit << "\n";
            ans += (1LL << cur_bit);
            // cout << "ans = " << ans << "\n";
        }
        cur_bit++;
    }
    // cout << "ans = " << ans << "\n";
    // cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
    // assert(ans % 2 == 0);
    return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 36 ms 2244 KB Output isn't correct - L* = 0
2 Partially correct 32 ms 2272 KB Output isn't correct - L* = 0
3 Partially correct 34 ms 2232 KB Output isn't correct - L* = 0
4 Partially correct 33 ms 2332 KB Output isn't correct - L* = 0
5 Partially correct 32 ms 2272 KB Output isn't correct - L* = 0
6 Partially correct 36 ms 2228 KB Output isn't correct - L* = 0
7 Partially correct 34 ms 2268 KB Output isn't correct - L* = 0
8 Partially correct 35 ms 2172 KB Output isn't correct - L* = 0
9 Partially correct 33 ms 2340 KB Output isn't correct - L* = 0
10 Partially correct 32 ms 2252 KB Output isn't correct - L* = 0
11 Partially correct 33 ms 2228 KB Output isn't correct - L* = 0
12 Partially correct 34 ms 2332 KB Output isn't correct - L* = 0
13 Partially correct 33 ms 2296 KB Output isn't correct - L* = 0
14 Partially correct 33 ms 2364 KB Output isn't correct - L* = 0
15 Partially correct 36 ms 2252 KB Output isn't correct - L* = 0
16 Partially correct 32 ms 2260 KB Output isn't correct - L* = 0
17 Partially correct 35 ms 2332 KB Output isn't correct - L* = 0
18 Partially correct 37 ms 2284 KB Output isn't correct - L* = 0
19 Partially correct 32 ms 2228 KB Output isn't correct - L* = 0
20 Partially correct 32 ms 2348 KB Output isn't correct - L* = 0
21 Partially correct 32 ms 2284 KB Output isn't correct - L* = 0
22 Partially correct 34 ms 2228 KB Output isn't correct - L* = 0
23 Partially correct 44 ms 2372 KB Output isn't correct - L* = 0
24 Partially correct 31 ms 2292 KB Output isn't correct - L* = 0
25 Partially correct 32 ms 2228 KB Output isn't correct - L* = 0
26 Partially correct 32 ms 2228 KB Output isn't correct - L* = 0
27 Partially correct 32 ms 2340 KB Output isn't correct - L* = 0
28 Partially correct 37 ms 2332 KB Output isn't correct - L* = 0
29 Partially correct 37 ms 2312 KB Output isn't correct - L* = 0
30 Partially correct 34 ms 2292 KB Output isn't correct - L* = 0
31 Partially correct 31 ms 2228 KB Output isn't correct - L* = 0
32 Partially correct 32 ms 2252 KB Output isn't correct - L* = 0
33 Partially correct 32 ms 2344 KB Output isn't correct - L* = 0
34 Partially correct 34 ms 2316 KB Output isn't correct - L* = 0
35 Partially correct 36 ms 2320 KB Output isn't correct - L* = 0
36 Partially correct 35 ms 2284 KB Output isn't correct - L* = 0
37 Partially correct 35 ms 2252 KB Output isn't correct - L* = 0
38 Partially correct 32 ms 2232 KB Output isn't correct - L* = 0
39 Partially correct 32 ms 2308 KB Output isn't correct - L* = 0
40 Partially correct 34 ms 2260 KB Output isn't correct - L* = 0