已解决(ps over%100写错了,应该是over/100。。。)

#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
int gcd(int a, int b){return b == 0 ? a : gcd(a%b, a);}
const int N = 12;
int main()
{
int m, over = 0, re; double save = 0.;
for(int i = 0; scanf("%d", &m) and i < N; i++)
{
over += 300 - m;
if (over > 99) re = (over % 100) * 100, save += re, over -= re;
else if (over < 0) return printf("-%d\n", i + 1), 0;
}
save *= 1.2;
return printf("%d\n", over + (int)save), 0;
}

  解决了(ps 因为我的m设置得还是太小了,改为0x3f3f3f3f就过了):

#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define min(a, b) ((a) < (b) ? (a) : (b))
int gcd(int a, int b){return b == 0 ? a : gcd(a%b, a);}
const int N = 3;
int main()
{
int a, b, c, k, m = 100010;
scanf("%d", &a);
for(int i = 0; scanf("%d %d", &b, &c) && i < N; i++)
{
k = (int)ceil((double)a / (double)b);
m = min(m, k*c);
}
return printf("%d\n", m), 0;
}

  P1308 只过了4个测试点,不知道什么原因。。。

#include <cstdio>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i <= b; i++)
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define index(a) (a - 'A')
#define transUpp(a) (a - 32)
#define transLow(a) (a + 32)
#define ll long long
int gcd(int a, int b){return b == 0 ? a : gcd(a%b, a);}
const int N = 1000010;
int main(int n, char**v)
{
string s; int letter[128];
char sen[N], word[10], *pw;
int count = -1, f, pos = N, i, x, l;
scanf("%s", word);
while(getchar() != '\n') continue;
getline(cin, s);
strcpy(sen, s.c_str());
for (int j = 0; j < 128; j++)
if (j < 26) letter[j] = 1;
else letter[j] = 0;
for (int j = 0; word[j]; j++)
if (letter[index(word[j])] != 0)
word[j] = transLow(word[j]);
for (int j = 0; sen[j]; j++)
if (letter[index(sen[j])] != 0)
sen[j] = transLow(sen[j]);
i = 0;
while(sen[i])
{
l = 0;
if (sen[i] == ' ')
{
i++;
continue;
}
f = 0, pw = word;
while(*pw)
if (*pw++ == sen[i++]) f = 1, x = i - 1, l++;
else
{
f = 0;
break;
}
if (f) pos = min(pos, x - l + 1), count++;
}
if (count > -1)
printf("%d %d\n", count + 1, pos);
else cout << count << endl;
return 0;
}

  P1553 6个测试点没过。。不知道什么原因

#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i <= b; i++)
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define index(a) (a - 'A')
#define transUpp(a) (a - 32)
#define transLow(a) (a + 32)
#define ll long long
#define PB push_back
int gcd(int a, int b){return b == 0 ? a : gcd(a%b, a);}
const int N = 1000010;
int main(int n, char**v)
{
vector<char> s_;
char s[N];
cin >> s;
int i, j = -1, pos = -1;
for (i = 0; s[i]; i++)
if (s[i] == '%' || s[i] == '.' || s[i] == '/') pos = j = i;
if (j > -1)
{
while (s[--j] == '0');
while (s[j])
s_.PB(s[j--]);
s_.PB(s[pos++]);
while (s[pos] == '0') pos++;
}
while (s[i - 1] == '0') i--;
while (i-- > pos)
s_.PB(s[i]);
for (auto c : s_)
cout << c;
return 0;
}

  

