题目链接:Highways
没看题,看了输入输出,就有种似曾相识的感觉,果然和HDU1102 题相似度99%,但是也遇到一坑
cin输入竟然TLE,cin的缓存不至于这么狠吧,题目很水,矩阵已经告诉你了,就敲个模板就是了,5分钟,1A
题意就是打印,最小生成树的最大边权,改了改输入,水过
这个题完了,我的个人POJ计划进度以完成 20/200,这其中主要是图论的题,等下周把...
分类:
其他好文 时间:
2014-06-16 20:15:56
阅读次数:
221
题目链接:Agri-Net
最小生成树水题,数组开的和题目描述一样,但是就是RE,有填了个0,还好这个题用 库鲁斯卡尔 敲了一遍,发现了点问题,以前写的库鲁卡尔模板有点问题,多写了步无用的操作,已修正。
题意:就是一个农夫想选镇长。。。。建一条路,使之能到达所有点,距离最短。
scanf输入
796K
32MS
cin输入
...
分类:
Web程序 时间:
2014-06-16 19:11:17
阅读次数:
429
水题,注意数据范围即可#include #include #include using
namespace std;typedef pair Point;int main(){ int x,y; cin >> x >>y;
Point a,b; if((x>0 && y > ...
分类:
其他好文 时间:
2014-06-16 10:47:47
阅读次数:
226
#include
#include
using std::cout;
using std::endl;
using std::cin;
using std::string;
int main(void){
string str1="We can insert a string";
string str2="a str into ";
//在字符串指定位置...
分类:
编程语言 时间:
2014-06-15 19:29:30
阅读次数:
251
compare函数用来进行字符串以及其子串的比较,示例如下:
#include
#include
#include
using std::cout;
using std::endl;
using std::cin;
using std::string;
int main(void){
const int maxlength=100;
string str1="hi,t...
分类:
编程语言 时间:
2014-06-15 08:52:26
阅读次数:
287
水题#include #include #include using namespace std;int main(){ vector a(4); cin >> a[0] >> a[1]>>a[2]>>a[3]; string str; cin >> str; int res = 0; for(in...
分类:
其他好文 时间:
2014-06-14 23:00:14
阅读次数:
249
暴利搜索即可#include #include #include using namespace std;int main(){ int n,k,x; cin >> n >> k >> x; vector c(n); for(int i = 0 ; i > c[i]; ...
分类:
其他好文 时间:
2014-06-14 18:47:42
阅读次数:
206
近期让学生敲代码交作业的时候要求他们仅仅给我交个cpp文件和一个exe文件,这样交上来的东西不至于太多,不占我的地方,可是有一个问题是exe它总是执行完后就直接关闭界面了,看不到执行结果的界面。然后我就教他们说,用一个cin语句,让界面停留一下等待用户输入,这样我们就能够看得到界面了。(我认为眼下为...
分类:
编程语言 时间:
2014-06-14 16:31:05
阅读次数:
276
Java: import java.util.*; public class Main{ public static void main(String args[]){ Scanner cin = new Scanner(System.in); int a, b; whil...
分类:
编程语言 时间:
2014-06-14 15:26:25
阅读次数:
253
cin流可以用于读取标准输入流的一个字符,一行字符包含空格,多行字符等,示例如下:
#include
using std::cout;
using std::endl;
using std::cin;
int main(void){
const int maxlength=100;
char text[maxlength]={0};
char test=0;
//...
分类:
编程语言 时间:
2014-06-14 07:46:55
阅读次数:
321