답안 #954856

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
954856 2024-03-28T18:06:35 Z leo_2727 Broken Device (JOI17_broken_device) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include <Annalib.h>
using namespace std;
typedef long ong ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
void Anna(int N, ll X, int K, int P[]){
    vi ar(N, 0);
    ll curr=0;
    for(int i=0;i<K;i++)    ar[P[i]]=-1;
    int i;
    for(i=0;i+2<N;i++){
        if(ar[i]!=0 && ar[i+1]!=0 && ar[i+2]!=0){
            Set(i 0);
            break;
        }
        Set(i, 1);
        ll b1=X & ((ll)1<<curr);
        curr++;
        ll b2=X & ((ll)1<<curr);
        curr++;
        (b1>0)  ?   Set(i+1, 1)    :   Set(1+2, 0);
        (b1>0)  ?   Set(i+1, 1)    :   Set(1+2, 0);
        i+=2;
        if(curr>62) break;
    }
    for(;i<n;i++)   Set(i, 0);
}
#include <bits/stdc++.h>
#include <Brunolib.h>
typedef long long ll;
using namespace std;

ll Bruno(int N, int A[]){
    ll ans=0, curr=0;
    bool br=false;
    for(int i=0;i<N;i++){
        if(i==1){
            i+=2;
            if(A[i+1]==1)   ans|=((ll)1<<curr);
            curr++;
            if(A[i+2]==1)   ans|=((ll)1<<curr);
            curr++;
            if(curr>62) br=true;
        }
        if(br)  break;
    }
    return ans;
}

Compilation message

Anna.cpp:4:18: error: expected initializer before 'll'
    4 | typedef long ong ll;
      |                  ^~
Anna.cpp:7:18: error: 'll' has not been declared
    7 | void Anna(int N, ll X, int K, int P[]){
      |                  ^~
Anna.cpp: In function 'void Anna(int, int, int, int*)':
Anna.cpp:9:5: error: 'll' was not declared in this scope
    9 |     ll curr=0;
      |     ^~
Anna.cpp:14:18: error: expected ')' before numeric constant
   14 |             Set(i 0);
      |                ~ ^~
      |                  )
Anna.cpp:14:20: error: too few arguments to function 'void Set(int, int)'
   14 |             Set(i 0);
      |                    ^
In file included from Anna.cpp:2:
Annalib.h:2:6: note: declared here
    2 | void Set( int pos, int bit );
      |      ^~~
Anna.cpp:18:11: error: expected ';' before 'b1'
   18 |         ll b1=X & ((ll)1<<curr);
      |           ^~~
      |           ;
Anna.cpp:19:9: error: 'curr' was not declared in this scope
   19 |         curr++;
      |         ^~~~
Anna.cpp:20:11: error: expected ';' before 'b2'
   20 |         ll b2=X & ((ll)1<<curr);
      |           ^~~
      |           ;
Anna.cpp:22:10: error: 'b1' was not declared in this scope; did you mean 'y1'?
   22 |         (b1>0)  ?   Set(i+1, 1)    :   Set(1+2, 0);
      |          ^~
      |          y1
Anna.cpp:27:12: error: 'n' was not declared in this scope
   27 |     for(;i<n;i++)   Set(i, 0);
      |            ^