Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long int solutie(int putere)
- {
- long long int solutie=3;
- long long int R=1;
- while(putere)
- {
- if(putere%2==1)
- R*=solutie;
- solutie*=solutie;
- putere/=2;
- }
- return R;
- }
- int main()
- {
- int n;
- cin>>n;
- int putere=n*(n-1)/2;
- cout<<solutie(putere);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement