Mujin Programming Challenge 2017

Submission #1514733

Source codeソースコード

#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, ans = 1, k = 0;
    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", ans);
    return 0;
}

Submission

Task問題 A - Robot Racing
User nameユーザ名 vjudge3
Created time投稿日時
Language言語 Bash (GNU bash v4.3.11)
Status状態 RE
Score得点 0
Source lengthソースコード長 805 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - 0_00.txt,0_01.txt,0_02.txt,0_03.txt
Subtask 0 / 500 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 / 400 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
0_00.txt RE
0_01.txt RE
0_02.txt RE
0_03.txt RE
1_00.txt RE
1_01.txt RE
1_02.txt RE
1_03.txt RE
1_04.txt RE
1_05.txt RE
1_06.txt RE
1_07.txt RE
1_08.txt RE
1_09.txt RE
1_10.txt RE
2_00.txt RE
2_01.txt RE
2_02.txt RE
2_03.txt RE
2_04.txt RE
2_05.txt RE
2_06.txt RE
2_07.txt RE
2_08.txt RE
2_09.txt RE
2_10.txt RE
2_11.txt RE
2_12.txt RE