답안 #492759

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
492759 2021-12-08T20:10:44 Z Habitus Broken Device (JOI17_broken_device) C++14
컴파일 오류
0 ms 0 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-3; 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;

Compilation message

Bruno.cpp: In function 'll Bruno(int, int*)':
Bruno.cpp:35:13: error: expected '}' at end of input
   35 |     return x;
      |             ^
Bruno.cpp:21:26: note: to match this '{'
   21 | ll Bruno(int N, int A[]) {
      |                          ^