Submission #312492

#TimeUsernameProblemLanguageResultExecution timeMemory
312492mohamedsobhi777Mouse (info1cup19_mouse)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include<bits/stdc++.h> using namespace std ; int n, num ; vector<int> per, ans ; int main(){ ios_base::sync_with_stdio(0) ; cin.tie(0) ; //freopen("in.in" , "r" , stdin) ; cin >> n; for(int i = 1;i <= n ; ++ i){ ans.push_back(i) ; } for(int i = 0 ;i < n; ++ i){ int x ; cin >> x ; per.push_back(x) ; } random_shuffle(ans.begin() , ans.end()) ; srand(time(0)) ; int tim = 0 ; int las = 0 ; while(tim ++ < 1000000){ int x = rand() % n ; int y = rand() % n; if(x == y)continue ; swap(ans[x],ans[y]) ; int now = query(ans) ; if(now < las)swap(ans[x],ans[y]) ; las = max(las , now) ; if(now == n) break ; } return 0 ; if(las == n) cout<<"ok " << num ; else cout<<"incorrect" ; return 0 ; }

Compilation message (stderr)

/tmp/cc27iUb6.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccgbMg4o.o:mouse.cpp:(.text.startup+0x0): first defined here
/tmp/cc27iUb6.o: In function `main':
grader.cpp:(.text.startup+0x28): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status