Task: | Family reunion |
Sender: | zscoder |
Submission time: | 2017-01-21 11:27:21 +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]; 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++) { vi cnt(3); cnt[0]=cnt[1]=cnt[2]=0; for(int j = 0; j < 2*k+1; j++) { if(j==k) continue; cnt[a[i][j]%3]++; } int mx = 0; int idx=-1; for(int j = 0; j < 3; j++) { if(cnt[j]>mx) { mx=cnt[j]; idx=j; } } cout<<z[idx]<<'\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) |