天呢,太垃圾了我。。

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. 「AT2292」Division into Two

    传送门 Luogu 解题思路 考虑如何 \(\text{DP}\) 为了方便处理,我们设 \(A > B\) 设 \(dp[i]\) 表示处理完 \(1...i\) ,并且第 \(i\) 个数放 ...

  2. Slim安装以及使用

    最近在用backbone.js 做东西,因为牵扯到REST services 所以需要后台支持,此处选择了php.Slim 是php的一个框架. 貌似国内文章对此的介绍比较少,在安装Slim的过程中出 ...

  3. PCA算法提取人脸识别特征脸(降噪)

    PCA算法可以使得高维数据(mxn)降到低维,而在整个降维的过程中会丢失一定的信息,也会因此而实现降噪除噪的效果,另外,它通过降维可以计算出原本数据集的主成分分量Wk矩阵(kxn),如果将其作为数据样 ...

  4. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:显示和隐藏内容

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  5. NO30 磁盘分区--Raid--ext2文件系统

    Raid: ext2文件系统:

  6. ThinkPad重大更新!5款创意设计PC齐发2日

    导读 日前,ThinkPad巨匠P系列专业移动工作站迎来全线更新,包括ThinkPad P1隐士2019.ThinkPad P53.ThinkPad P73.ThinkPad P43s.ThinkPa ...

  7. CSS - flex使行内元素快速对齐

    div{ display:flex; alian-items:center; //使垂直对齐 justify-content:center //使水平对齐 }

  8. CVE-2019-0708—微软RDP远程桌面代码执行漏洞复现

    0x01 2019年9月7日凌晨,msf上更新了0708的漏洞利用程序. 顿时安全群和朋友圈就爆炸了 - 奈何接到HW攻击队任务,又在家过了个中秋,0708才在今天更新. 0x02 环境 Window ...

  9. AndroidStudio3.0打开Android Device Monitor

    相信很多更新了AndroidStudio3.0的小伙伴会发现无法在工具栏的的Tools->Android->device monitor,打开DeviceMonitor. 今天偶然看到 G ...

  10. 016.CI4框架CodeIgniter数据库操作之:Insert插入一条数据

    01.在Model中,写入插入的语句 <?php namespace App\Models\System; use CodeIgniter\Model; class User_model ext ...