답안 #649481

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
649481 2022-10-10T09:34:22 Z DangerNoodle7591 Binary Subsequences (info1cup17_binary) C++17
0 / 100
1 ms 340 KB
#include <iostream>
using namespace std;
#define mod 1000000007
long long int fast_pow(int x,int us){
	if(us==1){return x%mod;}
	int mid=us/2;
	long long a=fast_pow(x,mid)%mod;
	if(us%2==0) return (a*a)%mod;
	return (a*a*x)%mod;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;cin>>t;
	while(t--){
		int x;cin>>x;
		if(x==1){
			cout<<2<<"\n"<<-1<<"\n";
			continue;
		}
		cout<<fast_pow(2,x-1)%mod<<"\n"<<-1<<"\n";
	}
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -