QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#46091 | #4330. Točkice | ltunjic | 0 | 1ms | 7736kb | C++ | 1.2kb | 2022-08-25 16:50:17 | 2022-08-25 16:50:18 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
#define pii pair<ll, ll>
#define X first
#define Y second
#define pb push_back
using namespace std;
const int N = 1e6;
int n, pos, stk[N], in[N];
pii point[N];
vector<pair<pii, int>> v;
ll ccw(pii a, pii b, pii c){
return (b.X - a.X) * (c.Y - a.Y) - (c.X - a.X) * (b.Y - a.Y);
}
int main(){
ios_base::sync_with_stdio(false);
cin >> n;
for(int i = 0; i < n; i++){
int x, y;
cin >> x >> y;
v.pb({{x, y}, i});
point[i] = {x, y};
}
sort(v.begin(), v.end());
for(pair<pii, int> x : v){
while(pos >= 2){
if(ccw(point[stk[pos - 2]], point[stk[pos - 1]], x.X) > 0)
pos--;
else
break;
}
stk[pos++] = x.Y;
}
for(int i = 0; i < pos; i++) in[stk[i]] = true;
pos = 0;
reverse(v.begin(), v.end());
for(pair<pii, int> x : v){
while(pos >= 2){
if(ccw(point[stk[pos - 2]], point[stk[pos - 1]], x.X) > 0)
pos--;
else
break;
}
stk[pos++] = x.Y;
}
for(int i = 0; i < pos; i++) in[stk[i]] = true;
int rub = 0;
for(int i = 0; i < n; i++) rub += in[i];
int ans = rub + rub - 3 + (n - rub) * 3;
cout << (ans & 1 ? "Alenka" : "Bara") << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 7736kb
input:
1 62 -83
output:
Alenka
result:
wrong answer 1st lines differ - expected: 'Bara', found: 'Alenka'
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%