답안 #1055920

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1055920 2024-08-13T06:35:11 Z mindiyak A Light Inconvenience (CEOI23_light) C++17
컴파일 오류
0 ms 0 KB
#include "light.h"
#pragma GCC optimize("O1,O2,O3,Ofast,unroll-loops")
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <cmath>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<int, int> pl;
typedef pair<ld, ld> pd;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto &a : x)
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)
#define len(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define nl endl
#define S second
#define lb lower_bound
#define ub upper_bound
#define aint(x) x.begin(), x.end()
#define raint(x) x.rbegin(), x.rend()
#define ins insert
const int MOD = 1000000007;
int cnt;

void prepare(){
	cnt = 0;
}

pair<ll, vl> check(ll p){
	vl arr;
	int mx = 5;
	FOR(i,1,6){
		if(cnt/(i*p) <= 150)mx = min(i,mx);
	}

	ll ans = mx*p;
	vl arr;
	int pos = cnt;
	while(pos > 0){
		arr.pb(pos+1);
		pos -= ans;
	}
	vl arr2;

	for(int i=arr1.size()-1;i>=0;i--)arr2.pb(arr1[i]);

	cerr << ans << endl;
	for(ll a:arr2)cerr << a << " ";
	cerr << endl;

	return pair<ans,arr2>;
}

pair<ll, vl> join(ll p){
	cnt += p;
	return check(p);
}

pair<ll, vl> leave(ll p){
	cnt -= p;
	return check(p);
}

Compilation message

light.cpp: In function 'std::pair<long long int, std::vector<long long int> > check(ll)':
light.cpp:54:5: error: redeclaration of 'vl arr'
   54 |  vl arr;
      |     ^~~
light.cpp:47:5: note: 'vl arr' previously declared here
   47 |  vl arr;
      |     ^~~
light.cpp:62:12: error: 'arr1' was not declared in this scope; did you mean 'arr2'?
   62 |  for(int i=arr1.size()-1;i>=0;i--)arr2.pb(arr1[i]);
      |            ^~~~
      |            arr2
light.cpp:68:22: error: type/value mismatch at argument 1 in template parameter list for 'template<class _T1, class _T2> struct std::pair'
   68 |  return pair<ans,arr2>;
      |                      ^
light.cpp:68:22: note:   expected a type, got 'ans'
light.cpp:68:22: error: type/value mismatch at argument 2 in template parameter list for 'template<class _T1, class _T2> struct std::pair'
light.cpp:68:22: note:   expected a type, got 'arr2'