제출 #963533

#제출 시각아이디문제언어결과실행 시간메모리
963533ttttttttttttthZvijezda (COCI19_zvijezda)C++17
0 / 110
1034 ms4840 KiB
// Author: Ivan Teo // Created: Mon Apr 15 14:41:22 2024 #define TASKNAME "tomau" #include <bits/stdc++.h> using namespace std; #define fore(i, a, b) for (int i = (a); i <= (b); i++) #define int long long using vi = vector<int>; using ii = pair<int, int>; #define pb emplace_back #define fi first #define se second #define sz(v) ((int)v.size()) #define all(v) v.begin() + 1, v.end() #define alll(v) v.begin(), v.end() #define db(x) cerr << "[" << #x << " = " << x << "]" #define el cerr << "\n=============================\n" mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); int Rand(int l, int r) { assert(l <= r); return uniform_int_distribution<int> (l, r)(rng); } __int128 cross(int x0, int y0, int x1, int y1, int x2, int y2) { return (__int128) (x1 - x0) * (y2 - y0) - (__int128) (x2 - x0) * (y1 - y0); } const int maxn = 2e5 + 5; ii a[maxn]; int n, q, t; void solve() { cin >> t >> n; fore(i, 0, n - 1) cin >> a[i].fi >> a[i].se; cin >> q; int p = 0; while (q--) { int x, y; cin >> x >> y; if (t) x ^= p * p * p, y ^= p * p * p; int flag = 0; fore(i, 0, n - 1) { auto dir = cross(x, y, a[i].fi, a[i].se, a[(i + 1) % n].fi, a[(i + 1) % n].se); if (dir < 0) flag++; if (dir == 0) { flag = 0; break; } } if (flag < n / 2) cout << "YES"; else cout << "NO"; cout << '\n'; } } signed main() { cin.tie(0)->sync_with_stdio(0); if (fopen("in", "r")) freopen("in", "r", stdin); if (fopen(TASKNAME ".inp", "r")) freopen(TASKNAME ".inp", "r", stdin), freopen(TASKNAME ".out", "w", stdout); int tc = 1; // cin >> tc; while (tc--) solve(); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

zvijezda.cpp: In function 'int main()':
zvijezda.cpp:67:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   67 |         freopen("in", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~
zvijezda.cpp:69:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   69 |         freopen(TASKNAME ".inp", "r", stdin),
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zvijezda.cpp:70:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   70 |                 freopen(TASKNAME ".out", "w", stdout);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...