コード例 #1
0
void gen_euclid(int n)
{
    int g = a[0];
    FOR(i,1,n) g = euclid(g, a[i], X[i], Y[i]);
    LL mult = 1;
    FORD(i,n,1) v[i] = (mult * Y[i]) % m, mult = (mult * X[i]) % m;
    v[0] = mult;
}
コード例 #2
0
ファイル: hull2d.cpp プロジェクト: glapul/contest_library
void computeHull(){
  int d = 0;
  sort(points, points+N);
  //N = unique(points, points+N)-points;// Potrzebne TYLKO jeśli N>1 i wszystkie równe
                                        //     (można obsłużyć inaczej)
  H = 0;                                       
  REP(i,N)addPoint(i);
  if(N<2)return;
  FORD(i,N-1,0)addPoint(i);  
  H--;
}