Submission #131579

# Submission time Handle Problem Language Result Execution time Memory
131579 2019-07-17T10:00:52 Z MohamedAhmed04 Broken Device (JOI17_broken_device) C++14
0 / 100
5 ms 996 KB
#include "Annalib.h"
#include <bits/stdc++.h>

void Anna( int N, long long X, int K, int P[] )
{
	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 finished = -1 ; 
	long long nxt = 0 ; 
	for(int i = 0; i < N; i++ )
	{
	   if(finished == i)
	   	 continue ;
	   if(mark[i+1] || mark[i])
	   	Set(i , 0) ;
	   else
	   {
	   	  finished = i+1 ;
	   	  Set(i , 1) ;
	   	  int now = 0 ;
	   	  if((X & (1ll << nxt)))
	   	  	Set(i+1 , 1) ;
	   	  else
	   	  	Set(i+1 , 0) ;
	   	  if(nxt < 62)
	   	  	nxt++ ;
	   }
	}
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std ;

long long Bruno( int N, int A[] )
{
  long long ans = 0ll ;
  long long nxt = 0 ;
  int finished = -1 ;
  for(int i = 0 ; i < N ; ++i)
  {
  	 if(finished == i)
  	 	continue ;
  	 if(A[i] == 0)
  	 	continue ;
  	 finished = i+1 ;
  	 if(A[i+1] == 1)
  	 	ans += (1ll << nxt) ;
  	 nxt++ ;
  }
  return ans ;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:23:12: warning: unused variable 'now' [-Wunused-variable]
        int now = 0 ;
            ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 768 KB Wrong Answer [1]
2 Incorrect 4 ms 972 KB Wrong Answer [1]
3 Incorrect 5 ms 760 KB Wrong Answer [1]
4 Incorrect 4 ms 920 KB Wrong Answer [1]
5 Incorrect 4 ms 768 KB Wrong Answer [1]
6 Incorrect 4 ms 980 KB Wrong Answer [1]
7 Incorrect 4 ms 976 KB Wrong Answer [1]
8 Incorrect 4 ms 856 KB Wrong Answer [1]
9 Incorrect 4 ms 996 KB Wrong Answer [1]
10 Incorrect 4 ms 760 KB Wrong Answer [1]
11 Incorrect 4 ms 988 KB Wrong Answer [1]
12 Incorrect 4 ms 764 KB Wrong Answer [1]
13 Incorrect 4 ms 856 KB Wrong Answer [1]
14 Incorrect 4 ms 760 KB Wrong Answer [1]
15 Incorrect 4 ms 760 KB Wrong Answer [1]
16 Incorrect 4 ms 888 KB Wrong Answer [1]
17 Incorrect 4 ms 888 KB Wrong Answer [1]
18 Incorrect 4 ms 856 KB Wrong Answer [1]
19 Incorrect 4 ms 760 KB Wrong Answer [1]
20 Incorrect 4 ms 988 KB Wrong Answer [1]
21 Incorrect 4 ms 764 KB Wrong Answer [1]
22 Incorrect 4 ms 988 KB Wrong Answer [1]
23 Incorrect 4 ms 984 KB Wrong Answer [1]
24 Incorrect 4 ms 888 KB Wrong Answer [1]
25 Incorrect 4 ms 780 KB Wrong Answer [1]
26 Incorrect 4 ms 628 KB Wrong Answer [1]
27 Incorrect 4 ms 764 KB Wrong Answer [1]
28 Incorrect 4 ms 768 KB Wrong Answer [1]
29 Incorrect 4 ms 888 KB Wrong Answer [1]
30 Incorrect 4 ms 760 KB Wrong Answer [1]
31 Incorrect 4 ms 860 KB Wrong Answer [1]
32 Incorrect 4 ms 760 KB Wrong Answer [1]
33 Incorrect 4 ms 760 KB Wrong Answer [1]
34 Incorrect 4 ms 772 KB Wrong Answer [1]
35 Incorrect 4 ms 632 KB Wrong Answer [1]
36 Incorrect 4 ms 756 KB Wrong Answer [1]
37 Incorrect 4 ms 888 KB Wrong Answer [1]
38 Incorrect 4 ms 992 KB Wrong Answer [1]
39 Incorrect 4 ms 984 KB Wrong Answer [1]
40 Incorrect 4 ms 816 KB Wrong Answer [1]