# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
573218 |
2022-06-06T09:19:47 Z |
Sho10 |
Saveit (IOI10_saveit) |
C++17 |
|
457 ms |
21600 KB |
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho
#include "grader.h"
using ll=long long;
using ld=long double;
int const INF=1000000005;
ll const LINF=1000000000000000005;
ll const mod=6700417;
ld const PI=3.14159265359;
ll const MAX_N=3e5+5;
ld const EPS=0.00000001;
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define sz(a) (int)a.size()
#define CODE_START ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
vector<ll>g[1005];
ll d[1005],ans[1005][1005];
string calc(ll x){
string res="";
for(ll i=0;i<30;i++)
{
if((1ll<<i)&x){
res+='1';
}else res+='0';
}
reverse(res.begin(),res.end());
return res;
}
void encode(int n, int h, int m, int *v1, int *v2){
for(ll i=0;i<m;i++)
{
g[v1[i]].pb(v2[i]);
g[v2[i]].pb(v1[i]);
}
for(ll i=0;i<h;i++)
{
for(ll j=0;j<=n;j++)
{
d[j]=LINF;
}
queue<ll>q;
q.push(i);
d[i]=0;
while(!q.empty()){
ll x=q.front();
ans[i][x]=d[x];
q.pop();
for(auto it : g[x]){
if(d[it]==LINF){
d[it]=d[x]+1;
q.push(it);
}
}
}
}
for(ll i=0;i<h;i++)
{
for(ll j=0;j<n;j++)
{
string s1=calc(ans[i][j]);
while(s1.size()<10){
s1=" "+s1;
}
for(auto it : s1){
encode_bit(it-'0');
}
}
}
}
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho
#include "grader.h"
using ll=long long;
using ld=long double;
int const INF=1000000005;
ll const LINF=1000000000000000005;
ll const mod=6700417;
ld const PI=3.14159265359;
ll const MAX_N=3e5+5;
ld const EPS=0.00000001;
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define sz(a) (int)a.size()
#define CODE_START ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll ans[1005][1005];
void decode(int n,int h){
for(ll i=0;i<h;i++)
{
for(ll j=0;j<n;j++)
{
string s="";
for(ll k=0;k<10;k++)
{
ll x=decode_bit();
s+=(x+'0');
}
reverse(s.begin(),s.end());
ll pw=0;
ll val=0;
for(ll k=0;k<s.size();k++)
{
if(s[k]=='1'){
val+=(1ll<<pw);
}
pw++;
}
hops(i,j,val);
}
}
}
Compilation message
decoder.cpp: In function 'void decode(int, int)':
decoder.cpp:36:17: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
36 | for(ll k=0;k<s.size();k++)
| ~^~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
457 ms |
21600 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
4608 KB |
Output isn't correct |
3 |
Incorrect |
155 ms |
12632 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
4608 KB |
Output isn't correct |
5 |
Incorrect |
159 ms |
12984 KB |
Output isn't correct |
6 |
Incorrect |
172 ms |
13728 KB |
Output isn't correct |
7 |
Incorrect |
187 ms |
14448 KB |
Output isn't correct |
8 |
Incorrect |
165 ms |
13184 KB |
Output isn't correct |
9 |
Incorrect |
208 ms |
13540 KB |
Output isn't correct |
10 |
Incorrect |
176 ms |
13548 KB |
Output isn't correct |
11 |
Incorrect |
229 ms |
13800 KB |
Output isn't correct |
12 |
Incorrect |
179 ms |
13528 KB |
Output isn't correct |
13 |
Incorrect |
211 ms |
14568 KB |
Output isn't correct |
14 |
Incorrect |
181 ms |
13548 KB |
Output isn't correct |
15 |
Incorrect |
179 ms |
13624 KB |
Output isn't correct |
16 |
Incorrect |
223 ms |
14364 KB |
Output isn't correct |
17 |
Incorrect |
196 ms |
14308 KB |
Output isn't correct |
18 |
Incorrect |
197 ms |
14712 KB |
Output isn't correct |
19 |
Incorrect |
219 ms |
14112 KB |
Output isn't correct |
20 |
Incorrect |
205 ms |
15276 KB |
Output isn't correct |
21 |
Incorrect |
252 ms |
15416 KB |
Output isn't correct |
22 |
Incorrect |
206 ms |
14520 KB |
Output isn't correct |
23 |
Incorrect |
259 ms |
15980 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
457 ms |
21600 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
4608 KB |
Output isn't correct |
3 |
Incorrect |
155 ms |
12632 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
4608 KB |
Output isn't correct |
5 |
Incorrect |
159 ms |
12984 KB |
Output isn't correct |
6 |
Incorrect |
172 ms |
13728 KB |
Output isn't correct |
7 |
Incorrect |
187 ms |
14448 KB |
Output isn't correct |
8 |
Incorrect |
165 ms |
13184 KB |
Output isn't correct |
9 |
Incorrect |
208 ms |
13540 KB |
Output isn't correct |
10 |
Incorrect |
176 ms |
13548 KB |
Output isn't correct |
11 |
Incorrect |
229 ms |
13800 KB |
Output isn't correct |
12 |
Incorrect |
179 ms |
13528 KB |
Output isn't correct |
13 |
Incorrect |
211 ms |
14568 KB |
Output isn't correct |
14 |
Incorrect |
181 ms |
13548 KB |
Output isn't correct |
15 |
Incorrect |
179 ms |
13624 KB |
Output isn't correct |
16 |
Incorrect |
223 ms |
14364 KB |
Output isn't correct |
17 |
Incorrect |
196 ms |
14308 KB |
Output isn't correct |
18 |
Incorrect |
197 ms |
14712 KB |
Output isn't correct |
19 |
Incorrect |
219 ms |
14112 KB |
Output isn't correct |
20 |
Incorrect |
205 ms |
15276 KB |
Output isn't correct |
21 |
Incorrect |
252 ms |
15416 KB |
Output isn't correct |
22 |
Incorrect |
206 ms |
14520 KB |
Output isn't correct |
23 |
Incorrect |
259 ms |
15980 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
457 ms |
21600 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
4608 KB |
Output isn't correct |
3 |
Incorrect |
155 ms |
12632 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
4608 KB |
Output isn't correct |
5 |
Incorrect |
159 ms |
12984 KB |
Output isn't correct |
6 |
Incorrect |
172 ms |
13728 KB |
Output isn't correct |
7 |
Incorrect |
187 ms |
14448 KB |
Output isn't correct |
8 |
Incorrect |
165 ms |
13184 KB |
Output isn't correct |
9 |
Incorrect |
208 ms |
13540 KB |
Output isn't correct |
10 |
Incorrect |
176 ms |
13548 KB |
Output isn't correct |
11 |
Incorrect |
229 ms |
13800 KB |
Output isn't correct |
12 |
Incorrect |
179 ms |
13528 KB |
Output isn't correct |
13 |
Incorrect |
211 ms |
14568 KB |
Output isn't correct |
14 |
Incorrect |
181 ms |
13548 KB |
Output isn't correct |
15 |
Incorrect |
179 ms |
13624 KB |
Output isn't correct |
16 |
Incorrect |
223 ms |
14364 KB |
Output isn't correct |
17 |
Incorrect |
196 ms |
14308 KB |
Output isn't correct |
18 |
Incorrect |
197 ms |
14712 KB |
Output isn't correct |
19 |
Incorrect |
219 ms |
14112 KB |
Output isn't correct |
20 |
Incorrect |
205 ms |
15276 KB |
Output isn't correct |
21 |
Incorrect |
252 ms |
15416 KB |
Output isn't correct |
22 |
Incorrect |
206 ms |
14520 KB |
Output isn't correct |
23 |
Incorrect |
259 ms |
15980 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
457 ms |
21600 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
4608 KB |
Output isn't correct |
3 |
Incorrect |
155 ms |
12632 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
4608 KB |
Output isn't correct |
5 |
Incorrect |
159 ms |
12984 KB |
Output isn't correct |
6 |
Incorrect |
172 ms |
13728 KB |
Output isn't correct |
7 |
Incorrect |
187 ms |
14448 KB |
Output isn't correct |
8 |
Incorrect |
165 ms |
13184 KB |
Output isn't correct |
9 |
Incorrect |
208 ms |
13540 KB |
Output isn't correct |
10 |
Incorrect |
176 ms |
13548 KB |
Output isn't correct |
11 |
Incorrect |
229 ms |
13800 KB |
Output isn't correct |
12 |
Incorrect |
179 ms |
13528 KB |
Output isn't correct |
13 |
Incorrect |
211 ms |
14568 KB |
Output isn't correct |
14 |
Incorrect |
181 ms |
13548 KB |
Output isn't correct |
15 |
Incorrect |
179 ms |
13624 KB |
Output isn't correct |
16 |
Incorrect |
223 ms |
14364 KB |
Output isn't correct |
17 |
Incorrect |
196 ms |
14308 KB |
Output isn't correct |
18 |
Incorrect |
197 ms |
14712 KB |
Output isn't correct |
19 |
Incorrect |
219 ms |
14112 KB |
Output isn't correct |
20 |
Incorrect |
205 ms |
15276 KB |
Output isn't correct |
21 |
Incorrect |
252 ms |
15416 KB |
Output isn't correct |
22 |
Incorrect |
206 ms |
14520 KB |
Output isn't correct |
23 |
Incorrect |
259 ms |
15980 KB |
Output isn't correct |