!! Really Strange !!
来源:互联网 发布:ubuntu 17.10 qq 编辑:程序博客网 时间:2024/05/27 08:13
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=31329#problem/B
f[ 0 ] = 1 , f[ n ] = f[ n - 1 ] + 2 * (n - 1 ),化简得f[n]=n^2 - n + 2 ;
import java.math.BigInteger;import java.util.Scanner;public class Main{public static void main(String[] args ){Scanner cin = new Scanner(System.in);while( cin.hasNext()){BigInteger n = cin.nextBigInteger();if( n.equals(BigInteger.valueOf(0))){System.out.println("1");}else{n = n.multiply(n).add(n.negate()).add(BigInteger.valueOf(2));System.out.println(n);}}}}
- Really Strange!!
- !! Really Strange !!
- UVa10519 - !! Really Strange !!
- UVA 10519 !! Really Strange !!
- UVA 10519 !! Really Strange !!
- UVa:10519 - !! Really Strange !!
- UVa 10519 - !! Really Strange !!
- UVA 10519 !! Really Strange !!
- UVa 10519 - !! Really Strange !!
- uva 10519!! Really Strange !!
- UVA10519 - !! Really Strange !!(数论+高精度)
- uva 10519 - !! Really Strange !!(规律)
- UVA 10519 - !! Really Strange !!(数论,规律)
- UVa 10519 !! Really Strange !! (递推)
- Meta Really
- HTTP Made Really Easy
- Debian is really COOL
- I am really tired
- 张小龙
- C语言typedef void fun(int) 与typedef void (*pfun)(int)类型
- python学习计划
- hdu 4725 The Shortest Path in Nya Graph(堆+dij,最短路,5级)
- P131 E2(a) P137 E2 anwser
- !! Really Strange !!
- java学习心得1
- 绘制矩形(方法一)
- NSPredicate的用法
- AsyncSocket详解
- Windows下Resin的配置与部署(可用版)
- 简单安装NFS流程
- 最小圆覆盖
- 作业4