It's the year 4527 and the tanks game that we all know and love still exists. There also exists Great Gena's code, written in 2016. The problem this code solves is: given the number of tanks that go into the battle from each country, find their product. If it is turns to be too large, then the servers might have not enough time to assign tanks into teams and the whole game will collapse!

There are exactly n distinct countries in the world and the i-th country added ai tanks to the game. As the developers of the game are perfectionists, the number of tanks from each country is beautiful. A beautiful number, according to the developers, is such number that its decimal representation consists only of digits '1' and '0', moreover it contains at most one digit '1'. However, due to complaints from players, some number of tanks of one country was removed from the game, hence the number of tanks of this country may not remain beautiful.

Your task is to write the program that solves exactly the same problem in order to verify Gena's code correctness. Just in case.

Input

The first line of the input contains the number of countries n (1 ≤ n ≤ 100 000). The second line contains n non-negative integers aiwithout leading zeroes — the number of tanks of the i-th country.

It is guaranteed that the second line contains at least n - 1 beautiful numbers and the total length of all these number's representations doesn't exceed 100 000.

Output

Print a single number without leading zeroes — the product of the number of tanks presented by each country.

Sample test(s)
input
3
5 10 1
output
50
input
4
1 1 10 11
output
110
input
5
0 3 1 100 1
output
0

水题啦不过要注意一些细节 比如对0的处理 比如...好像没什么了啊...
#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <queue>
#include <map>
#include <vector>
#include <set>
#include <algorithm>
#define INF 0x3F3F3F3F
using namespace std; bool isBeautiful(char data[]){
int len = strlen(data);
if(data[] != '') return false;
for(int i = ; i < len; i++){
if(data[i] != '') return false;
}
return true;
} int main()
{
int n, digit = ;
char data[], nonb[] = "";
bool zero = false;
scanf("%d", &n);
while(n--){
scanf("%s", data);
if(data[] == '') zero = true;
if(isBeautiful(data)) digit += strlen(data) - ;
else strcpy(nonb, data);
}
if(zero) puts("");
else{
printf("%s", nonb);
for(int i = ; i <= digit; i++) printf("");
putchar('\n');
}
return ;
}
close

Codeforces Round #339 Div.2 B - Gena's Code的更多相关文章

  1. Codeforces Round #339 (Div. 2) B. Gena's Code 水题

    B. Gena's Code 题目连接: http://www.codeforces.com/contest/614/problem/B Description It's the year 4527 ...

  2. Codeforces Round #339 (Div.2)

    A. Link/Cut Tree time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...

  3. Codeforces Round #339 (Div. 1) A. Peter and Snow Blower 计算几何

    A. Peter and Snow Blower 题目连接: http://www.codeforces.com/contest/613/problem/A Description Peter got ...

  4. Codeforces Round #339 (Div. 2) A. Link/Cut Tree 水题

    A. Link/Cut Tree 题目连接: http://www.codeforces.com/contest/614/problem/A Description Programmer Rostis ...

  5. Codeforces Round #339 (Div. 1) C. Necklace 构造题

    C. Necklace 题目连接: http://www.codeforces.com/contest/613/problem/C Description Ivan wants to make a n ...

  6. Codeforces Round #339 (Div. 1) B. Skills 暴力 二分

    B. Skills 题目连接: http://www.codeforces.com/contest/613/problem/B Description Lesha plays the recently ...

  7. Codeforces Round #339 Div.2 C - Peter and Snow Blower

    Peter got a new snow blower as a New Year present. Of course, Peter decided to try it immediately. A ...

  8. Codeforces Round #339 Div.2 A - Link/Cut Tree

    第一次正式参加常规赛想想有些小激动的呢 然后第一题就被hack了 心痛 _(:зゝ∠)_ tle点在于越界 因此结束循环条件从乘变为除 done //等等 这题没过总评 让我静静........ // ...

  9. Codeforces Round #339 (Div. 2) A

    Description Programmer Rostislav got seriously interested in the Link/Cut Tree data structure, which ...

随机推荐

  1. 大开眼界 游览Facebook香港办公室

    想加入Facebook 的话不一定要跑去美国,Facebook在香港也开了一个很赞的办公室.除了无敌海景外,更可享用按摩椅.乒乓球桌.跑步机.麻将桌.酒廊.育婴室及开放式厨房.

  2. ODI中通过配置表和自定义逆向工程获取数据库信息

    自定义逆向工程RKM 从配置表meta_db, meta_table, meta_column, meta_key中获取生产库的元数据信息.

  3. JS获取客户端Mac和IP

    JS获取硬件信息是通过ActiveX进行获取的,因此只能IE浏览器支持,火狐不支持 而且必须降低浏览器安全级别,因此不到万不得以一般不会采用这种方式 <html> <head> ...

  4. 06-图1 List Components

    这题主要涉及到了队列,无向图的邻接矩阵表示,图的深度和广度优先搜索.又是糙哥,参考了他的程序(http://www.cnblogs.com/liangchao/p/4288807.html),主要是B ...

  5. 2016 - 1- 22 NSURLConnetction --- GET请求

    ---恢复内容开始--- 一: 给服务器发送一个简单的GET请求 1.同步 // 发送一个GET请求给服务器 // 0.请求路径 NSURL *url = [NSURL URLWithString:@ ...

  6. 产生冠军 map 的 应用 .

    开始 比赛  ,  每一次的 比赛 都会有人失败 , 如果产生英雄的话  , 那就是产生 唯一一个 没有被打败的人  , 就是英雄, . #include<stdio.h> #includ ...

  7. 用python做些有意思的事——分析QQ聊天记录

    ####################################### 已更新续集,戳这里. ######################################## 是这样的,有位学 ...

  8. iOS支付

    1.IOS purchase 介绍 所谓的IOS 内支付就是在应用中内嵌Store,在iOS APP 中使用Store Kit framework来实现In-App Purchase,Store Ki ...

  9. HDU 5093

    http://acm.hdu.edu.cn/showproblem.php?pid=5093 二分图最大匹配的经典建图模型,行列分别缩点(连起来的'*' & 'o'),交集有'*'就连边 #i ...

  10. HDU 5009

    http://acm.hdu.edu.cn/showproblem.php?pid=5009 题意:一个数列,每个点代表一种颜色,每次选一个区间覆盖,覆盖的代价是区间内颜色种类数的平方,直到覆盖整个数 ...