Submission #19533


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<2000000;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)/2000000.0);
}

Submission Info

Submission Time
Task D - シャッフル席替え
User DEGwer
Language C++ (G++ 4.6.4)
Score 100
Code Size 829 Byte
Status AC
Exec Time 3765 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 100 / 100
Status
AC × 71
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 3757 ms 760 KB
00_mini_02.txt AC 3765 ms 792 KB
00_sample_01.txt AC 602 ms 788 KB
00_sample_02.txt AC 2661 ms 768 KB
00_sample_03.txt AC 912 ms 820 KB
01_rnd_11_01.txt AC 2359 ms 788 KB
01_rnd_11_02.txt AC 2551 ms 788 KB
01_rnd_11_03.txt AC 2554 ms 764 KB
01_rnd_11_04.txt AC 2605 ms 780 KB
01_rnd_11_05.txt AC 2610 ms 788 KB
01_rnd_11_06.txt AC 2698 ms 820 KB
01_rnd_11_07.txt AC 2626 ms 796 KB
01_rnd_11_08.txt AC 2673 ms 788 KB
01_rnd_11_09.txt AC 2727 ms 796 KB
01_rnd_11_10.txt AC 2878 ms 800 KB
01_rnd_11_11.txt AC 2832 ms 792 KB
01_rnd_11_12.txt AC 2170 ms 812 KB
01_rnd_11_13.txt AC 833 ms 788 KB
01_rnd_11_14.txt AC 1180 ms 792 KB
01_rnd_11_15.txt AC 2559 ms 784 KB
01_rnd_11_16.txt AC 1953 ms 784 KB
01_rnd_11_17.txt AC 1595 ms 788 KB
01_rnd_11_18.txt AC 2180 ms 792 KB
01_rnd_11_19.txt AC 2526 ms 784 KB
01_rnd_11_20.txt AC 2598 ms 784 KB
01_rnd_11_21.txt AC 2041 ms 792 KB
01_rnd_11_22.txt AC 1690 ms 792 KB
01_rnd_7_01.txt AC 2391 ms 792 KB
01_rnd_7_02.txt AC 2435 ms 784 KB
01_rnd_7_03.txt AC 2534 ms 824 KB
01_rnd_7_04.txt AC 2549 ms 788 KB
01_rnd_7_05.txt AC 2569 ms 792 KB
01_rnd_7_06.txt AC 2593 ms 788 KB
01_rnd_7_07.txt AC 2584 ms 796 KB
01_rnd_7_08.txt AC 2583 ms 792 KB
01_rnd_7_09.txt AC 2557 ms 788 KB
01_rnd_7_10.txt AC 2591 ms 792 KB
01_rnd_7_11.txt AC 2620 ms 796 KB
01_rnd_7_12.txt AC 1587 ms 784 KB
01_rnd_7_13.txt AC 2337 ms 788 KB
01_rnd_7_14.txt AC 1816 ms 732 KB
01_rnd_7_15.txt AC 1680 ms 780 KB
01_rnd_7_16.txt AC 2374 ms 792 KB
01_rnd_7_17.txt AC 1476 ms 792 KB
01_rnd_7_18.txt AC 1796 ms 788 KB
01_rnd_7_19.txt AC 1218 ms 792 KB
01_rnd_7_20.txt AC 1472 ms 796 KB
01_rnd_7_21.txt AC 1829 ms 740 KB
01_rnd_7_22.txt AC 1233 ms 764 KB
01_rnd_8_01.txt AC 2286 ms 796 KB
01_rnd_8_02.txt AC 2421 ms 788 KB
01_rnd_8_03.txt AC 2454 ms 760 KB
01_rnd_8_04.txt AC 2574 ms 792 KB
01_rnd_8_05.txt AC 2489 ms 792 KB
01_rnd_8_06.txt AC 2573 ms 784 KB
01_rnd_8_07.txt AC 2539 ms 788 KB
01_rnd_8_08.txt AC 2512 ms 788 KB
01_rnd_8_09.txt AC 2559 ms 788 KB
01_rnd_8_10.txt AC 2573 ms 788 KB
01_rnd_8_11.txt AC 2604 ms 776 KB
01_rnd_8_12.txt AC 1718 ms 788 KB
01_rnd_8_13.txt AC 789 ms 792 KB
01_rnd_8_14.txt AC 1887 ms 784 KB
01_rnd_8_15.txt AC 1599 ms 792 KB
01_rnd_8_16.txt AC 1448 ms 788 KB
01_rnd_8_17.txt AC 2374 ms 776 KB
01_rnd_8_18.txt AC 1177 ms 784 KB
01_rnd_8_19.txt AC 1642 ms 760 KB
01_rnd_8_20.txt AC 1974 ms 788 KB
01_rnd_8_21.txt AC 1243 ms 792 KB
01_rnd_8_22.txt AC 2453 ms 784 KB