結果
問題 | No.378 名声値を稼ごう |
ユーザー |
![]() |
提出日時 | 2016-06-17 22:24:20 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 190 bytes |
コンパイル時間 | 1,210 ms |
コンパイル使用メモリ | 157,016 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 13:53:00 |
合計ジャッジ時間 | 1,664 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:12:13: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘int’ [-Wformat=] 12 | printf("%ld\n", total); | ~~^ ~~~~~ | | | | | int | long int | %d main.cpp:5:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%ld", &N); | ~~~~~^~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>int main() {long N;scanf("%ld", &N);int total = N * 2;do {total -= N;N /= 2;} while( N != 0 );printf("%ld\n", total);return 0;}