답안 #100093

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
100093 2019-03-09T08:26:04 Z oolimry Broken Device (JOI17_broken_device) C++14
85 / 100
67 ms 3328 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[38];
    for(int i = 0;i < 38;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 == 38){
                    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[38];
  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 < 38;i++){
        //ter[i] = X % 3;
       // X /= 3;
        //cout << ter[i] << " ";
    }
  for(int i = 37;i >= 0;i--){
    ans *= 3ll;
    ans += (long long)ter[i];
  }
  //cout << "\n" << ans;
  return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 57 ms 3056 KB Output is partially correct - L* = 37
2 Partially correct 48 ms 3016 KB Output is partially correct - L* = 37
3 Partially correct 45 ms 3056 KB Output is partially correct - L* = 37
4 Partially correct 67 ms 3056 KB Output is partially correct - L* = 37
5 Partially correct 39 ms 3072 KB Output is partially correct - L* = 37
6 Partially correct 55 ms 3000 KB Output is partially correct - L* = 37
7 Partially correct 39 ms 3072 KB Output is partially correct - L* = 37
8 Partially correct 43 ms 3056 KB Output is partially correct - L* = 37
9 Partially correct 40 ms 2888 KB Output is partially correct - L* = 37
10 Partially correct 48 ms 3056 KB Output is partially correct - L* = 37
11 Partially correct 49 ms 3072 KB Output is partially correct - L* = 37
12 Partially correct 56 ms 3072 KB Output is partially correct - L* = 37
13 Partially correct 59 ms 3056 KB Output is partially correct - L* = 37
14 Partially correct 50 ms 3104 KB Output is partially correct - L* = 37
15 Partially correct 56 ms 3056 KB Output is partially correct - L* = 37
16 Partially correct 48 ms 3072 KB Output is partially correct - L* = 37
17 Partially correct 47 ms 2920 KB Output is partially correct - L* = 37
18 Partially correct 47 ms 3056 KB Output is partially correct - L* = 37
19 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
20 Partially correct 48 ms 3328 KB Output is partially correct - L* = 37
21 Partially correct 39 ms 3056 KB Output is partially correct - L* = 37
22 Partially correct 39 ms 3072 KB Output is partially correct - L* = 37
23 Partially correct 47 ms 3056 KB Output is partially correct - L* = 37
24 Partially correct 43 ms 3072 KB Output is partially correct - L* = 37
25 Partially correct 61 ms 3064 KB Output is partially correct - L* = 37
26 Partially correct 51 ms 3072 KB Output is partially correct - L* = 37
27 Partially correct 44 ms 3072 KB Output is partially correct - L* = 37
28 Partially correct 41 ms 3072 KB Output is partially correct - L* = 37
29 Partially correct 43 ms 3144 KB Output is partially correct - L* = 37
30 Partially correct 39 ms 2872 KB Output is partially correct - L* = 37
31 Partially correct 40 ms 3072 KB Output is partially correct - L* = 37
32 Partially correct 39 ms 3072 KB Output is partially correct - L* = 37
33 Partially correct 51 ms 3056 KB Output is partially correct - L* = 37
34 Partially correct 59 ms 3000 KB Output is partially correct - L* = 37
35 Partially correct 61 ms 3056 KB Output is partially correct - L* = 37
36 Partially correct 48 ms 3064 KB Output is partially correct - L* = 37
37 Partially correct 49 ms 3072 KB Output is partially correct - L* = 37
38 Partially correct 44 ms 3056 KB Output is partially correct - L* = 37
39 Partially correct 48 ms 3056 KB Output is partially correct - L* = 37
40 Partially correct 59 ms 3056 KB Output is partially correct - L* = 37