11.5
>w<
11.6
大概受到周围的人影响想过要不要继续念下去.....然后呢....还是社会大学叭www
那之后就开始慢慢准备叭.....菜鸡lizishu加油加油!
Kickstart Round D 2017
这场感觉比E ,F,G更难一点qaq
状态和转移都想对了,但是算等待时间错了一点 就GG了qaqaqaq dp[i][j] 表示到达第i个城市已经参观过j个城市花的最小时间
1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <iostream> 5 #include <algorithm> 6 using namespace std; 7 8 typedef long long LL; 9 const long long INF = (1LL << 60) - 1; 10 int n; 11 LL s[2005],f[2005],d[2005],ts,tf,dp[2005][2005]; 12 13 int wait(int t,int si,int fi) 14 { 15 if (t <= si) return si - t; 16 int wt = ceil(1.0 * (t - si)/(1.0 * fi)) * fi + si - t; 17 return wt; 18 } 19 20 int main() 21 { 22 23 freopen("A-large-practice.txt","r",stdin); 24 freopen("Asmallv3.txt","w",stdout); 25 26 int T; 27 scanf("%d",&T); 28 for (int kase = 1;kase <= T;kase++) 29 { 30 scanf("%d %I64d %I64d",&n,&ts,&tf); 31 for (int i = 1;i < n;i++) scanf("%I64d %I64d %I64d",&s[i],&f[i],&d[i]); 32 33 for (int i = 1;i <= n;i++) 34 for (int j = 0;j <= n;j++) dp[i][j] = INF; 35 36 dp[1][0] = 0; 37 // printf("dp[1][0] = %d dp[1][1] = %d \n",dp[1][0],dp[1][1]); 38 39 40 for (int i = 1;i < n;i++) 41 { 42 for (int j = 0;j <= i;j++) 43 { 44 LL x = max(0LL,(dp[i][j] - s[i] + f[i] - 1)/f[i]); 45 dp[i+1][j] = min(dp[i+1][j],s[i] + x * f[i] + d[i]); 46 47 x = max(0LL,(dp[i][j] + ts - s[i] + f[i]-1)/f[i]); 48 dp[i+1][j+1] = min(dp[i+1][j+1],s[i] + x * f[i] + d[i]); 49 50 } 51 } 52 53 int ans = -1; 54 for (int i = 0;i < n;i++) 55 { 56 // printf("dp[%d][%d] = %d\n",n,i,dp[n][i]); 57 if (dp[n][i] != INF) 58 { 59 60 if (dp[n][i] <= tf) ans = max(ans,i); 61 } 62 } 63 printf("Case #%d: ",kase); 64 if (ans == -1) puts("IMPOSSIBLE"); 65 else printf("%d\n",ans); 66 } 67 return 0; 68 } 69 70 71 /* 72 73 5 74 11 20 115 75 8 19 8 76 3 17 11 77 35 15 2 78 37 2 2 79 22 25 4 80 31 21 3 81 57 20 2 82 61 19 1 83 27 19 1 84 66 15 20 85 86 87 4 88 4 3 12 89 3 2 1 90 6 2 2 91 1 3 2 92 93 100 94 4 3 12 95 3 2 1 96 1 5 2 97 8 1 1 98 99 100 */
B. Sherlock and The Matrix Game
11.10
11.17
记一个梦
梦到这篇博客还是空的就开一篇新的十二月流水账..以为十一月已经完了.
突然就醒了qaq
----------------------------------------------------------------------------------------
不知道这样一直做项目赶ddl好不好..但是还是希望能够不要ddl 复 ddl 希望能够有时间做一些自己的事情qaq
11.18
hiho一下 第176周 Constraint Checker
字符串模拟,最开始 是想把所有的不等关系存下来 再去check 但是这样写的很繁 后来 看了一份别人的代码
拆成二元关系
每次判断是否矛盾的时候再去模拟一遍 这样代码就好看多了qaq
1 #include <cstdio> 2 #include <cstring> 3 #include <map> 4 #include <iostream> 5 #include <algorithm> 6 using namespace std; 7 8 int n,T,m,vis[105]; 9 string s[105]; 10 map<char,int> h; 11 12 int get_val(int x,int& y) 13 { 14 int res = 0; 15 if (isalpha(s[x][y])) return h[s[x][y++]]; 16 while(y < s[x].length() && isdigit(s[x][y])) 17 { 18 res = res * 10 + s[x][y] - '0';y++; 19 } 20 return res; 21 } 22 23 string get_op(int x,int& y) 24 { 25 string res; 26 while(y < s[x].length() && !isalpha(s[x][y]) && !isdigit(s[x][y])) res += s[x][y++]; 27 return res; 28 } 29 30 int judge(int u,string op,int v) 31 { 32 if (op == "<") return u < v; 33 if (op == "<=") return u <= v; 34 } 35 36 int ok() 37 { 38 for (int i = 1;i <= n;i++) 39 { 40 int len = s[i].length(); 41 int j = 0; 42 int a = get_val(i,j); 43 for (;;) 44 { 45 string op = get_op(i,j); 46 if (op == "") break; 47 int b = get_val(i,j); 48 49 // printf("a = %d op = %s b = %d\n",a,op.c_str(),b); 50 51 if (!judge(a,op,b)) return 0; 52 a = b; 53 } 54 } 55 return 1; 56 } 57 58 int main() 59 { 60 scanf("%d",&n); 61 for (int i = 1;i <= n;i++) 62 { 63 cin >> s[i]; 64 int len = s[i].length(); 65 for (int j = 0;j < len;j++) 66 { 67 if (isalpha(s[i][j])) {vis[s[i][j] - 'A'] = 1;} 68 } 69 } 70 for (int i = 0;i < 26;i++) m += vis[i]; 71 72 scanf("%d",&T); 73 for (int i = 1;i <= T;i++) 74 { 75 h.clear(); 76 char u;int x; 77 for (int i = 1;i <= m;i++) cin >> u >> x,h[u] = x; 78 79 if (ok()) puts("Yes"); 80 else puts("No"); 81 82 } 83 return 0; 84 }
hiho一下 第174周 Dice Possibility
dp[i][j] 表示 丢了 i 次骰子 和为 j 的概率( 一眼看就会的题目 写了感觉没进步阿qaqaaqaqa
1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <algorithm> 5 #include <iomanip> 6 #include <sstream> 7 using namespace std; 8 9 double dp[105][605]; 10 int n,m; 11 12 double round(double x,int bits) 13 { 14 stringstream ss; 15 ss << fixed << setprecision(bits) << x; 16 ss >> x; 17 return x; 18 } 19 20 int main() 21 { 22 memset(dp,0,sizeof(dp)); 23 dp[0][0] = 1.0; 24 for (int i = 0;i < 100;i++) 25 { 26 for (int j = 0;j < 600;j++) 27 { 28 if (dp[i][j]) 29 { 30 for (int k = 1;k <= 6;k++) 31 { 32 dp[i+1][j+k] += dp[i][j] * 1.0 / 6.0; 33 } 34 } 35 } 36 } 37 38 scanf("%d %d",&n,&m); 39 printf("%.2f\n",dp[n][m]* 100); 40 41 42 return 0; 43 }
11.19
11.20
2017 快要过去了呢... 发生好多事呀qaq
为了让它看起来没那么虚度...决定悄悄在这里立个flag
1. cf 做题到 86 / 160
2. 画画练习到 110 / 160张
3. 西瓜书看到 0 / 5 章 ,一周一章写一篇笔记
4. 瘦到 95 / 90 斤
学习的笔记 放在这里
11.21
11.22
hiho一下 第177周 Full Binary Tree Picture
看题就想到去年goodbye 2016 的D题,虽然不是很像拉..因为都是二叉树,而且不停长长长,所以联想到w
#include <cstdio> #include <cstring> #include <vector> #include <iostream> #include <algorithm> using namespace std; int n,m; int h[105],a[105]; vector<pair<int,int> > g; void dfs(int x,int y,int k) { // printf("x = %d y = %d k = %d\n",x,y,k); g.push_back(make_pair(x,y)); if (k == n + 1) return; dfs(x + h[n - k + 1] + 1,y - h[n - k + 1] - 1,k + 1); dfs(x + h[n - k + 1] + 1,y + h[n - k + 1] + 1,k + 1); } int main() { memset(a,0,sizeof(a)); memset(h,0,sizeof(h)); a[1] = 3; for (int i = 2;i <= 20;i++) a[i] = a[i-1] * 2; int sum = 0; for (int i = 1;i <= 20;i++) { h[i] = a[i] - (i + 1) - sum; // printf("a[%d] = %d sum = %d h[%d] = %d\n",i,a[i],sum,i,h[i]); sum += h[i]; } scanf("%d %d",&n,&m);n--; int x1,y1,x2,y2; g.clear(); if (n == 0) g.push_back(make_pair(0,0)); else dfs(0,0,1); // for (int i = 0;i < g.size();i++) printf("%d %d\n",g[i].first,g[i].second); for (int i = 1;i <= m;i++) { scanf("%d %d %d %d",&x1,&y1,&x2,&y2); int ans = 0; for (int j = 0;j < g.size();j++) { int x = g[j].first,y = g[j].second; // printf("---- x = %d y = %d x1 = %d y1 = %d x2 = %d y2 = %d\n",x,y,x1,y1,x2,y2); if (x >= x1 && x <= x2 && y >= y1 && y <= y2) ans++; } printf("%d\n",ans); } return 0; }
但是因为要打一个均值符号,找了好几篇博客都没有写,最后还是在知乎找到 qaq
\overline是一根横线覆盖所有文本,\bar 是一根横线覆盖一个字母
--------------- 分割线 ----------------------
听了一个传销式的宣讲?报告?
vision
insight
execution
好奇以后会是什么样子www
11.27
相似图片搜索原理 原来也和哈希有关系呀,好神奇!
11.29
看论文( 每到看论文的时候觉得英语非常的贫瘠qaqaqaqaq
1 .Assessment of Response to Tyrosine Kinase Inhibitors in Metastatic Renal Cell Cancer: CT Texture as a Predictive Biomarker
2. Functional imaging and circulating biomarkers of response to regorafenib in treatment-refractory metastatic colorectal cancer patients in a prospective phase ii study
3. Radiological imaging markers predicting clinical outcome in patients with metastatic colorectal carcinoma treated with regorafenib: post hoc analysis of the CORRECT phase III trial (RadioCORRECT study)