Submission #1514736
Source Code Expand
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> #include<vector> #include<set> #include<string> #include<sstream> #include<cctype> #include<map> #include<stack> #include<queue> #include<cstdlib> #include<ctime> using namespace std; #define INF 0x3f3f3f3f typedef long long ll; int gcd(int a, int b){return b==0?a:gcd(b,a%b);} const int MOD = 1e9 + 7; int main() { // freopen("input1.txt", "r", stdin); // freopen("output.txt", "w", stdout); int n, x, k = 0; ll ans = 1; scanf("%d", &n); while(n--) { scanf("%d", &x); k++; if(x < 2 * k - 1) { ans = ans * k % MOD; k--; } } for(int i = 2; i <= k; i++) ans = ans * i % MOD; printf("%d\n", (int)ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Robot Racing |
User | vjudge1 |
Language | Bash (GNU bash v4.3.11) |
Score | 0 |
Code Size | 817 Byte |
Status | RE |
Exec Time | 17 ms |
Memory | 1268 KB |
Judge Result
Set Name | Sample | Subtask | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | 0 / 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 | RE | 17 ms | 1268 KB |
0_01.txt | RE | 2 ms | 504 KB |
0_02.txt | RE | 2 ms | 504 KB |
0_03.txt | RE | 2 ms | 504 KB |
1_00.txt | RE | 2 ms | 504 KB |
1_01.txt | RE | 2 ms | 504 KB |
1_02.txt | RE | 2 ms | 504 KB |
1_03.txt | RE | 2 ms | 504 KB |
1_04.txt | RE | 2 ms | 504 KB |
1_05.txt | RE | 2 ms | 504 KB |
1_06.txt | RE | 2 ms | 504 KB |
1_07.txt | RE | 2 ms | 504 KB |
1_08.txt | RE | 2 ms | 504 KB |
1_09.txt | RE | 2 ms | 504 KB |
1_10.txt | RE | 2 ms | 504 KB |
2_00.txt | RE | 2 ms | 504 KB |
2_01.txt | RE | 2 ms | 504 KB |
2_02.txt | RE | 2 ms | 504 KB |
2_03.txt | RE | 2 ms | 504 KB |
2_04.txt | RE | 2 ms | 504 KB |
2_05.txt | RE | 2 ms | 504 KB |
2_06.txt | RE | 2 ms | 504 KB |
2_07.txt | RE | 2 ms | 504 KB |
2_08.txt | RE | 2 ms | 504 KB |
2_09.txt | RE | 2 ms | 504 KB |
2_10.txt | RE | 2 ms | 504 KB |
2_11.txt | RE | 2 ms | 504 KB |
2_12.txt | RE | 2 ms | 504 KB |