Submission #755827

#TimeUsernameProblemLanguageResultExecution timeMemory
755827vjudge1A Huge Tower (CEOI10_tower)C++17
0 / 100
115 ms262144 KiB
///YOU WILL MAKE IT #include<bits/stdc++.h> using namespace std; const int N=1e5+4; long long MOD=1e9+9; long long memo[21][1<<21]; int y[N],n,d,p; long long dp(int i,int j){ //cout<<i<<" "<<j<<endl; if(__builtin_popcount(j)==n-1){ return 1; } if(memo[i][j]!=-1) return memo[i][j]; memo[i][j]=0; for(int h=0;h<n;h++){ //if(h==p) continue; if((!(j&(1<<h)))&&y[i]+d>=y[h]){ memo[i][j]+=dp(h,j^(1<<h)); memo[i][j]%=MOD; } } return memo[i][j]; } void solve(){ memset(memo,-1,sizeof(memo)); cin>>n>>d; for(int i=0;i<n;i++){ cin>>y[i]; } y[n]=1e9; long long ans=0; for(int i=0;i<n;i++){ } } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int t=1; // cin>>t; while(t--){ solve(); } } // Bac Math 2k24

Compilation message (stderr)

tower.cpp: In function 'void solve()':
tower.cpp:32:14: warning: unused variable 'ans' [-Wunused-variable]
   32 |    long long ans=0;
      |              ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...