답안 #784059

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
784059 2023-07-15T15:37:47 Z AdamGS Broken Device (JOI17_broken_device) C++17
51 / 100
40 ms 2428 KB
#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void Anna(int n, ll x, int k, int P[]) {
	vector<int>V(n), czy(n), odw(n);
	srand(213769);
	rep(i, n) {
		V[i]=i;
		swap(V[i], V[rand()%(i+1)]);
	}
	rep(i, 60) if(rand()%2) x^=1ll<<(ll)i;
	rep(i, k) czy[P[i]]=1;
	ll akt=0;
	rep(i, V.size()-1) if(!czy[V[i]] && akt<60) {
		if(czy[V[i+1]] && (x&(1ll<<akt))) continue;
		Set(V[i], 1);
		odw[V[i]]=1;
		++i;
		if(x&(1ll<<akt)) Set(V[i], 1); else Set(V[i], 0);
		++akt;
		odw[V[i]]=1;
	}
	rep(i, n) if(!odw[i]) Set(i, 0);
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
ll Bruno(int n, int A[]) {
	vector<int>V(n);
	srand(213769);
	rep(i, n) {
		V[i]=i;
		swap(V[i], V[rand()%(i+1)]);
	}
	ll akt=0, ans=0;
	rep(i, V.size()-1) if(A[V[i]]) {
		++i;
		if(A[V[i]]) ans+=1ll<<akt;
		++akt;
	}
	rep(i, 60) if(rand()%2) ans^=1ll<<(ll)i;
	return ans;
}

Compilation message

Anna.cpp: In function 'void Anna(int, ll, int, int*)':
Anna.cpp:5:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define rep(a, b) for(int a = 0; a < (b); ++a)
      |                                    ^
Anna.cpp:20:2: note: in expansion of macro 'rep'
   20 |  rep(i, V.size()-1) if(!czy[V[i]] && akt<60) {
      |  ^~~

Bruno.cpp: In function 'll Bruno(int, int*)':
Bruno.cpp:5:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define rep(a, b) for(int a = 0; a < (b); ++a)
      |                                    ^
Bruno.cpp:18:2: note: in expansion of macro 'rep'
   18 |  rep(i, V.size()-1) if(A[V[i]]) {
      |  ^~~
# 결과 실행 시간 메모리 Grader output
1 Partially correct 32 ms 2244 KB Output is partially correct - L* = 25
2 Partially correct 34 ms 2312 KB Output is partially correct - L* = 24
3 Partially correct 33 ms 2348 KB Output is partially correct - L* = 25
4 Partially correct 32 ms 2240 KB Output is partially correct - L* = 23
5 Partially correct 32 ms 2312 KB Output is partially correct - L* = 20
6 Partially correct 32 ms 2228 KB Output is partially correct - L* = 24
7 Partially correct 32 ms 2248 KB Output is partially correct - L* = 24
8 Partially correct 32 ms 2252 KB Output is partially correct - L* = 24
9 Partially correct 32 ms 2428 KB Output is partially correct - L* = 26
10 Partially correct 40 ms 2228 KB Output is partially correct - L* = 22
11 Partially correct 32 ms 2272 KB Output is partially correct - L* = 22
12 Partially correct 32 ms 2284 KB Output is partially correct - L* = 23
13 Partially correct 32 ms 2288 KB Output is partially correct - L* = 21
14 Partially correct 32 ms 2396 KB Output is partially correct - L* = 22
15 Partially correct 32 ms 2336 KB Output is partially correct - L* = 23
16 Partially correct 33 ms 2252 KB Output is partially correct - L* = 20
17 Partially correct 32 ms 2348 KB Output is partially correct - L* = 23
18 Partially correct 32 ms 2352 KB Output is partially correct - L* = 23
19 Partially correct 36 ms 2336 KB Output is partially correct - L* = 26
20 Partially correct 32 ms 2352 KB Output is partially correct - L* = 21
21 Partially correct 32 ms 2252 KB Output is partially correct - L* = 23
22 Partially correct 32 ms 2416 KB Output is partially correct - L* = 26
23 Partially correct 32 ms 2344 KB Output is partially correct - L* = 22
24 Partially correct 32 ms 2272 KB Output is partially correct - L* = 23
25 Partially correct 33 ms 2284 KB Output is partially correct - L* = 21
26 Partially correct 32 ms 2268 KB Output is partially correct - L* = 22
27 Partially correct 34 ms 2368 KB Output is partially correct - L* = 24
28 Partially correct 32 ms 2364 KB Output is partially correct - L* = 25
29 Partially correct 32 ms 2248 KB Output is partially correct - L* = 23
30 Partially correct 32 ms 2356 KB Output is partially correct - L* = 23
31 Partially correct 32 ms 2324 KB Output is partially correct - L* = 24
32 Partially correct 32 ms 2332 KB Output is partially correct - L* = 24
33 Partially correct 33 ms 2236 KB Output is partially correct - L* = 22
34 Partially correct 32 ms 2416 KB Output is partially correct - L* = 22
35 Partially correct 32 ms 2236 KB Output is partially correct - L* = 22
36 Partially correct 32 ms 2224 KB Output is partially correct - L* = 20
37 Partially correct 32 ms 2260 KB Output is partially correct - L* = 24
38 Partially correct 32 ms 2248 KB Output is partially correct - L* = 24
39 Partially correct 32 ms 2244 KB Output is partially correct - L* = 25
40 Partially correct 32 ms 2272 KB Output is partially correct - L* = 24