uva414 - Machined Surfaces
/*
水题,值得一提的是,getline使用时注意不能让它多吃回车键,处理方法可以用getchar。
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int n; while (cin >> n, n)
{
getchar(); //第一个回车键会被getline拿去,所以要用getchar处理这个回车 定义在cstdio string s[n]; int black[n], sum = ; for (int i = ; i < n; ++i)
{
getline(cin, s[i]); int temp = ; for (int j = ; j < s[i].size(); ++j)
{
if (s[i][j] == 'X')
temp--;
} black[i] = temp; sum += black[i];
} cout << sum - *min_element(black, black+n)*n << endl;
}
}
uva414 - Machined Surfaces的更多相关文章
- UVa 414 - Machined Surfaces
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=s ...
- 414 - Machined Surfaces
Sample Input (character "B" for ease of reading. The actual input file will use the ASCII- ...
- UVA_414:Machined Surfaces
Language : C++ 4.8.2 #include<stdio.h> #include<string.h> int main(void) { int n; int su ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- 【索引】Volume 0. Getting Started
AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- HOJ题目分类
各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- <<Differential Geometry of Curves and Surfaces>>笔记
<Differential Geometry of Curves and Surfaces> by Manfredo P. do Carmo real line Rinterval I== ...
随机推荐
- Android图片下载以及缓存框架
实际开发中进行图片下载以及缓存的框架 介绍一下开发中常见图片加载框架的使用和对比一下优缺点. 1.Picasso 框架 在Android中开发,常需要从远程获取图片并显示在客户端,当然我们可以使用原生 ...
- Ubuntu12.04 Bugzilla 和 TestOpia的安装步骤
1. 安装apache User@ubuntu:$ sudo apt-get install apache2 注:安装完以后能够通过http://192.168.128.128/ 来訪 ...
- Twelves Monkeys (multiset解法 141 - ZOJ Monthly, July 2015 - H)
Twelves Monkeys Time Limit: 5 Seconds Memory Limit: 32768 KB James Cole is a convicted criminal ...
- 为 sublime text3 添加 github 上的插件
1.CMD+SHIFT+P ---> ADD REPOSITORY 输入 github 上的地址 https://github.com/akira-cn/sublime-gbk 2.CMD+SH ...
- asp.net生成视图时报错 未引用System.Runtime, Version...
这是没有添加程序集引用 在程序集中添加一条引用 <compilation debug="true" targetFramework="4.5.1"> ...
- simpleRNN
simpleRNN 训练集为<爱丽丝梦境>英文版txt文档,目标:根据随机给出的10个字符,生成可能的后100个字符 词向量空间生产 In [4]: INPUT_FILE = " ...
- yum安装Apache Web Server后各个文件存放位置
yum安装Apache Web Server后各个文件存放位置 用yum安装apache软件: yum -y install httpd 安装完成后,来查看理解yum安装软件的过程和安装路径. ...
- JNI调用实例
1. 环境 Windows7-64Bit VS2010-32Bit JDK1.8-64Bit 2. 步骤 2.1 创建NativePrint类 public class NativePrint { p ...
- [sh]清理memcached缓存
#!/bin/bash ###author xxx ###date xxx ###清理内存缓存 used=`free -m | awk 'NR==2' | awk '{print $3}'` free ...
- flink on yarn部分源码解析
转发请注明原创地址:https://www.cnblogs.com/dongxiao-yang/p/9403427.html flink任务的deploy形式有很多种选择,常见的有standalone ...