Submission #19550


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<5000000;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)/5000000.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 9436 ms
Memory 820 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 9373 ms 784 KB
00_mini_02.txt AC 9436 ms 792 KB
00_sample_01.txt AC 1494 ms 772 KB
00_sample_02.txt AC 6641 ms 796 KB
00_sample_03.txt AC 2215 ms 792 KB
01_rnd_11_01.txt AC 6015 ms 788 KB
01_rnd_11_02.txt AC 6493 ms 776 KB
01_rnd_11_03.txt AC 6572 ms 796 KB
01_rnd_11_04.txt AC 6520 ms 788 KB
01_rnd_11_05.txt AC 6518 ms 780 KB
01_rnd_11_06.txt AC 6747 ms 820 KB
01_rnd_11_07.txt AC 6903 ms 780 KB
01_rnd_11_08.txt AC 6678 ms 792 KB
01_rnd_11_09.txt AC 6756 ms 792 KB
01_rnd_11_10.txt AC 7327 ms 764 KB
01_rnd_11_11.txt AC 7031 ms 792 KB
01_rnd_11_12.txt AC 5430 ms 788 KB
01_rnd_11_13.txt AC 2055 ms 784 KB
01_rnd_11_14.txt AC 2922 ms 792 KB
01_rnd_11_15.txt AC 6315 ms 788 KB
01_rnd_11_16.txt AC 4881 ms 788 KB
01_rnd_11_17.txt AC 3953 ms 736 KB
01_rnd_11_18.txt AC 5503 ms 784 KB
01_rnd_11_19.txt AC 6313 ms 784 KB
01_rnd_11_20.txt AC 6553 ms 792 KB
01_rnd_11_21.txt AC 5085 ms 812 KB
01_rnd_11_22.txt AC 4234 ms 792 KB
01_rnd_7_01.txt AC 5769 ms 812 KB
01_rnd_7_02.txt AC 6061 ms 792 KB
01_rnd_7_03.txt AC 6293 ms 796 KB
01_rnd_7_04.txt AC 6358 ms 796 KB
01_rnd_7_05.txt AC 6407 ms 784 KB
01_rnd_7_06.txt AC 6460 ms 736 KB
01_rnd_7_07.txt AC 6461 ms 820 KB
01_rnd_7_08.txt AC 6546 ms 736 KB
01_rnd_7_09.txt AC 6391 ms 816 KB
01_rnd_7_10.txt AC 6518 ms 800 KB
01_rnd_7_11.txt AC 6562 ms 788 KB
01_rnd_7_12.txt AC 3895 ms 792 KB
01_rnd_7_13.txt AC 5927 ms 788 KB
01_rnd_7_14.txt AC 4522 ms 796 KB
01_rnd_7_15.txt AC 4205 ms 756 KB
01_rnd_7_16.txt AC 5963 ms 788 KB
01_rnd_7_17.txt AC 3677 ms 792 KB
01_rnd_7_18.txt AC 4519 ms 796 KB
01_rnd_7_19.txt AC 3022 ms 732 KB
01_rnd_7_20.txt AC 3610 ms 784 KB
01_rnd_7_21.txt AC 4560 ms 756 KB
01_rnd_7_22.txt AC 2957 ms 768 KB
01_rnd_8_01.txt AC 5668 ms 784 KB
01_rnd_8_02.txt AC 6053 ms 796 KB
01_rnd_8_03.txt AC 6120 ms 784 KB
01_rnd_8_04.txt AC 6219 ms 780 KB
01_rnd_8_05.txt AC 6242 ms 780 KB
01_rnd_8_06.txt AC 6369 ms 788 KB
01_rnd_8_07.txt AC 6368 ms 792 KB
01_rnd_8_08.txt AC 6283 ms 784 KB
01_rnd_8_09.txt AC 6356 ms 780 KB
01_rnd_8_10.txt AC 6515 ms 784 KB
01_rnd_8_11.txt AC 6509 ms 788 KB
01_rnd_8_12.txt AC 4251 ms 792 KB
01_rnd_8_13.txt AC 1900 ms 816 KB
01_rnd_8_14.txt AC 4782 ms 788 KB
01_rnd_8_15.txt AC 4013 ms 784 KB
01_rnd_8_16.txt AC 3607 ms 792 KB
01_rnd_8_17.txt AC 5980 ms 788 KB
01_rnd_8_18.txt AC 2924 ms 792 KB
01_rnd_8_19.txt AC 4079 ms 820 KB
01_rnd_8_20.txt AC 4934 ms 756 KB
01_rnd_8_21.txt AC 2995 ms 784 KB
01_rnd_8_22.txt AC 6074 ms 788 KB