Submission #487107

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4871072021-11-14 10:26:17Cross_RatioPrinted Circuit Board (CEOI12_circuit)C++14
100 / 100
54 ms8260 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;
int X[200005];
int Y[200005];
int cmp(int x, int y) { // x < y : True
int k = Y[y]*X[x]-Y[x]*X[y];
if(k > 0) return 1;
else if(k == 0) return 0;
return -1;
}
int ccw(int x, int y, int m) {
int x1 = X[x]-X[y];
int y1 = Y[x]-Y[y];
int x2 = X[m]-X[x];
int y2 = Y[m]-Y[x];
return x1*y2-x2*y1;
}
int ccw2(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
int op = a.first*b.second + b.first*c.second + c.first*a.second;
op -= (a.second*b.first + b.second*c.first + c.second*a.first);
if (op > 0)return 1;
else if (op == 0)return 0;
else return -1;
}
int isIntersect(pair<pair<int, int>, pair<int, int>> x, pair<pair<int, int>, pair<int, int>> y) {
pair<int, int> a = x.first;
pair<int, int> b = x.second;
pair<int, int> c = y.first;
pair<int, int> d = y.second;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

circuit.cpp: In function 'int main()':
circuit.cpp:64:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   64 |         for(i=0;i<ans.size();i++) cout << ans[i] << ' ';
      |                 ~^~~~~~~~~~~
circuit.cpp:103:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  103 |     for(i=0;i<A.size();i++) {
      |             ~^~~~~~~~~
circuit.cpp:116:25: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  116 |                 while(i < A.size() &&(cmp(A[i],A[n1])==1
      |                       ~~^~~~~~~~~~
circuit.cpp:120:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  120 |                 if(i < A.size()) S.push(i);
      |                    ~~^~~~~~~~~~
circuit.cpp:142:26: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  142 |                     if(i == A.size()) break;
      |                        ~~^~~~~~~~~~~
circuit.cpp:164:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  164 |     for(i=0;i<ans.size();i++) cout << ans[i]+1 <<' ';
      |             ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...