Submission #1440481


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n, a[100005];
int main() {
	scanf("%d", &n);
	for( int i = 0; i < n; i++ ) scanf("%d", &a[i]);
	int ans = 1, t = 0;
	for( int i = 0; i < n; i++ ){
		while( t<n && a[t] > (t-i)*2 ) t++;
		if( t<n && a[t]==(t-i)*2 ) t++;
		ans = 1LL*ans*(t-i)%mod;
	}
	printf("%d\n", ans);
	ansurn 0;
}

Submission Info

Submission Time
Task A - Robot Racing
User Leokery
Language C++14 (GCC 5.4.1)
Score 0
Code Size 375 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:15:2: error: ‘ansurn’ was not declared in this scope
  ansurn 0;
  ^
./Main.cpp:6:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
                 ^
./Main.cpp:7:49: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  for( int i = 0; i < n; i++ ) scanf("%d", &a[i]);
                                                 ^