Submission #1054666

#TimeUsernameProblemLanguageResultExecution timeMemory
1054666anangoPortal (BOI24_portal)C++17
0 / 100
3 ms348 KiB
#include <bits/stdc++.h> #define int long long using namespace std; mt19937 rng; vector<pair<int,int>> cords; int area(int i, int j, int k) { return cords[i].first*cords[j].second-cords[i].second*cords[j].first+cords[j].first*cords[k].second-cords[j].second*cords[k].first+cords[k].first*cords[i].second-cords[k].second*cords[i].first; } signed main() { int local = 0; if (local) { // for getting input from input.txt freopen("input.txt", "r", stdin); // for writing output to output.txt freopen("output.txt", "w", stdout); } #ifdef ONLINE_JUDGE ios_base::sync_with_stdio(false); cin.tie(NULL); #endif //fast IO int n; cin >> n; for (int i=0; i<n; i++) { int x,y; cin >> x >> y; cords.push_back({x,y}); } sort(cords.begin(), cords.end()); int g = 0; for (int it=0; it<100000; it++) { int i,j,k; i=rng()%n; j=rng()%n; k=rng()%n; //cout << i <<" " << j <<" " << k <<" " << area(i,j,k) << endl; g=gcd(g,area(i,j,k)); } g=abs(g); cout << g << endl; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:17:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |         freopen("input.txt", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:19:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |         freopen("output.txt", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...