Submission #1131277


Source Code Expand

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;

ll big = 1000000007ll;

ll n,m,q,T;

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("autput.txt","w",stdout);

    int c1,c2,c3,c4,c5;
    ll a,b,c,d;
    ll x,y;

    cin >> n;

    vector<ll> X;
    vector<ll> SP;
    vector<ll> PL;

    ll prev = 0;
    ll sum = 0;

    ll ans = 1;

    for(c1 = 0; c1 < n; c1++){
        cin >> a;
        X.push_back(a);
        sum += a-prev-1;
        SP.push_back(sum);
        PL.push_back(max(1ll , c1-sum));
        ans *= c1-PL[c1]+2;
        ans %= big;
        prev = a;
       // cout << c1-PL[c1]+2 << "\n";
    }

    cout << ans << "\n";

    return 0;
}

Submission Info

Submission Time
Task A - Robot Racing
User nigus
Language C++14 (GCC 5.4.1)
Score 0
Code Size 765 Byte
Status WA
Exec Time 44 ms
Memory 2912 KB

Judge Result

Set Name Sample Subtask All
Score / Max Score 0 / 0 0 / 500 0 / 400
Status
AC × 2
WA × 2
AC × 9
WA × 5
AC × 13
WA × 15
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 9 ms 764 KB
0_01.txt AC 1 ms 256 KB
0_02.txt WA 1 ms 256 KB
0_03.txt WA 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 WA 1 ms 256 KB
1_04.txt AC 1 ms 256 KB
1_05.txt AC 1 ms 256 KB
1_06.txt WA 1 ms 256 KB
1_07.txt WA 1 ms 256 KB
1_08.txt WA 1 ms 256 KB
1_09.txt AC 1 ms 256 KB
1_10.txt AC 1 ms 256 KB
2_00.txt WA 32 ms 2912 KB
2_01.txt AC 33 ms 2912 KB
2_02.txt AC 44 ms 2784 KB
2_03.txt WA 33 ms 2784 KB
2_04.txt WA 33 ms 2784 KB
2_05.txt WA 33 ms 2784 KB
2_06.txt WA 33 ms 2784 KB
2_07.txt WA 33 ms 2784 KB
2_08.txt WA 35 ms 2784 KB
2_09.txt WA 34 ms 2784 KB
2_10.txt WA 33 ms 2912 KB
2_11.txt AC 43 ms 2784 KB
2_12.txt AC 43 ms 2784 KB