竞赛
考级
一只CR400BF-5033
#include<bits/stdc++.h> using namespace std; #define cai int #define ji for #define libulihainijige if #define libulihainikunge else #define liangnianban return #define beidaiku cin #define basketball cout cai ikun(cai ngm){ cai taimei=0; ji(cai music=ngm/2;music>=0;music--){ libulihainijige(music>1) { taimei+=ikun(music); }libulihainikunge{ taimei+=1; } } liangnianban taimei; } cai main() { cai chicken; beidaiku>>chicken; basketball<<ikun(chicken); liangnianban 0; }
只莹
耐高总冠军 张文杰
#include<bits/stdc++.h> using namespace std; int ikun(int n) { int sum = 0; for (int i = n / 2; i >= 0; i--) { if (i > 1) { sum += ikun(i); } else { sum += 1; } } return sum; } int main() { int n; cin>>n; cout<<ikun(n); return 0; }
🕈.👎.☝✌💧❄☜☼
#include<bits/stdc++.h> using namespace std; int kun(int n){ int ans = 0; for(int i = n / 2;i >= 0;i--){ if(i > 1) ans += kun(i); else ans += 1; } return ans; } int main(){ int n; cin >> n; cout << kun(n); return 0; }
手持剑,刺锋芒
#include <bits/stdc++.h> using namespace std; int x; int ans=1; void kun(int x) { if(x<2) return; for(int i=1;i<=x/2;i++) { ans++; kun(i); } } void work() { cin>>x; kun(x); cout<<ans; } int main() { work(); return 0; }
Voldemort
#include<iostream> using namespace std; int topikun=114514; int main(){ int kunn,kun[topikun]={0,1,2,2}; cin>>kunn; for(int cxk=4;cxk<=kunn;cxk++){ if(cxk%2==0) kun[cxk]=kun[cxk-1]+kun[cxk/2]; else kun[cxk]=kun[cxk-1]; } cout<<kun[kunn]; }
准
#include<bits/stdc++.h> using namespace std; int ikun(int n){ int sum = 0; for (int i = n / 2; i >= 0; i--) { if (i > 1) { sum += ikun(i); } else { sum += 1; } } return sum; } int main() { int n; cin>>n; cout<<ikun(n); return 0; }
159****1573
#include<iostream> using namespace std; int cnt = 0; int jjjj(int x){ cnt++; if(x == 1) return 0; for(int i = 1;i <= x / 2;i++){ jjjj(i); } } int main(){ int n; cin >> n; jjjj(n); cout << cnt; return 0; }
DARK SPECTRE
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[n]; a[1]=1; a[2]=2; for(int i=3;i<=n;i++){ a[i]=1; for(int j=1;j<=i/2;j++) a[i]+=a[j]; } cout<<a[n]; return 0; }
风中雪zLyXj
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a[n]; a[1]=1; a[2]=2; for(int i=3;i<=n;i++) { a[i]=1; for(int j=1;j<=i/2;j++) { a[i]+=a[j]; } } cout<<a[n]; return 0; }
^
def count_sequences(n): dp = [0] * (n + 1) dp[1] = 1 for i in range(2, n + 1): dp[i] = 1 for j in range(1, i // 2 + 1): dp[i] += dp[j] return dp[n] n = int(input().strip()) print(count_sequences(n))
复仇者_龍乄
YuQing1919
代码如下🏀🏀🏀
元气满满
#include<bits/stdc++.h> using namespace std; int n;int arr[510]; int main(){ cin>>n; arr[0]=1;arr[1]=2; for(int i=2;i<=n;i++){ arr[i]=1; for(int j=1;j<=i/2;j++)arr[i]+=arr[j]; } cout<<arr[n]<<endl; return 0; }
苏言
#jikunde<jiba/stdc++.h> using namespace std; int main(){ jint jiba; kunin>>jiba; jint ji[jiba]; a[1]=1; a[2]=2; for(int i=3;i<=n;i++){ a[i]=1; for(int j=1;j<=i/2;j++) a[i]+=a[j]; } cout<<a[n]; return 0; }
胖猫
#include<bits/stdc++.h> #define ikun int using namespace std; ikun kun=1,kunge=2,kunkun=3,caixukun=0; ikun main(){ ikun cai; cin>>cai; ikun xu[cai]; xu[kun]=kun; xu[kunge]=kunge; for(ikun ji=kunkun;ji<=cai;ji++){ xu[ji]=kun; for(ikun zhiyin=kun;zhiyin<=ji/kunge;zhiyin++) xu[ji]+=xu[zhiyin]; } cout<<xu[cai]; return caixukun; }
卡布叻·琉璃
#include<bits/stdc++.h> using namespace std; int ikun(int n){ if(n==0) return 1; int ans=0; for(int i=0;i<=n/2;i++){ ans+=ikun(i); } return ans; } int main(){ int n; cin>>n; cout<<ikun(n); return 0; }
法西斯玫瑰
共60条