2011年1月24日
摘要: 推出推导式:r=R*sin(PI/n)/(1+sin(PI/n))。code:#include iostream#include cstdio#include cmath#define PI 3.1415926using namespace std;int main(){ int cas; while(scanf("%d",&cas)!=EOF) { int n, t=1; double R, r; while(cas--) { scanf("%lf%d",&R, &n); r=R*sin(PI/n)/(1+sin(PI/n)); printf("Scenario #%d:\n%. 阅读全文
posted @ 2011-01-24 23:33 FreeAquar 阅读(188) 评论(0) 推荐(0)
摘要: 有个hint,计算w的时候,边界n<=300,但t处理要处理到t[301],以为要计算的是w[n]=w[n-1]+n*t[n+1]。code:#include <iostream>#include <cstdio>#include <cstdlib>using namespace std;int t[350], w[350];void ready(){ t[1]=1; for(int i=2; i<=304; i++) t[i]=t[i-1]+i;}void ok(){ for(int i=1; i<304; i++) w[i]=i*t[i 阅读全文
posted @ 2011-01-24 22:31 FreeAquar 阅读(277) 评论(0) 推荐(0)