제출 #231662

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2316622020-05-14 09:56:31crimsonredSolar Storm (NOI20_solarstorm)C++17
100 / 100
516 ms193160 KiB
#include <bits/stdc++.h>
using namespace std;
#define mod 1'000'000'007
typedef long long ll;
template<typename T>
void deb(initializer_list<T> l)
{
for (auto &e : l)
cout << e << ' ';
cout << endl;
}
ll n, s, k;
vector<ll> coord, a, parents, leftx, rightx, pref;
vector<vector<ll>> adj;
ll mx = 0;
pair<ll, ll> ans;
void dfs(ll u, ll parent, vector<ll>& stk)
{
stk.push_back(u);
for (auto &v : adj[u])
if (v != parent)
dfs(v, u, stk);
ll ancestor = stk.size() >= s ? stk[stk.size() - s] : stk[0];
// [u, ancestor]
ll sum = pref[rightx[ancestor]] - (leftx[u] ? pref[leftx[u] - 1] : 0);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

SolarStorm.cpp: In function 'void dfs(ll, ll, std::vector<long long int>&)':
SolarStorm.cpp:28:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  ll ancestor = stk.size() >= s ? stk[stk.size() - s] : stk[0];
                ~~~~~~~~~~~^~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...