Time of Update: 2018-12-03
/*下面需要推導一下求VR的公式:V2=iR=CR d/dt (VS*cos(wt)-VR*cos(wt+q))=VRcos(wt+q) = CR w (sin(wt+q)-sin(wt))=VRcos(wt+q)下面用到高中數學當中的計算方法,分別令 t=0 和 wt+q=0 ,得到 CRw tan b = 1 和 VR=CRw VS sin b ,然後利用三角函數中的萬能公式,求得 :VR = CRw VS / sqrt (1+ (CRw) ^ 2
Time of Update: 2018-12-03
//照著地圖取花生,每次都是取最大的花生數,在限定的步數內,可以取到最多的花生數!用貪心就可以! #include "cstdio"#include "iostream"#include "math.h"using namespace std;int map[60][60];int main(){ int tc, m, n, k, i, j, totaltime, curi, curj, x, y, max, sum; scanf("%d", &tc); while (
Time of Update: 2018-12-03
原文網址:http://mychrome.blogbus.com/logs/31489447.html 使用網路中的FTP方式登陸FTP,開啟後中文出現亂碼。 使用FTP軟體登陸如果不設定,中文不顯示 建議用filezilla,新立徳有 開啟filezilla 檔案-網站管理器-新網站--字元集--使用自訂的字元集 ,填寫gbk 這樣串連起來就不會出現問題了
Time of Update: 2018-12-03
Acer筆記本上面安裝了ubuntu12.04,進入系統過散熱就特別大,顯卡是ATI的,是雙顯卡,沒有對應的驅動管理,所以發熱很大。 網上很多資料說,可以使用命令 禁用獨顯: sudo su echo IGD > /sys/kernel/debug/vgaswitcheroo/switch
Time of Update: 2018-12-03
//單位之間的轉換,用一個map映射器就很容易解決!#include "iostream"#include "string"#include "map"#include "iomanip"using namespace std;int main(){int testcase, count = 0;double n, ans;string measurement;map<string, double>m;map<string, string>m1;m["kg"] = 2.2
Time of Update: 2018-12-03
在右上方的選項區中,點擊網路連接表徵圖,然後在下面彈出的選項中選擇建立新的無線網路。 其中有三個選項,一個是網路名稱,就是即將建立的無線網路的名字,然後是選擇無線網路安全性,在測試的過程中,發現選擇 無 或者 wep 40/128位密鑰(16進位或ASCII)這兩項中的一個都是可以連上的,其中需要設定密碼的好像密碼位元有要求,貌似是5或13位。 在選擇wep 128密碼位 選項,其它筆記本在win7下可以搜到wifi,但是無法串連。
Time of Update: 2018-12-03
前言通常,對於一個給定的演算法,我們要做:設F(n)為演算法A在最壞情況下F(n),則如果F(n)屬於Ο(g(n)),則說演算法A的漸近時間複雜度上限為g(n),且g(n)為F(n)的漸近上確界。設F(n)為演算法A在最壞情況下F(n),則如果F(n)屬於Ω(g(n)),則說演算法A的漸近時間複雜度下限為g(n),且g(n)為F(n)的漸近下確界。這裡一定要注意,由於我們是以F(n)最壞情況分析的,所以,我們可以100%保證在輸入規模超過臨界條件n0時,演算法的已耗用時間一定不會高於漸近上確界,
Time of Update: 2018-12-03
//一開始思考這題的時候,以為是用動態規劃來做的,但是再仔細分析,//找不出動態規劃的式子,到最後只有百度了!/*題目大意 有n個盒子,編號1到n,第i個盒子裡面裝有i個javabeans,每次選擇一個數字, 有javabeans的個數大於此數位盒子可以每次拿出那個數位javabeans, 要拿走左右的javabeans,需要多少次 題目分析 二分法,每次將不小於n/2個javabeans的盒子拿出n/2個javabeans, 然後規模就小了一半,一直進行此操作,知道所有盒子的球為0為止
Time of Update: 2018-12-03
//直接就可以寫出來了,很簡單的一題!#include "iostream"using namespace std;int main(){int a;while (cin >> a && a != -1){if (a == 0)cout << "Exactly 3 o'clock" << endl;else if (a > 0 && a < 30)cout << "Between 2 o'clock
Time of Update: 2018-12-03
//題目比較簡單,就按題目的要求,如果密碼有得修改的就修改,如果沒有就輸出!#include "iostream"#include "string"#include "map"#include "vector"using namespace std;struct Info{string name;string password;};int main(){int N, i, j, count, len;bool flag;Info info[1010];map<char, char>
Time of Update: 2018-12-03
//這題的意思就是:求一個最小的正整數x,使a乘以x對m的取餘等於1對m的取餘!#include "iostream"using namespace std;int main(){int testcase, i, a, m;bool flag;cin >> testcase;while (testcase--){cin >> a >> m;flag = false;if (m == 1){cout << 1 <<
Time of Update: 2018-12-03
今天在linux下,同學使用我電腦幫忙搞東西,由於我使用的不是 root 使用者,不時的要求授權,總是讓我來輸入密碼很是麻煩,而且也不太好,不過 root 的密碼告訴別人又不大好,於是使用 sudo passwd root 命令,將 root 的密碼更改了,因為我安裝系統是建立的使用者不是 root , 本人又是新手,對使用者和 root 理解不是很明白,以為修改了 root
Time of Update: 2018-12-03
//這題屬於簡單題,只要你有耐心讀懂題目就很簡單了!#include "iostream"#include "string"#include "memory.h"using namespace std;string chosencourses[110];//已選課程string categorycourses[110];//分類中的課程bool flag[110];int main(){int k, m, c, r, i, j, q, count;while (cin >> k
Time of Update: 2018-12-03
//這題的大意是:給定你一個五位元,但頭和尾的數缺失,需要你找出頭和尾的兩個數(注意:頭的數不為0)//如果有多種情況的,就輸出其最大的那個數!#include "iostream"#include "algorithm"using namespace std;struct Info{int firstnum;int endnum;int price;}info[100];bool cmp(Info a, Info b){return a.price > b.price;}int
Time of Update: 2018-12-03
//剛開始,讀了很久題目,也不是很明白題目的要求是什麼!經過再三閱讀,才明白!//題目要求是:在給出的這麼多個座標中,取中間的座標為原點,然後分別統計落在第一和第三象限,//第二和第四象限的座標點個數!#include "iostream"using namespace std;struct Info{int x;int y;};Info info[200010];int main(){int n, i, j, ans1, ans2;Info centerpoint;while (cin
Time of Update: 2018-12-03
/*abcfbc abfcabprogramming contest abcd mnpabcdefgh abdcdaefaaaaaabbbbbbccccccdddddd adabcdaaaaaabbbbbbccccccdddddd adaaabbccdd*///這題主要是從一個字串中找出另一個字串中最長的字串!要求在這個字串中的下標序號為遞增順序!//用動態規劃來做就簡單啦!#include "iostream"#include "string"#include
Time of Update: 2018-12-03
/*判斷六個矩形能否組成長方體,我們只要找到一組充要條件去判斷即可這裡用的就是把邊排序,然後根據對面必相等,相鄰面有邊重合判斷 *///看了別人代碼,再自己寫出來的,無什麼心情寫這一題!囧!#include "iostream"#include "stdio.h"#include "algorithm"using namespace std;struct Rect{int x;int y;}rect[6];bool cmpy(Rect a, Rect b){if (a.x !=
Time of Update: 2018-12-03
//這題的大意就是對輸出的數字進行判斷,對於每一位元字,凡是滿5就進1!#include "iostream"#include "string"#include "cmath"using namespace std;int main(){int testcase, i, len, temp1, temp2, ans;string num;cin >> testcase;while (testcase--){cin >> num;ans = 0;len =
Time of Update: 2018-12-03
//這題主要是將IP地址轉換為十進位表示!#include "iostream"#include "string"#include "cmath"using namespace std;int main(){int N, i, j, k, sum, output[4];string input, temp[4];cin >> N;for (i = 0; i < N; i++){for (j = 0; j < 4; j++){output[j] =
Time of Update: 2018-12-03
//這題需要注意就是:它給出的名字的排序是逆序來的!#include "iostream"#include "string"using namespace std;int main(){int testcase, num, i, ans;string name, str[110];cin >> testcase;while (testcase--){cin >> num >> name;for (i = 0; i < 110; i++)str[i] =