Submission #1085761

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10857612024-09-08 16:10:39alexander707070Game (APIO22_game)C++17
60 / 100
4061 ms50432 KiB
#include<bits/stdc++.h>
#define MAXN 300007
using namespace std;
const int bucket_sz=500;
int n,k,bucket[MAXN];
int from[MAXN],to[MAXN];
int mins[MAXN],maxs[MAXN];
int li[MAXN],tim,cnt[MAXN];
vector<int> v[MAXN],r[MAXN],news;
void init(int N,int K){
n=N; k=K;
for(int i=1;i<=k;i++){
bucket[i]=i/bucket_sz+1;
}
for(int i=1;i<=k;i++){
mins[i]=maxs[i]=bucket[i];
from[i]=to[i]=i;
}
for(int i=k+1;i<=n;i++){
from[i]=n+1; to[i]=0;
mins[i]=800; maxs[i]=0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

game.cpp: In function 'int dfs(int, int, int)':
game.cpp:55:27: warning: division by zero [-Wdiv-by-zero]
   55 |     if(cnt[x]>1100)cout<<1/0;
      |                          ~^~
game.cpp:57:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |     for(int i=0;i<v[x].size();i++){
      |                 ~^~~~~~~~~~~~
game.cpp: In function 'int dfs2(int, int, int)':
game.cpp:87:27: warning: division by zero [-Wdiv-by-zero]
   87 |     if(cnt[x]>1100)cout<<1/0;
      |                          ~^~
game.cpp:89:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   89 |     for(int i=0;i<r[x].size();i++){
      |                 ~^~~~~~~~~~~~
game.cpp: In function 'void dfs3(int)':
game.cpp:106:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  106 |     for(int i=0;i<v[x].size();i++){
      |                 ~^~~~~~~~~~~~
game.cpp: In function 'int dfs4(int)':
game.cpp:123:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  123 |     for(int i=0;i<r[x].size();i++){
      |                 ~^~~~~~~~~~~~
#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...