답안 #561952

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
561952 2022-05-13T23:18:13 Z aryan12 Broken Device (JOI17_broken_device) C++17
8 / 100
47 ms 2464 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 < 122; 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 = 122; 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 < 122; 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;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 47 ms 2220 KB Output is partially correct - L* = 14
2 Partially correct 38 ms 2212 KB Output is partially correct - L* = 14
3 Partially correct 32 ms 2276 KB Output is partially correct - L* = 14
4 Partially correct 33 ms 2308 KB Output is partially correct - L* = 14
5 Partially correct 32 ms 2272 KB Output is partially correct - L* = 14
6 Partially correct 31 ms 2324 KB Output is partially correct - L* = 14
7 Partially correct 46 ms 2228 KB Output is partially correct - L* = 14
8 Partially correct 43 ms 2236 KB Output is partially correct - L* = 14
9 Partially correct 33 ms 2248 KB Output is partially correct - L* = 14
10 Partially correct 32 ms 2308 KB Output is partially correct - L* = 14
11 Partially correct 32 ms 2340 KB Output is partially correct - L* = 14
12 Partially correct 33 ms 2360 KB Output is partially correct - L* = 14
13 Partially correct 31 ms 2340 KB Output is partially correct - L* = 14
14 Partially correct 36 ms 2228 KB Output is partially correct - L* = 14
15 Partially correct 39 ms 2312 KB Output is partially correct - L* = 14
16 Partially correct 36 ms 2328 KB Output is partially correct - L* = 14
17 Partially correct 32 ms 2256 KB Output is partially correct - L* = 14
18 Partially correct 31 ms 2220 KB Output is partially correct - L* = 14
19 Partially correct 32 ms 2348 KB Output is partially correct - L* = 14
20 Partially correct 32 ms 2264 KB Output is partially correct - L* = 14
21 Partially correct 32 ms 2228 KB Output is partially correct - L* = 14
22 Partially correct 34 ms 2228 KB Output is partially correct - L* = 14
23 Partially correct 34 ms 2292 KB Output is partially correct - L* = 14
24 Partially correct 31 ms 2348 KB Output is partially correct - L* = 14
25 Partially correct 34 ms 2324 KB Output is partially correct - L* = 14
26 Partially correct 33 ms 2464 KB Output is partially correct - L* = 14
27 Partially correct 32 ms 2248 KB Output is partially correct - L* = 14
28 Partially correct 42 ms 2232 KB Output is partially correct - L* = 14
29 Partially correct 36 ms 2256 KB Output is partially correct - L* = 14
30 Partially correct 36 ms 2276 KB Output is partially correct - L* = 14
31 Partially correct 34 ms 2424 KB Output is partially correct - L* = 14
32 Partially correct 33 ms 2240 KB Output is partially correct - L* = 14
33 Partially correct 32 ms 2248 KB Output is partially correct - L* = 14
34 Partially correct 34 ms 2356 KB Output is partially correct - L* = 14
35 Partially correct 43 ms 2248 KB Output is partially correct - L* = 14
36 Partially correct 36 ms 2256 KB Output is partially correct - L* = 14
37 Partially correct 32 ms 2352 KB Output is partially correct - L* = 14
38 Partially correct 33 ms 2424 KB Output is partially correct - L* = 14
39 Partially correct 32 ms 2352 KB Output is partially correct - L* = 14
40 Partially correct 32 ms 2444 KB Output is partially correct - L* = 14