結果
問題 |
No.1372 Median of Submasks
|
ユーザー |
|
提出日時 | 2021-02-05 22:37:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 711 bytes |
コンパイル時間 | 1,904 ms |
コンパイル使用メモリ | 193,992 KB |
最終ジャッジ日時 | 2025-01-18 12:42:53 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 TLE * 1 MLE * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <math.h> #include <iomanip> #include <cstdint> #include <string> #include <sstream> template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } #define rep(i,n) for (int i = 0; i < (n); ++i) typedef long long ll; using P=pair<ll,ll>; const int INF=1001001001; const int mod=1e9+7; int main() { ll N; cin>>N; vector<ll>res; for(ll j=N;j>0;j=(j-1)&N){res.push_back(j);} int n=res.size(); cout<<res[n/2]<<endl; return 0; }