Submission #1193976

#TimeUsernameProblemLanguageResultExecution timeMemory
1193976vnedu허수아비 (JOI14_scarecrows)C++17
5 / 100
70 ms1860 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

template<class T> bool maximize(T &a, const T &b){ return (a < b ? a = b, 1 : 0); }
template<class T> bool minimize(T &a, const T &b){ return (a > b ? a = b, 1 : 0); }

#define fi first
#define se second

#define pb push_back
#define ii pair<int, int>

#define all(x) x.begin(), x.end()

#define TASK "nonsense"

/// end of template ///

const int N = 2e5 + 10;
struct Point
{
    int x,y;
    Point() {}
    void input()
    {
        cin>>x>>y;
    }
} point[N];
int n;
namespace sub1
{
    bool check()
    {
        return (n<=400);
    }
    void solve()
    {
        int ans=0;
        for(int i=1;i<=n;++i) for(int j=1;j<=n;++j) if(j!=i && point[i].x<point[j].x && point[i].y<point[j].y)
        {
            bool ok=0;
            for(int k=1;k<=n;++k) if(k!=i && k!=j)
            {
                ok|=(point[i].x<point[k].x && point[k].x<point[j].x && point[i].y<point[k].y && point[k].y<point[j].y);
            }
            ans+=!ok;
        }
        cout<<ans;
    }
}
void solve()
{
    cin>>n;
    for(int i=1;i<=n;++i) point[i].input();
    if(sub1::check()) return void(sub1::solve());
}
int main()  {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

//    freopen(TASK".inp","r",stdin);
//    freopen(TASK".out","w",stdout);

    int testcase=1;
//    cin>>testcase;

    while (testcase--)
        solve();

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...