# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
567909 |
2022-05-24T10:39:20 Z |
zaneyu |
Flights (JOI22_flights) |
C++17 |
|
426 ms |
13580 KB |
#include "Ali.h"
#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("Ofast")
//#pragma GCC target("avx2")
//order_of_key #of elements less than x
// find_by_order kth element
using ll=long long;
using ld=long double;
using pii=pair<int,int>;
#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 maxn=5e5+5;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int 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)
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
out<<P.f<<' '<<P.s;
return out;
}
template<typename T>
ostream& operator<<(ostream& out,vector<T> V){
REP(i,sz(V)) out<<V[i]<<((i!=sz(V)-1)?" ":"");
return out;
}
namespace {
int variable_example = 0;
}
vector<int> v[maxn];
int n;
void Init(int N, std::vector<int> U, std::vector<int> V) {
n=N;
REP(i,n) v[i].clear();
REP(i,n-1){
v[U[i]].pb(V[i]);
v[V[i]].pb(U[i]);
}
REP(i,n) SetID(i,i);
}
int dep[maxn];
void dfs(int u,int p){
//cout<<u<<' '<<dep[u]<<'\n';
for(int x:v[u]){
if(x==p) continue;
dep[x]=dep[u]+1;
dfs(x,u);
}
}
std::string SendA(std::string S) {
int x=0;
REP(i,10){
x=(x*2)+(S[i]-'0');
}
int y=0;
REP(i,10){
y=(y*2)+(S[i+10]-'0');
}
vector<int> vv;
vector<vector<int>> tmp;
REP(i,n){
if(i%1024==x){
vector<int> dst;
dep[i]=0;
dfs(i,-1);
REP(a,n) dst.pb(dep[a]);
tmp.pb(dst);
vv.pb(i);
}
}
string ans="";
REP(i,n){
if(i%1024==y){
REP(j,sz(vv)){
if(vv[j]>=i) break;
int d=tmp[j][i];
REP(j,14){
bool z=(d&(1<<(13-j)));
ans.pb('0'+z);
}
}
}
}
return ans;
}
#include "Benjamin.h"
#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("Ofast")
//#pragma GCC target("avx2")
//order_of_key #of elements less than x
// find_by_order kth element
using ll=long long;
using ld=long double;
using pii=pair<int,int>;
#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 maxn=5e5+5;
const ll maxlg=__lg(maxn)+2;
const ll INF64=4e18;
const int 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)
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
out<<P.f<<' '<<P.s;
return out;
}
template<typename T>
ostream& operator<<(ostream& out,vector<T> V){
REP(i,sz(V)) out<<V[i]<<((i!=sz(V)-1)?" ":"");
return out;
}
namespace {
int variable_example = 0;
int n,x,y;
}
std::string SendB(int N, int X, int Y) {
if(X>Y) swap(X,Y);
n=N,x=X,y=Y;
string ans="";
REP(i,10){
bool a=(X&(1<<(9-i)));
ans.pb('0'+a);
}
REP(i,10){
bool a=(Y&(1<<(9-i)));
ans.pb('0'+a);
}
return ans;
}
int Answer(std::string T) {
vector<int> v1,v2;
REP(i,n) if(i%1024==x%1024) v1.pb(i);
REP(i,n) if(i%1024==y%1024) v2.pb(i);
int c=0;
for(int a:v2){
for(int b:v1){
if(b>=a) break;
if(b==x and a==y){
int ans=0;
REP(j,14){
ans=ans*2+(T[c*14+j]-'0');
}
return ans;
}
++c;
}
}
}
Compilation message
Ali.cpp:46:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
46 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
grader_ali.cpp:10:8: warning: '{anonymous}::_randmem' defined but not used [-Wunused-variable]
10 | char _randmem[12379];
| ^~~~~~~~
Benjamin.cpp: In function 'int Answer(std::string)':
Benjamin.cpp:65:17: warning: control reaches end of non-void function [-Wreturn-type]
65 | vector<int> v1,v2;
| ^~
Benjamin.cpp: At global scope:
Benjamin.cpp:46:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
46 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
12260 KB |
Output is correct |
2 |
Correct |
7 ms |
12304 KB |
Output is correct |
3 |
Correct |
9 ms |
12272 KB |
Output is correct |
4 |
Correct |
7 ms |
12264 KB |
Output is correct |
5 |
Correct |
7 ms |
12120 KB |
Output is correct |
6 |
Correct |
16 ms |
13064 KB |
Output is correct |
7 |
Correct |
17 ms |
13176 KB |
Output is correct |
8 |
Correct |
17 ms |
13032 KB |
Output is correct |
9 |
Correct |
17 ms |
13004 KB |
Output is correct |
10 |
Correct |
17 ms |
13260 KB |
Output is correct |
11 |
Correct |
13 ms |
12872 KB |
Output is correct |
12 |
Correct |
16 ms |
13104 KB |
Output is correct |
13 |
Correct |
13 ms |
13008 KB |
Output is correct |
14 |
Correct |
13 ms |
13088 KB |
Output is correct |
15 |
Correct |
13 ms |
13392 KB |
Output is correct |
16 |
Correct |
13 ms |
13256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
12176 KB |
Output is correct |
2 |
Partially correct |
89 ms |
13460 KB |
Output is partially correct |
3 |
Correct |
11 ms |
12176 KB |
Output is correct |
4 |
Partially correct |
419 ms |
13308 KB |
Output is partially correct |
5 |
Partially correct |
371 ms |
13320 KB |
Output is partially correct |
6 |
Partially correct |
426 ms |
13124 KB |
Output is partially correct |
7 |
Partially correct |
396 ms |
13572 KB |
Output is partially correct |
8 |
Partially correct |
411 ms |
13280 KB |
Output is partially correct |
9 |
Partially correct |
296 ms |
13368 KB |
Output is partially correct |
10 |
Partially correct |
265 ms |
13468 KB |
Output is partially correct |
11 |
Partially correct |
364 ms |
13232 KB |
Output is partially correct |
12 |
Partially correct |
45 ms |
12852 KB |
Output is partially correct |
13 |
Partially correct |
181 ms |
13112 KB |
Output is partially correct |
14 |
Partially correct |
218 ms |
13192 KB |
Output is partially correct |
15 |
Correct |
9 ms |
12300 KB |
Output is correct |
16 |
Partially correct |
296 ms |
13540 KB |
Output is partially correct |
17 |
Partially correct |
256 ms |
13580 KB |
Output is partially correct |
18 |
Partially correct |
350 ms |
13468 KB |
Output is partially correct |
19 |
Partially correct |
359 ms |
13544 KB |
Output is partially correct |
20 |
Partially correct |
201 ms |
13276 KB |
Output is partially correct |
21 |
Partially correct |
255 ms |
13552 KB |
Output is partially correct |
22 |
Partially correct |
262 ms |
13144 KB |
Output is partially correct |
23 |
Partially correct |
302 ms |
13196 KB |
Output is partially correct |
24 |
Partially correct |
294 ms |
13224 KB |
Output is partially correct |
25 |
Partially correct |
273 ms |
13188 KB |
Output is partially correct |
26 |
Partially correct |
279 ms |
13216 KB |
Output is partially correct |
27 |
Partially correct |
276 ms |
13252 KB |
Output is partially correct |
28 |
Partially correct |
265 ms |
13200 KB |
Output is partially correct |
29 |
Partially correct |
283 ms |
13260 KB |
Output is partially correct |
30 |
Partially correct |
285 ms |
13240 KB |
Output is partially correct |
31 |
Partially correct |
260 ms |
13348 KB |
Output is partially correct |
32 |
Partially correct |
303 ms |
13164 KB |
Output is partially correct |
33 |
Partially correct |
273 ms |
13208 KB |
Output is partially correct |
34 |
Partially correct |
280 ms |
13192 KB |
Output is partially correct |
35 |
Partially correct |
268 ms |
13296 KB |
Output is partially correct |
36 |
Partially correct |
288 ms |
13288 KB |
Output is partially correct |
37 |
Partially correct |
275 ms |
13192 KB |
Output is partially correct |
38 |
Partially correct |
272 ms |
13200 KB |
Output is partially correct |
39 |
Partially correct |
63 ms |
13176 KB |
Output is partially correct |
40 |
Partially correct |
412 ms |
13504 KB |
Output is partially correct |