hdu 2099 整數的尾數 http://acm.hdu.edu.cn/showproblem.php?pid=2099

#include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b) { int tag=0; if(a==0&&b==0) break; for(int i=0;i<=9;i++) for(int j=0;j<=9;j++) { int final=a*100;

nefu 84 http://acm.nefu.edu.cn/test/problemshow.php?problem_id=84

#include<iostream>using namespace std;typedef long long inta;int extend_gcd(inta a,inta b,inta &x,inta &y,inta &gcd){ if(b==0) { x=1; y=0; gcd=a; } else { extend_gcd(b,a%b,x,y,gcd); int temp=x;

nefu 118 質數在階乘中的冪 http://acm.nefu.edu.cn/test/problemshow.php?problem_id=118

#include<iostream>#include<cmath>using namespace std;int main(){ int k; cin>>k; int n; while(cin>>n) { int exponent=0; for(int i=1;pow(5.0,i)<=n;i++) exponent+=n/pow(5.0,i); cout<<exponent<<

http://acm.hdu.edu.cn/showproblem.php?pid=1496

思路:主要將等式化為左右兩部分,用一個hash數組先把左邊的值存起來,,然後在計算右面的值時只需要定址就行了,,,,EquationsTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2456 Accepted Submission(s): 969Problem DescriptionConsider equations having the

http://acm.nyist.net/JudgeOnline/problem.php?pid=510

題意中文不解釋。。思路:以每個物品當做圖中的頂點,以優惠的價格為邊權,建圖,這裡讓求需要的最少金幣,故可以轉化為最短路問題,這裡引入一個超級源點0,可以看做是每個物品都可以和自己交換,但沒有優惠價格,當找不到可交換的物品時(只能和自己交換),則返回當前的最短路徑長度,即是所需要的最少金幣。#include<iostream>#include<vector>#include<algorithm>#include<string.h>#include&l

http://acm.nyist.net/JudgeOnline/problem.php?pid=90

