- 博客(16)
- 收藏
- 关注
原创 cin/cout 比 scanf/printf 慢吗
之前在看书的时候,作者曾经提到过 scanf/printf 比 cin/cout 快,并建议在ACM中尽量使用 scanf/printf当时也没怎么在意,毕竟 cin/cout 不用考虑格式占位符但是最近几天在做 POJ 2299 一道关于求逆序对的问题折腾了半天用树状数组做出来了发现耗时特别长,大多数AC的程序都在400ms上下而我的程序3000+ms一开始还在想可能是因为用
2015-04-05 22:18:40
1305
原创 Chapter 1 - A Tour of Computer System
Files such as hello.c that consist exclusively ASCII characters are known as text files, while all other files are known as binary files.In order to run the hello.c on the system, the individu
2015-03-26 08:05:52
490
原创 Eming Cup 网络赛 B-Topcoder
这是一道求TC得分的题目题目大意是给出题目数量和每道题的分数,花费时间,罚时求以最恰当的顺序做题能得到的最高分为多少可以想到是道0-1背包题但是首先要确定每道题的拓扑序假设题i在题j前一个做那么如果 交换i题和j题的做题顺序后得分变高即 A[i]-B[i]*(N+C[i]) + A[j
2015-03-20 00:05:42
495
原创 Eming Cup 现场赛 A-Divide
大致题意是给定N,求出最小的整数A满足A*X*X = N (X也为整数,1 思路就是枚举但是有一个小技巧如果直接枚举的话,次数是10^9数量级很容易TLE而利用等式的特性,可以降低枚举次数的数量级先将A从1开始枚举到10^6,如果没有符合条件的那么说明此时X一定小于10^6于是将X从去10^6开始枚举到1,一定能找到答案
2015-03-19 18:31:51
341
原创 CodeForces 520C DNA Alignment
C. DNA Alignmenttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya became interested in bioinformatics.
2015-03-14 23:26:40
602
原创 CodeForces 388A Fox and Box Accumulation
A. Fox and Box Accumulationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel has n boxes in her room
2015-03-04 19:24:02
502
原创 CodeForces 24A Ring road
A. Ring roadtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNowadays the one-way traffic is introduced all
2015-03-04 17:40:27
460
原创 CodeForces 340A The Wall
A. The Walltime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIahub and his friend Floyd have started painting
2015-03-04 17:24:57
416
原创 CodeForces 342A Xenia and Divisors
A. Xenia and Divisorstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia the mathematician has a sequence
2015-03-04 17:03:02
889
原创 CodeForces 342B Xenia and Spies
B. Xenia and Spiestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia the vigorous detective faced n (n
2015-03-04 13:32:40
579
原创 CodeForces 343A Rational Resistance
A. Rational Resistancetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMad scientist Mike is building a time
2015-03-03 22:35:30
433
原创 CodeForces 509B Painting Pebbles
B. Painting Pebblestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n piles of pebbles on the tabl
2015-03-03 22:05:09
823
原创 CodeForces 405A Gravity Flip
A. Gravity Fliptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Chris is bored during his physics les
2015-03-03 21:48:06
432
原创 CodeForces 407B Long Path
B. Long Pathtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day, little Vasya found himself in a maze c
2015-03-03 17:25:46
826
原创 CodeForces 510B Fox And Two Dots
B. Fox And Two Dotstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is playing a mobile puzzle gam
2015-03-03 16:13:29
528
原创 CodeForces 513B1 Permutations
B1. Permutationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a permutation p of numbers 1
2015-03-03 14:59:03
897
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人