제출 #1011738

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10117382024-07-01 07:53:43dimashhh순열 (APIO22_perm)C++17
0 / 100
0 ms348 KiB
#include "perm.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[150];
ll K;
ll calc(vector<int> x){
ll S = 1;
for(int i = 0;i < (int)x.size();i++){
dp[i] = 1;
for(int j = i - 1;j >= 0;j--){
if(x[j] < x[i]){
dp[i] += dp[j];
if(dp[i] > K) return K + 1;
}
}
S += dp[i];
if(S > K) return K + 1;
}
return S;
}
vector<int> ins(vector<int> &x,int a){
vector<int> ret = x;
for(int i = 0;i < (int)ret.size();i++){
if(ret[i] >= a){
ret[i]++;
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

perm.cpp: In function 'std::vector<int> solve(ll, ll, std::vector<int>)':
perm.cpp:56:16: warning: 'pos' may be used uninitialized in this function [-Wmaybe-uninitialized]
   56 |   a = ins(a,pos);
      |                ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...