#pragma GCC diagnostic warning "-std=c++11"
#include <bits/stdc++.h>
#include "longesttrip.h"
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
#define flush fflush(stdout)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define pii pair<int,int>
using namespace std;
int n,m,T,k;
vector<int> longest_trip(int N, int D) {
vector<int> v;
int fix[N];
for (int i=0; i<N; i++) {
fix[i]=0;
}
vector<int> v1,v2;
for (int i=0; i<N; i++) {
for (int j=i+1; j<N; j++) {
vector<int> a,b; a.pb(i); b.pb(j);
if (!are_connected(a,b)) {
v1.pb(i); v2.pb(j);
fix[i]=1; fix[j]=1;
}
}
}
for (auto x:v1) v.pb(x);
for (int i=0; i<N; i++) if (!fix[i]) v.pb(i);
for (auto x:v2) v.pb(x);
return v;
}
Compilation message
longesttrip.cpp:1:32: warning: '-std=c++11' is not an option that controls warnings [-Wpragmas]
1 | #pragma GCC diagnostic warning "-std=c++11"
| ^~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
344 KB |
Output is correct |
2 |
Correct |
22 ms |
344 KB |
Output is correct |
3 |
Correct |
116 ms |
596 KB |
Output is correct |
4 |
Correct |
367 ms |
344 KB |
Output is correct |
5 |
Correct |
728 ms |
412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
344 KB |
Output is correct |
2 |
Correct |
25 ms |
344 KB |
Output is correct |
3 |
Correct |
133 ms |
344 KB |
Output is correct |
4 |
Correct |
357 ms |
344 KB |
Output is correct |
5 |
Correct |
689 ms |
412 KB |
Output is correct |
6 |
Correct |
6 ms |
340 KB |
Output is correct |
7 |
Correct |
27 ms |
344 KB |
Output is correct |
8 |
Correct |
126 ms |
344 KB |
Output is correct |
9 |
Correct |
265 ms |
592 KB |
Output is correct |
10 |
Correct |
692 ms |
408 KB |
Output is correct |
11 |
Correct |
749 ms |
412 KB |
Output is correct |
12 |
Correct |
751 ms |
408 KB |
Output is correct |
13 |
Correct |
736 ms |
408 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
344 KB |
Output is correct |
2 |
Correct |
26 ms |
344 KB |
Output is correct |
3 |
Correct |
122 ms |
344 KB |
Output is correct |
4 |
Correct |
383 ms |
344 KB |
Output is correct |
5 |
Correct |
732 ms |
412 KB |
Output is correct |
6 |
Correct |
7 ms |
344 KB |
Output is correct |
7 |
Correct |
25 ms |
344 KB |
Output is correct |
8 |
Correct |
137 ms |
344 KB |
Output is correct |
9 |
Correct |
308 ms |
344 KB |
Output is correct |
10 |
Correct |
681 ms |
416 KB |
Output is correct |
11 |
Correct |
680 ms |
412 KB |
Output is correct |
12 |
Correct |
686 ms |
412 KB |
Output is correct |
13 |
Correct |
683 ms |
412 KB |
Output is correct |
14 |
Incorrect |
1 ms |
344 KB |
Incorrect |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
344 KB |
Output is correct |
2 |
Correct |
26 ms |
344 KB |
Output is correct |
3 |
Partially correct |
137 ms |
344 KB |
Output is partially correct |
4 |
Partially correct |
341 ms |
344 KB |
Output is partially correct |
5 |
Partially correct |
712 ms |
412 KB |
Output is partially correct |
6 |
Correct |
9 ms |
512 KB |
Output is correct |
7 |
Correct |
25 ms |
344 KB |
Output is correct |
8 |
Partially correct |
109 ms |
344 KB |
Output is partially correct |
9 |
Partially correct |
263 ms |
592 KB |
Output is partially correct |
10 |
Partially correct |
700 ms |
408 KB |
Output is partially correct |
11 |
Partially correct |
723 ms |
416 KB |
Output is partially correct |
12 |
Partially correct |
712 ms |
416 KB |
Output is partially correct |
13 |
Partially correct |
710 ms |
600 KB |
Output is partially correct |
14 |
Incorrect |
0 ms |
344 KB |
Incorrect |
15 |
Halted |
0 ms |
0 KB |
- |