Submission #150773

# Submission time Handle Problem Language Result Execution time Memory
150773 2019-09-01T08:54:54 Z CHT를 사랑하는 모임(#3587, moonrabbit2, Retro3014, gs18115) Lokahian Relics (FXCUP4_lokahia) C++17
0 / 100
8 ms 896 KB
#include"lokahia.h"
#include<iostream>
#include<vector>
#include<algorithm>
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const ll inf=1e18;
int q[205][205];
int query(int x,int y)
{
	if(q[x][y]) return q[x][y]-100;
	if(q[y][x]) return q[y][x]-100;
	q[x][y]=CollectRelics(x,y)+100;
	return q[x][y]-100;
}
int FindBase(int N)
{
	int cnt=0,tgt=0;
	vector<int>tgs,szs;
	vector<vector<int> >difs;
	int i;
	for(i=0;i<N;i++)
	{
		if(cnt==0)
		{
			tgt=i;
			cnt=1;
			tgs.eb(tgt);
			szs.eb(1);
			difs.eb(vector<int>());
		}
		else
		{
			if(query(tgt,i)!=-1)
				cnt++,szs[szs.size()-1]++;
			else
				difs.back().eb(i),cnt--;
		}
	}
	int t=tgs.back();
	int n=tgs.size();
	cnt=0;
	for(i=0;i<n;i++)
	{
		if(tgs[i]==t)
			cnt+=szs[i];
		else
		{
			if(query(tgs[i],t)!=-1)
				cnt+=szs[i];
			else
				for(int m:difs[i])
					if(query(t,m)!=-1)
						cnt++;
		}
	}
	for(int i=0;i<N;i++){
		if(i!=t&&(q[i][t]||q[t][i])){
			if(q[i][t]) t=q[i][t]-100;
			else t=q[t][i]-100;
		}
	}
	if(cnt>=N/2)
		return t;
	return -1;
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 512 KB Correct : C = 0
2 Correct 6 ms 640 KB Correct : C = 198
3 Runtime error 6 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Correct 7 ms 640 KB Correct : C = 201
5 Runtime error 6 ms 896 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 7 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Correct 7 ms 640 KB Correct : C = 199
8 Runtime error 6 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Correct 6 ms 512 KB Correct : C = 4
10 Correct 6 ms 640 KB Correct : C = 119
11 Runtime error 8 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Correct 5 ms 512 KB Correct : C = 121
13 Runtime error 7 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Correct 6 ms 640 KB Correct : C = 126
15 Runtime error 6 ms 896 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Correct 6 ms 640 KB Correct : C = 118
17 Runtime error 7 ms 896 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Correct 6 ms 640 KB Correct : C = 198
21 Correct 5 ms 640 KB Correct : C = 119
22 Runtime error 6 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 6 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Correct 7 ms 640 KB Correct : C = 199
25 Runtime error 6 ms 768 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 7 ms 828 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Incorrect 6 ms 640 KB Wrong