Submission #1131225
Source Code Expand
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e6+10;
int main(){
DRI(n);
VI d;
REP(i,n){
DRI(x);
d.PB(x);
}
int lt=1;
int now=1;
LL an=1;
REPP(i,1,n){
if(d[i]==lt+1)an=an*(now+1)%MOD;
else{
now++;
lt+=2;
}
}
REPP(i,1,now+1)an=an*i%MOD;
cout<<an<<endl;
return 0;
}
Submission Info
Submission Time
2017-02-25 21:12:42+0900
Task
A - Robot Racing
User
dreamoon
Language
C++14 (GCC 5.4.1)
Score
900
Code Size
1415 Byte
Status
AC
Exec Time
13 ms
Memory
892 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:32:11: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
DRI(n);
^
./Main.cpp:35:15: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
DRI(x);
^
Judge Result
Set Name
Sample
Subtask
All
Score / Max Score
0 / 0
500 / 500
400 / 400
Status
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
AC
8 ms
764 KB
0_01.txt
AC
1 ms
256 KB
0_02.txt
AC
1 ms
256 KB
0_03.txt
AC
1 ms
256 KB
1_00.txt
AC
1 ms
256 KB
1_01.txt
AC
1 ms
256 KB
1_02.txt
AC
1 ms
256 KB
1_03.txt
AC
1 ms
256 KB
1_04.txt
AC
1 ms
256 KB
1_05.txt
AC
1 ms
256 KB
1_06.txt
AC
1 ms
256 KB
1_07.txt
AC
1 ms
256 KB
1_08.txt
AC
1 ms
256 KB
1_09.txt
AC
1 ms
256 KB
1_10.txt
AC
1 ms
256 KB
2_00.txt
AC
11 ms
892 KB
2_01.txt
AC
11 ms
892 KB
2_02.txt
AC
13 ms
892 KB
2_03.txt
AC
11 ms
892 KB
2_04.txt
AC
11 ms
892 KB
2_05.txt
AC
11 ms
892 KB
2_06.txt
AC
11 ms
892 KB
2_07.txt
AC
11 ms
892 KB
2_08.txt
AC
11 ms
892 KB
2_09.txt
AC
11 ms
892 KB
2_10.txt
AC
11 ms
892 KB
2_11.txt
AC
13 ms
892 KB
2_12.txt
AC
13 ms
892 KB