摘要:
#include<stdio.h>#include<string.h>int main(){ int a,i,n,m,k,t=0,b=0; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&a); if(i==1)t=a; else { if(a>=b)t+=a-b+1; else t+=b-a+1; } b=a; } printf("%d",t+n); retu... 阅读全文
摘要:
#include<stdio.h>#include<string.h>int main(){ char a[51],b[51]; int i,n,t=1; scanf("%s %s",a,b); n=strlen(b); for(i=0;i<n;i++) { if(a[t-1]==b[i])t++; } printf("%d",t); return 0;}http://codeforces.com/contest/265/problem/A 阅读全文