답안 #492747

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
492747 2021-12-08T17:06:44 Z Habitus Broken Device (JOI17_broken_device) C++14
0 / 100
36 ms 2660 KB
#include "Annalib.h"
#include<bits/stdc++.h>
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define dec(x, y) fixed << setprecision((y)) << (x)
#define xx first
#define yy second
#define srt(v) sort((v).begin(), (v).end())
#define srtr(v) sort((v).rbegin(), (v).rend())
#define pb push_back
#define popb pop_back
#define sz(a) (int)(a).size()
#define len(a) (int)(a).length()
#define mp make_pair

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

void Anna(int N, ll X, int K, int P[]) {
    bool pokv[150]={0};
    bool broj[61]={0};
    for(int i=0; i<60; i++) {
        broj[i]=(bool)(X&(1LL<<i));
    }
    for(int i=0; i<K; i++) {
        pokv[P[i]]=1;
    }
    int j=0;
    for(int i=0; i<N; i+=3) {
        int kolko=(int)pokv[i]+(int)pokv[i+1]+(int)pokv[i+2];
        if(kolko>=2 || j>=60) {
            Set(i, 0); Set(i+1, 0); Set(i+2, 0);
            continue;
        }
        else if(kolko==1) {
            int koji;
            if(pokv[i]) koji=0;
            else if(pokv[i+1]) koji=1;
            else koji=2;
            if(koji==0) {
                if(broj[j]==0 && broj[j+1]==0) {
                    Set(i, 0); Set(i+1, 0); Set(i+2, 1);
                    j+=2;
                    continue;
                }
                else if(broj[j]==0) {
                    Set(i, 0); Set(i+1, 1); Set(i+2, 0);
                    j++;
                    continue;
                }
                else {
                    Set(i, 0); Set(i+1, 1); Set(i+2, 1);
                    j++;
                    continue;
                }
            }
            else if(koji==1) {
                if(broj[j]==0 && broj[j+1]==0) {
                    Set(i, 0); Set(i+1, 0); Set(i+2, 1);
                    j+=2;
                    continue;
                }
                else if(broj[j]==0) {
                    Set(i, 1); Set(i+1, 0); Set(i+2, 1);
                    j+=2;
                    continue;
                }
                else {
                    Set(i, 1); Set(i+1, 0); Set(i+2, 0);
                    j++;
                    continue;
                }
            }
            else {
                if(broj[j]==1 && broj[j+1]==0) {
                    Set(i, 1); Set(i+1, 1); Set(i+2, 0);
                    j+=2;
                    continue;
                }
                else if(broj[j]==1) {
                    Set(i, 1); Set(i+1, 0); Set(i+2, 0);
                    j++;
                    continue;
                }
                else {
                    Set(i, 0); Set(i+1, 1); Set(i+2, 0);
                    j++;
                    continue;
                }
            }
        }
        else {
            if(broj[j]==0 && broj[j+1]==0) {
                Set(i, 0); Set(i+1, 0); Set(i+2, 1);
                j+=2;
                continue;
            }
            else if(broj[j]==0) {
                Set(i, 1); Set(i+1, 0); Set(i+2, 1);
                j+=2;
                continue;
            }
            else if(broj[j+1]==0) {
                Set(i, 1); Set(i+1, 1); Set(i+2, 0);
                j+=2;
                continue;
            }
            else {
                Set(i, 1); Set(i+1, 1); Set(i+2, 1);
                j+=2;
                continue;
            }
        }
    }
}
#include "Brunolib.h"
#include<bits/stdc++.h>
#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define dec(x, y) fixed << setprecision((y)) << (x)
#define xx first
#define yy second
#define srt(v) sort((v).begin(), (v).end())
#define srtr(v) sort((v).rbegin(), (v).rend())
#define pb push_back
#define popb pop_back
#define sz(a) (int)(a).size()
#define len(a) (int)(a).length()
#define mp make_pair

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

