/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 332.0 KiB
#2 Accepted 1ms 488.0 KiB
#3 Accepted 1ms 680.0 KiB
#4 Wrong Answer 1ms 540.0 KiB
#5 Accepted 2ms 488.0 KiB
#6 Accepted 1ms 492.0 KiB
#7 Accepted 1ms 452.0 KiB
#8 Wrong Answer 1ms 540.0 KiB

Code

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define yes cout << "YES" << "\n";
#define no cout << "NO" << "\n";
#define fri(a,b) for(ll i = a; i<b; i++) 
#define frj(a,b) for(ll j = a; j <b; j++)
#define frk(a,b) for(ll k = a; k <b; k++) 
#define rfri(a,b) for(ll i = a; i>=b; i--)

using namespace std;
int main()
{
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL);

    ll T = 1;
    // cin >> T;
    while(T--)
    {
     ll x,y,n;
     cin >> n;
     bool ps = 0;
     vector < pair <ll,ll> > v;
     ll j = 0;
     while(n--)
     {
        ll x1,y1;
        cin >> x1 >> y1;
        v.pb({x1,y1});
     }
     cin >> x >> y;
     ll first = 0;
     ll second = 0;
     v.push_back({v[0].first,v[0].second});
     fri(0,v.size()-1)
     {
       first += v[i].first*v[i+1].second;
     }
    //  cout << first << "\n";
      fri(0,v.size()-1)
    {
        second += v[i].second*v[i+1].first;
    }
    //  cout << second << "\n";
     ll bohuvuj = abs(first - second);
    //  cout << bohuvuj << "\n";
     ll total = 0;
     fri(0,v.size()-1)
     {
        frj(i+1,v.size() - 1)
        {
            vector < pair <ll,ll> > t;
            t.pb({v[i].first,v[i].second});
            t.pb({v[j].first, v[j].second});
            t.pb({x,y});
            t.pb({v[i].first,v[i].second});

            ll f = 0;
            ll s = 0;

            for(ll k = 0 ; k< t.size()-1; k++)
            {
                f += t[k].first*t[k+1].second;
                s += t[k].second*t[k+1].first;
            }
            total += abs(f-s);
        }
     }
    if(total != bohuvuj) no
    else 
    {
        if(total != 0) yes
        else
        {
            no
        }
    }
    }
}

Information

Submit By
Type
Submission
Problem
P1145 Nobita's Love for Shizuka
Contest
LU IUJPC : Sylhet Division 2024
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-09 08:08:24
Judged At
2024-12-09 08:08:24
Judged By
Score
20
Total Time
2ms
Peak Memory
680.0 KiB