Submission #293047

#TimeUsernameProblemLanguageResultExecution timeMemory
293047Leonardo16Split the Attractions (IOI19_split)C++14
Compilation error
0 ms0 KiB
/// Code by Leonardo16 /// “Your focus determines your reality.” – Qui-Gon Jinn #include<bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //#pragma GCC option("arch=native","tune=native","no-zero-upper") //#pragma GCC target("avx2") //#define int long long #define ll long long #define sz size #define ull unsigned long long #define ld long double #define ii pair<int,int> #define fst first #define scd second #define vi vector<int> #define vii vector<ii> #define pb push_back #define pf push_front #define fl '\n' #define el endl #define all(x) x.begin() , x.end() #define rall(x) x.rbegin() , x.rend() /// Functions #define db(x) cerr << #x << ": " << (x) << '\n'; #define random() __builtin_ia32_rdtsc() #define lg2(x) 31-__builtin_clz(x) #define lg2ll(x) 63-__builtin_clzll(x) #define pi acos(-1) #define YN(x) cout<<((x)?("YES"):("NO"))<<fl; #define yn(x) cout<<((x)?("Yes"):("No"))<<fl; #define des(x,s1,s2,end1,end2) cout<<((x)?(s1):(s2))<<fl;if(x){end1;}else{end2;} #define precision(x) cout.setf(ios::fixed);cout.precision(x); /// Red-Black Tree Template //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> //using namespace __gnu_pbds; //typedef tree < long long , null_type , less<long long> , rb_tree_tag , tree_order_statistics_node_update > ordered_set; //#define less_than(n) order_of_key(n) //#define en_pos(n) find_by_order(n) /// Prime numbers 173,179,311,331,737,1009,2011,2027,3079,4001,100003 ///===================================================================== vi g[200005]; vector<int>v; bool mk[200005]; int n,a,b,c; void dfs(int u){ if(v.sz()<b)v.pb(u); else return; mk[u]=true; for(auto v:g[u]){ if(mk[v])continue; dfs(v); } } int* find_split(int nn,int aa,int bb,int cc,int p[],int q[]){ n=nn;a=aa;b=bb;c=cc; static int sol[200005]; for(int i=0;i<n;i++){ sol[i]=0; } for(int i=0;i<=sizeof(p);i++){ g[p[i]].pb(q[i]); g[q[i]].pb(p[i]); } dfs(0); for(auto it:v){ sol[it]=2; } for(int i=0;i<n;i++){ if(sol[i]==0){ sol[i]=1; break; } } for(int i=0;i<n;i++){ if(sol[i]==0){ sol[i]=3; } } return sol; } main(){ ios_base::sync_with_stdio(0);cin.tie(0); // int p[]= {0, 0, 0, 0, 0, 0, 1, 3, 4, 5}; // int q[]= {1, 2, 3, 4, 6, 8, 7, 7, 5, 6}; // // int *sol=find_split(9, 1, 4, 3,p,q); // for(int i=0;i<n;i++){ // cout<<*(sol+i)<<" "; // } }

Compilation message (stderr)

split.cpp: In function 'void dfs(int)':
split.cpp:49:14: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   49 |     if(v.sz()<b)v.pb(u);
      |        ~~~~~~^~
split.cpp: In function 'int* find_split(int, int, int, int, int*, int*)':
split.cpp:67:28: warning: 'sizeof' on array function parameter 'p' will return size of 'int*' [-Wsizeof-array-argument]
   67 |     for(int i=0;i<=sizeof(p);i++){
      |                            ^
split.cpp:59:49: note: declared here
   59 | int* find_split(int nn,int aa,int bb,int cc,int p[],int q[]){
      |                                             ~~~~^~~
split.cpp:67:18: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare]
   67 |     for(int i=0;i<=sizeof(p);i++){
      |                 ~^~~~~~~~~~~
split.cpp: At global scope:
split.cpp:91:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   91 | main(){
      |      ^
/tmp/ccazIdno.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc47esSn.o:split.cpp:(.text.startup+0x0): first defined here
/tmp/ccazIdno.o: In function `main':
grader.cpp:(.text.startup+0x265): undefined reference to `find_split(int, int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status