Submission #19528


Source Code Expand

Copy
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<stdlib.h>
using namespace std;
int main()
{
	int num,kum,kai;
	scanf("%d%d%d",&num,&kum,&kai);
	vector<int>vec[11];
	for(int i=0;i<kum;i++)
	{
		int za,zb;
		scanf("%d%d",&za,&zb);
		vec[za].push_back(zb);
		vec[zb].push_back(za);
	}
	int ret=0;
	for(int p=0;p<100000;p++)
	{
		vector<int>ve;
		for(int i=0;i<num;i++)
		{
			ve.push_back(i);
		}
		for(int j=0;j<kai;j++)
		{
			l01:;
			int a=rand()%num;
			int b=rand()%num;
			if(a==b)
			{
				goto l01;
			}
			swap(ve[a],ve[b]);
		}
		int han=1;
		for(int k=0;k<num;k++)
		{
			for(int l=0;l<vec[ve[k]].size();l++)
			{
				if(ve[(k+1)%num]==vec[ve[k]][l])
				{
					han=0;
					break;
				}
			}
		}
		ret+=han;
	}
	printf("%lf\n",double(ret)/100000.0);
}

Submission Info

Submission Time
Task D - シャッフル席替え
User DEGwer
Language C++ (G++ 4.6.4)
Score 0
Code Size 827 Byte
Status WA
Exec Time 208 ms
Memory 824 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:32: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:14:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

Judge Result

