Submission #1153920

#TimeUsernameProblemLanguageResultExecution timeMemory
1153920nhnguyen14Ancient Machine (JOI21_ancient_machine)C++20
Compilation error
0 ms0 KiB
#include "Anna.h"
//#include "Bruno.h"
#include <vector>
#include<bits/stdc++.h>

using namespace std;

// void send(int id){
// }
// void remove(int id){
// }

void Anna(int n,vector<char>s){
	int first_pos;
	for(int i=0;i<n;++i){
		if (s[i]=='X') {
			first_pos=i;
			send(1);
			break;
		}
		else send(0);
	}
	for(int i=first_pos+1;i<n;++i){
		if (s[i]=='Z') send(1); else send(0);
	}
	return;
}

// void Bruno(int n,int l,vector<int>s){
// 	int oo=-1,pos=n;
// 	for(int i=0;i<n;++i){
// 		if (s[i]==1){
// 			if (oo==-1) {
// 				for(int j=i-1;j>=0;--j) remove(j);
// 				pos=i;
// 				oo=i+1;
// 			}
// 			else {
// 				for(int j=i-1;j>=oo;--j) remove(j);
// 				remove(i);
// 				oo=i+1;
// 			}
// 		}
// 	}
// 	for(int i=oo;i<n;++i) remove(i);
// 	if (pos!=n) remove(pos);
// 	return;
// }

//#include "Anna.h"
#include "Bruno.h"
//#include <vector>
#include<bits/stdc++.h>

using namespace std;

// void send(int id){
// }
// void remove(int id){
// }

// void Anna(int n,vector<char>s){
// 	int first_pos;
// 	for(int i=0;i<n;++i){
// 		if (s[i]=='X') {
// 			first_pos=i;
// 			send(1);
// 			break;
// 		}
// 		else send(0);
// 	}
// 	for(int i=first_pos+1;i<n;++i){
// 		if (s[i]=='Z') send(1); else send(0);
// 	}
// 	return;
// }

void Bruno(int n,int l,vector<int>s){
	int oo=-1,pos=n;
	for(int i=0;i<n;++i){
		if (s[i]==1){
			if (oo==-1) {
				for(int j=i-1;j>=0;--j) remove(j);
				pos=i;
				oo=i+1;
			}
			else {
				for(int j=i-1;j>=oo;--j) remove(j);
				remove(i);
				oo=i+1;
			}
		}
	}
	for(int i=oo;i<n;++i) remove(i);
	if (pos!=n) remove(pos);
	return;
}

Compilation message (stderr)

# 1번째 컴파일 단계

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:18:25: error: 'send' was not declared in this scope; did you mean 'Send'?
   18 |                         send(1);
      |                         ^~~~
      |                         Send
Anna.cpp:21:22: error: 'send' was not declared in this scope; did you mean 'Send'?
   21 |                 else send(0);
      |                      ^~~~
      |                      Send
Anna.cpp:24:32: error: 'send' was not declared in this scope; did you mean 'Send'?
   24 |                 if (s[i]=='Z') send(1); else send(0);
      |                                ^~~~
      |                                Send
Anna.cpp:24:46: error: 'send' was not declared in this scope; did you mean 'Send'?
   24 |                 if (s[i]=='Z') send(1); else send(0);
      |                                              ^~~~
      |                                              Send