Submission #67027

# Submission time Handle Problem Language Result Execution time Memory
67027 2018-08-13T08:36:45 Z reality Broken Device (JOI17_broken_device) C++17
0 / 100
74 ms 13384 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,2,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 < N;++i)
  		st[i] = 0;
  	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 3056 KB Output isn't correct - L* = 0
2 Incorrect 53 ms 3872 KB Output isn't correct - L* = 0
3 Incorrect 56 ms 4336 KB Output isn't correct - L* = 0
4 Incorrect 50 ms 4504 KB Output isn't correct - L* = 0
5 Incorrect 67 ms 5008 KB Output isn't correct - L* = 0
6 Incorrect 57 ms 5432 KB Output isn't correct - L* = 0
7 Incorrect 49 ms 5528 KB Output isn't correct - L* = 0
8 Incorrect 71 ms 5560 KB Output isn't correct - L* = 0
9 Incorrect 56 ms 5824 KB Output isn't correct - L* = 0
10 Incorrect 49 ms 6056 KB Output isn't correct - L* = 0
11 Incorrect 50 ms 6312 KB Output isn't correct - L* = 0
12 Incorrect 65 ms 6808 KB Output isn't correct - L* = 0
13 Incorrect 53 ms 6808 KB Output isn't correct - L* = 0
14 Incorrect 46 ms 7048 KB Output isn't correct - L* = 0
15 Incorrect 52 ms 7288 KB Output isn't correct - L* = 0
16 Incorrect 54 ms 7528 KB Output isn't correct - L* = 0
17 Incorrect 61 ms 7800 KB Output isn't correct - L* = 0
18 Incorrect 46 ms 8032 KB Output isn't correct - L* = 0
19 Incorrect 63 ms 8256 KB Output isn't correct - L* = 0
20 Incorrect 51 ms 8616 KB Output isn't correct - L* = 0
21 Incorrect 54 ms 8976 KB Output isn't correct - L* = 0
22 Incorrect 49 ms 8992 KB Output isn't correct - L* = 0
23 Incorrect 53 ms 9336 KB Output isn't correct - L* = 0
24 Incorrect 54 ms 9688 KB Output isn't correct - L* = 0
25 Incorrect 50 ms 9960 KB Output isn't correct - L* = 0
26 Incorrect 52 ms 9968 KB Output isn't correct - L* = 0
27 Incorrect 53 ms 10216 KB Output isn't correct - L* = 0
28 Incorrect 74 ms 10464 KB Output isn't correct - L* = 0
29 Incorrect 49 ms 10704 KB Output isn't correct - L* = 0
30 Incorrect 70 ms 10944 KB Output isn't correct - L* = 0
31 Incorrect 49 ms 11208 KB Output isn't correct - L* = 0
32 Incorrect 58 ms 11448 KB Output isn't correct - L* = 0
33 Incorrect 53 ms 11688 KB Output isn't correct - L* = 0
34 Incorrect 52 ms 11920 KB Output isn't correct - L* = 0
35 Incorrect 48 ms 12416 KB Output isn't correct - L* = 0
36 Incorrect 49 ms 12464 KB Output isn't correct - L* = 0
37 Incorrect 49 ms 12656 KB Output isn't correct - L* = 0
38 Incorrect 53 ms 12904 KB Output isn't correct - L* = 0
39 Incorrect 55 ms 13144 KB Output isn't correct - L* = 0
40 Incorrect 49 ms 13384 KB Output isn't correct - L* = 0