답안 #677090

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
677090 2023-01-02T08:55:54 Z alvingogo Ancient Machine (JOI21_ancient_machine) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "Anna.h"
#pragma GCC optimize("Ofast")
#define AquA cin.tie(0);ios_base::sync_with_stdio(0);
#define fs first
#define sc second
#define p_q priority_queue
using namespace std;

vector<long long> v;
const int A=51,B=73;
void init(){
	v.clear();
	v.push_back(1);
	v.push_back(1);
	int x=1;
	for(int i=0;i<74;i++){
		long long u=v[i]+v[i+1];
		if(u>1e18){
			break;
		}
		v.push_back(u);
	}
}
void sei(long long a){
	for(int i=A-1;i>=0;i--){
		if(a>=(1ll<<i)){
			a-=(1ll<<i);
			Send(1);
		}
		else{
			Send(0);
		}
	}
}
void Anna(int n,vector<char> s){
	init();
	string a;
	int flag=0;
	for(int i=0;i<n;i++){
		if(s[i]=='X'){
			if(flag==0){
				flag=1;
				a+='1';
				a+='0';
			}
			else{
				a+='0';
			}
		}
		else if(s[i]=='Y'){
			a+='0';
		}
		else{
			if(flag){
				a+='1';
			}
			else{
				a+='0';
			}
		}
	}
	int g=a.size();
	while(g%B!=0){
		g++;
		a+='0';
	}
	for(int i=0;i<g/B;i++){
		long long x=0;
		for(int j=0;j<B;j++){
			if(a[i*B+j]=='1'){
				x+=v[B-j];
			}
		}
		assert(x<=(1ll<<A));
		sei(x);
	}
}



    

Compilation message

Anna.cpp: In function 'void init()':
Anna.cpp:16:6: warning: unused variable 'x' [-Wunused-variable]
   16 |  int x=1;
      |      ^

/usr/bin/ld: /tmp/ccUwAS2j.o: in function `main':
grader_bruno.cpp:(.text.startup+0x24d): undefined reference to `Bruno(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status