• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
HaibaraAi
博客园    首页    新随笔    联系   管理    订阅  订阅
2013年11月1日
Codechef November Challenge 2013 Missing some chairs
摘要: Missing some chairsProblem code: MCHAIRSSubmitMy SubmissionsAll SubmissionsRead problems statements in Mandarin Chinese and Russian.A new school in Byteland is now in the process of renewing some classrooms with new, stronger and better chairs, so that the students can stay still and pay attention t 阅读全文
posted @ 2013-11-01 22:59 HaibaraAi 阅读(108) 评论(0) 推荐(0)
Codechef November Challenge 2013 Uncle Johny
摘要: Uncle JohnyProblem code: JOHNYSubmitMy SubmissionsAll SubmissionsRead problems statements in Mandarin Chinese and Russian.Vlad enjoys listening to music. He lives in Sam's Town. A few days ago he had a birthday, so his parents gave him a gift: MP3-player! Vlad was the happiest man in the world! 阅读全文
posted @ 2013-11-01 22:51 HaibaraAi 阅读(483) 评论(0) 推荐(0)
纪念我sgu第一个10题!
摘要: 哎,等下次再做20题纪念一下!尼玛,根本做不出来,还要到处翻别人的555555555555 阅读全文
posted @ 2013-11-01 16:12 HaibaraAi 阅读(130) 评论(0) 推荐(0)
SGU 109 Magic of David Copperfield II
摘要: 109. Magic of David Copperfield IItime limit per test: 0.5 sec. memory limit per test: 4096 KBThe well-known magician David Copperfield loves lo show the following trick: a square with N rows and N columns of different pictures appears on a TV screen, Let us number all the pictures in the following 阅读全文
posted @ 2013-11-01 16:10 HaibaraAi 阅读(102) 评论(0) 推荐(0)
SGU 108 Self-numbers 2
摘要: 108. Self-numbers 2time limit per test: 1 sec. memory limit per test: 4096 KBIn 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for digitadition, a term coine 阅读全文
posted @ 2013-11-01 13:20 HaibaraAi 阅读(107) 评论(0) 推荐(0)
SGU 107 987654321 problem
摘要: 107. 987654321 problemtime limit per test: 0.5 sec. memory limit per test: 4096 KBFor given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321.InputInput contains integer number N (1 3 #include 4 #include 5 #include 6 #include 7 #incl... 阅读全文
posted @ 2013-11-01 07:42 HaibaraAi 阅读(162) 评论(0) 推荐(0)
SGU 106 The equation
摘要: 106. The equationtime limit per test: 0.5 sec. memory limit per test: 4096 KB 对于等式ax+by=c,a,b,c皆为整数,c如果是gcd(a, b)的倍数,则方程有解,否则方程无解。(定理1)因为等式ax+by=gcd(a, b)必定有解(定理1),所以可以解出来,解法如下: 因为gcd(a, b) = gcd(b, a % b),所以有bx1+(a%b)y1=gcd(a,b),注意!此时x1并不等于x,y1也不等于y!这个过程可以循环(就想求最大公约数一样),将b视为新的a',a%b视为新的b',可 阅读全文
posted @ 2013-11-01 00:15 HaibaraAi 阅读(151) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3