原创 STL

pair 這裏沒有什麼可以說的了 #include <iostream> using namespace std; typedef pair<int,int> P;//定義pair類型 P a[10],b[10]; int m

原创 cf--TV Subscriptions (Hard Version)

time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output The o

原创 任務

今天某公司有M個任務需要完成。 每個任務都有相應的難度級別和完成任務所需時間。 第i個任務的難度級別爲yi,完成任務所需時間爲xi分鐘。 如果公司完成此任務,他們將獲得(500 * xi + 2 * yi)美元收入。 該公司有N臺

原创 漢明碼

奇偶校驗 求相應的漢明碼 偶 c1 = 3,5,7異或爲0 奇 c1 = 3,5,7異或的非爲1 漢明碼的糾錯 求欲傳送的漢明碼 偶 p1 =1, 3,5,7異或爲0 奇 p1 =1, 3,5,7異或的非爲0 大佬的博客 反思

原创 計劃 1

每天必做題 :至少兩個,也可以選擇看看以前的 vj 博客 貪心,搜索,中位數,思維,模擬 priority_queue;vector,set,map的用法(做題鞏固,不要總想着數組) 簽到題基本上就是這些,把這些做會 學c++

原创

字符的讀入 int m = input.next().charAt(0); 結束 System.exit(0);

原创 錯題

分兩列 格式錯誤:n = 1的時候需要特判 行末不要輸出多餘的空格 換行 數組元素的刪除 這個題屬於簡單題,因爲元素刪除在大一下學期單鏈表什麼的就學了很多遍了,而且還是重點,但這次還是沒ac,一個方面是想得太複雜,另一個是格式,還

原创 1

ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

原创 拓展歐幾里得算法

青蛙的約會 ll extend(ll a, ll b,ll &x,ll &y) { ll r,t; if(!b){ x = 1; y = 0; return a; } r = ext

原创 貪心(貪心)

貪心 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; const int ma

原创 反思一

這是大二的第一篇反思,也是我自從暑假進入acm以來的第一篇。先感慨一下和其他人之間的差距吧,其他隊友最晚的大一上學期11月份就開始準備了,也有兩位大佬從初中就開始了,各種語言都寫得很六,而自己是大一這個暑假結束纔開始接觸的,一點底

原创 最大的最小公約數(貪心)

給出一個數字n,選1到n中任意的3個數的最大的最小公倍數 #include <iostream> #define int long long using namespace std; signed main() { ios

原创 古風排版

傳送門 #include <bits/stdc++.h> using namespace std; int hang; string s,ans[110];//行數是100,所以110 int main() { //fre

原创 歐拉函數

#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int phi[maxn]; void euler() { for (i

原创 break,continue,return

break 跳出這個循環,這個循環結束了 continue 結束的是本次循環,繼續執行下一次循環 int tmp = 1; for(int i=1;i<=4;i++){ fo