2011-04-28から1日間の記事一覧

AOJ - Problem 0036 : A Figure on Surface

AOJ

問題文 図形はひとつなので普通に実装しただけです。 #include <iostream> #include <cstdio> using namespace std; int main(){ int ax, ay; char f[12][12]; bool flag = false; for(int y=0 ; y<12 ; y++){ for(int x=0 ; x<12 ; x++){ f[y][x] = 0; } } while( 1 ){ for(in</cstdio></iostream>…

AOJ - Problem 0035 : Is it Convex?

問題文 線分ACと直線BD,あるいは直線ACと線分BDのどちらかが交差していない場合は、 凹みのある四角形です。 線分や縁の交差判定はよく使うので慣れておきたいものです。 #include <complex> #include <cstdio> #include <cmath> using namespace std; // 点座標を型とする typedef </cmath></cstdio></complex>…