Submission #131745

# Submission time Handle Problem Language Result Execution time Memory
131745 2019-07-17T14:10:54 Z MohamedAhmed04 Broken Device (JOI17_broken_device) C++14
0 / 100
57 ms 3056 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std ;

void Anna( int N, long long X, int K, int P[] )
{
	srand(123321) ;
	vector<int>v ;
	for(int i = 0 ; i < N ; ++i)
		v.push_back(i) ;
	random_shuffle(v.begin() , v.end()) ;
	int mark[N+1] ;
	for(int i = 0 ; i <= N ; ++i)
		mark[i] = 0 ;
	for(int i = 0 ; i < K ; ++i)
		mark[P[i]] = 1;
	int last = -1 ;
	for(int i = 0 ; i < N ; i += 2)
	{
		last = i+1 ;
		if(X == 0)
		{
			Set(v[i] , 0) ;
			Set(v[i+1] , 0) ;
			continue ;
		}
		int now = X % 3 ;
		X /= 3 ;
		if(now == 0 && mark[v[i+1]] == 0)
		{
			Set(v[i] , 0) ;
			Set(v[i+1] , 1) ;
			continue ;
		}
		if(now == 1 && mark[v[i]] == 0)
		{
			Set(v[i] , 1) ;
			Set(v[i+1] , 0) ;
			continue ;
		}
		if(now == 2 && mark[v[i]] == 0 && mark[v[i+1]] == 0)
		{
			Set(v[i] , 1) ;
			Set(v[i+1] , 1) ;
			continue ;
		}
		Set(v[i] , 0) ;
		Set(v[i+1] , 0) ;
	}
	if(last < N-1)
		Set(v[N-1] , 0) ;
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std ;

long long Bruno( int N, int A[] )
{
   srand(123321) ;
   vector<int>v ;
  for(int i = 0 ; i < N ; ++i)
    v.push_back(i) ;
  random_shuffle(v.begin() , v.end()) ;
  vector<int>v1 ;
   long long ans = 0ll ;
   for(int i = 0 ; i < N-1 ; i += 2)
   {
      if(A[v[i]] == 0 && A[v[i+1]] == 0)
        continue ;
      if(A[v[i]] == 0 && A[v[i+1]] == 1)
        v1.push_back(0) ;
      else if(A[v[i]] == 1 && A[v[i+1]] == 0)
        v1.push_back(1) ;
      else if(A[v[i]] == 1 && A[v[i+1]] == 1)
        v1.push_back(2) ;
   }
   reverse(v1.begin() , v1.end()) ;
   for(auto &i : v1)
      ans = ans * 3ll + i * 1ll ;
   return ans;    
}
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
3 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
4 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
5 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
6 Incorrect 56 ms 3056 KB Output isn't correct - L* = 0
7 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
8 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
9 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
10 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
11 Incorrect 55 ms 3016 KB Output isn't correct - L* = 0
12 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
13 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
14 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
15 Incorrect 56 ms 3056 KB Output isn't correct - L* = 0
16 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
17 Incorrect 55 ms 2896 KB Output isn't correct - L* = 0
18 Incorrect 55 ms 2872 KB Output isn't correct - L* = 0
19 Incorrect 55 ms 3000 KB Output isn't correct - L* = 0
20 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
21 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
22 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
23 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
24 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
25 Incorrect 56 ms 3000 KB Output isn't correct - L* = 0
26 Incorrect 57 ms 3056 KB Output isn't correct - L* = 0
27 Incorrect 57 ms 3056 KB Output isn't correct - L* = 0
28 Incorrect 56 ms 3056 KB Output isn't correct - L* = 0
29 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
30 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
31 Incorrect 56 ms 3056 KB Output isn't correct - L* = 0
32 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
33 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
34 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
35 Incorrect 55 ms 2848 KB Output isn't correct - L* = 0
36 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
37 Incorrect 55 ms 3000 KB Output isn't correct - L* = 0
38 Incorrect 55 ms 3000 KB Output isn't correct - L* = 0
39 Incorrect 56 ms 3056 KB Output isn't correct - L* = 0
40 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0