답안 #775128

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
775128 2023-07-06T08:02:38 Z bachhoangxuan Broken Device (JOI17_broken_device) C++17
8 / 100
27 ms 2520 KB
#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;

void Anna( int N, long long X, int K, int P[] ){
    //cout << '*' << N << ' ' << X << ' ' << K << '\n';
    vector<int> d(N,0);
    for(int i=0;i<K;i++) d[P[i]]=1;
    for(int i=N-3;i>=0;i-=3){
        int a=0,b=0,c=0;
        if(d[i]+d[i+1]+d[i+2]==0){
            if(X%4==0) b=1;
            else a=1,b=X>>1&1,c=X&1;
            X/=4;
        }
        else if(d[i]+d[i+1]+d[i+2]==1){
            if(X&1){
                if(d[i]) b=c=1;
                else a=1;
            }
            else if(d[i+2]) a=X>>1&1,b=1,X/=2;
            else c=1;
            X/=2;
        }
        Set(i,a);Set(i+1,b);Set(i+2,c);
        //cout << X << ' ' << a << b << c << '\n';
    }
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;

long long Bruno( int N, int A[] ){
    long long res=0;
    for(int i=0;i<N;i+=3){
        int num=A[i]*4+A[i+1]*2+A[i+2];
        if(num==1) res*=2;
        else if(num>=5) res=res*4+num%4;
        else if(num==2) res*=4;
        else res=res*2+1;
    }
    //cout << res << '\n';
    return res;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 25 ms 2328 KB Output is partially correct - L* = 14
2 Partially correct 25 ms 2308 KB Output is partially correct - L* = 14
3 Partially correct 24 ms 2276 KB Output is partially correct - L* = 14
4 Partially correct 25 ms 2336 KB Output is partially correct - L* = 14
5 Partially correct 24 ms 2244 KB Output is partially correct - L* = 14
6 Partially correct 27 ms 2520 KB Output is partially correct - L* = 14
7 Partially correct 24 ms 2364 KB Output is partially correct - L* = 14
8 Partially correct 25 ms 2368 KB Output is partially correct - L* = 14
9 Partially correct 24 ms 2272 KB Output is partially correct - L* = 14
10 Partially correct 24 ms 2324 KB Output is partially correct - L* = 14
11 Partially correct 24 ms 2256 KB Output is partially correct - L* = 14
12 Partially correct 25 ms 2232 KB Output is partially correct - L* = 14
13 Partially correct 24 ms 2300 KB Output is partially correct - L* = 14
14 Partially correct 25 ms 2444 KB Output is partially correct - L* = 14
15 Partially correct 25 ms 2256 KB Output is partially correct - L* = 14
16 Partially correct 24 ms 2264 KB Output is partially correct - L* = 14
17 Partially correct 25 ms 2244 KB Output is partially correct - L* = 14
18 Partially correct 24 ms 2276 KB Output is partially correct - L* = 14
19 Partially correct 24 ms 2424 KB Output is partially correct - L* = 14
20 Partially correct 24 ms 2256 KB Output is partially correct - L* = 14
21 Partially correct 25 ms 2348 KB Output is partially correct - L* = 14
22 Partially correct 24 ms 2288 KB Output is partially correct - L* = 14
23 Partially correct 24 ms 2268 KB Output is partially correct - L* = 14
24 Partially correct 25 ms 2400 KB Output is partially correct - L* = 14
25 Partially correct 26 ms 2244 KB Output is partially correct - L* = 14
26 Partially correct 25 ms 2356 KB Output is partially correct - L* = 14
27 Partially correct 25 ms 2372 KB Output is partially correct - L* = 14
28 Partially correct 24 ms 2248 KB Output is partially correct - L* = 14
29 Partially correct 25 ms 2300 KB Output is partially correct - L* = 14
30 Partially correct 25 ms 2308 KB Output is partially correct - L* = 14
31 Partially correct 24 ms 2244 KB Output is partially correct - L* = 14
32 Partially correct 24 ms 2256 KB Output is partially correct - L* = 14
33 Partially correct 24 ms 2256 KB Output is partially correct - L* = 14
34 Partially correct 24 ms 2256 KB Output is partially correct - L* = 14
35 Partially correct 24 ms 2248 KB Output is partially correct - L* = 14
36 Partially correct 24 ms 2332 KB Output is partially correct - L* = 14
37 Partially correct 27 ms 2316 KB Output is partially correct - L* = 14
38 Partially correct 24 ms 2248 KB Output is partially correct - L* = 14
39 Partially correct 24 ms 2248 KB Output is partially correct - L* = 14
40 Partially correct 24 ms 2344 KB Output is partially correct - L* = 14