답안 #104529

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
104529 2019-04-07T15:49:28 Z figter001 코끼리 (Dancing Elephants) (IOI11_elephants) C++17
컴파일 오류
0 ms 0 KB
// #include "grader.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const int N = 1e5+50;
const ll oo = 1e18;
const ll mod = 1e9+7;

int n,l;
vector<int> a;

void init(int N, int L, int X[]){
	n = N;
	l=L;
	for(int i=0;i<n;i++)
		a.push_back(X[i]);
}

int update(int x, int y){
	vector<int> tmp;
	for(int i=0;i<n;i++){
		if(i == x)
			continue;
		if(a[i] >= y && y != -1){
			tmp.push_back(y);
			y = -1;
		}
		tmp.push_back(a[i]);
	}
	if(tmp.size() != a.size())
		tmp.push_back(y);
	a = tmp;
	int ans = 0;z`
	int to = -1;
	for(int it : a){
		if(it > to){
			to = it+l;
			ans++;
		}
	}
	return ans;
}

Compilation message

elephants.cpp:36:15: error: stray '`' in program
  int ans = 0;z`
               ^
elephants.cpp: In function 'int update(int, int)':
elephants.cpp:36:14: error: 'z' was not declared in this scope
  int ans = 0;z`
              ^
elephants.cpp:39:11: error: 'to' was not declared in this scope
   if(it > to){
           ^~
elephants.cpp:39:11: note: suggested alternative: 'oo'
   if(it > to){
           ^~
           oo