整數劃分時間限制:3000 ms | 記憶體限制:65535 KB難度:3描述 將正整數n表示成一系列正整數之和:n=n1+n2+…+nk, 其中n1≥n2≥…≥nk≥1,k≥1。 正整數n的這種表示稱為正整數n的劃分。求正整數n的不 同劃分個數。 例如正整數6有如下11種不同的劃分: 6; 5+1; 4+2,4+1+1; 3+3,3+2+1,3+1+1+1; 2+2+2,2+2+1+1,2+1+1+1+1; 1+1+1+1+1+1。 輸入 第一行是測試資料的數目M(1<=M<=10

http://acm.nyist.net/JudgeOnline/problem.php?pid=150

棧的應用水題,,#include<string>#include<stack>#include<string.h>#include<iostream>using namespace std;string a[20];int main(){int n;string s,s1;while(cin>>n){ stack<char> Q;cin>>s>>s1;int i=0,j=0;int

http://acm.nyist.net/JudgeOnline/problem.php?pid=58

bfs搜尋水題進行時~~~~#include<iostream>#include<string.h>#include<cstdio>#include<string>#include<queue>using namespace std;int map[9][9]={1,1,1,1,1,1,1,1,1, 1,0,0,1,0,0,1,0,1, 1,0,0,1,1,0,0,0,1, 1,0,1,0,1,1,0,1,1, 1,0,0,0,0,1,

http://acm.nyist.net/JudgeOnline/problem.php?pid=119

一開始想的是寫兩個查詢一個找最大值,一個找最小值,沒想到卻tle,,最後寫了一個查詢,,卻莫名其妙的過了,杯具的線段樹求法~~~~#include<iostream>#include<cstring>#include<cstdio>#include<cmath>#include<climits>#include<algorithm>using namespace std;const int MAX =

http://acm.nyist.net/JudgeOnline/problem.php?pid=221

已知一棵樹的先序和中序遍曆,求該樹的後序遍曆,,,例如:DBACEGF ABCDEFGACBFGEDAC代碼:#include<stdio.h>#include<string.h>void build(int n,char *s1,char *s2)//構造後序遍曆過程{if(n<=0) return;int

http://acm.nyist.net/JudgeOnline/problemrank.php?pid=525

可以當做STL的入門題,,杯具的是我竟然忘記考慮字串最後一個不應定是以5結束,因此總是少一個資料。。#include<string>#include<set>#include<iostream>#include<cstdio>#include<stdlib.h>using namespace std;int main(){ string s; while(cin>>s) { multiset<

http://acm.nyist.net/JudgeOnline/problem.php?pid=27

搜尋入門題。。。#include<iostream>#include<string.h>#include<string>using namespace std;int map[105][105];void dfs(int x,int y){if(!map[x][y]) return;map[x][y]=0;dfs(x-1,y);dfs(x+1,y);dfs(x,y-1);dfs(x,y+1);}int main(){int

http://acm.nyist.net/JudgeOnline/problem.php?pid=301

http://www.matrix67.com/blog/archives/276原來線性代數中的矩陣有這般用處真是神奇啊,,,遞推求值問題=矩陣運算+二分。。代碼:#include<iostream>#include<cstdio>using namespace std;typedef long long LL;LL c[3][3];void f(LL a[3][3],LL b[3][3]){ c[0][0]=(a[0][0]*b[0][0]+a[0][1]*b[1][

http://acm.uestc.edu.cn/problem.php?pid=1784&&

Description時間是最難以捉摸的東西,光是測量它們就已經很難了。一般而言,測量時間用一個可重複等時間長度發生的事件來定義最小的時間可測單位。於是Krolia想到了一個測量時間的好方法。Krolia有一盒火柴,如果把火柴的頭去掉火柴就會變成一樣長的木棍。Krolia知道一根(沒有火柴頭)木棍一端點燃後,整個燃燒會持續x時間。Krolia還可以從兩端同時點燃木棍,這樣燃燒會持續x/2時間。現在Krolia想用這堆火柴來計時,問什麼樣的時間可以被完全精確地計算出。Input第一行一個整數T(T

http://acm.hdu.edu.cn/showproblem.php?pid=2222&&AC自動機

第一道AC自動機題~ 其實就是字典樹上的KMP演算法,主要就是學會建字典樹和構造失敗指標。字典樹我用的是數組類比的方法~AC代碼:#include <iostream>#include<string.h>#include<algorithm>#include<cstdio>#include<queue>#define Fp freopen("1.txt","r",stdin)#define N 2000005using

http://acm.hdu.edu.cn/showproblem.php?pid=1023&&卡特蘭數

Problem DescriptionAs we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing order, how many orders that all the trains can get out of the railway.InputThe input contains

http://acm.nyist.net/JudgeOnline/problem.php?pid=520

最大素因子時間限制:1000 ms | 記憶體限制:65535 KB難度:2描述 i c e最近正在學習數論中的素數,但是現在他遇到了一個難題:給定一個整數n,要求我們求出n的最大素因子的序數,例如:2的序數是1,3的序數是2,5的序數是3,以此類推. 研究數論是需要很大的耐心的,為了懲罰那些沒有耐心讀完題目的童鞋,我們規定:1的最大素因子序數是0.輸入 有多組測試資料,每一行輸入一個數字n.(0<n<=1000000) 輸出 在接下來的一行,輸出結果. 範例輸入

歐拉迴路的應用&&http://acm.hdu.edu.cn/showproblem.php?pid=3018

題意:給你一個圖,問你最少幾筆能畫完該圖,其中孤立的點除外#include<cstdio>#include<string.h>#include<vector>#include<string>#define N 100005#include<algorithm>#include<iostream>using namespace std;int

http://acm.hdu.edu.cn/showproblem.php?pid=1878&&歐拉迴路

判斷無向圖的歐拉迴路,不解釋,,,,AC代碼:#include<iostream>#include<string.h>#include<cstdio>#define CLR(arr,val) memset(arr,val,sizeof(arr))#define N 1001using namespace std;int deg[N];int Father[N];void init(int n){CLR(deg,0);for(int i=0;i!=n+1;++

php支援GD library

在wordpress上安裝外掛程式NextGEN Gallery 用於支援相簿,在上傳圖片後出現錯誤You do not have the GD Library installed. This class requires the GD library to function properly. visit http://us2.php.net/manual/en/ref.image.php for more

總頁數: 1662 1 .... 454 455 456 457 458 .... 1662 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.