题目:http://acm.hdu.edu.cn/showproblem.php?pid=2002 注意,要用double 才能过,float过不了. 体积公式要加括号(优先级别)(4 * Π * r * r * r)/3 #include <stdio.h> #define PI 3.1415927 int main() { double r, v; while(~scanf("%lf", &r)) { v = (4 * PI * r * r * r)/3; pr…
Then n - 1n−1 lines follow. ii-th line contains two integers f_{a_i}(1 \le f_{a_i} < i)fai(1≤fai<i), w_i(0 \le w_i \le 10^{18})wi(0≤wi≤1018) —The parent of the ii-th node and the edge weight between the ii-th node and f_{a_i} (ifai(istart fr…
#include <bits/stdc++.h> using namespace std; const int MAXN = 100; const int X = 3; long long f[1005]; void init() { f[0] = 1; for(int i = 1;i < MAXN; i++) { f[i] = f[i-1]*X; } } int hash(string num) { int ans = 0; for (int i = 0; i < num.len…