Submission #72175018


Source Code Expand

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#include <atcoder/all>
#define DEBUG_PRINT(x) std::cerr << #x << ": " << (x) << std::endl
#define SQUARED(x) ((x) * (x))
#define CUBED(x) ((x) * (x) * (x))
#define CEIL(x, y) ((x + y - 1) / y)
#define FLOOR(x, y) (x / y)
#define CTOI(c) ((c) - '0')
#define CHECK_HW(h, w) (0 <= h and h < H and 0 <= w and w < W)

using namespace std;
using namespace atcoder;

const long long INF = 1e15;
const long double EPS = 1e-8;

long long int_pow(long long a, long long n)
{
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a;
    a = a * a;
    n >>= 1;
  }
  return res;
}

int main()
{
  long long N;
  std::scanf("%lld", &N);

  cout << int_pow(2, N) - 2 * N << endl;

  return 0;
}

Submission Info

Submission Time
Task A - 2^n - 2*n
User hajime0316
Language C++23 (GCC 15.2.0)
Score 100
Code Size 745 Byte
Status AC
Exec Time 1 ms
Memory 3816 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 11
Set Name Test Cases
Sample 01.txt, 02.txt, 11.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt
Case Name Status Exec Time Memory
01.txt AC 1 ms 3752 KiB
02.txt AC 1 ms 3704 KiB
03.txt AC 1 ms 3752 KiB
04.txt AC 1 ms 3816 KiB
05.txt AC 1 ms 3704 KiB
06.txt AC 1 ms 3612 KiB
07.txt AC 1 ms 3816 KiB
08.txt AC 1 ms 3816 KiB
09.txt AC 1 ms 3752 KiB
10.txt AC 1 ms 3748 KiB
11.txt AC 1 ms 3804 KiB