QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#339144 | #1820. Contest Construction | NYCU_CartesianTree# | WA | 0ms | 3624kb | C++14 | 814b | 2024-02-26 20:03:36 | 2024-02-26 20:03:37 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N = 55;
int a[N];
int dp[N][N][20];
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n, k;
cin >> n >> k;
for(int i = 0; i < n; i++){
cin >> a[i];
}
sort(a, a + n);
int ans = 0;
for(int i = 0; i < n; i++){
for(int j = i + 1; j < n; j++){
for(int s = 2; s < k; s++){
if(s == 2){
dp[i][j][s] = 1;
}
for(int t = j + 1; t < n; t++){
if(a[i] + a[j] >= a[t]){
dp[j][t][s + 1] += dp[i][j][s];
}
}
}
ans += dp[i][j][k];
}
}
cerr << ans << '\n';
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3624kb
input:
5 4 2 1 4 3 5
output:
result:
wrong output format Unexpected end of file - token expected