ll Bruno(int N, int A[]) {
    ll x=0LL;
    for(int i=N-2; i>=0; i-=3) {
        int br=0;
        br+=A[i+2]; br*=2; br+=A[i+1]; br*=2; br+=A[i];
        if(br==0) continue;
        else if(br==1) {x*=2LL; x+=1LL;}
        else if(br==2) {x*=2LL;}
        else if(br==3) {x*=4LL; x+=1LL;}
        else if(br==4) {x*=4LL;}
        else if(br==5) {x*=4LL; x+=2LL;}
        else if(br==6) {x*=2LL; x+=1LL;}
        else {x*=4LL; x+=3LL;}
    }
    return x;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 28 ms 2492 KB Output isn't correct - L* = 0
2 Partially correct 28 ms 2464 KB Output isn't correct - L* = 0
3 Partially correct 30 ms 2524 KB Output isn't correct - L* = 0
4 Partially correct 30 ms 2492 KB Output isn't correct - L* = 0
5 Partially correct 28 ms 2564 KB Output isn't correct - L* = 0
6 Partially correct 30 ms 2456 KB Output isn't correct - L* = 0
7 Partially correct 28 ms 2660 KB Output isn't correct - L* = 0
8 Partially correct 28 ms 2560 KB Output isn't correct - L* = 0
9 Partially correct 33 ms 2464 KB Output isn't correct - L* = 0
10 Partially correct 30 ms 2576 KB Output isn't correct - L* = 0
11 Partially correct 36 ms 2660 KB Output isn't correct - L* = 0
12 Partially correct 32 ms 2428 KB Output isn't correct - L* = 0
13 Partially correct 30 ms 2492 KB Output isn't correct - L* = 0
14 Partially correct 31 ms 2484 KB Output isn't correct - L* = 0
15 Partially correct 33 ms 2540 KB Output isn't correct - L* = 0
16 Partially correct 28 ms 2600 KB Output isn't correct - L* = 0
17 Partially correct 28 ms 2524 KB Output isn't correct - L* = 0
18 Partially correct 31 ms 2584 KB Output isn't correct - L* = 0
19 Partially correct 30 ms 2496 KB Output isn't correct - L* = 0
20 Partially correct 30 ms 2552 KB Output isn't correct - L* = 0
21 Partially correct 30 ms 2480 KB Output isn't correct - L* = 0
22 Partially correct 32 ms 2484 KB Output isn't correct - L* = 0
23 Partially correct 28 ms 2556 KB Output isn't correct - L* = 0
24 Partially correct 28 ms 2540 KB Output isn't correct - L* = 0
25 Partially correct 28 ms 2464 KB Output isn't correct - L* = 0
26 Partially correct 31 ms 2464 KB Output isn't correct - L* = 0
27 Partially correct 28 ms 2552 KB Output isn't correct - L* = 0
28 Partially correct 30 ms 2556 KB Output isn't correct - L* = 0
29 Partially correct 28 ms 2468 KB Output isn't correct - L* = 0
30 Partially correct 29 ms 2480 KB Output isn't correct - L* = 0
31 Partially correct 34 ms 2540 KB Output isn't correct - L* = 0
32 Partially correct 31 ms 2452 KB Output isn't correct - L* = 0
33 Partially correct 30 ms 2460 KB Output isn't correct - L* = 0
34 Partially correct 31 ms 2484 KB Output isn't correct - L* = 0
35 Partially correct 31 ms 2564 KB Output isn't correct - L* = 0
36 Partially correct 28 ms 2520 KB Output isn't correct - L* = 0
37 Partially correct 36 ms 2596 KB Output isn't correct - L* = 0
38 Partially correct 28 ms 2596 KB Output isn't correct - L* = 0
39 Partially correct 30 ms 2492 KB Output isn't correct - L* = 0
40 Partially correct 31 ms 2584 KB Output isn't correct - L* = 0