poj 2643 Election

//這題要注意的兩點是:1.注意要用cin.get()輸入其結束標誌,要不對getline()的輸入造成影響//2.要注意選舉人的票數相同的情況,例如:最高票數的有兩個選舉人,那麼結果就是tie了! #include <iostream>#include <string>#include <algorithm> using namespace std;struct Info{ string name, party; int votes;

Ubuntu下minicom配置方法全解

轉自http://www.eefocus.com/PSOCPSOC/blog/11-09/230207_dade0.html我一直都是用ARM板卡與XP 系統的超級終端通訊,或者ARM板卡與xp系統的Tera Term Pro軟體通訊,Tera TermPro軟體就是一種超級終端的軟體,因為有的xp是不帶有超級終端的,因此可能需要安裝Tera Term

poj 2363 Blocks

//暴力0ms通過,題目的意思是:封裝這些立方體所需要的封裝紙的最小表面積! #include<iostream>#include<climits>using namespace std;int main(){ int tc, cube, i, a, b, c, min, tmp; cin >> tc; while (tc--){ cin >> cube; min = INT_MAX;

poj 2803 Defining Moment

//其實是一道很水的題,點知道我在沒有讀懂題意的情況之下,把其做法往深處想了!//注意:You need to expand at most one prefix and one suffix,意思是說只要進行一次首碼和尾碼的//轉換即可(要在有首碼和尾碼的情況之下啊) #include <iostream>#include <string>#include <map> using namespace std;string pre[5],

poj 3366 Deli Deli

#include <iostream>#include <string>#include <map> using namespace std;map<string, string> m; map<string, string>::iterator it; int main(){ int l, n, i, len; string str1, str2; bool flag; cin >> l

poj 3982 序列

#include <iostream>#include <string>#include <memory.h>using namespace std;string str[1000];int n;string solve(string str1, string str2, string str3){ int i, j, c, nn, len1, len2, len3, num1[100], num2[100], num3[100], tmp[100

poj 2470 Ambiguous permutations

//第一次用了cin竟然逾時了,我暈! #include<iostream>#include<cstdio>using namespace std;int p[100010], ans[100010];int main(){ int num, i; bool flag; while (scanf("%d", &num)){ if (num == 0) break; flag = false;

poj 1056 IMMEDIATE DECODABILITY

//這一題用暴力求解可以過,但是當資料比較大的時候,就肯定會逾時,所以就用到了字典樹,這也是我第一次接觸字典樹,花了幾小時//看懂了字典樹的原理之後,再看懂別人的代碼,自己打出來,無辦法,第一次接觸,還需要多多的練習! /*#include <iostream>#include <string>#include <vector>using namespace std;vector<string> v; int main(){ int tc

strcpy strlen memcpy strcat strcmp strstr strrev函數的實現代碼

/* //strcpy函數的實現,注意命名要與原來的庫函數有區別 #include <iostream>#include <cstdio>#include <assert.h>using namespace std;char *mystrcpy(char *strDest, const char *strSrc){ if ((strDest == NULL) || (strSrc == NULL))//保證strDest和strSrc的有效性

poj 2498 StuPId

//Multiply the digits from back to front (!) with repeating factors 9, 3, 7//一定要注意上面這句話的意思,要不在進行求和的時候就會出錯! #include <cstdio>#include <iostream>#include <string>using namespace std;char id[10];int main(){ int tc, len, i, cur, ans,

erase方法的正確使用

STL中的容器按儲存方式分為兩類,一類是按以數組形式儲存的容器(如:vector

poj 1917 Automatic Poetry

//主要就是考察輸入輸出的題目,竟然用了那麼久來解決這個問題!自己的基礎還不行! #include <iostream>#include <cstdio>#include <string>using namespace std;int main(){ int tc, len1, len2, i, j, pos1, pos2, pos3, pos4; string input1, input2, s1, s2, s3, s4, s5, s6;

poj 3297 Open Source

//這題由於用了set中的erase總是出現段錯誤,所以不得不要轉換過來,用了比較繁瑣的轉換!代碼亦加長了不少!囧! #include <iostream>#include <string> #include <set> #include <algorithm> #include <vector> using namespace std;set<string>::iterator it;struct Info{

poj 2190 ISBN

//不要被這句話迷惑了:Each of the first nine digits can take a value between 0 and 9!!!無關的一句話//這題需要考慮的情況比較多,只要細心一點分清楚需要討論的情況就OK! #include<iostream>#include<string>#include<algorithm>using namespace std;int main(){ string str; cin

poj 3749 破譯密碼

#include <iostream>#include <string>#include <map>#include <cctype>using namespace std;map<char, char> m;int main(){ int i, len; string str, ans; ans.clear(); m['A'] = 'V', m['B'] = 'W', m['C'] = 'X', m['D']

poj 1674 Sorting by Swapping

#include <iostream>#include <memory.h>#include <algorithm>using namespace std;int num[10010];int main(){ int tc, n, i, j, ans; cin >> tc; while (tc--){ cin >> n; ans = 0; memset(num, 0

poj 3173 Parkside’s Triangle

#include <iostream>using namespace std;const int MAX = 25;int triangle[MAX][MAX];int main(){ int n, s, i, j, k; bool flag = false; cin >> n >> s; for (i = 0; i <= n; i++){ for (j = 0; j <= i; j++){

poj 3126 Prime Path

#include <iostream>#include <memory.h>#include <queue>using namespace std;const int MAX = 100000;//竟然RE了三次,就是因為這裡的MAX開小了! int step[MAX];bool prime[MAX];int base[4] = {1, 10, 100, 1000};int main(){ int i, j, tc, num1, num2, n[5],

poj2328 Guessing Game

#include<iostream>#include<string>#include<vector>using namespace std;struct Info//guess資訊儲存 { int num; string guess;};vector<Info> v;//儲存資訊的結構體! int main(){ int size, i; Info info, tmp; v.clear();

poj 2350 Above Average

//主要考察浮點數的處理! #include<iostream>#include<cstdio>using namespace std;int scores[1010];int main(){ int tc, num, i, c; double sum, average, ans; cin >> tc; while (tc--){ cin >> num; sum = c = 0;

總頁數: 61357 1 .... 19889 19890 19891 19892 19893 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.