标签:cin clu typedef color TE include i++ mes int
n=1 --> ans = 2 = 1*2 = 2^0(2^0+1)
#include<bits/stdc++.h> using namespace std; typedef long long ll; int solve(ll a, ll b) { ll ans = 1; a %= 100; while(b) { if(b&1) ans = ans *a % 100; b /= 2; a = a * a % 100; } return ans; } int main() { int t; while(cin >> t && t) { for(int i = 1; i <= t; i++) { ll n; cin >> n; n = solve(2, n-1); printf("Case %d: %d\n", i, (n*(n+1))%100); } printf("\n"); } return 0; }
标签:cin clu typedef color TE include i++ mes int
原文地址:https://www.cnblogs.com/kindleheart/p/9189402.html