From 9564705865ea0bc7e8d08abc787d41e66b78c67e Mon Sep 17 00:00:00 2001 From: unknown <刘桐源> Date: Fri, 12 Aug 2016 10:16:59 +0800 Subject: [PATCH 01/11] Powered By HC TECH : AutoACer Engine --- HDOJ/1071_autoAC.cpp | 18 ++++++++ HDOJ/1072_autoAC.cpp | 88 ++++++++++++++++++++++++++++++++++++ HDOJ/1073_autoAC.cpp | 59 ++++++++++++++++++++++++ HDOJ/1074_autoAC.cpp | 68 ++++++++++++++++++++++++++++ HDOJ/1075_autoAC.cpp | 105 +++++++++++++++++++++++++++++++++++++++++++ HDOJ/1076_autoAC.cpp | 31 +++++++++++++ HDOJ/1077_autoAC.cpp | 67 +++++++++++++++++++++++++++ HDOJ/1078_autoAC.cpp | 61 +++++++++++++++++++++++++ HDOJ/1079_autoAC.cpp | 15 +++++++ HDOJ/1080_autoAC.cpp | 66 +++++++++++++++++++++++++++ 10 files changed, 578 insertions(+) create mode 100644 HDOJ/1071_autoAC.cpp create mode 100644 HDOJ/1072_autoAC.cpp create mode 100644 HDOJ/1073_autoAC.cpp create mode 100644 HDOJ/1074_autoAC.cpp create mode 100644 HDOJ/1075_autoAC.cpp create mode 100644 HDOJ/1076_autoAC.cpp create mode 100644 HDOJ/1077_autoAC.cpp create mode 100644 HDOJ/1078_autoAC.cpp create mode 100644 HDOJ/1079_autoAC.cpp create mode 100644 HDOJ/1080_autoAC.cpp diff --git a/HDOJ/1071_autoAC.cpp b/HDOJ/1071_autoAC.cpp new file mode 100644 index 0000000..1ade059 --- /dev/null +++ b/HDOJ/1071_autoAC.cpp @@ -0,0 +1,18 @@ +#include +#include +int main() +{ + int T; + double x1, x2, x3, y1, y2, y3, a, b, c, s; + scanf("%d",&T); + while(T--) + { + scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3); + a = ((y2-y1)*(x3-x2)/(x2-x1)-(y3-y2))/((x2*x2-x1*x1)*(x3-x2)/(x2-x1)-(x3*x3-x2*x2)); + b = ((y2-y1)-a*(x2*x2-x1*x1))/(x2-x1); + c = y1-a*x1*x1-b*x1; + s = (a/3*x3*x3*x3+b/2*x3*x3+c*x3)-(a/3*x2*x2*x2+b*x2*x2/2+c*x2)-(y3+y2)*(x3-x2)/2; + printf("%.2lf\n",s); + } + return 0; +} diff --git a/HDOJ/1072_autoAC.cpp b/HDOJ/1072_autoAC.cpp new file mode 100644 index 0000000..37bae05 --- /dev/null +++ b/HDOJ/1072_autoAC.cpp @@ -0,0 +1,88 @@ +#include +#include +#include +#include +#include +#include +using namespace std; +struct node +{ + int x, y; + int step; + int t; +}; +const int maxn = 9; +int dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}; +int maze[maxn][maxn], graph[maxn][maxn]; +int n, m, ex, ey, ans; +bool bfs(int x, int y); +int main() +{ + int test; + scanf("%d", &test); + while(test-- != 0) + { + scanf("%d %d", &n, &m); + int sx, sy; + for(int i = 0; i < n; i++) + { + for(int j = 0; j < m; j++) + { + scanf("%d", &maze[i][j]); + if(maze[i][j] == 2) + sx = i, sy = j; + if(maze[i][j] == 3) + ex = i, ey = j; + graph[i][j] = 0; + } + } + if(bfs(sx, sy)) + printf("%d\n", ans); + else + printf("-1\n"); + } + return 0; +} +bool bfs(int x, int y) +{ + queue que; + node s; + s.x = x; + s.y = y; + s.step = 0; + s.t = 6; + graph[x][y] = 6; + que.push(s); + while(!que.empty()) + { + node st = que.front(); + que.pop(); + if(st.x == ex && st.y == ey) + { + ans = st.step; + return true; + } + if(st.t == 1) + continue; + for(int i = 0; i < 4; i++) + { + int dx = st.x + dir[i][0]; + int dy = st.y + dir[i][1]; + if(dx >= 0 && dx < n && dy >= 0 && dy < m && maze[dx][dy] != 0) + { + node tmp; + tmp.x = dx; tmp.y = dy; + tmp.step = st.step + 1; + tmp.t = st.t - 1; + if(maze[dx][dy] == 4) + tmp.t = 6; + if(tmp.t > graph[dx][dy]) + { + graph[dx][dy] = tmp.t; + que.push(tmp); + } + } + } + } + return false; +} diff --git a/HDOJ/1073_autoAC.cpp b/HDOJ/1073_autoAC.cpp new file mode 100644 index 0000000..59be9fd --- /dev/null +++ b/HDOJ/1073_autoAC.cpp @@ -0,0 +1,59 @@ +#include +#define N 10000 +char str1[N],str2[N]; +void input(char *str) +{ + char tmp[N]; + getchar(); + gets(tmp); + while(gets(tmp) && strcmp(tmp,"END")) + { + if(strlen(tmp)==0) + strcat(str,"\n"); + else + strcat(str,tmp); + } +} +void dechar(char *str,int len) +{ + char tmp[N]; + int t=0; + for(int i=0;i +#include +#include +#include +#include +using namespace std; +const int N = 16; +int dp[1<>a[i].s>>a[i].time>>a[i].cost; + } + memset(dp,0x3f3f3f3f,sizeof(dp)); + memset(pre,0,sizeof(pre)); + dp[0]=0; + for(int st=0;st<(1<dp[st]+max(0,tmp+a[i].cost-a[i].time)){ + dp[st|(1< +#include +#include +#include +typedef struct node +{ + char s[50]; + struct node *next[26]; +}node; +node memory[1000000]; +int k=0; +void insert(char *b,char *a,node *T) +{ + int i,len,j,id; + node *p,*q; + p=T; + len=strlen(b); + for(i=0;inext[id]==NULL) + { + q=&memory[k++]; + memset(q->s,'\0',sizeof(q->s)); + for(j=0;j<26;++j) + q->next[j]=NULL; + p->next[id]=q; + } + p=p->next[id]; + } + strcpy(p->s,a); +} +int search(char *t,node *T) +{ + int id,i=0; + char *p=t; + node *q=T; + while(islower(p[i])) + { + id=p[i]-'a'; + if(q->next[id]==NULL) + return 0; + else + { + q=q->next[id]; + ++i; + } + } + if(strlen(q->s)) + { + printf("%s",q->s); + return 1; + } + return 0; +} +int main() +{ + int i,len; + char a[50],b[50]; + char c[4000]; + node *T; + T=&memory[k++]; + memset(T->s,'\0',sizeof(T->s)); + for(i=1;i<26;++i) + T->next[i]=NULL; + while(scanf("%s",a)&&strcmp(a,"START")==0) + { + while(scanf("%s",a)&&strcmp(a,"END")) + { + scanf("%s",b); + insert(b,a,T); + } + while(scanf("%s",a)&&strcmp(a,"START")==0) + { + getchar(); + while(gets(c)) + { + if(strcmp(c,"END")==0) + return 0; + len=strlen(c); + for(i=0;i +int leapyear(int Y) +{ + if((Y%4==0 && Y%100!=0) || (Y%400==0)) + return 1; + else + return 0; +} +int main() +{ + int Y,N,n,count; + scanf("%d",&n); + while(n--) + { + count=0; + scanf("%d%d",&Y,&N); + while(count +#include +#include +#include +#include +#include +#define INF 1E9 +using namespace std; +double X[301],Y[301]; +int n,ans; +double x,y; +inline double c(int i) +{ + return (X[i]-x)*(X[i]-x)+(Y[i]-y)*(Y[i]-y); +} +int calc() +{ + int i,ans=0; + for(i=0;i1.0+1e-8)continue; + ans++; + } + return ans; +} +void center(int i,int j) +{ + double x1=X[i]-X[j],y1=Y[i]-Y[j],len,k; + double a,b; + if(x1==0) + a=1,b=0; + else if (y1==0) + a=0,b=1; + else + { + k=-1/y1*x1; + len=sqrt(1+k*k); + a=1.0/len; + b=k/len; + } + len=1-(x1*x1+y1*y1)/4; + if(len<0)return; + len=sqrt(len); + x1=(X[i]+X[j])/2.0;y1=(Y[i]+Y[j])/2.0; + a*=len;b*=len; + x=x1+a;y=y1+b; + ans=max(ans,calc()); + x=x1-a;y=y1-b; + ans=max(ans,calc()); +} +int main() +{ + int T; + int i,j; + scanf("%d",&T); + while(T--) + { + scanf("%d",&n); + for(i=0;i +#include +using namespace std; +const int N = 102; +int graph[N][N]; +int collect[N][N]; +int n, k, ans; +int dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}; +bool isBound(int x, int y) +{ + if(x < 0 || y < 0) + return false; + if(x >= n || y >= n) + return false; + return true; +} +int memory(pair p ) +{ + int i, j, maxb = 0, tmax; + pair cs; + if(collect[p.first][p.second] > 0) + return collect[p.first][p.second]; + for(i = 0; i < 4; i++) + { + cs = p; + for(j = 0; j < k; j++) + { + cs.first += dir[i][0]; + cs.second += dir[i][1]; + if(!isBound(cs.first, cs.second)) + break; + if(graph[cs.first][cs.second] > graph[p.first][p.second]) + { + tmax = memory(cs); + if(tmax > maxb) + maxb = tmax; + } + } + } + collect[p.first][p.second] = maxb + graph[p.first][p.second]; + return collect[p.first][p.second]; +} +int main() +{ + pair p; + int i, j; + while(scanf("%d%d", &n, &k)) + { + if(n == -1 && k == -1) + break; + for(i = 0; i < n; i++) + for(j = 0; j < n; j++) + { + scanf("%d", &graph[i][j]); + collect[i][j] = 0; + } + p.first = p.second = 0; + printf("%d\n", memory(p)); + } + return 0; +} diff --git a/HDOJ/1079_autoAC.cpp b/HDOJ/1079_autoAC.cpp new file mode 100644 index 0000000..922e286 --- /dev/null +++ b/HDOJ/1079_autoAC.cpp @@ -0,0 +1,15 @@ +#include +int main(){ + int yy,mm,dd; + int t; + scanf("%d",&t); + while(t--){ + scanf("%d%d%d",&yy,&mm,&dd); + if( ((mm + dd) & 1) ==0 ) + puts("YES"); + else if(dd==30 && ( mm == 9 || mm == 11)) + puts("YES"); + else puts("NO"); + } + return 0; +} diff --git a/HDOJ/1080_autoAC.cpp b/HDOJ/1080_autoAC.cpp new file mode 100644 index 0000000..bbd4e88 --- /dev/null +++ b/HDOJ/1080_autoAC.cpp @@ -0,0 +1,66 @@ +#include +int matrix[5][5] = { + {5, -1, -2, -1, -3}, + {-1, 5, -3, -2, -4}, + {-2, -3, 5, -2, -2}, + {-1, -2, -2, 5, -1}, + {-3, -4, -2, -1, 0}, +}; +char exchange[5] = {'A', 'C', 'G', 'T', ' '}; +int Value (char m, char n){ + int R, C; + int i; + for (i=0; i<5; ++i){ + if (exchange[i] == m) + R = i; + if (exchange[i] == n) + C = i; + } + return matrix[R][C]; +} +int Max (int a, int b, int c){ + int max = (a > b) ? a : b; + return (max > c) ? max : c; +} +int Similarity (char str1[], int length1, char str2[], int length2){ + int dp[110][110]; + int i, j; + dp[0][0] = 0; + for (i=1; i<=length1; ++i) + dp[i][0] = dp[i-1][0] + Value (str1[i], ' '); + for (i=1; i<=length2; ++i) + dp[0][i] = dp[0][i-1] + Value (' ', str2[i]); + for (i=1; i<=length1; ++i){ + for (j=1; j<=length2; ++j){ + if (str1[i] == str2[j]){ + dp[i][j] = dp[i-1][j-1] + Value (str1[i], str2[j]); + } + else{ + dp[i][j] = Max (dp[i-1][j] + Value (str1[i], ' '), + dp[i][j-1] + Value (' ', str2[j]), + dp[i-1][j-1] + Value (str1[i], str2[j])); + } + } + } + return dp[length1][length2]; +} +int main(void){ + char str1[110]; + char str2[110]; + int length1; + int length2; + int T; + int ans; + while (scanf ("%d", &T) != EOF){ + while (T-- != 0){ + scanf ("%d%s", &length1, str1 + 1); + scanf ("%d%s", &length2, str2 + 1); + if (length1 > length2) + ans = Similarity (str1, length1, str2, length2); + else + ans = Similarity (str2, length2, str1, length1); + printf ("%d\n", ans); + } + } + return 0; +} From dcf62b62331ef259cec1728c0957ec01d0c6da02 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sat, 13 Aug 2016 11:24:55 +0800 Subject: [PATCH 02/11] Create 1247.cpp --- HDOJ/1247.cpp | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 HDOJ/1247.cpp diff --git a/HDOJ/1247.cpp b/HDOJ/1247.cpp new file mode 100644 index 0000000..bec297b --- /dev/null +++ b/HDOJ/1247.cpp @@ -0,0 +1,100 @@ +#include +#include +using namespace std; + +class node +{ +public: + node* next[26]; + bool value; + node() : value(false) + { + memset(next,0,sizeof(next)); + } +}; +node _headnode; +node* head=&_headnode; + +void insert(const char* str) +{ + int L=strlen(str); + node* p=head; + for(int i=0;inext[str[i]-'a']==nullptr) + { + p->next[str[i]-'a']=new node; + } + p=p->next[str[i]-'a']; + } + p->value=true; +} + +bool search(const char* str) +{ + int L=strlen(str); + node* p=head; + + for(int i=0;inext[str[i]-'a']!=nullptr) + { + p=p->next[str[i]-'a']; + if(p->value) + { + bool isFound=true; + node* q=head; + for(int j=i+1;jnext[str[j]-'a']!=nullptr) + { + q=q->next[str[j]-'a']; + } + else + { + isFound=false; + break; + } + } + if(isFound) + { + if(q->value) + { + return true; + } + } + } + } + else + { + break; + } + } + + return false; +} + +#define MAXN 50005 +#define MAXLEN 1005 +char input[MAXN][MAXLEN]; + + + + +int main() +{ + int i=0; + while(cin>>input[i]) + { + insert(input[i++]); + } + for(int ci=0;ci Date: Sat, 13 Aug 2016 12:09:21 +0800 Subject: [PATCH 03/11] Create 1711.cpp --- HDOJ/1711.cpp | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 HDOJ/1711.cpp diff --git a/HDOJ/1711.cpp b/HDOJ/1711.cpp new file mode 100644 index 0000000..dfbd21a --- /dev/null +++ b/HDOJ/1711.cpp @@ -0,0 +1,94 @@ +#include +#include +#include +#include +using namespace std; +#define MAXA 1000005 +#define MAXN 10010 +#define MAXNEXT 10050 + +/* +int f[MAXN]; + + +void getfill(int* s,int LenS,int* f) +{ + //memset(f,0,sizeof(f)); //根据其前一个字母得到 + for(int i=1;i Date: Sat, 13 Aug 2016 12:11:28 +0800 Subject: [PATCH 04/11] Create KMP.cpp --- .ACM-Templates/KMP.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .ACM-Templates/KMP.cpp diff --git a/.ACM-Templates/KMP.cpp b/.ACM-Templates/KMP.cpp new file mode 100644 index 0000000..65d236e --- /dev/null +++ b/.ACM-Templates/KMP.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +using namespace std; + +void getfill(string s,int* f) +{ + //memset(f,0,sizeof(f)); //根据其前一个字母得到 + for(size_t i=1;i Date: Sat, 13 Aug 2016 12:11:48 +0800 Subject: [PATCH 05/11] Create KMP_int.cpp --- .ACM-Templates/KMP_int.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .ACM-Templates/KMP_int.cpp diff --git a/.ACM-Templates/KMP_int.cpp b/.ACM-Templates/KMP_int.cpp new file mode 100644 index 0000000..16d8bdd --- /dev/null +++ b/.ACM-Templates/KMP_int.cpp @@ -0,0 +1,23 @@ +void MakeNext(int* P,int M,int* Next){ + Next[0] = -1; + int i = 0, j = -1; + while(i Date: Sat, 13 Aug 2016 14:57:09 +0800 Subject: [PATCH 06/11] Create 100820C_snowy_smile.cpp From http://blog.csdn.net/snowy_smile/article/details/50156279 --- Codeforces/Gym/100820C_snowy_smile.cpp | 104 +++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 Codeforces/Gym/100820C_snowy_smile.cpp diff --git a/Codeforces/Gym/100820C_snowy_smile.cpp b/Codeforces/Gym/100820C_snowy_smile.cpp new file mode 100644 index 0000000..b8d7988 --- /dev/null +++ b/Codeforces/Gym/100820C_snowy_smile.cpp @@ -0,0 +1,104 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +void fre(){freopen("c://test//input.in","r",stdin);freopen("c://test//output.out","w",stdout);} +#define MS(x,y) memset(x,y,sizeof(x)) +#define MC(x,y) memcpy(x,y,sizeof(x)) +#define MP(x,y) make_pair(x,y) +#define ls o<<1 +#define rs o<<1|1 +typedef long long LL; +typedef unsigned long long UL; +typedef unsigned int UI; +template inline void gmax(T1 &a,T2 b){if(b>a)a=b;} +template inline void gmin(T1 &a,T2 b){if(bbb.b[i])return 1; + if(b[i]middle>lower的顺序排序。 +多个前缀关键字,位于最后的关键字作为第一关键字,依次类推。 +如果发生关键字数量差别,空关键字被认定为middle。 +如果最后依然重复,则按照人名字典序。 + +【类型】 +模拟 排序 多关键字排序 + +【分析】 +这题只是一个关键字有点多的排序而已。 +最多会有256/6个关键字。我们直接把所有的关键字提取出来,位置越后,级别越高。 +upper=1 +middle=0(初始也为0) +lower=-1 +然后排个序,这道题就做完啦! + +【时间复杂度&&优化】 +O(关键字数*nlogn) + +【数据】 +5 +mom: upper upper lower middle class +dad: middle middle lower middle class +queenelizabeth: upper upper class +chair: lower lower class +unclebob: middle lower middle class + +*/ From ee0f443fa94483da03e4161d821e93187ef8df88 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sat, 13 Aug 2016 16:03:09 +0800 Subject: [PATCH 07/11] Create Readme.md --- BNUOJ/Readme.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 BNUOJ/Readme.md diff --git a/BNUOJ/Readme.md b/BNUOJ/Readme.md new file mode 100644 index 0000000..7470180 --- /dev/null +++ b/BNUOJ/Readme.md @@ -0,0 +1,2 @@ +#BNUOJ +[Problem Set](https://www.bnuoj.com/v3/problem.php "Problem List") From d51551adee447d5bbd06a10a4b1014608d31a994 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sat, 13 Aug 2016 16:27:45 +0800 Subject: [PATCH 08/11] Create 100819L_Standard.cpp --- Codeforces/Gym/100819L_Standard.cpp | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Codeforces/Gym/100819L_Standard.cpp diff --git a/Codeforces/Gym/100819L_Standard.cpp b/Codeforces/Gym/100819L_Standard.cpp new file mode 100644 index 0000000..a666145 --- /dev/null +++ b/Codeforces/Gym/100819L_Standard.cpp @@ -0,0 +1,38 @@ +#include +#include +#include + +using namespace std; + +const int MAXN = 100000; +int N, W; +string safe; +long double p[MAXN], v[MAXN+1], s[MAXN+1]; + +int main() +{ + //ios::sync_with_stdio(0); + while (cin >> N >> W && N) + { + v[0] = 0; + for (int i = 0; i < N; ++i) + { + cin >> safe >> p[i] >> v[i+1]; + v[i+1] = log1p(v[i+1] / W); + if (safe == "safe") + s[i+1] = v[i+1]; + else + s[i+1] = s[i]; + } + for (int i = N-1; i >= 0; --i) + { + long double Ewin = p[i]*v[i+1] + (1-p[i])*s[i]; + v[i] = max(v[i], Ewin); + } + long double ans = expm1(v[0]) * W; + cout << '$' << fixed << setprecision(2) << ans << endl; + int residualDigit = int(1000*ans) % 10; + if (residualDigit == 4 || residualDigit == 5) + cerr << "WARNING: " << residualDigit << " in the first unseen place" << endl; + } +} From 9e31c5012207a4e69cab539d125bb7c4a9dd5284 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sat, 13 Aug 2016 16:41:04 +0800 Subject: [PATCH 09/11] Create 100819L.cpp --- Codeforces/Gym/100819L.cpp | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Codeforces/Gym/100819L.cpp diff --git a/Codeforces/Gym/100819L.cpp b/Codeforces/Gym/100819L.cpp new file mode 100644 index 0000000..7131622 --- /dev/null +++ b/Codeforces/Gym/100819L.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +#include + +#include +using namespace std; +#define MAXROUND 100005 +double safemoney[MAXROUND]; +double roundmoney[MAXROUND]; +double p[MAXROUND]; +char str[256]; +inline double ln(double inc) +{ + return log(inc); +} +int main() +{ + int n,W; + scanf("%d %d",&n,&W); + for(int i=0;i=0;i--) + { + double tmp=p[i]*roundmoney[i+1]+(1-p[i])*safemoney[i]; + roundmoney[i]=max(tmp,roundmoney[i]); + } + double ans=(exp(roundmoney[0])-1)*W; + printf("$%.2f\n",ans); +} From f386cf069ccf740ac37168b72047ddefda07b257 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sat, 13 Aug 2016 17:04:34 +0800 Subject: [PATCH 10/11] Create 100819M.cpp --- Codeforces/Gym/100819M.cpp | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Codeforces/Gym/100819M.cpp diff --git a/Codeforces/Gym/100819M.cpp b/Codeforces/Gym/100819M.cpp new file mode 100644 index 0000000..40777f5 --- /dev/null +++ b/Codeforces/Gym/100819M.cpp @@ -0,0 +1,72 @@ +#include +using namespace std; +string op; +int parm; +int n; + +int operation_type[16]; +int operation_parm[16]; + +bool takeoperation(int a) +{ + for(int i=0;i>n; + for(int i=0;i>op>>operation_parm[i]; + operation_type[i]=0; + switch(op.at(0)) + { + case 'D': + operation_type[i]++; + case 'M': + operation_type[i]++; + case 'S': + operation_type[i]++; + case 'A': + break; + } + } + int cnt=0; + for(int i=1;i<=100;i++) + { + if(takeoperation(i)) + { + cnt++; + } + } + cout<<100-cnt< Date: Sat, 13 Aug 2016 17:14:13 +0800 Subject: [PATCH 11/11] Create 100819N.cpp --- Codeforces/Gym/100819N.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Codeforces/Gym/100819N.cpp diff --git a/Codeforces/Gym/100819N.cpp b/Codeforces/Gym/100819N.cpp new file mode 100644 index 0000000..717c8ee --- /dev/null +++ b/Codeforces/Gym/100819N.cpp @@ -0,0 +1,28 @@ +#include +#include +using namespace std; + +string str; + +int main() +{ + int n,k; + cin>>n>>k; + int x=1;//safe + int y=k;//break + for(int i=0;i>t>>str; + if(str.at(0)=='B') + { + if(tx) x=t; + } + } + cout<