随笔分类 - ACM Training
在信息竞赛过程中记录的一些代码与思路
摘要:Time Limit:1000MS Memory Limit:32768KB Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum
阅读全文
摘要:Time Limit:500MS Memory Limit:32768KB Description Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calc
阅读全文
摘要:Time Limit:1000MS Memory Limit:32768KB Description Calculate A + B. Input Each line will contain two integers A and B. Process to end of file. Output
阅读全文
摘要:103. Traffic Lights Time limit per test: 0.25 second(s) Memory limit: 4096 kilobytes 题解: 1、其实就是求两点间的最短路,不过加了交通灯的限制,使得两点间的所需时间并不只是由路程决定。 2、只有一条路两个端点的交通
阅读全文
摘要:102. Coprimes time limit per test: 0.25 sec. memory limit per test: 4096 KB 题解: 求一个1-10000之间的数 N 的互质数个数。题目很简单,有两种方法: 1、复杂度是O(n^2),依次判断从1到N-1的数是否与N互质。
阅读全文
摘要:101. Domino time limit per test: 0.25 sec. memory limit per test: 4096 KB 题解: 求多米诺骨牌按照一定方式放置能否使相邻的位置数字相同。其实就是求无向图的欧拉通路,dfs即可。 但需要注意以下几点: 1、注意是否是连通图。 2
阅读全文
摘要:100.A+B time limit per test: 0.25 sec. memory limit per test: 65536 KB 题解:上手题,不解释。 直接上代码: #include <iostream> using namespace std; int main(){ int a,
阅读全文

浙公网安备 33010602011771号