Submission #1474251


Source Code Expand

#include<cstdio>
const int inf=1e9+7;
typedef long long ll;
ll a[100005];
ll fac[100005];
void init()
{
	fac[0]=1;
	for(int i=1;i<100005;i++)
		fac[i]=fac[i-1]*i%inf;
}
int main ()
{
	//freopen("in.txt","r",stdin);
	init();
	int n,k=0;
	ll sum=1,cur=1;
	scanf("%d",&n);
	for(int i=1;i<n;i++)
	{
		int c;
		scanf("%d",&c);
		if(cur<=c)
			cur+=2;
		else
		{
			sum*=i;
			k++;
		}
	}
	sum=sum*fac[n-k]%inf;
	printf("%I64d\n",sum);

}

Submission Info

Submission Time
Task A - Robot Racing
User vjudge1
Language Bash (GNU bash v4.3.11)
Score 0
Code Size 432 Byte
Status RE
Exec Time 6 ms
Memory 556 KB

Judge Result

Set Name Sample Subtask All
Score / Max Score 0 / 0 0 / 500 0 / 400
Status
RE × 4
RE × 14
RE × 28
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt
Subtask 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 2_00.txt, 2_01.txt, 2_02.txt, 2_03.txt, 2_04.txt, 2_05.txt, 2_06.txt, 2_07.txt, 2_08.txt, 2_09.txt, 2_10.txt, 2_11.txt, 2_12.txt
Case Name Status Exec Time Memory
0_00.txt RE 6 ms 548 KB
0_01.txt RE 3 ms 556 KB
0_02.txt RE 3 ms 548 KB
0_03.txt RE 3 ms 548 KB
1_00.txt RE 3 ms 548 KB
1_01.txt RE 3 ms 548 KB
1_02.txt RE 3 ms 548 KB
1_03.txt RE 3 ms 548 KB
1_04.txt RE 3 ms 548 KB
1_05.txt RE 3 ms 548 KB
1_06.txt RE 3 ms 556 KB
1_07.txt RE 3 ms 548 KB
1_08.txt RE 3 ms 548 KB
1_09.txt RE 3 ms 552 KB
1_10.txt RE 3 ms 548 KB
2_00.txt RE 3 ms 548 KB
2_01.txt RE 3 ms 548 KB
2_02.txt RE 3 ms 548 KB
2_03.txt RE 3 ms 556 KB
2_04.txt RE 3 ms 548 KB
2_05.txt RE 3 ms 548 KB
2_06.txt RE 3 ms 556 KB
2_07.txt RE 3 ms 556 KB
2_08.txt RE 3 ms 548 KB
2_09.txt RE 3 ms 544 KB
2_10.txt RE 3 ms 548 KB
2_11.txt RE 3 ms 548 KB
2_12.txt RE 3 ms 548 KB