QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#398175#8209. Curly PalindromesdomovonokWA 1ms3788kbC++141.3kb2024-04-25 03:54:592024-04-25 03:55:00

Judging History

This is the latest submission verdict.

  • [2024-04-25 03:55:00]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3788kb
  • [2024-04-25 03:54:59]
  • Submitted

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;
}

Details

Tip: Click on the bar to expand more detailed information

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'