Submission #2042349


Source Code Expand

#include<cstdio>
using namespace std;
long long m,v[100001];
long long ans=1,cnt=0,p=0,k=1;
int main()
{
	freopen("robot.in","r",stdin);
	freopen("robot.out","w",stdout);
	scanf("%lld",&m);
	for(int i=1;i<=m;i++)
	{
	scanf("%lld",&v[i]);
	int z=(v[i-1]+1)/2-(i-1);
	while(z<p)
	{
		ans=ans*cnt%1000000007;
		cnt--;
		p--;
		k++;
	}
	cnt++;
	}
	for(;k<=m;k++)
	ans=ans*(cnt--)%1000000007;
	printf("%lld",ans);
	fclose(stdin);
	fclose(stdout);
}

Submission Info

Submission Time
Task A - Robot Racing
User vjudge5
Language Bash (GNU bash v4.3.11)
Score 0
Code Size 443 Byte
Status RE
Exec Time 3 ms
Memory 576 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 3 ms 568 KB
0_01.txt RE 3 ms 572 KB
0_02.txt RE 3 ms 572 KB
0_03.txt RE 3 ms 572 KB
1_00.txt RE 3 ms 576 KB
1_01.txt RE 3 ms 572 KB
1_02.txt RE 3 ms 568 KB
1_03.txt RE 3 ms 572 KB
1_04.txt RE 3 ms 572 KB
1_05.txt RE 3 ms 572 KB
1_06.txt RE 3 ms 568 KB
1_07.txt RE 3 ms 572 KB
1_08.txt RE 3 ms 568 KB
1_09.txt RE 3 ms 572 KB
1_10.txt RE 3 ms 572 KB
2_00.txt RE 3 ms 572 KB
2_01.txt RE 3 ms 576 KB
2_02.txt RE 3 ms 572 KB
2_03.txt RE 3 ms 572 KB
2_04.txt RE 3 ms 572 KB
2_05.txt RE 3 ms 568 KB
2_06.txt RE 3 ms 572 KB
2_07.txt RE 3 ms 572 KB
2_08.txt RE 3 ms 572 KB
2_09.txt RE 3 ms 568 KB
2_10.txt RE 3 ms 572 KB
2_11.txt RE 3 ms 572 KB
2_12.txt RE 3 ms 572 KB