7
8
2015
0

XJOI 1515 猫猫的小鱼

#include <iostream>
using namespace std;

int main(){
	int n;
	cin>>n;
	while (n){
		long long x=1,ans=0,k;
		cin>>k;
		while (k){
			ans+=k%2*x;
			x*=3;
			k/=2;
		}
		cout<<ans<<endl;
		--n;
	}
	return 0;
}
Category: 题解 | Tags: XJOI 数学 | Read Count: 262

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com