답안 #492760

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
492760 2021-12-08T20:11:28 Z Habitus Broken Device (JOI17_broken_device) C++14
0 / 100
39 ms 2420 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 32 ms 2168 KB Output isn't correct - L* = 0
2 Partially correct 28 ms 2228 KB Output isn't correct - L* = 0
3 Partially correct 28 ms 2192 KB Output isn't correct - L* = 0
4 Partially correct 28 ms 2204 KB Output isn't correct - L* = 0
5 Partially correct 38 ms 2408 KB Output isn't correct - L* = 0
6 Partially correct 32 ms 2224 KB Output isn't correct - L* = 0
7 Partially correct 28 ms 2228 KB Output isn't correct - L* = 0
8 Partially correct 28 ms 2228 KB Output isn't correct - L* = 0
9 Partially correct 32 ms 2268 KB Output isn't correct - L* = 0
10 Partially correct 32 ms 2356 KB Output isn't correct - L* = 0
11 Partially correct 28 ms 2212 KB Output isn't correct - L* = 0
12 Partially correct 28 ms 2276 KB Output isn't correct - L* = 0
13 Partially correct 30 ms 2336 KB Output isn't correct - L* = 0
14 Partially correct 28 ms 2420 KB Output isn't correct - L* = 0
15 Partially correct 28 ms 2284 KB Output isn't correct - L* = 0
16 Partially correct 28 ms 2224 KB Output isn't correct - L* = 0
17 Partially correct 37 ms 2216 KB Output isn't correct - L* = 0
18 Partially correct 34 ms 2224 KB Output isn't correct - L* = 0
19 Partially correct 36 ms 2284 KB Output isn't correct - L* = 0
20 Partially correct 28 ms 2224 KB Output isn't correct - L* = 0
21 Partially correct 28 ms 2236 KB Output isn't correct - L* = 0
22 Partially correct 31 ms 2244 KB Output isn't correct - L* = 0
23 Partially correct 29 ms 2280 KB Output isn't correct - L* = 0
24 Partially correct 28 ms 2268 KB Output isn't correct - L* = 0
25 Partially correct 28 ms 2212 KB Output isn't correct - L* = 0
26 Partially correct 33 ms 2296 KB Output isn't correct - L* = 0
27 Partially correct 31 ms 2224 KB Output isn't correct - L* = 0
28 Partially correct 28 ms 2348 KB Output isn't correct - L* = 0
29 Partially correct 28 ms 2332 KB Output isn't correct - L* = 0
30 Partially correct 29 ms 2212 KB Output isn't correct - L* = 0
31 Partially correct 28 ms 2312 KB Output isn't correct - L* = 0
32 Partially correct 28 ms 2344 KB Output isn't correct - L* = 0
33 Partially correct 39 ms 2300 KB Output isn't correct - L* = 0
34 Partially correct 28 ms 2228 KB Output isn't correct - L* = 0
35 Partially correct 31 ms 2208 KB Output isn't correct - L* = 0
36 Partially correct 28 ms 2300 KB Output isn't correct - L* = 0
37 Partially correct 31 ms 2316 KB Output isn't correct - L* = 0
38 Partially correct 28 ms 2360 KB Output isn't correct - L* = 0
39 Partially correct 28 ms 2220 KB Output isn't correct - L* = 0
40 Partially correct 28 ms 2224 KB Output isn't correct - L* = 0