답안 #1077297

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1077297 2024-08-27T04:59:23 Z veehj Broken Device (JOI17_broken_device) C++17
85 / 100
31 ms 2720 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define sz(a) (ll) a.size()
#define all(x) (x).begin(), (x).end()

void Anna( int N, long long X, int K, int P[] ){
  set<int> s={};
  stack<ll> st;
  while(X!=0){
    st.push(X%3);
    X/=3;
  }
  for(int i=0; i<K; i++) s.insert(P[i]);
  for(int i=0; i<N; i+=2){
    if(s.count(i) || (i+1<N && s.count(i+1)) || st.size()==0){
      Set(i, 0);
      Set(i+1, 0);
      continue;
    }
    if(st.top()==0){
      Set(i, 0);
      Set(i+1, 1);
    }
    if(st.top()==1){
      Set(i, 1);
      Set(i+1, 0);
    }
    if(st.top()==2){
      Set(i, 1);
      Set(i+1, 1);
    }
    st.pop();
  }
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define sz(a) (ll) a.size()
#define all(x) (x).begin(), (x).end()

long long Bruno( int N, int A[] ){
  ll ans=0;
  for(int i=0; i<N; i+=2){
    if(A[i]==0 && A[i+1]==0) continue;
    int x=A[i]*2+A[i+1]-1;
    ans*=3;
    ans+=x;
  }
  return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 24 ms 2308 KB Output is partially correct - L* = 37
2 Partially correct 27 ms 2396 KB Output is partially correct - L* = 37
3 Partially correct 24 ms 2396 KB Output is partially correct - L* = 37
4 Partially correct 24 ms 2392 KB Output is partially correct - L* = 37
5 Partially correct 23 ms 2396 KB Output is partially correct - L* = 37
6 Partially correct 24 ms 2396 KB Output is partially correct - L* = 37
7 Partially correct 24 ms 2392 KB Output is partially correct - L* = 37
8 Partially correct 22 ms 2396 KB Output is partially correct - L* = 37
9 Partially correct 23 ms 2388 KB Output is partially correct - L* = 37
10 Partially correct 23 ms 2396 KB Output is partially correct - L* = 37
11 Partially correct 24 ms 2396 KB Output is partially correct - L* = 37
12 Partially correct 23 ms 2392 KB Output is partially correct - L* = 37
13 Partially correct 25 ms 2420 KB Output is partially correct - L* = 37
14 Partially correct 22 ms 2392 KB Output is partially correct - L* = 37
15 Partially correct 23 ms 2480 KB Output is partially correct - L* = 37
16 Partially correct 24 ms 2492 KB Output is partially correct - L* = 37
17 Partially correct 23 ms 2600 KB Output is partially correct - L* = 37
18 Partially correct 23 ms 2484 KB Output is partially correct - L* = 37
19 Partially correct 24 ms 2308 KB Output is partially correct - L* = 37
20 Partially correct 24 ms 2368 KB Output is partially correct - L* = 37
21 Partially correct 27 ms 2372 KB Output is partially correct - L* = 37
22 Partially correct 22 ms 2644 KB Output is partially correct - L* = 37
23 Partially correct 24 ms 2504 KB Output is partially correct - L* = 37
24 Partially correct 22 ms 2644 KB Output is partially correct - L* = 37
25 Partially correct 24 ms 2480 KB Output is partially correct - L* = 37
26 Partially correct 25 ms 2396 KB Output is partially correct - L* = 37
27 Partially correct 31 ms 2448 KB Output is partially correct - L* = 37
28 Partially correct 25 ms 2720 KB Output is partially correct - L* = 37
29 Partially correct 22 ms 2396 KB Output is partially correct - L* = 37
30 Partially correct 22 ms 2396 KB Output is partially correct - L* = 37
31 Partially correct 24 ms 2396 KB Output is partially correct - L* = 37
32 Partially correct 23 ms 2520 KB Output is partially correct - L* = 37
33 Partially correct 26 ms 2396 KB Output is partially correct - L* = 37
34 Partially correct 23 ms 2396 KB Output is partially correct - L* = 37
35 Partially correct 23 ms 2372 KB Output is partially correct - L* = 37
36 Partially correct 26 ms 2372 KB Output is partially correct - L* = 37
37 Partially correct 22 ms 2404 KB Output is partially correct - L* = 37
38 Partially correct 23 ms 2656 KB Output is partially correct - L* = 37
39 Partially correct 23 ms 2396 KB Output is partially correct - L* = 37
40 Partially correct 23 ms 2384 KB Output is partially correct - L* = 37