제출 #1009803

#제출 시각아이디문제언어결과실행 시간메모리
1009803pcc게임 (APIO22_game)C++17
2 / 100
9 ms14464 KiB
#include "game.h"
#include <bits/stdc++.h>
using namespace std;

const int mxn = 3e5+10;

bool flag = false;
int cnt[mxn];
void add(int k){
	cnt[k]++;
	if(cnt[k] >= 2)flag = true;
	return;
}

struct GRAPH{
	vector<int> paths[mxn];
	bitset<mxn> vis;
	GRAPH(){}
	void DFS(int now){
		if(vis[now])return;
		vis[now] = true;
		add(now);
		for(auto nxt:paths[now]){
			if(vis[nxt])continue;
			DFS(nxt);
		}
		return;
	}
	void add_edge(int a,int b){
		paths[a].push_back(b);
		if(vis[a])DFS(b);
		return;
	}
};

GRAPH g,rg;
int N,K;

void init(int n, int k) {
	g.vis[0] = true;
	rg.vis[k-1] = true;
	N = n;
	K = k;
	for(int i = k-2;i>=0;i--){
		g.add_edge(i,i+1);
		rg.add_edge(i+1,i);
	}
	flag = false;
	cerr<<"INIT DONE!"<<endl;
	for(int i = 0;i<N;i++)cerr<<g.vis[i];cerr<<endl;
	for(int i = 0;i<N;i++)cerr<<rg.vis[i];cerr<<endl;
	return;
}

int add_teleporter(int u, int v) {
	if(0<=u&&u<K&&0<=v&&v<K&&u>=v)return 1;
	g.add_edge(u,v);
	rg.add_edge(v,u);
	return flag;
}

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

game.cpp: In function 'void init(int, int)':
game.cpp:50:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   50 |  for(int i = 0;i<N;i++)cerr<<g.vis[i];cerr<<endl;
      |  ^~~
game.cpp:50:39: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   50 |  for(int i = 0;i<N;i++)cerr<<g.vis[i];cerr<<endl;
      |                                       ^~~~
game.cpp:51:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   51 |  for(int i = 0;i<N;i++)cerr<<rg.vis[i];cerr<<endl;
      |  ^~~
game.cpp:51:40: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   51 |  for(int i = 0;i<N;i++)cerr<<rg.vis[i];cerr<<endl;
      |                                        ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...