QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#339144#1820. Contest ConstructionNYCU_CartesianTree#WA 0ms3624kbC++14814b2024-02-26 20:03:362024-02-26 20:03:37

Judging History

你现在查看的是最新测评结果

  • [2024-02-26 20:03:37]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3624kb
  • [2024-02-26 20:03:36]
  • 提交

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