天呢,太垃圾了我。。

AB懵逼了半天题意,C最后搞了个DP还不对。。。DP太垃圾了,,

 #include<bits/stdc++.h>
#define INF 0x7fffffff
#define LL long long
#define N 100005
using namespace std;
inline int ra()
{
int x=,f=; char ch=getchar();
while (ch<'' || ch>'') {if (ch=='-') f=-; ch=getchar();}
while (ch>='' && ch<='') {x=x*+ch-''; ch=getchar();}
return x*f;
}
int main()
{
string s1,s2; cin>>s1>>s2;
if (s1.length()!=s2.length())
{
if (s1.length()>s2.length())
cout<<s1.length();
else cout<<s2.length();
}
else
{
if (s1==s2) cout<<"-1";
else cout<<s1.length();
}
return ;
}
#include<bits/stdc++.h>
#define INF 0x7fffffff
#define LL long long
#define N 100005
using namespace std;
inline int ra()
{
int x=,f=; char ch=getchar();
while (ch<'' || ch>'') {if (ch=='-') f=-; ch=getchar();}
while (ch>='' && ch<='') {x=x*+ch-''; ch=getchar();}
return x*f;
}
int a[N];
int main()
{
int n=ra();
for (int i=; i<=n; i++) a[i]=ra();
sort(a+,a+n+);
for (int i=; i<=n-; i++)
{
if (a[i]+a[i+]>a[i+] && a[i+]-a[i]<a[i+])
{
cout<<"YES";
return ;
}
}
cout<<"NO";
return ;
}
 /*#include<bits/stdc++.h>
#define INF 0x7fffffff
#define LL long long
#define N 100005
using namespace std;
inline LL ra()
{
LL x=0,f=1; char ch=getchar();
while (ch<'0' || ch>'9') {if (ch=='-') f=-1; ch=getchar();}
while (ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
return x*f;
}
bool vis[1005][1005];
LL n,f[1005][1005],a[50],anslen;
char s[1005];
const LL mod=1e9+7;
int main()
{
n=ra(); scanf("%s",s+1);
for (LL i=0; i<26; i++) a[i]=ra();
LL mn=INF;
for (LL i=1; i<=n; i++)
{
mn=min(mn,a[s[i]-'a']);
if (mn<i) break;
f[i][1]=1;
vis[i][1]=1;
anslen=max(anslen,i);
}
for (LL i=1; i<=n; i++)
{
for (LL j=2; j<=i; j++)
{
LL mn=a[s[i]-'a'],cnt=1;
for (LL k=i-1; k>=1; k--,cnt++)
{
mn=min(mn,a[s[k]-'a']);
if (mn<cnt) break;
f[i][j]+=f[k][j-1];
if (vis[k][j-1]) vis[i][j]=1;
f[i][j]%=mod;
if (vis[k][j-1]) anslen=max(anslen,cnt);
}
}
}
LL anstot=0,ansnum;
for (LL i=1; i<=n; i++) anstot+=f[n][i],anstot%=mod;
cout<<anstot<<endl;
for (LL i=1; i<=n; i++)
if (f[n][i])
{
ansnum=i;
break;
}
cout<<anslen<<endl<<ansnum;
return 0;
}*/
#include<bits/stdc++.h>
#define INF 0x7fffffff
#define LL long long
#define N 100005
using namespace std;
inline LL ra()
{
LL x=,f=; char ch=getchar();
while (ch<'' || ch>'') {if (ch=='-') f=-; ch=getchar();}
while (ch>='' && ch<='') {x=x*+ch-''; ch=getchar();}
return x*f;
}
int f[N],n,dp[N],a[N],mx;
char s[N];
const int mod=1e9+;
bool check(int i, int j)
{
int l=j-i+;
for (int k=i; k<=j; k++)
{
if (a[s[k]-'a']<l)
return ;
}
return ;
}
int main()
{
n=ra(); scanf("%s",s+);
for (int i=; i<; i++) a[i]=ra();
memset(f,0x3f,sizeof(f));
dp[]=; f[]=;
for (int i=; i<=n; i++)
for (int j=; j<=i; j++)
if (check(i-j+,i))
{
dp[i]=(dp[i]+dp[i-j])%mod;
f[i]=min(f[i],f[i-j]+);
if (dp[i-]) mx=max(mx,j);
}
cout<<dp[n]<<endl;
cout<<mx<<endl;
cout<<f[n]<<endl;
}

