hdu4450
来源:互联网 发布:unity3d导入fbx动画 编辑:程序博客网 时间:2024/05/19 23:16
Draw Something
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2989 Accepted Submission(s): 2495
Problem Description
Wangpeng is good at drawing. Now he wants to say numbers like “521” to his girlfriend through the game draw something.
Wangpeng can’t write the digit directly. So he comes up a way that drawing several squares and the total area of squares is the number he wants to say.
Input all the square Wangpeng draws, what’s the number in the picture?
Wangpeng can’t write the digit directly. So he comes up a way that drawing several squares and the total area of squares is the number he wants to say.
Input all the square Wangpeng draws, what’s the number in the picture?
Input
There are multiple test cases.
For each case, the first line contains one integer N(1≤N≤100) indicating the number of squares.
Second line contains N integers ai(1≤ai≤100)represent the side length of each square. No squares will overlap.
Input ends with N = 0.
For each case, the first line contains one integer N(1≤N≤100) indicating the number of squares.
Second line contains N integers ai(1≤ai≤100)represent the side length of each square. No squares will overlap.
Input ends with N = 0.
Output
For each case, output the total area in one line.
Sample Input
41 2 3 433 3 30
Sample Output
3027
Source
2012 Asia JinHua Regional Contest
#include <stdio.h>main (){ int n,m,sum; while (scanf ("%d",&n)==1&&n) { sum=0; while (n--) { scanf ("%d",&m); sum=sum+m*m; } printf ("%d\n",sum); }}
0 0
- hdu4450
- hdu4450
- HDU4450
- hdu4450
- hdu4450 Draw Something
- hdu4450-Draw Something
- hdu4450 不错的贪心
- UVALive6336 HDU4450 Draw Something【水题】
- 动态加载当前屏幕的网页图片(网页拖动时图片加载显示)
- CPCI
- git@ubuntu-start!
- 如何才能让自己更有魅力
- 怎么样保存奔溃后activity中的数据
- hdu4450
- 高质量编程的金玉良言——依赖倒转原则
- Cookies vs Tokens. Getting auth right with Angular.JS
- 中国教育信息化的未来
- 中级篇——斐波那契数列详解
- TCP的拥塞机制
- 解决E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.NoSuchFieldError
- iphone开发之表格组件UITableView的使用(三)通过加载plist文件字典转模型方式展示分组数据
- 【SBT】 POJ 3481 Double Queue