답안 #100091

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
100091 2019-03-09T08:24:11 Z oolimry Broken Device (JOI17_broken_device) C++14
0 / 100
67 ms 3312 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
void Anna( int N, long long X, int K, int P[] ){
    set<int> bad;
    for(int i = 0;i < K;i++){
        bad.insert(P[i]);
    }
    int ter[36];
    for(int i = 0;i < 36;i++){
        ter[i] = X % 3ll;
        X /= 3ll;
        //cout << ter[i] << " ";
    }
    //cout << "\n";
    int c = 0;
    for(int i = 0;i < N;i++){
        if(i % 2 == 0) continue;
        else{
            if(bad.find(i) != bad.end() || bad.find(i-1) != bad.end()){
                Set(i,0);
                Set(i-1,0);
            }
            else{
                if(c == 36){
                    Set(i-1,0);
                    Set(i,0);

                }
                else{

                    if(ter[c] == 0){
                        Set(i-1,0);
                        Set(i,1);
                    }
                    else if(ter[c] == 1){
                        Set(i-1,1);
                        Set(i,0);
                    }
                    else{
                        Set(i-1,1);
                        Set(i,1);
                    }
                    c++;
                }
            }
        }
    }

}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno( int N, int A[] ){
  long long ans = 0ll;
  int ter[36];
  int c = 0;
  for(int i = 0;i < N;i++){
        if(i % 2 == 0) continue;
        else{
            int a = A[i-1];
            int b = A[i];
            if(a == 0 && b == 0){
                continue;
            }
            else{

                if(a == 0 && b == 1){
                    ter[c] = 0;
                }
                else if(a == 1 && b == 0){
                    ter[c] = 1;
                }
                else{
                    ter[c] = 2;
                }
                c++;
            }
        }
  }
  for(int i = 0;i < 36;i++){
        //ter[i] = X % 3;
       // X /= 3;
        //cout << ter[i] << " ";
    }
  for(int i = 35;i >= 0;i--){
    ans *= 3ll;
    ans += (long long)ter[i];
  }
  //cout << "\n" << ans;
  return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 49 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 53 ms 3072 KB Output isn't correct - L* = 0
3 Incorrect 53 ms 3056 KB Output isn't correct - L* = 0
4 Incorrect 49 ms 3312 KB Output isn't correct - L* = 0
5 Incorrect 47 ms 3000 KB Output isn't correct - L* = 0
6 Incorrect 60 ms 3056 KB Output isn't correct - L* = 0
7 Incorrect 48 ms 3072 KB Output isn't correct - L* = 0
8 Incorrect 48 ms 3056 KB Output isn't correct - L* = 0
9 Incorrect 50 ms 3072 KB Output isn't correct - L* = 0
10 Incorrect 40 ms 3000 KB Output isn't correct - L* = 0
11 Incorrect 61 ms 3056 KB Output isn't correct - L* = 0
12 Incorrect 48 ms 3056 KB Output isn't correct - L* = 0
13 Incorrect 48 ms 3056 KB Output isn't correct - L* = 0
14 Incorrect 59 ms 3064 KB Output isn't correct - L* = 0
15 Incorrect 59 ms 3000 KB Output isn't correct - L* = 0
16 Incorrect 43 ms 3072 KB Output isn't correct - L* = 0
17 Incorrect 49 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 48 ms 3224 KB Output isn't correct - L* = 0
19 Incorrect 44 ms 3056 KB Output isn't correct - L* = 0
20 Incorrect 54 ms 3072 KB Output isn't correct - L* = 0
21 Incorrect 43 ms 3072 KB Output isn't correct - L* = 0
22 Incorrect 37 ms 3072 KB Output isn't correct - L* = 0
23 Incorrect 40 ms 3072 KB Output isn't correct - L* = 0
24 Incorrect 45 ms 3056 KB Output isn't correct - L* = 0
25 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
26 Incorrect 47 ms 3064 KB Output isn't correct - L* = 0
27 Incorrect 48 ms 3056 KB Output isn't correct - L* = 0
28 Incorrect 50 ms 3056 KB Output isn't correct - L* = 0
29 Incorrect 45 ms 3056 KB Output isn't correct - L* = 0
30 Incorrect 47 ms 2968 KB Output isn't correct - L* = 0
31 Incorrect 47 ms 3056 KB Output isn't correct - L* = 0
32 Incorrect 53 ms 3056 KB Output isn't correct - L* = 0
33 Incorrect 44 ms 3072 KB Output isn't correct - L* = 0
34 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
35 Incorrect 46 ms 3064 KB Output isn't correct - L* = 0
36 Incorrect 51 ms 3056 KB Output isn't correct - L* = 0
37 Incorrect 67 ms 3056 KB Output isn't correct - L* = 0
38 Incorrect 51 ms 2944 KB Output isn't correct - L* = 0
39 Incorrect 56 ms 3056 KB Output isn't correct - L* = 0
40 Incorrect 38 ms 3072 KB Output isn't correct - L* = 0