Submission #1081765

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10817652024-08-30 10:14:05KALARRYBitaro’s Party (JOI18_bitaro)C++14
14 / 100
212 ms40908 KiB
//chockolateman
#include<bits/stdc++.h>
using namespace std;
int S = 20;
int N,M,Q,cur_dp[100005];
vector<pair<int,int>> dp[100005];
vector<int> adj_rev[100005];
bool visited[100005],prohibited[100005];
vector<pair<int,int>> temp;
void dfs(int v)
{
if(visited[v])
return;
visited[v] = true;
temp.push_back({-1,-1});
temp.push_back({0,v});
for(auto u : adj_rev[v])
{
dfs(u);
for(auto x : dp[u])
if(x.first != -1)
temp.push_back({x.first+1,x.second});
}
sort(temp.begin(),temp.end(),greater<pair<int,int>>());
for(int i = 0 ; i <= min(S,(int)(temp.size()-1)) ; i++)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bitaro.cpp: In function 'int main()':
bitaro.cpp:53:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   53 |     scanf("%d%d%d",&N,&M,&Q);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
bitaro.cpp:56:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   56 |         scanf("%d%d",&a,&b);
      |         ~~~~~^~~~~~~~~~~~~~
bitaro.cpp:64:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   64 |         scanf("%d%d",&t,&y);
      |         ~~~~~^~~~~~~~~~~~~~
bitaro.cpp:67:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   67 |             scanf("%d",&a);
      |             ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...