제출 #819402

#제출 시각아이디문제언어결과실행 시간메모리
819402Alihan_8기지국 (IOI20_stations)C++17
0 / 100
682 ms544 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define pb push_back #define ln '\n' //#define int long long template <class _T> bool chmin(_T &x, const _T &y){ bool flag = false; if ( x > y ){ x = y; flag |= true; } return flag; } template <class _T> bool chmax(_T &x, const _T &y){ bool flag = false; if ( x < y ){ x = y; flag |= true; } return flag; } vector<int> label(int n, int k, vector<int> u, vector<int> v) { vector <int> ans(n); for ( int i = 0; i < n; i++ ){ ans[i] = i; } return ans; } int find_next_station(int s, int t, vector<int> c) { int bck = -1; auto in = [&](int s, int t){ int x = __lg(s), y = __lg(t); if ( x >= y ){ return false; } if ( s % 2 == 0 ){ if ( (s + 1) * (1ll << y - x) <= t ){ return false; } if ( (s * 2 + 1) * (1ll << y - x - 1) <= t ){ bck = s * 2 + 1; } else bck = s * 2; return true; } else{ if ( s * (1ll << y - x) > t ){ return false; } if ( (s * 2 + 1) * (1ll << y - x - 1) <= t ){ bck = s * 2 + 1; } else bck = s * 2; return true; } }; return in(s + 1, t + 1) ? bck - 1 : (s - 1) / 2; }

컴파일 시 표준 에러 (stderr) 메시지

stations.cpp: In lambda function:
stations.cpp:44:38: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   44 |             if ( (s + 1) * (1ll << y - x) <= t ){
      |                                    ~~^~~
stations.cpp:47:46: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   47 |             if ( (s * 2 + 1) * (1ll << y - x - 1) <= t ){
      |                                        ~~~~~~^~~
stations.cpp:52:32: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   52 |             if ( s * (1ll << y - x) > t ){
      |                              ~~^~~
stations.cpp:55:46: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   55 |             if ( (s * 2 + 1) * (1ll << y - x - 1) <= t ){
      |                                        ~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...