Submission #6215670


Source Code Expand

Copy
#include<iostream>
#include<string>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
const long long int M = 1e9 + 7, MAX_N = 2010;
int C[MAX_N][MAX_N];

int main(){
  C[0][0] = 1;
  for(int i = 1; i < MAX_N; i++){
    for(int j = 0; j <= i; j++){
      if(j - 1 >= 0) C[i][j] = C[i - 1][j - 1] + C[i - 1][j] % M;
      else C[i][j] = C[i - 1][j];
    }
  }
  int N, K; cin >>N >>K;
  for(int i = 1; i <= K; i++){
    long long int r = i, n = N - K + 1;
    long long int ans = C[n][r];
    for(long long int j = 0; j < K - i; j++) ans = ans * i % M;
    cout <<ans <<endl;
  }
  return 0;
}

Submission Info

Submission Time
Task D - Blue and Red Balls
User unigiri
Language C++14 (GCC 5.4.1)
Score 0
Code Size 641 Byte
Status
Exec Time 21 ms
Memory 15104 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
× 2
× 6
× 8
Set Name Test Cases
Sample 01.txt, 02.txt
All 01.txt, 02.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt
Case Name Status Exec Time Memory
01.txt 8 ms 15104 KB
02.txt 8 ms 15104 KB
11.txt 9 ms 15104 KB
12.txt 8 ms 15104 KB
13.txt 9 ms 15104 KB
14.txt 8 ms 15104 KB
15.txt 8 ms 15104 KB
20.txt 8 ms 15104 KB
21.txt 15 ms 15104 KB
22.txt 21 ms 15104 KB
23.txt 21 ms 15104 KB
24.txt 8 ms 15104 KB
25.txt 11 ms 15104 KB
26.txt 16 ms 15104 KB