답안 #954932

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
954932 2024-03-28T20:45:10 Z logangd Broken Device (JOI17_broken_device) C++14
0 / 100
27 ms 3288 KB
#include <bits/stdc++.h>
#include "Annalib.h"
typedef long long ll;
using namespace std;
void Anna( int N, ll X, int K, int P[] ){
  int ar[N]={0},s[60]={0};
  for(int i=0;i<60;i++)
    if(X&((ll)1<<i))s[i]=1;
  for(int i=0;i<N;i++)ar[i]=-1;
  for(int i=0;i<K;i++)ar[P[i]]=0;
  int curr=0;
  for(int i=0;i<N;i++){
    if(s[curr]==0){
      if(ar[i]!=0&&ar[i+2]!=0){
        ar[i]=ar[i+2]=1;
        ar[i+1]=0;
        curr++;
        i++;
      }
    }else{
      if(ar[i]!=-1)continue;
      if(i==0||ar[i-1]==1)ar[i]=1,curr++;
      else if(1<i&&ar[i-2]!=1)ar[i]=1,curr++;
    }
    if(59<curr)break;
  }
  for(int i=0;i<N;i++){
    if(ar[i]==1)cout<<1;
    else cout<<0;
    if(ar[i]==1)Set(i,1);
    else Set(i,0);
  }
  cout<<endl;
}
    #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;
        for(int i=0;i<N;i++){
          if(curr>59) break;
            if(i<N-2&&A[i]==1&&A[i+1]==0&&A[i+2]==1){   
                curr++;
                i++;
            }else if(A[i]==1&&(i==0||(1<i&&(A[i-1]!=0||A[i-2]!=1))))ans|=((ll)1<<curr),curr++;
        }
        cout<<ans<<endl;
        return ans;
    }
# 결과 실행 시간 메모리 Grader output
1 Incorrect 22 ms 2884 KB Unexpected end of file - int64 expected
2 Incorrect 21 ms 2900 KB Unexpected end of file - int64 expected
3 Incorrect 22 ms 2876 KB Unexpected end of file - int64 expected
4 Incorrect 27 ms 2720 KB Unexpected end of file - int64 expected
5 Incorrect 26 ms 2628 KB Unexpected end of file - int64 expected
6 Incorrect 23 ms 2872 KB Unexpected end of file - int64 expected
7 Incorrect 22 ms 2784 KB Unexpected end of file - int64 expected
8 Incorrect 22 ms 2896 KB Unexpected end of file - int64 expected
9 Incorrect 21 ms 2804 KB Unexpected end of file - int64 expected
10 Incorrect 22 ms 2716 KB Unexpected end of file - int64 expected
11 Incorrect 21 ms 2812 KB Unexpected end of file - int64 expected
12 Incorrect 22 ms 2792 KB Unexpected end of file - int64 expected
13 Incorrect 22 ms 2812 KB Unexpected end of file - int64 expected
14 Incorrect 24 ms 2772 KB Unexpected end of file - int64 expected
15 Incorrect 22 ms 2800 KB Unexpected end of file - int64 expected
16 Incorrect 22 ms 3056 KB Unexpected end of file - int64 expected
17 Incorrect 22 ms 2716 KB Unexpected end of file - int64 expected
18 Incorrect 21 ms 2836 KB Unexpected end of file - int64 expected
19 Incorrect 22 ms 2780 KB Unexpected end of file - int64 expected
20 Incorrect 21 ms 3288 KB Unexpected end of file - int64 expected
21 Incorrect 22 ms 2780 KB Unexpected end of file - int64 expected
22 Incorrect 26 ms 2804 KB Unexpected end of file - int64 expected
23 Incorrect 22 ms 2812 KB Unexpected end of file - int64 expected
24 Incorrect 21 ms 2808 KB Unexpected end of file - int64 expected
25 Incorrect 25 ms 3144 KB Unexpected end of file - int64 expected
26 Incorrect 22 ms 2800 KB Unexpected end of file - int64 expected
27 Incorrect 21 ms 2848 KB Unexpected end of file - int64 expected
28 Incorrect 21 ms 2804 KB Unexpected end of file - int64 expected
29 Incorrect 21 ms 2812 KB Unexpected end of file - int64 expected
30 Incorrect 23 ms 2804 KB Unexpected end of file - int64 expected
31 Incorrect 21 ms 2844 KB Unexpected end of file - int64 expected
32 Incorrect 21 ms 2804 KB Unexpected end of file - int64 expected
33 Incorrect 22 ms 2808 KB Unexpected end of file - int64 expected
34 Incorrect 22 ms 2804 KB Unexpected end of file - int64 expected
35 Incorrect 22 ms 2804 KB Unexpected end of file - int64 expected
36 Incorrect 21 ms 2804 KB Unexpected end of file - int64 expected
37 Incorrect 21 ms 2804 KB Unexpected end of file - int64 expected
38 Incorrect 21 ms 2812 KB Unexpected end of file - int64 expected
39 Incorrect 22 ms 2788 KB Unexpected end of file - int64 expected
40 Incorrect 22 ms 2804 KB Unexpected end of file - int64 expected