結果

問題 No.737 PopCount
ユーザー ei1333333ei1333333
提出日時 2018-05-02 22:44:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 283 bytes
コンパイル時間 2,197 ms
コンパイル使用メモリ 193,912 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-20 09:18:14
合計ジャッジ時間 4,682 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
10,624 KB
testcase_01 AC 7 ms
5,376 KB
testcase_02 AC 7 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 6 ms
5,376 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;

int main() {
  int64 N;
  cin >> N;

  int64 ret = 0;
  for(int64 i = 1; i <= N; i++) {
    ret += 1LL * i * __builtin_popcountll(i) % mod;
    ret %= mod;
  }
  cout << ret << endl;
}
0