Cod sursa(job #1709206)

Utilizator UPT_sThorUPT sThor UPT_sThor Data 28 mai 2016 11:16:55
Problema Twoton Scor 0
Compilator cpp Status done
Runda ONIS 2016 - Runda - 2 - ACM ICPC Romanian Programming Contest Marime 0.41 kb
#include <fstream>
#include <iostream>

using namespace std;

ifstream f ( "twoton.in" );
ofstream g ( "twoton.out" );

int a[100005];

int main()
{
  int n;
  f>>n;
  for (int i = 0; i < n; ++i) {
    f>>a[i];
  }

   long long N = 2;
   long long Sol = 1;

   for (int i = 1; i <= n ; i*= 2 ){
      if ( n&i)
      Sol = ( 1LL * Sol * N);
      N = ( 1LL* N * N );
      }
   Sol--;
   g << Sol  ;
   return 0;


}