Submission #67023

# Submission time Handle Problem Language Result Execution time Memory
67023 2018-08-13T08:34:56 Z reality Broken Device (JOI17_broken_device) C++17
0 / 100
64 ms 13704 KB
#include "Annalib.h"
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
template < class P , class Q > ostream& operator<<(ostream& stream, pair < P , Q > v){ stream << "(" << v.fi << ',' << v.se << ")"; return stream;}
template < class T > ostream& operator<<(ostream& stream, const vector<T> v){ stream << "[ "; for (int i=0; i<(int)v.size(); i++) stream << v[i] << " "; stream << "]"; return stream;}
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}

const int NN = 256;

int st[NN];

const int A[] = {1,2,4,4,4,4,1,4};
const int B[] = {0,1,0,1,2,0,1,3};


void Anna(int N,ll X,int K,int P[]) {
  	int n = N;
  	for (int i = 0;i < K;++i)
  		st[P[i]] = 1;
  	for (int i = 0;i < N;i += 3) {
  		int bl = st[i] + st[i + 1] * 2 + st[i + 2] * 4;
  		int mask = 0;
  		for (int j = 1;j < 8;++j)
  			if (!(j & bl) && (X & (A[j] - 1)) == B[j]) {
  				if (A[mask] < A[j])
  					mask = j;
  			}
  		for (int j = 0;j < 3;++j)
  			Set(i + j,(mask >> j) & 1);
  		X /= A[mask];
  	}
}
#include "Brunolib.h"
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define vii vector < pii >
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
template < class P , class Q > ostream& operator<<(ostream& stream, pair < P , Q > v){ stream << "(" << v.fi << ',' << v.se << ")"; return stream;}
template < class T > ostream& operator<<(ostream& stream, const vector<T> v){ stream << "[ "; for (int i=0; i<(int)v.size(); i++) stream << v[i] << " "; stream << "]"; return stream;}
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}

const int A[] = {1,2,4,4,4,4,1,4};
const int B[] = {0,1,0,1,2,0,1,3};

long long Bruno( int N, int S[] ){
	int n = N;
	ll ans = 0;
	ll was = 1;
	for (int i = 0;i < N;i += 3) {
		int cnt = S[i] + S[i + 1] * 2 + S[i + 2] * 4;
		ans += was * B[cnt];
		was *= A[cnt];
	}
	return ans;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:29:8: warning: unused variable 'n' [-Wunused-variable]
    int n = N;
        ^

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:25:6: warning: unused variable 'n' [-Wunused-variable]
  int n = N;
      ^
# Verdict Execution time Memory Grader output
1 Incorrect 48 ms 3568 KB Output isn't correct - L* = 0
2 Incorrect 55 ms 4096 KB Output isn't correct - L* = 0
3 Incorrect 54 ms 4536 KB Output isn't correct - L* = 0
4 Incorrect 49 ms 4704 KB Output isn't correct - L* = 0
5 Incorrect 60 ms 4976 KB Output isn't correct - L* = 0
6 Incorrect 48 ms 5480 KB Output isn't correct - L* = 0
7 Incorrect 47 ms 5776 KB Output isn't correct - L* = 0
8 Incorrect 53 ms 6232 KB Output isn't correct - L* = 0
9 Incorrect 63 ms 6232 KB Output isn't correct - L* = 0
10 Incorrect 48 ms 6480 KB Output isn't correct - L* = 0
11 Incorrect 51 ms 6568 KB Output isn't correct - L* = 0
12 Incorrect 45 ms 6856 KB Output isn't correct - L* = 0
13 Incorrect 46 ms 7096 KB Output isn't correct - L* = 0
14 Incorrect 48 ms 7344 KB Output isn't correct - L* = 0
15 Incorrect 52 ms 7584 KB Output isn't correct - L* = 0
16 Incorrect 50 ms 7824 KB Output isn't correct - L* = 0
17 Incorrect 44 ms 8088 KB Output isn't correct - L* = 0
18 Incorrect 54 ms 8320 KB Output isn't correct - L* = 0
19 Incorrect 46 ms 8816 KB Output isn't correct - L* = 0
20 Incorrect 47 ms 9064 KB Output isn't correct - L* = 0
21 Incorrect 49 ms 9064 KB Output isn't correct - L* = 0
22 Incorrect 49 ms 9296 KB Output isn't correct - L* = 0
23 Incorrect 48 ms 9536 KB Output isn't correct - L* = 0
24 Incorrect 43 ms 9776 KB Output isn't correct - L* = 0
25 Incorrect 54 ms 10024 KB Output isn't correct - L* = 0
26 Incorrect 56 ms 10528 KB Output isn't correct - L* = 0
27 Incorrect 47 ms 10528 KB Output isn't correct - L* = 0
28 Incorrect 53 ms 11024 KB Output isn't correct - L* = 0
29 Incorrect 49 ms 11024 KB Output isn't correct - L* = 0
30 Incorrect 64 ms 11504 KB Output isn't correct - L* = 0
31 Incorrect 52 ms 11504 KB Output isn't correct - L* = 0
32 Incorrect 51 ms 11736 KB Output isn't correct - L* = 0
33 Incorrect 55 ms 12168 KB Output isn't correct - L* = 0
34 Incorrect 56 ms 12488 KB Output isn't correct - L* = 0
35 Incorrect 48 ms 12488 KB Output isn't correct - L* = 0
36 Incorrect 48 ms 13000 KB Output isn't correct - L* = 0
37 Incorrect 52 ms 13208 KB Output isn't correct - L* = 0
38 Incorrect 53 ms 13208 KB Output isn't correct - L* = 0
39 Incorrect 49 ms 13696 KB Output isn't correct - L* = 0
40 Incorrect 63 ms 13704 KB Output isn't correct - L* = 0