# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1121940 | vjudge1 | Calvinball championship (CEOI15_teams) | C++17 | 66 ms | 65536 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/**
██╗░░██╗████████╗██╗░░░░░███╗░░░███╗
██║░░██║╚══██╔══╝██║░░░░░████╗░████║
███████║░░░██║░░░██║░░░░░██╔████╔██║
██╔══██║░░░██║░░░██║░░░░░██║╚██╔╝██║
██║░░██║░░░██║░░░███████╗██║░╚═╝░██║
╚═╝░░╚═╝░░░╚═╝░░░╚══════╝╚═╝░░░░░╚═╝
**/
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define int l
#define f first
#define stop system("pause")
#define ara <<" "<<
#define s second
#define endl '\n'
#define l long long
#define pb push_back
#define pairs pair<l,l>
#define all(v) v.begin(),v.end()
#define yesno(v) ((v) ? "YES" : "NO")
#define dbg(x) cout<<#x<<" = "<<x<<endl;
#define filereader() ifstream cin(input);
#define fileprinter() ofstream cout(output);
#define fast ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int> , rb_tree_tag, tree_order_statistics_node_update> indexed_set;
l gcd(l a, l b){
return (b == 0) ? a : gcd(b, a%b);
}
const l N = 1e4 + 5;
const l INF = 1e18;
const l mod = 1e6 + 7;
const string input = "input.txt";
const string output = "output.txt";
l dp[N][N];
void solve(){
//ifstream cin(input);
//ofstream cout(output);
l n;
cin >> n;
l a[n];
//set<l>s;
for(int i = 0 ; i < n ; i++){
cin>>a[i];a[i]--;
}
dp[0][0] = 1;
for(int i = 1; i <= n ; i++){
for(int j = 1; j <= n; j++){
dp[i][j] = ((dp[i-1][j] * (j)) % mod + dp[i-1][j-1]) % mod;
}
}
/*
3
0 1 1
*/
l ans = 0;
for(int i = 1 ; i <= n ; i++){
ans = (ans + dp[n][i]) % mod;
}
cout<<ans<<endl;
}
signed main(){
//fast;
system("color a");
l n = 1;
//cin>>n;
while(n--){
solve();
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |