| Task: | Family reunion |
| Sender: | zscoder |
| Submission time: | 2017-01-21 11:55:38 +0200 |
| Language: | C++ |
| Status: | READY |
| Result: | 19 |
| group | verdict | score |
|---|---|---|
| #1 | UNKNOWN | 0 |
| #2 | UNKNOWN | 0 |
| #3 | UNKNOWN | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | UNKNOWN | -- | 1 | details |
| #2 | UNKNOWN | -- | 2 | details |
| #3 | UNKNOWN | -- | 3 | details |
Code
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;
int a[1001][18];
char z[3] = {'A','B','C'};
bool used[1001];
bool special(int x)
{
if(x%1001==0) return 1;
return 0;
}
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int n,m,k; cin>>n>>m>>k;
for(int j = 0; j < m; j++)
{
for(int i = 0; i < 2*k + 1; i++)
{
cin>>a[j][i];
}
}
if(m==1)
{
for(int i = 0; i < m; i++)
{
vi vec(2*k+2);
for(int j = 0; j < 2*k + 1; j++)
{
used[a[i][j]]=1;
vec[j]=a[i][j];
}
for(int j = 1; j <= n; j++)
{
if(!used[j]) vec[2*k+1] = j;
}
int dist = 0;
int ptr = k;
while(vec[ptr]!=1)
{
ptr++;
dist++;
if(ptr>=2*k+2) ptr=0;
}
cout<<z[dist%2]<<'\n';
}
return 0;
}
if(m == 2)
{
for(int i = 0; i < m; i++)
{
int dist1 = 1001+a[i][k];
for(int j = k - 1; j >= 0; j--)
{
if(special(j))
{
dist1=min(dist1,k-j); break;
}
}
/*
int dist2 = 1001;
for(int j = k + 1; j <= 2*k; j++)
{
if(special(j))
{
dist2=min(dist2,j-k); break;
}
}
int hsh = abs(dist1-dist2)%3;
*/
int hsh = dist1%3;
cout<<z[hsh]<<'\n';
}
}
}
Test details
Test 1
Group: 1
Verdict: UNKNOWN
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| (not available) |
Test 2
Group: 2
Verdict: UNKNOWN
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| (not available) |
Test 3
Group: 3
Verdict: UNKNOWN
| input |
|---|
| #!/bin/bash set -e OFFSET=$(grep -onam1 '^__DATA_... |
| correct output |
|---|
| 50 |
| user output |
|---|
| (not available) |
