#define wiwihorz
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma loop-opt(on)
#define rep(i, a, b) for(int i = a; i <= b; i ++)
#define rrep(i, a, b) for(int i = b; i >= a; i --)
#define ceil(a, b) ((a + b - 1) / (b))
#define all(x) x.begin(), x.end()
#define INF 1000000000000000000
#define MOD 1000000007
#define eps (1e-9)
using namespace std;
#define lld long double
#define pii pair<int, int>
#define random mt19938 rnd(chrono::steady_clock::now().time_since_epoch().count())
#ifdef wiwihorz
#define print(a...) cerr << "Line " << __LINE__ << ": ", kout("[" + string(#a) + "] = ", a)
void vprint(auto L, auto R) { while(L < R) cerr << *L << " \n"[next(L) == R], ++L;}
void kout() { cerr << endl; }
template<class T1, class ... T2> void kout(T1 a, T2 ... e) { cerr << a << " ", kout(e...); }
#else
#define print(...) 0
#define vprint(...) 0
#endif
namespace solver {
int n;
const int P = 120000;
vector<bitset<P>> a;
void init_(int _n) {
n = _n;
a.assign(n, bitset<P>());
rep(i, 0, n - 1) a[i][i] = 1;
}
void S(int x, int y) {
x--, y--;
a[x] = a[x] | a[y];
a[y] = a[x];
}
int Q(int x, int y) {
return a[x - 1][y - 1];
}
int C(int x) {
return 0;
}
};
using namespace solver;
signed main() {
ios::sync_with_stdio(false), cin.tie(0);
int n, k;
cin >> n >> k;
init_(n);
rep(i, 1, k + n - 1) {
char op; cin >> op;
if(op == 'S') {
int x, y; cin >> x >> y;
S(x, y);
}
else if(op == 'Q') {
int x, y; cin >> x >> y;
if(Q(x, y)) cout << "yes\n";
else cout << "no\n";
}
else {
int x; cin >> x;
cout << C(x) << "\n";
}
}
return 0;
}
Compilation message
servers.cpp:4: warning: ignoring '#pragma loop ' [-Wunknown-pragmas]
4 | #pragma loop-opt(on)
|
servers.cpp:23:13: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
23 | void vprint(auto L, auto R) { while(L < R) cerr << *L << " \n"[next(L) == R], ++L;}
| ^~~~
servers.cpp:23:21: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
23 | void vprint(auto L, auto R) { while(L < R) cerr << *L << " \n"[next(L) == R], ++L;}
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1348 KB |
Output is correct |
2 |
Correct |
90 ms |
60788 KB |
Output is correct |
3 |
Correct |
82 ms |
60800 KB |
Output is correct |
4 |
Correct |
89 ms |
60740 KB |
Output is correct |
5 |
Correct |
88 ms |
60748 KB |
Output is correct |
6 |
Correct |
82 ms |
60728 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1348 KB |
Output is correct |
2 |
Correct |
90 ms |
60788 KB |
Output is correct |
3 |
Correct |
82 ms |
60800 KB |
Output is correct |
4 |
Correct |
89 ms |
60740 KB |
Output is correct |
5 |
Correct |
88 ms |
60748 KB |
Output is correct |
6 |
Correct |
82 ms |
60728 KB |
Output is correct |
7 |
Incorrect |
26 ms |
2156 KB |
Extra information in the output file |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1424 KB |
Output is correct |
2 |
Runtime error |
241 ms |
524292 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1424 KB |
Output is correct |
2 |
Runtime error |
241 ms |
524292 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1692 KB |
Output is correct |
2 |
Runtime error |
249 ms |
524292 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1692 KB |
Output is correct |
2 |
Runtime error |
249 ms |
524292 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1724 KB |
Output is correct |
2 |
Runtime error |
235 ms |
524292 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1724 KB |
Output is correct |
2 |
Runtime error |
235 ms |
524292 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1744 KB |
Output is correct |
2 |
Runtime error |
240 ms |
524292 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1744 KB |
Output is correct |
2 |
Runtime error |
240 ms |
524292 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
1812 KB |
Output is correct |
2 |
Correct |
94 ms |
60752 KB |
Output is correct |
3 |
Correct |
83 ms |
60800 KB |
Output is correct |
4 |
Correct |
95 ms |
60768 KB |
Output is correct |
5 |
Correct |
89 ms |
60732 KB |
Output is correct |
6 |
Correct |
90 ms |
60736 KB |
Output is correct |
7 |
Correct |
26 ms |
2252 KB |
Output is correct |
8 |
Runtime error |
237 ms |
524292 KB |
Execution killed with signal 9 |
9 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
1812 KB |
Output is correct |
2 |
Correct |
94 ms |
60752 KB |
Output is correct |
3 |
Correct |
83 ms |
60800 KB |
Output is correct |
4 |
Correct |
95 ms |
60768 KB |
Output is correct |
5 |
Correct |
89 ms |
60732 KB |
Output is correct |
6 |
Correct |
90 ms |
60736 KB |
Output is correct |
7 |
Correct |
26 ms |
2252 KB |
Output is correct |
8 |
Runtime error |
237 ms |
524292 KB |
Execution killed with signal 9 |
9 |
Halted |
0 ms |
0 KB |
- |