cf 766#的更多相关文章

  1. ORA-00494: enqueue [CF] held for too long (more than 900 seconds) by 'inst 1, osid 5166'

    凌晨收到同事电话,反馈应用程序访问Oracle数据库时报错,当时现场现象确认: 1. 应用程序访问不了数据库,使用SQL Developer测试发现访问不了数据库.报ORA-12570 TNS:pac ...

  2. cf之路,1,Codeforces Round #345 (Div. 2)

     cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....   ...

  3. cf Round 613

    A.Peter and Snow Blower(计算几何) 给定一个点和一个多边形,求出这个多边形绕这个点旋转一圈后形成的面积.保证这个点不在多边形内. 画个图能明白 这个图形是一个圆环,那么就是这个 ...

  4. ARC下OC对象和CF对象之间的桥接(bridge)

    在开发iOS应用程序时我们有时会用到Core Foundation对象简称CF,例如Core Graphics.Core Text,并且我们可能需要将CF对象和OC对象进行互相转化,我们知道,ARC环 ...

  5. [Recommendation System] 推荐系统之协同过滤(CF)算法详解和实现

    1 集体智慧和协同过滤 1.1 什么是集体智慧(社会计算)? 集体智慧 (Collective Intelligence) 并不是 Web2.0 时代特有的,只是在 Web2.0 时代,大家在 Web ...

  6. CF memsql Start[c]UP 2.0 A

    CF memsql Start[c]UP 2.0 A A. Golden System time limit per test 1 second memory limit per test 256 m ...

  7. CF memsql Start[c]UP 2.0 B

    CF memsql Start[c]UP 2.0 B B. Distributed Join time limit per test 1 second memory limit per test 25 ...

  8. CF #376 (Div. 2) C. dfs

    1.CF #376 (Div. 2)    C. Socks       dfs 2.题意:给袜子上色,使n天左右脚袜子都同样颜色. 3.总结:一开始用链表存图,一直TLE test 6 (1)如果需 ...

  9. CF #375 (Div. 2) D. bfs

    1.CF #375 (Div. 2)  D. Lakes in Berland 2.总结:麻烦的bfs,但其实很水.. 3.题意:n*m的陆地与水泽,水泽在边界表示连通海洋.最后要剩k个湖,总要填掉多 ...

随机推荐

  1. Maven项目- Servlet的抽取和优化 java.lang.NoSuchMethodException 的解决方法

    优化servlet,减少servlet的数量,便于开发与维护.现在是一个功能一个Servlet,将其优化为一个模块一个Servlet,BaseServlet的抽取和优化,相当于在数据库中一张表对应一个 ...

  2. shell和Makefile

    一.shell基础 1.shell介绍 shell是操作系统的终端命令行 意义:快速的编译多个.c文件 shell是一类编程语言 常用shell语言:sh.bash.csh.ksh.perl.pyth ...

  3. 树莓派开启VNC远程桌面

    分类: Raspberry Pi Linux2013-03-12 10:18 4288人阅读 评论(1) 收藏 举报   目录(?)[+]   1.安装VNC sudo apt-get install ...

  4. Paper代写:别让段落结尾拉低你的分数

    为了达到paper写作格式和字数要求,学生往往会在段末做一件事:总结.都不算是一个很长的段落.本来就写不了多少论证的内容,我们还强制加一个总结句,不仅占用了我们论证的篇幅,而且显得多余(段首的主题句已 ...

  5. MyBatis-Insert、Delete、Update的注意事项

    MyBatis-Insert.Delete.Update的注意事项 插入/更新乱码的解决 出现插入乱码,首先要考虑数据库的编码集是不是UTF-8 如果数据库的编码无误,查看MyBatis的全局配置文件 ...

  6. greenplum 存储过程 输出信息

    raise notice 'just a simple output msg';

  7. Windows编程常用api

    转载网络 黑客常用WIN API函数整理 一.进程 创建进程: CreateProcess (,,,,,,,&si,&pi); WinExec("notepad", ...

  8. Liveness 探测【转】

    Liveness 探测让用户可以自定义判断容器是否健康的条件.如果探测失败,Kubernetes 就会重启容器. 还是举例说明,创建如下 Pod: 启动进程首先创建文件 /tmp/healthy,30 ...

  9. 条件判断语句(if-else)

    if-else 语法 if-else 语法,只有一个语句块被执行 if 和 else都是Java中的关键字 if 语法 把 if-else 看做一个表达式,程序整体还是顺序执行的 if (boolea ...

  10. NIO三大组件简介

    NIO简介 NIO 是面向缓冲区(或者说面向块)编程的, 因为Buffer底层本质上就是内存块.数据被读取到一个缓冲区, 稍后再被它处理, 需要时数据可在缓冲区前后移动, 从而增加了处理过程中的灵活性 ...