迷のbug的更多相关文章

  1. Guava 是个风火轮之函数式编程(3)——表处理

    云栖社区> 博客列表> 正文 Guava 是个风火轮之函数式编程(3)--表处理 潘家邦 2016-01-26 13:19:21 浏览1062 评论0 java Guava 摘要: 早先学 ...

  2. 【OpenCV】全景拼接

    从OpenCV3.0正式版开始,features2d中的一些接口,搬到附加库xfeatures2d中了,其中就有SIFT.SURF的特征检测方法,但是正常下载安装OpenCV并不包含附加库,因为附加库 ...

  3. 踩坑之路_"var name = ' ';"_迷之BUG

    情景介绍:最近写一个拖拽生成图表的工具,自己的思路每次mousedown的时候动态将this的name属性值赋值给全局中变量(自己手贱测试时直接将变量名命名为了'name',一大波bug还有30s到达 ...

  4. 迷之bug

    是这样的.要解决tbody滚动,而thead不动的布局问题,我把它们分别放在两个表格里,上面的只有thead,下面的只有tbody, 然后解决宽度对齐的问题,我用colgroup设置每列的宽度,用的都 ...

  5. paip.提升效率--僵尸代码的迷思

    paip.提升效率--僵尸代码的迷思 僵尸代码是指你的代码库里被注释掉的那部分代码, 很少去使用它,就像僵尸一样, 看雷kill-the-zombies-in-your-code ========== ...

  6. WP老杨解迷:如何营造让人花钱的游戏

    游戏是最好做也是最不好做的项目,游戏的好坏现在都是直接从数据来说话,Windows Phone的游戏应用同样不可能逃出这个行业准则,要说在市场里做的好,那就直接拿数据来说,几乎没人会去在乎游戏到底传达 ...

  7. ionic 使用了 crosswalkwebview 所产生的bug 及 解决方案

    一.问题产生: 在ionic app 优化方案中,我在前之前的博文中提到使用 --crosswalkwebview: 使用了crosswalkwebview后,app的显示及兼容效果确实很不错,虽然a ...

  8. bug终结者 团队作业第一周

    bug终结者 团队作业第一周 小组组员及人员分工 小组成员 组长: 20162323 周楠 组员: 20162302 杨京典 20162322 朱娅霖 20162327 王旌含 20162328 蔡文 ...

  9. java 华容道 迷弟版(向 xd-女神 吴嘉欣致敬)

    // Person.java 每个方块人物是一个类 package test; import javax.swing.*; import java.awt.*; import java.awt.eve ...

随机推荐

  1. Python_函数进阶

    楔子 假如有一个函数,实现返回两个数中的较大值: def my_max(x,y): m = x if x>y else y return mbigger = my_max(10,20)print ...

  2. 松软科技Web课堂:AJAX 简介

    AJAX AJAX 并不是编程语言. AJAX 是一种从网页访问 Web 服务器的技术. AJAX 代表异步 JavaScript 和 XML. AJAX 实例解释 HTML 页面 <!DOCT ...

  3. IntelliJ IDEA 2017.3尚硅谷-----模板

    https://www.jetbrains.com/help/idea/using-live-templates.html  

  4. fdssd

    #include<stdio.h> #include<string.h> #include<math.h> #include<iostream> #in ...

  5. HTML学习(2)编辑器

    HTML编辑常用的编辑器:Notepad++.Sublime Text.VS Code 可以使用Emmet插件来提高编码速度. 注:emmet只支持32位的Notepad++. 注意这里要把这两个dl ...

  6. Javaweb项目的命名规范

    项目名称:一般是英文 包名:公司域名的倒写,例如com.baidu 数据访问层:dao,persist,mapper 实体:entity,model,bean,javabean,pojo 业务逻辑:s ...

  7. Scrapy爬取伯乐在线的所有文章

    本篇文章将从搭建虚拟环境开始,爬取伯乐在线上的所有文章的数据. 搭建虚拟环境之前需要配置环境变量,该环境变量的变量值为虚拟环境的存放目录 1. 配置环境变量 2.创建虚拟环境 用mkvirtualen ...

  8. 水题Eating Soup

    A. Eating Souptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutput ...

  9. IntelliJ IDEA 2017.3尚硅谷-----查看项目配置

  10. 如何用navicat连接linux服务器上的mysql以及重启服务

    1,开启mysql权限:https://www.cnblogs.com/NaughtyCat/p/how-to-connect-to-mysql-on-linux-by-navicat.html my ...