首页 > 小红的二叉树
头像 CARLJOSEPHLEE
发表于 2025-03-10 22:49:02
n = int(input()) if n == 1: print(0) else: pow1 = pow(2,n-1,1000000007) print((3*pow1-5)%1000000007)
头像 努力努力zzb
发表于 2025-04-04 21:10:28
shendu2 =input() shendu=int(shendu2) MOD=10**9+7 if shendu==1: print(0) else: ZHILI=pow(2,shendu-1,MOD) BABA=3*ZHILI-5 daan=BABA%MOD 展开全文
头像 ading007
发表于 2025-05-23 14:30:17
package main import ( "fmt" ) const mod float64 = 1e9+7 func main() { var h int fmt.Scan(&h) cnt := 0 if h > 1 展开全文
头像 lhp_zml
发表于 2025-03-10 13:46:03
// 从深度为2开始,当前叶子节点为2个。每加一层,每个叶子节点会增加三条路径 #include<bits/stdc++.h> using namespace std; const int mod=1e9+7; int n; int main(){ cin>>n; 展开全文
头像 我没拿98k
发表于 2025-04-03 16:23:50
n=int(input()) if n==1: print(0) else: print((3*2**(n-1)-5)%(10**9+7)) 数学问题(3*pow(2,n-1)) - 5
头像 屁颠屁颠の父
发表于 2025-03-13 15:33:18
depth = int(input()) dp = [0] * depth dp[0] = 0 if depth == 1: print(dp[0]) elif depth == 2: dp[1] = 1 print(dp[1]) else: dp[1] = 1 展开全文
头像 你吃了码
发表于 2025-03-10 16:40:19
import sys deep=int(input().strip()) def f(d): res1=0 res2=0 p1=0 p2=0 if d <=1: return 0 if d==2: return 展开全文
头像 牛客210380430号
发表于 2025-04-14 16:52:46
# import math n=int(input()) if n==1: print(0) else: # nl=int(math.pow(2,n-1)-1) print((3*(2**(n-1)-1)-2)%((10**9)+7))
头像 楚云杰
发表于 2025-03-17 22:08:33
while True: try: n = int(input()) if n == 1: print(0) elif n == 2: print(1) else: 展开全文
头像 番禺小韭菜
发表于 2025-03-05 21:50:38
#include <iostream> #include <vector> using namespace std; int main() { constexpr int MOD = 1e9+7; int n; cin >> n; vec 展开全文