国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

快速冪_2017 NOIP普及組 程序填空第1題

2023-07-31 21:08 作者:windowsxpw  | 我要投稿

#include<bits/stdc++.h>

#define int unsigned long long

#pragma GCC optimize(2)

using namespace std;

int fastPower(int base, int exponent) {

? ? if (!exponent) {

? ? ? ? return 1;

? ? } else if (exponent==1) {

? ? ? ? return base;

? ? } else {

? ? ? ? long long half = fastPower(base, exponent>>1);

? ? ? ? if (!(exponent&1)){

? ? ? ? ? ? return half * half;

? ? ? ? } else {

? ? ? ? ? ? return half * half * base;

? ? ? ? }

? ? }

}

signed main(){

? ? int a,b;

? ? cin>>a>>b;

? ? cout<<fastPower(a,b);

? ? return 0;

}

雖說(shuō)遞歸但還是o(logn)

快速冪_2017 NOIP普及組 程序填空第1題的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
涟水县| 综艺| 和平区| 临桂县| 龙门县| 满城县| 泊头市| 平谷区| 平凉市| 郴州市| 香格里拉县| 滨州市| 吉隆县| 青浦区| 淮滨县| 赤水市| 蒲城县| 洛浦县| 宝坻区| 冕宁县| 绥江县| 石屏县| 息烽县| 紫云| 库车县| 治多县| 康乐县| 八宿县| 双柏县| 红原县| 大渡口区| 花垣县| 砀山县| 延寿县| 新巴尔虎右旗| 丰都县| 漳州市| 阿巴嘎旗| 临湘市| 宝应县| 霍城县|