博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[J] Dumb Typo(题目很简单,比赛错在不该自己计算,应该用电脑跑一遍的)
阅读量:4037 次
发布时间:2019-05-24

本文共 1728 字,大约阅读时间需要 5 分钟。

1、

2、题目

  • [J] Dumb Typo

  • 时间限制: 2000 ms 内存限制: 262144 K       

  • 问题描述
  • Hello everyone who is partcipate in the Fighting For 2014 Contest, I'm MatRush. This is the simplest problem today, no algorithm knowledge needed, But it's also the hardest problem today if you are not on the right track, so please do not waste your time here if you have no idea with it after many tries.
    I was writing some C++ code one day, and I typed this fragment:
    x = y * 2 + 1;
    But unfortunately I had a bug. When y was 10, I wanted x to be 19. To fix this, I changed the '+' to a '-'.
    After fixing this bug, I wrote some more code:
    x = y * 2245 + (y * 2 - 7);
    I had a another bug. When y was 79, I wanted x to be 8841. What single character can I change to make this work? Remember your first answer as "pos,new char". For example, the answer to the first bug would be "10,-": we're changing the 10th (start from 0th) character ('+') to '-'.
    Several days later.
    I can't believe I made the same mistake again! Still this childish and straightforward code.
    x = y * 2245 + (y * 2 - 7);
    This time I had an another different bug. When y was 79, I wanted x to be 13186. What single character can I change to make this work? Remember your second answer as "pos,new char". For example, the answer to the first bug would be "10,-": we're changing the 10th (start from 0th) character ('+') to '-'.
  • 输入
  • There is no input           
  • 输出
  • Please submit your two answer in separate lines (two lines).
  • 样例输入
  • There is no input
  • 样例输出
  • Sorry, no sample output.But I give you a wrong output for sample format. Here it is.1,-2,+

     

    3、AC代码:

    #include
    #include
    #include
    using namespace std;char s[100];int main(){ printf("10,*\n"); printf("8,0\n"); return 0;}

     

转载地址:http://sgddi.baihongyu.com/

你可能感兴趣的文章
1.3 Debugging of Shaders (调试着色器)
查看>>
关于phpcms中模块_tag.class.php中的pc_tag()方法的含义
查看>>
vsftp 配置具有匿名登录也有系统用户登录,系统用户有管理权限,匿名只有下载权限。
查看>>
linux安装usb wifi接收器
查看>>
用防火墙自动拦截攻击IP
查看>>
补充自动屏蔽攻击ip
查看>>
谷歌走了
查看>>
多线程使用随机函数需要注意的一点
查看>>
getpeername,getsockname
查看>>
让我做你的下一行Code
查看>>
浅析:setsockopt()改善程序的健壮性
查看>>
关于对象赋值及返回临时对象过程中的构造与析构
查看>>
VS 2005 CRT函数的安全性增强版本
查看>>
SQL 多表联合查询
查看>>
Visual Studio 2010:C++0x新特性
查看>>
drwtsn32.exe和adplus.vbs进行dump文件抓取
查看>>
cppcheck c++静态代码检查
查看>>
在C++中使用Lua
查看>>
在Dll中调用自身的位图资源
查看>>
C++中使用Mongo执行count和distinct运算
查看>>