Submission #561951

# Submission time Handle Problem Language Result Execution time Memory
561951 2022-05-13T23:17:05 Z aryan12 Broken Device (JOI17_broken_device) C++17
8 / 100
39 ms 2836 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 < 124; i += 2)
    {
        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";
        }
    }
    for(long long i = 124; i < 150; i++)
    {
        Set(i, 0);
    }
}
#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 < 124; 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 32 ms 2560 KB Output is partially correct - L* = 14
2 Partially correct 33 ms 2596 KB Output is partially correct - L* = 14
3 Partially correct 31 ms 2496 KB Output is partially correct - L* = 14
4 Partially correct 31 ms 2592 KB Output is partially correct - L* = 14
5 Partially correct 31 ms 2540 KB Output is partially correct - L* = 14
6 Partially correct 33 ms 2480 KB Output is partially correct - L* = 14
7 Partially correct 31 ms 2532 KB Output is partially correct - L* = 14
8 Partially correct 34 ms 2516 KB Output is partially correct - L* = 14
9 Partially correct 32 ms 2576 KB Output is partially correct - L* = 14
10 Partially correct 32 ms 2568 KB Output is partially correct - L* = 14
11 Partially correct 33 ms 2532 KB Output is partially correct - L* = 14
12 Partially correct 32 ms 2492 KB Output is partially correct - L* = 14
13 Partially correct 33 ms 2564 KB Output is partially correct - L* = 14
14 Partially correct 32 ms 2608 KB Output is partially correct - L* = 14
15 Partially correct 33 ms 2568 KB Output is partially correct - L* = 14
16 Partially correct 36 ms 2512 KB Output is partially correct - L* = 14
17 Partially correct 33 ms 2480 KB Output is partially correct - L* = 14
18 Partially correct 31 ms 2480 KB Output is partially correct - L* = 14
19 Partially correct 34 ms 2552 KB Output is partially correct - L* = 14
20 Partially correct 32 ms 2532 KB Output is partially correct - L* = 14
21 Partially correct 39 ms 2520 KB Output is partially correct - L* = 14
22 Partially correct 32 ms 2544 KB Output is partially correct - L* = 14
23 Partially correct 33 ms 2836 KB Output is partially correct - L* = 14
24 Partially correct 33 ms 2480 KB Output is partially correct - L* = 14
25 Partially correct 35 ms 2748 KB Output is partially correct - L* = 14
26 Partially correct 32 ms 2504 KB Output is partially correct - L* = 14
27 Partially correct 33 ms 2484 KB Output is partially correct - L* = 14
28 Partially correct 33 ms 2496 KB Output is partially correct - L* = 14
29 Partially correct 34 ms 2504 KB Output is partially correct - L* = 14
30 Partially correct 33 ms 2536 KB Output is partially correct - L* = 14
31 Partially correct 37 ms 2480 KB Output is partially correct - L* = 14
32 Partially correct 33 ms 2760 KB Output is partially correct - L* = 14
33 Partially correct 31 ms 2480 KB Output is partially correct - L* = 14
34 Partially correct 31 ms 2676 KB Output is partially correct - L* = 14
35 Partially correct 34 ms 2560 KB Output is partially correct - L* = 14
36 Partially correct 31 ms 2480 KB Output is partially correct - L* = 14
37 Partially correct 34 ms 2624 KB Output is partially correct - L* = 14
38 Partially correct 33 ms 2532 KB Output is partially correct - L* = 14
39 Partially correct 33 ms 2572 KB Output is partially correct - L* = 14
40 Partially correct 32 ms 2572 KB Output is partially correct - L* = 14