南华大学ACM新生训练.docVIP

  • 3
  • 0
  • 约5.37千字
  • 约 8页
  • 2017-02-05 发布于北京
  • 举报
南华大学ACM新生训练

2013-6 南华大学ACM新生训练 系统使用说明: 采用PC^2系统提交,请点击桌面的用户名和密码同为teamXX ..XX为你在签名册上的标号,签名册将在你的桌面上。请找到自己的序号(用Ctrl+F 查找自己姓名)登录自己的账号交题。 交题时: 选择Submit在随后蹦出来的框中再确认选择Yes..题目提交成功..等几秒钟裁判机将返回结果..Yes为通过..No则会说明原因… 注意事项: 1、训练做题时间为19:30-22:00 程序文件请不要用中文命名和空格,否则提交会返回No - Compile error 编译不能.. 3、main请用int类型..并在结束前返回 return 0 如: int main() { …….. return 0; } 4、所有程序采用标准的输入输出,不要读写文件(也就是自己测的时候是屏幕输入输出) 5、题目的输入输出请按照题目的要求 6、No – Compile error 为编译错误,一般是你的程序名中包含非法字符或者程序缺少一些头文件 No – Wrong answer 为答案错误,请检查你的程序有无Bug No - Presentation Error 为格式错误,请检查你的程序输出格式时不是按照题目的要求来的 No –Time Limit Exceeded 为超时,你的程序效率太低,请优化算法 No – Connect staff 请找老队员具体询问 7、自己在调试时使用的system类的请在提交时删除或者用//屏蔽…. A. Even Odds Being a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is positive integer number). He is determined to rearrange them. But there are too many natural numbers, so Volodya decided to start with the first n. He writes down the following sequence of numbers: firstly all odd integers from 1 to n (in ascending order), then all even integers from 1 to n (also in ascending order). Help our hero to find out which number will stand at the position number k. Input The only line of input contains integers n and k (1≤k≤n≤1e14). Output Print the number that will stand at the position number k after Volodyas manipulations. Sample test(s) input 10 3 7 7 output 5 6 Note In the first sample Volodyas sequence will look like this: {1, 3, 5, 7, 9, 2, 4, 6, 8, 10}. The third place in the sequence is therefore occupied by the number 5. Hint 注意数据的类型 use __int64 to read data and use %I64d to output data B. Strings of Power Volodya likes listening to heavy metal and (occasionally) reading. No wonder Volodya is especially interested in texts concerning his favourite music style. Volodya calls a string powerful if it starts with heavy and e

文档评论(0)

1亿VIP精品文档

相关文档