# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
484572 |
2021-11-04T12:40:19 Z |
Victor |
Pipes (CEOI15_pipes) |
C++17 |
|
2721 ms |
65536 KB |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define per(i, a, b) for (int i = (b - 1); i >= (a); --i)
#define trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) x.size()
#define pb push_back
#define debug(x) cout << #x << " = " << x << endl
#define umap unordered_map
#define uset unordered_set
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
const int INF = 1'000'000'007;
vector<unsigned short> graph[100000];
vector<unsigned char> extra[100000];
int n, m, num[100000], lo[100000];
int main() {
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(cin.failbit);
cin >> n >> m;
int u, v;
rep(i, 0, m) {
cin >> u >> v;
--u; --v;
if(sz(graph[u])%8==0)extra[u].pb(0);
if(sz(graph[v])%8==0)extra[v].pb(0);
graph[u].pb(v & (1<<16) - 1);
extra[u][sz(graph[u]) / 8] |= (v & (1 << 16)) >> (16 - sz(graph[u]) % 8);
graph[v].pb(u & (1<<16) - 1);
extra[v][sz(graph[v]) / 8] |= (u & (1 << 16)) >> (16 - sz(graph[v]) % 8);
}
return 0;
}
Compilation message
pipes.cpp: In function 'int main()':
pipes.cpp:47:33: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
47 | graph[u].pb(v & (1<<16) - 1);
| ~~~~~~~~^~~
pipes.cpp:50:33: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
50 | graph[v].pb(u & (1<<16) - 1);
| ~~~~~~~~^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
4940 KB |
Wrong number of edges |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
5324 KB |
Wrong number of edges |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
122 ms |
14712 KB |
Output is correct |
2 |
Incorrect |
101 ms |
14380 KB |
Wrong number of edges |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
205 ms |
20712 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
441 ms |
33136 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
738 ms |
41068 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1118 ms |
64984 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1640 ms |
65536 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2114 ms |
65536 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2721 ms |
65536 KB |
Memory limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |