답안 #241545

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
241545 2020-06-24T12:04:03 Z osaaateiasavtnl Broken Device (JOI17_broken_device) C++17
0 / 100
68 ms 3120 KB
#include "Annalib.h"
#include<bits/stdc++.h>
 
using namespace std;
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
 
void Anna( int N, long long X, int K, int P[] ){
    mt19937 rnd(2007);
    vector <int> c(N);
    for (int i = 0; i < N; ++i)
        c[i] = rnd()&1;

    vector <bool> used(N);
    for (int i = 0; i < K; ++i)
        used[P[i]] = 1;
    vector <int> can;
    for (int i = 0; i < N; ++i)
        if (!used[i])   
            can.app(i);
 
    int ptr = 0;
    vector <bool> ans(N);
    for (int bit = 0; bit < 60; ++bit) {
        int w = (X >> bit) & 1;
        while (ptr < can.size() && c[can[ptr]] != w) {
            ++ptr;
        }   
 
        if (ptr == can.size()) {
            for (int i = 0; i < N; ++i) 
                Set(i, 0);
            return;
        }   
 
        ans[can[ptr]] = 1;
        ++ptr;
    }   
    for (int i = 0; i < N; ++i) {
        Set(i, ans[i]);
    }   
}
#include "Brunolib.h"
#include<bits/stdc++.h>
 
using namespace std;
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
 
long long Bruno( int N, int A[] ){
    mt19937 rnd(2007);
    vector <int> c(N);
    for (int i = 0; i < N; ++i)
        c[i] = rnd()&1;

    vector <int> pos;
    for (int i = 0; i < N; ++i)
        if (A[i])
            pos.app(i);
 
    long long ans = 0;
    for (int i = 0; i < pos.size(); ++i) {
        if (c[pos[i]]) {
            ans += 1ll << i;
        }   
    }       
    return ans;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:33:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while (ptr < can.size() && c[can[ptr]] != w) {
                ~~~~^~~~~~~~~~~~
Anna.cpp:37:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (ptr == can.size()) {
             ~~~~^~~~~~~~~~~~~

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:27:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < pos.size(); ++i) {
                     ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Partially correct 64 ms 3072 KB Output isn't correct - L* = 0
2 Partially correct 65 ms 3056 KB Output is partially correct - L* = 14
3 Partially correct 65 ms 3072 KB Output is partially correct - L* = 14
4 Partially correct 63 ms 3056 KB Output is partially correct - L* = 14
5 Partially correct 63 ms 3072 KB Output isn't correct - L* = 0
6 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
7 Partially correct 65 ms 3056 KB Output is partially correct - L* = 14
8 Partially correct 64 ms 3072 KB Output is partially correct - L* = 14
9 Partially correct 65 ms 3072 KB Output isn't correct - L* = 0
10 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
11 Partially correct 66 ms 3072 KB Output isn't correct - L* = 0
12 Partially correct 62 ms 3072 KB Output isn't correct - L* = 0
13 Partially correct 63 ms 3064 KB Output isn't correct - L* = 0
14 Partially correct 61 ms 3056 KB Output isn't correct - L* = 0
15 Partially correct 62 ms 3072 KB Output isn't correct - L* = 0
16 Partially correct 68 ms 3120 KB Output isn't correct - L* = 0
17 Partially correct 61 ms 3056 KB Output isn't correct - L* = 0
18 Partially correct 63 ms 3072 KB Output isn't correct - L* = 0
19 Partially correct 62 ms 3072 KB Output isn't correct - L* = 0
20 Partially correct 68 ms 3056 KB Output isn't correct - L* = 0
21 Partially correct 61 ms 3072 KB Output isn't correct - L* = 0
22 Partially correct 68 ms 3056 KB Output isn't correct - L* = 0
23 Partially correct 63 ms 3056 KB Output is partially correct - L* = 14
24 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
25 Partially correct 60 ms 3056 KB Output isn't correct - L* = 0
26 Partially correct 62 ms 3056 KB Output isn't correct - L* = 0
27 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
28 Partially correct 61 ms 3056 KB Output is partially correct - L* = 14
29 Partially correct 61 ms 3056 KB Output is partially correct - L* = 14
30 Partially correct 62 ms 3056 KB Output isn't correct - L* = 0
31 Partially correct 62 ms 3072 KB Output is partially correct - L* = 14
32 Partially correct 61 ms 3056 KB Output isn't correct - L* = 0
33 Partially correct 63 ms 3056 KB Output isn't correct - L* = 0
34 Partially correct 64 ms 3072 KB Output isn't correct - L* = 0
35 Partially correct 62 ms 3072 KB Output isn't correct - L* = 0
36 Partially correct 62 ms 3072 KB Output isn't correct - L* = 0
37 Partially correct 63 ms 3056 KB Output is partially correct - L* = 14
38 Partially correct 61 ms 3056 KB Output isn't correct - L* = 0
39 Partially correct 62 ms 3072 KB Output isn't correct - L* = 0
40 Partially correct 62 ms 3072 KB Output is partially correct - L* = 14