답안 #1084782

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1084782 2024-09-07T02:03:58 Z Math4Life2020 마술쇼 (APIO24_show) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#include "Alice.h"

const ll SEED = 82014384209183;
const ll N = 5000;
using ll = long long; using pii = pair<ll,ll>;

ll l2(ll x) {
	return (31-__builtin_clz(x));
}

vector<pii> Alice() {
	ll X = setN((int)N); //X<=10^18<2^60
	mt19937 gen(SEED);
	vector<pii> ans; 
	for (ll x=1;x<N;x++) {
		ll y=0;
		ll lx = l2(x);
		for (ll i=0;i<lx;i++) {
			ll bv = gen()%60;
			y += (1LL<<i)*((X>>bv)&1);
		}
		ans.push_back({y+1,x+1});
	}
	return ans;
}
#include <bits/stdc++.h>
using namespace std;
#include "Bob.h"

const ll SEED = 82014384209183;
const ll N = 5000;
using ll = long long; using pii = pair<ll,ll>;

ll l2(ll x) {
	return (31-__builtin_clz(x));
}

ll Bob(vector<pii> V) {
	ll ans = 0;
	ll read[N];
	for (ll i=0;i<N;i++) {
		read[i]=-1;
	}
	for (pii p0: V) {
		ll y = p0.first; ll x = p0.second;
		x--; y--;
		read[x]=y;
	}
	for (ll x=1;x<N;x++) {
		ll RD=read[x];
		ll lx = l2(x);
		for (ll i=0;i<lx;i++) {
			ll bv = gen()%60;
			if (RD!=-1) {
				ans |= (1LL<<bv)*(RD>>i);
			}
		}
	}
	return ans;
}

Compilation message

Alice.cpp:5:7: error: 'll' does not name a type
    5 | const ll SEED = 82014384209183;
      |       ^~
Alice.cpp:6:7: error: 'll' does not name a type
    6 | const ll N = 5000;
      |       ^~
Alice.cpp:13:13: error: ambiguating new declaration of 'std::vector<std::pair<long long int, long long int> > Alice()'
   13 | vector<pii> Alice() {
      |             ^~~~~
In file included from Alice.cpp:3:
Alice.h:3:33: note: old declaration 'std::vector<std::pair<int, int> > Alice()'
    3 | std::vector<std::pair<int,int>> Alice();
      |                                 ^~~~~
Alice.cpp: In function 'std::vector<std::pair<long long int, long long int> > Alice()':
Alice.cpp:14:19: error: 'N' was not declared in this scope
   14 |  ll X = setN((int)N); //X<=10^18<2^60
      |                   ^
Alice.cpp:15:14: error: 'SEED' was not declared in this scope
   15 |  mt19937 gen(SEED);
      |              ^~~~

Bob.cpp:5:7: error: 'll' does not name a type
    5 | const ll SEED = 82014384209183;
      |       ^~
Bob.cpp:6:7: error: 'll' does not name a type
    6 | const ll N = 5000;
      |       ^~
Bob.cpp: In function 'll Bob(std::vector<std::pair<long long int, long long int> >)':
Bob.cpp:15:10: error: 'N' was not declared in this scope
   15 |  ll read[N];
      |          ^
Bob.cpp:17:3: error: 'read' was not declared in this scope; did you mean 'fread'?
   17 |   read[i]=-1;
      |   ^~~~
      |   fread
Bob.cpp:22:3: error: 'read' was not declared in this scope; did you mean 'fread'?
   22 |   read[x]=y;
      |   ^~~~
      |   fread
Bob.cpp:25:9: error: 'read' was not declared in this scope; did you mean 'fread'?
   25 |   ll RD=read[x];
      |         ^~~~
      |         fread
Bob.cpp:28:12: error: 'gen' was not declared in this scope
   28 |    ll bv = gen()%60;
      |            ^~~