2012-04-07から1日間の記事一覧

AOJ 0197 - GCD: Euclidean Algorithm

aoj

stepを外へ #include <iostream> typedef long long int llint; llint step = 0; llint getgcd(llint a, llint b){ if(b==0)return a; step++; return getgcd(b, a%b); } int main(){ llint a, b; while(std::cin >> a >> b, a && b){ llint gcd = 0; step = 0; if(a ></iostream>…

AOJ 0196 - Baseball Championship

aoj

実装ゲー #include <iostream> #include <vector> #include <algorithm> struct team{std::string name; int win; int lose;}; bool ascendingteam(const team& lteam, const team& rteam){ if(lteam.win == rteam.win) return lteam.lose < rteam.lose; return lteam.win > rteam.win; } </algorithm></vector></iostream>…