zoukankan      html  css  js  c++  java
  • [ An Ac a Day ^_^ ] UVALive 7270 Osu! Master

    2015icpc北京区域赛的签到题

    还是很签到的 一次就过了

    题意呢 

    就是统计B C后最长上升序列还有S的个数

    当然B C要被S分割开……

     1 /* ***********************************************
     2 Author        :Sun Yuefeng
     3 Created Time  :2016/10/16 18:41:24
     4 File Name     :A.cpp
     5 ************************************************ */
     6 
     7 #include<cstdio>
     8 #include<iostream>
     9 #include<algorithm>
    10 #include<cmath>
    11 #include<cstring>
    12 #include<string>
    13 #include<bitset>
    14 #include<map>
    15 #include<set>
    16 #include<stack>
    17 #include<vector>
    18 #include<queue>
    19 #include<list>
    20 #define M(a,b) memset(a,b,sizeof(a))
    21 using namespace std;
    22 typedef long long ll;
    23 const int inf=0x3f3f3f3f;
    24 const int maxn=1e9+10;
    25 const int mod=1e7+7;
    26 int dx[8]= {0,0,1,-1,1,-1,1,-1};
    27 int dy[8]= {1,-1,0,0,-1,1,1,-1};
    28 
    29 int main()
    30 {
    31     //freopen("in.txt","r",stdin);
    32     //freopen("out.txt","w",stdout);
    33     int n;
    34     while(~scanf("%d",&n)){
    35         int ans=0,last=-1;
    36         while(n--){
    37             char a;
    38             cin>>a;
    39             if(a=='S'){
    40                 ans++;
    41                 last=-1;
    42             }
    43             else{
    44                 int a;
    45                 scanf("%d",&a);
    46                 if(a>last){
    47                     if(last==-1) ans++;
    48                     last=a;
    49                 }
    50                    else{
    51                     last=a;
    52                     ans++;
    53                 }
    54             }
    55         }
    56         printf("%d
    ",ans);
    57     }    
    58     return 0;
    59 }
  • 相关阅读:
    双屏显示器
    Cheat Engine Tutorial v3翻译Cheat Engine 6.1 tutorial(3)
    [转]VC6创建UNICODE版Windows程序
    fread
    [转]回调函数在MFC中的使用
    [转]C++ 虚函数表解析
    [转]C/C++返回内部静态成员的陷阱
    [转]EVC 中 include 的错误
    【rgw压缩】
    【ceph | 运维】rgw重置
  • 原文地址:https://www.cnblogs.com/general10/p/5967397.html
Copyright © 2011-2022 走看看