結果
| 問題 | No.589 Counting Even |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-08-26 21:14:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 279 bytes |
| 記録 | |
| コンパイル時間 | 1,444 ms |
| コンパイル使用メモリ | 161,120 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-08-26 21:14:24 |
| 合計ジャッジ時間 | 2,815 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%lld",&n);
| ~~~~~^~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
#define FL(i,a,b) for(int i=(a);i<=(b);i++)
#define FR(i,a,b) for(int i=(a);i>=(b);i--)
#define ll long long
using namespace std;
ll n;
signed main(){
scanf("%lld",&n);
ll t=n,res=1;
while(t){
if(t&1) res<<=1;
t>>=1;
}
printf("%lld\n",n+1-res);
}
vjudge1