注: 1. 对于double计算,一定要小心,必要时把与double计算相关的所有都变成double型. 2. for (int i = 0; i < N; i++) //N 不可写为N - 1,否则当N为1时无法进行: 原题: 1100. Pi Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 5683 Accepted Runs: 2317 Professor Robert A. J. Matthews…
下次不要被长题目吓到,其实不一定难. 先看输入输出,再揣测题意. 原文: 2548. Celebrity jeopardy Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 1306 Accepted Runs: 898 It's hard to construct a problem that's so easy that everyone will get it, yet still difficult enough…
原题: 2857. Digit Sorting Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 3234 Accepted Runs: 1704 Several players play a game. Each player chooses a certain number, writes it down (in decimal notation, without leading zeroes) and sorts t…
注意数据范围,十位数以上就可以考虑long long 了,断点调试也十分重要. 原题: 1065. Factorial Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 6067 Accepted Runs: 2679 The most important part of a GSM network is so called Base Transceiver Station (BTS). These transceiver…
注意: for (int i = 1; i <= aaa.length(); i++) 其中是“ i <= ",注意等号. 原题: 2520. Quicksum Time Limit: 0.5 Seconds Memory Limit: 65536KTotal Runs: 2964 Accepted Runs: 1970 A checksum is an algorithm that scans a packet of data and returns a single…
注:对于每一横行的数据读取,一定小心不要用int型,而应该是char型或string型. 原题: 1090. City hall Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 4874 Accepted Runs: 2395 Because of its age, the City Hall has suffered damage to one of its walls. A matrix with M rows an…
题目链接: Water problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 23 Accepted Submission(s): 14 Problem Description If the numbers 1 to 5 are written out in words: one, two, three, four, fi…
这道题目还是简单的,但是自己WA了好几次,总结下: 1.对输入的总结,加上上次ZOJ Problem Set - 1334 Basically Speaking ac代码及总结这道题目的总结 题目要求输入的格式: START X Y Z END 这算做一个data set,这样反复,直到遇到ENDINPUT.我们可以先吸纳一个字符串判断其是否为ENDINPUT,若不是进入,获得XYZ后,吸纳END,再进行输出结果 2.注意题目是一个圆周,所以始终用锐角进行计算,即z=360-z; 3.知识点的误…
参考: http://www.siongboon.com/projects/2013-07-08_raspberry_pi/index.html Raspberry Pi Get started with Raspberry Pi (RPi), a step by step approach to get your Raspberry Pi with low level electronics hardware control. Make simple, step by step…
参考:RPi Serial Connection 本文来自:http://www.raspberry-projects.com/pi/programming-in-c/uart-serial-port/using-the-uart Using the UART If you are running Raspbian or similar then the UART will be used as a serial console. Using a suitable cable, such as…
A Simple Problem with Integers [题目链接]A Simple Problem with Integers [题目类型]线段树 成段增减+区间求和 &题解: 线段树 成段增减+区间求和 模板题 这种题真的应该理解并且可以流畅的独立码出来了 [时间复杂度]\(O(nlogn)\) &代码: #include <iostream> #include <cstdio> #include <cstring> using namespa…
Problem 2082 过路费 Problem Description 有n座城市,由n-1条路相连通,使得任意两座城市之间可达.每条路有过路费,要交过路费才能通过.每条路的过路费经常会更新,现问你,当前情况下,从城市a到城市b最少要花多少过路费. Input 有多组样例,每组样例第一行输入两个正整数n,m(2 <= n<=50000,1<=m <= 50000),接下来n-1行,每行3个正整数a b c,(1 <= a,b <= n , a != b , 1…