QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#398175 | #8209. Curly Palindromes | domovonok | WA | 1ms | 3788kb | C++14 | 1.3kb | 2024-04-25 03:54:59 | 2024-04-25 03:55:00 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(x...)
#endif
using ll = long long;
using db = long double;
bool cross(pair<int, int> a, pair<int, int> b) {
return (ll)a.first * b.second - (ll)a.second * b.second > 0;
}
void solve() {
int n;
cin >> n;
vector<pair<pair<int, int>, char>> v(n);
for (int i = 0; i < n; i++) {
cin >> v[i].first.first >> v[i].first.second >> v[i].second;
}
bool f = false;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i == j) continue;
if (v[i].second == v[j].second) f = true;
for (int k = 0; k < n; k++) {
if (i == k || j == k) continue;
if (v[i].second == v[k].second && cross(v[i].first, v[j].first) && cross(v[j].first, v[k].first) && cross(v[k].first, v[i].first)) {
cout << "Infinity";
return;
}
}
}
}
if (f) {
cout << 2;
} else {
cout << 1;
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int tests = 1;
// cin >> tests;
while (tests--) {
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3556kb
input:
4 0 0 o 1 1 c 2 2 p 3 3 c
output:
2
result:
ok single line: '2'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3788kb
input:
3 2 3 e 3 2 e 8 9 e
output:
2
result:
wrong answer 1st lines differ - expected: 'Infinity', found: '2'