제출 #1177494

#제출 시각아이디문제언어결과실행 시간메모리
1177494kadir동굴 (IOI13_cave)C++20
컴파일 에러
0 ms0 KiB
#include "cave.h"
#include<bits/stdc++.h>
#define ll int
#define ff first
#define ss second
#define pb push_back
using namespace std;
const ll mod=1e9+7;
const ll inf=1e18;
const ll mxn=2e5+5;
void exploreCave(int N){
   	ll a[N+5],b[N+5],c[N+5];
	for(ll i=0;i<N;i++){
    	ll s[N+5];
    	for(ll j=0;j<N;j++){
    		if(c[j]!=0) s[j]=a[j];
			else s[j]=0;
		}
		ll x=tryCombination(s);
		ll t=1;
		if(x==-1 || x>i) t=0;
		vector<ll> v;
		for(ll j=0;j<n;j++){
			if(c[j]==0) v.pb(j);
		}
		while(v.size()>1){
			for(ll j=0;j<n;j++){
				if(c[j]!=0) s[j]=a[j];
				else s[j]=0;
			}
	
			vector<ll> v1,v2;
			ll u=v.size();
			for(ll j=0;j<u/2;j++){
				v1.pb(v[j]);
				s[v[j]]=(1-t);
			}
			for(ll j=u/2;j<u;j++){
				v2.pb(v[j]);
				s[v[j]]=(1-t);
			}
			x=tryCombination(s);
			if(x==-1 || x>i) v=v1;
			else v=v2;
		}
		c[v.back()]=1;
		a[v.back()]=t;
		b[v.back()]=i;
	}
	ll s[N+5],k[N+5];
	for(ll i=0;i<N;i++){
		s[i]=a[i];
		k[i]=b[i];
	}
	answer(s[],k[]);
}

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp:9:14: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
    9 | const ll inf=1e18;
      |              ^~~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:23:30: error: 'n' was not declared in this scope
   23 |                 for(ll j=0;j<n;j++){
      |                              ^
cave.cpp:27:38: error: 'n' was not declared in this scope
   27 |                         for(ll j=0;j<n;j++){
      |                                      ^
cave.cpp:55:18: error: expected primary-expression before ']' token
   55 |         answer(s[],k[]);
      |                  ^
cave.cpp:55:22: error: expected primary-expression before ']' token
   55 |         answer(s[],k[]);
      |                      ^