Set Name all
Score / Max Score 0 / 100
Status
AC × 62
WA × 9
Set Name Test Cases
all 00_mini_01.txt, 00_mini_02.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_rnd_11_01.txt, 01_rnd_11_02.txt, 01_rnd_11_03.txt, 01_rnd_11_04.txt, 01_rnd_11_05.txt, 01_rnd_11_06.txt, 01_rnd_11_07.txt, 01_rnd_11_08.txt, 01_rnd_11_09.txt, 01_rnd_11_10.txt, 01_rnd_11_11.txt, 01_rnd_11_12.txt, 01_rnd_11_13.txt, 01_rnd_11_14.txt, 01_rnd_11_15.txt, 01_rnd_11_16.txt, 01_rnd_11_17.txt, 01_rnd_11_18.txt, 01_rnd_11_19.txt, 01_rnd_11_20.txt, 01_rnd_11_21.txt, 01_rnd_11_22.txt, 01_rnd_7_01.txt, 01_rnd_7_02.txt, 01_rnd_7_03.txt, 01_rnd_7_04.txt, 01_rnd_7_05.txt, 01_rnd_7_06.txt, 01_rnd_7_07.txt, 01_rnd_7_08.txt, 01_rnd_7_09.txt, 01_rnd_7_10.txt, 01_rnd_7_11.txt, 01_rnd_7_12.txt, 01_rnd_7_13.txt, 01_rnd_7_14.txt, 01_rnd_7_15.txt, 01_rnd_7_16.txt, 01_rnd_7_17.txt, 01_rnd_7_18.txt, 01_rnd_7_19.txt, 01_rnd_7_20.txt, 01_rnd_7_21.txt, 01_rnd_7_22.txt, 01_rnd_8_01.txt, 01_rnd_8_02.txt, 01_rnd_8_03.txt, 01_rnd_8_04.txt, 01_rnd_8_05.txt, 01_rnd_8_06.txt, 01_rnd_8_07.txt, 01_rnd_8_08.txt, 01_rnd_8_09.txt, 01_rnd_8_10.txt, 01_rnd_8_11.txt, 01_rnd_8_12.txt, 01_rnd_8_13.txt, 01_rnd_8_14.txt, 01_rnd_8_15.txt, 01_rnd_8_16.txt, 01_rnd_8_17.txt, 01_rnd_8_18.txt, 01_rnd_8_19.txt, 01_rnd_8_20.txt, 01_rnd_8_21.txt, 01_rnd_8_22.txt
Case Name Status Exec Time Memory
00_mini_01.txt AC 207 ms 824 KB
00_mini_02.txt AC 208 ms 812 KB
00_sample_01.txt AC 51 ms 776 KB
00_sample_02.txt AC 151 ms 788 KB
00_sample_03.txt AC 64 ms 784 KB
01_rnd_11_01.txt AC 138 ms 788 KB
01_rnd_11_02.txt AC 144 ms 792 KB
01_rnd_11_03.txt WA 148 ms 788 KB
01_rnd_11_04.txt AC 149 ms 788 KB
01_rnd_11_05.txt WA 153 ms 788 KB
01_rnd_11_06.txt AC 151 ms 784 KB
01_rnd_11_07.txt WA 155 ms 792 KB
01_rnd_11_08.txt AC 153 ms 784 KB
01_rnd_11_09.txt WA 154 ms 792 KB
01_rnd_11_10.txt AC 161 ms 788 KB
01_rnd_11_11.txt AC 158 ms 788 KB
01_rnd_11_12.txt AC 126 ms 792 KB
01_rnd_11_13.txt AC 62 ms 792 KB
01_rnd_11_14.txt WA 75 ms 792 KB
01_rnd_11_15.txt AC 145 ms 792 KB
01_rnd_11_16.txt AC 120 ms 788 KB
01_rnd_11_17.txt AC 97 ms 788 KB
01_rnd_11_18.txt WA 126 ms 792 KB
01_rnd_11_19.txt AC 144 ms 792 KB
01_rnd_11_20.txt AC 148 ms 824 KB
01_rnd_11_21.txt AC 121 ms 784 KB
01_rnd_11_22.txt AC 103 ms 788 KB
01_rnd_7_01.txt AC 135 ms 796 KB
01_rnd_7_02.txt AC 141 ms 788 KB
01_rnd_7_03.txt WA 145 ms 792 KB
01_rnd_7_04.txt AC 146 ms 784 KB
01_rnd_7_05.txt AC 150 ms 788 KB
01_rnd_7_06.txt AC 148 ms 788 KB
01_rnd_7_07.txt AC 149 ms 796 KB
01_rnd_7_08.txt AC 149 ms 800 KB
01_rnd_7_09.txt AC 148 ms 792 KB
01_rnd_7_10.txt AC 150 ms 792 KB
01_rnd_7_11.txt AC 152 ms 788 KB
01_rnd_7_12.txt AC 98 ms 792 KB
01_rnd_7_13.txt AC 140 ms 764 KB
01_rnd_7_14.txt AC 112 ms 792 KB
01_rnd_7_15.txt WA 105 ms 768 KB
01_rnd_7_16.txt AC 138 ms 740 KB
01_rnd_7_17.txt AC 93 ms 788 KB
01_rnd_7_18.txt AC 110 ms 796 KB
01_rnd_7_19.txt AC 79 ms 788 KB
01_rnd_7_20.txt AC 93 ms 792 KB
01_rnd_7_21.txt AC 111 ms 768 KB
01_rnd_7_22.txt AC 80 ms 788 KB
01_rnd_8_01.txt AC 134 ms 788 KB
01_rnd_8_02.txt AC 139 ms 792 KB
01_rnd_8_03.txt AC 142 ms 792 KB
01_rnd_8_04.txt AC 144 ms 796 KB
01_rnd_8_05.txt WA 144 ms 796 KB
01_rnd_8_06.txt AC 146 ms 796 KB
01_rnd_8_07.txt AC 148 ms 784 KB
01_rnd_8_08.txt AC 146 ms 788 KB
01_rnd_8_09.txt AC 146 ms 792 KB
01_rnd_8_10.txt AC 149 ms 756 KB
01_rnd_8_11.txt AC 153 ms 788 KB
01_rnd_8_12.txt AC 105 ms 796 KB
01_rnd_8_13.txt AC 58 ms 788 KB
01_rnd_8_14.txt AC 115 ms 792 KB
01_rnd_8_15.txt AC 99 ms 792 KB
01_rnd_8_16.txt AC 93 ms 796 KB
01_rnd_8_17.txt AC 139 ms 788 KB
01_rnd_8_18.txt AC 79 ms 788 KB
01_rnd_8_19.txt AC 101 ms 788 KB
01_rnd_8_20.txt AC 118 ms 784 KB
01_rnd_8_21.txt AC 80 ms 784 KB
01_rnd_8_22.txt AC 141 ms 760 KB