Submission #100911

# Submission time Handle Problem Language Result Execution time Memory
100911 2019-03-15T06:13:19 Z Pro_ktmr Broken Device (JOI17_broken_device) C++14
0 / 100
40 ms 3328 KB
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#include"Annalib.h"

static vector<int> keta(LL X, int i){
	vector<int> re;
	while(X > 0){
		re.push_back(X%i);
		X /= i;
	}
	return re;
}

static LL make(vector<int> v, int i){
	LL re = 0;
	for(int j=v.size()-1; j>=0; j++){
		re += i;
		re += v[j];
	}
	return re;
}

//void Set(int pos, int bit)
//N=150
void Anna(int N, long long X, int K, int P[]){
	bool canUse[150];
	for(int i=0; i<N; i++) canUse[i] = true;
	for(int i=0; i<K; i++) canUse[P[i]] = false;
	vector<int> tmp = keta(X, 3);
	LL now = 0;
	for(int i=0; i+1<N; i+=2){
		if(now < tmp.size() && canUse[i] && canUse[i+1]){
			if(tmp[now] == 0){
				Set(i, 0);
				Set(i+1, 1);
			}
			if(tmp[now] == 1){
				Set(i, 1);
				Set(i+1, 0);
			}
			if(tmp[now] == 2){
				Set(i, 1);
				Set(i+1, 1);
			}
			now++;
		}
		else{
			Set(i, 0);
			Set(i+1, 0);
		}
	}
}
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#include"Brunolib.h"

static vector<int> keta(LL X, int i){
	vector<int> re;
	while(X > 0){
		re.push_back(X%i);
		X /= i;
	}
	return re;
}

static LL make(vector<int> v, int i){
	LL re = 0;
	for(int j=v.size()-1; j>=0; j++){
		re += i;
		re += v[j];
	}
	return re;
}

long long Bruno(int N, int A[]){
	vector<int> ans;
	for(int i=0; i+1<N; i+=2){
		if(A[i] == 0 && A[i+1] == 1){
			ans.push_back(0);
		}
		if(A[i] == 1 && A[i+1] == 0){
			ans.push_back(1);
		}
		if(A[i] == 1 && A[i+1] == 1){
			ans.push_back(2);
		}
	}
	return make(ans,3);
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:34:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(now < tmp.size() && canUse[i] && canUse[i+1]){
      ~~~~^~~~~~~~~~~~
Anna.cpp: At global scope:
Anna.cpp:16:11: warning: 'long long int make(std::vector<int>, int)' defined but not used [-Wunused-function]
 static LL make(vector<int> v, int i){
           ^~~~

Bruno.cpp:7:20: warning: 'std::vector<int> keta(long long int, int)' defined but not used [-Wunused-function]
 static vector<int> keta(LL X, int i){
                    ^~~~
# Verdict Execution time Memory Grader output
1 Runtime error 30 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 24 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 38 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 40 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 26 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 38 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 24 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 26 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 31 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 27 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 30 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 27 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 23 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 28 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 24 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 34 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 22 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 25 ms 3152 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 22 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 23 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 27 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 36 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 33 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 35 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 24 ms 3272 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 34 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 26 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 30 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 24 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 25 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 24 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 24 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Runtime error 28 ms 3056 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 23 ms 3272 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 25 ms 3328 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Runtime error 23 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 24 ms 3328 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Runtime error 24 ms 3072 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Runtime error 40 ms 3312 KB Execution killed with signal 11 (could be triggered by violating memory limits)