2012-05-01から1ヶ月間の記事一覧

自分用のプログラム

#-*- coding:utf-8 -*- import numpy as np import matplotlib.pyplot as plt def main(): count = 0 #counter delta_time = 0.001 #sec N = 10. # the number of firing per second DAp = 0.35e-6 #M the ititial value of the cons of DA Km = 4.98e-6 #M …

AOJ - Problem 0035 : Is it Convex?(C言語)

"問題35"交差判定の式を用いれば一発だったった。 #include <stdio.h> double intersection(double a, double b, double c,double d, double e,double f,double g,double h){ double tc, td; tc = (a - b) * (g - e) + (e - f) * (a - c); td = (a - b) * (h - e) + (</stdio.h>…

AOJ - Problem 0033 : Ball (C言語)

"問題0033"つまりは、BとCの一番上にある数よりも小さな数のボールがくれば、NOを出力すればいいだけ。 #include <stdio.h> int main(void){ int i, B, C,count, set, num[10]; scanf("%d", &set); for(i = 0; i < set; i++){ scanf("%d %d %d %d %d %d %d %d %d %d",</stdio.h>…

AOJ - Problem 0034 : Railway Lines(C言語)

"問題0034"結局は、二つの列車の速度の比率から交わるポイントが導出できる。 v1:v2 = 列車1が進んだ距離/(全体の線路の長さ) : 列車2が進んだ距離/(全体の線路の長さ) #include <stdio.h> int main(void){ int i; int num[12]; double total, rate, sum; while(scan</stdio.h>…