提出 #31121468


ソースコード 拡げる

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  long long ans = 0;
  for (int i = 0, t; i < N; i++) {
    cin >> t;
    long long pt = 1LL << t;
    ans = (ans / pt + 1) * pt;
    if (ans % (pt * 2) == 0) ans += pt;
  }
  cout << ans << "\n";
}

提出情報

提出日時
問題 A - Trailing Zeros
ユーザ Nyaan
言語 C++ (GCC 9.2.1)
得点 300
コード長 290 Byte
結果 AC
実行時間 25 ms
メモリ 3628 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 4
AC × 18
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 02_max_00.txt, 02_max_01.txt, 03_min_00.txt, 03_min_01.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 7 ms 3532 KiB
00_sample_01.txt AC 2 ms 3564 KiB
00_sample_02.txt AC 4 ms 3524 KiB
00_sample_03.txt AC 2 ms 3384 KiB
01_random_00.txt AC 25 ms 3448 KiB
01_random_01.txt AC 19 ms 3520 KiB
01_random_02.txt AC 20 ms 3524 KiB
01_random_03.txt AC 18 ms 3560 KiB
01_random_04.txt AC 19 ms 3580 KiB
01_random_05.txt AC 20 ms 3628 KiB
01_random_06.txt AC 19 ms 3576 KiB
01_random_07.txt AC 24 ms 3564 KiB
01_random_08.txt AC 19 ms 3384 KiB
01_random_09.txt AC 19 ms 3512 KiB
02_max_00.txt AC 24 ms 3620 KiB
02_max_01.txt AC 19 ms 3592 KiB
03_min_00.txt AC 18 ms 3580 KiB
03_min_01.txt AC 25 ms 3516 KiB