# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
333846 |
2020-12-07T23:39:44 Z |
zaneyu |
Stray Cat (JOI20_stray) |
C++14 |
|
61 ms |
17208 KB |
#include<bits/stdc++.h>
using namespace std;
#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_equal<long long>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
using ll = long long;
using ld = long double;
using pii = pair<ll,ll>;
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
const ll INF64=4e18;
const ll INF=0x3f3f3f3f;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld eps=1e-6;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
const int maxn=2e4+5;
vector<int> v[maxn];
int dist[maxn];
std::vector<int> Mark(int n, int m, int A, int B,
std::vector<int> U, std::vector<int> V) {
queue<int> q;
q.push(0);
REP(i,m){
v[U[i]].pb(V[i]);
v[V[i]].pb(U[i]);
}
REP(i,n) dist[i]=INF;
dist[0]=0;
while(!q.empty()){
int z=q.front();
q.pop();
for(int x:v[z]){
if(dist[x]>dist[z]+1) {
dist[x]=dist[z]+1;
q.push(x);
}
}
}
vector<int> mk;
REP(i,m){
mk.pb(min(dist[U[i]],dist[V[i]])%3);
}
return mk;
}
#include<bits/stdc++.h>
using namespace std;
#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_equal<long long>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
using ll = long long;
using ld = long double;
using pii = pair<ll,ll>;
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
const ll INF64=4e18;
const ll INF=0x3f3f3f3f;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld eps=1e-6;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
const int maxn=2e4+5;
void Init(int A, int B) {
}
int Move(std::vector<int> y) {
REP(i,3){
if(y[i] and y[(i+1)%3]){
return i;
}
}
REP(i,3){
if(y[i]){
return i;
}
}
return -1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
52 ms |
16424 KB |
Output is correct |
2 |
Correct |
2 ms |
1128 KB |
Output is correct |
3 |
Correct |
38 ms |
15248 KB |
Output is correct |
4 |
Correct |
59 ms |
17208 KB |
Output is correct |
5 |
Correct |
61 ms |
17076 KB |
Output is correct |
6 |
Correct |
46 ms |
16076 KB |
Output is correct |
7 |
Correct |
46 ms |
16152 KB |
Output is correct |
8 |
Correct |
54 ms |
16764 KB |
Output is correct |
9 |
Correct |
53 ms |
16508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
52 ms |
16424 KB |
Output is correct |
2 |
Correct |
2 ms |
1128 KB |
Output is correct |
3 |
Correct |
38 ms |
15248 KB |
Output is correct |
4 |
Correct |
59 ms |
17208 KB |
Output is correct |
5 |
Correct |
61 ms |
17076 KB |
Output is correct |
6 |
Correct |
46 ms |
16076 KB |
Output is correct |
7 |
Correct |
46 ms |
16152 KB |
Output is correct |
8 |
Correct |
54 ms |
16764 KB |
Output is correct |
9 |
Correct |
53 ms |
16508 KB |
Output is correct |
10 |
Correct |
46 ms |
13988 KB |
Output is correct |
11 |
Correct |
43 ms |
13860 KB |
Output is correct |
12 |
Correct |
53 ms |
14064 KB |
Output is correct |
13 |
Correct |
46 ms |
13868 KB |
Output is correct |
14 |
Correct |
45 ms |
14300 KB |
Output is correct |
15 |
Correct |
49 ms |
14508 KB |
Output is correct |
16 |
Correct |
53 ms |
16864 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
13748 KB |
Output is correct |
2 |
Correct |
1 ms |
1300 KB |
Output is correct |
3 |
Correct |
37 ms |
13208 KB |
Output is correct |
4 |
Correct |
57 ms |
15028 KB |
Output is correct |
5 |
Correct |
57 ms |
15040 KB |
Output is correct |
6 |
Correct |
44 ms |
13620 KB |
Output is correct |
7 |
Correct |
54 ms |
13852 KB |
Output is correct |
8 |
Correct |
51 ms |
14516 KB |
Output is correct |
9 |
Correct |
54 ms |
14636 KB |
Output is correct |
10 |
Correct |
52 ms |
14380 KB |
Output is correct |
11 |
Correct |
48 ms |
14380 KB |
Output is correct |
12 |
Correct |
47 ms |
14132 KB |
Output is correct |
13 |
Correct |
49 ms |
14380 KB |
Output is correct |
14 |
Correct |
50 ms |
14388 KB |
Output is correct |
15 |
Correct |
51 ms |
14516 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
13748 KB |
Output is correct |
2 |
Correct |
1 ms |
1300 KB |
Output is correct |
3 |
Correct |
37 ms |
13208 KB |
Output is correct |
4 |
Correct |
57 ms |
15028 KB |
Output is correct |
5 |
Correct |
57 ms |
15040 KB |
Output is correct |
6 |
Correct |
44 ms |
13620 KB |
Output is correct |
7 |
Correct |
54 ms |
13852 KB |
Output is correct |
8 |
Correct |
51 ms |
14516 KB |
Output is correct |
9 |
Correct |
54 ms |
14636 KB |
Output is correct |
10 |
Correct |
52 ms |
14380 KB |
Output is correct |
11 |
Correct |
48 ms |
14380 KB |
Output is correct |
12 |
Correct |
47 ms |
14132 KB |
Output is correct |
13 |
Correct |
49 ms |
14380 KB |
Output is correct |
14 |
Correct |
50 ms |
14388 KB |
Output is correct |
15 |
Correct |
51 ms |
14516 KB |
Output is correct |
16 |
Correct |
41 ms |
11948 KB |
Output is correct |
17 |
Correct |
38 ms |
12028 KB |
Output is correct |
18 |
Correct |
41 ms |
12136 KB |
Output is correct |
19 |
Correct |
39 ms |
12076 KB |
Output is correct |
20 |
Correct |
46 ms |
12816 KB |
Output is correct |
21 |
Correct |
44 ms |
12516 KB |
Output is correct |
22 |
Correct |
53 ms |
14648 KB |
Output is correct |
23 |
Correct |
41 ms |
12204 KB |
Output is correct |
24 |
Correct |
45 ms |
12204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1508 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
3004 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
3084 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |