zl程序教程

您现在的位置是:首页 >  其它

当前栏目

Codeforces Round #182 (Div. 2)

Codeforces div round
2023-09-11 14:16:05 时间
//A 好久没做了,5.1一过寝室不熄灯了,今天做了一场还是只做了2题。 弱。 #include iostream #include stdio.h using namespace std; int a[200005],b[200005]; int main() // freopen( 1.txt , r ,stdin); int n,m,
//A 好久没做了,5.1一过寝室不熄灯了,今天做了一场还是只做了2题。 弱。

#include iostream 

#include stdio.h 

using namespace std;

int a[200005],b[200005];

int main()

 // freopen("1.txt","r",stdin);

 int n,m,numx=0,numy=0,x,y;

 cin n m;

 for(int i=0; i i++)

 cin a[i];

 if(a[i]==1)

 numx++;

 else numy++;

 for(int j=0; j j++)

 cin x y;

 if((y-x)%2!=0 (y-x+1) =2*min(numx,numy)) // 满足这个条件才输出1

 cout 1 endl;

 else

 cout 0 endl;

 return 0;

#include iostream 

#include stdio.h 

#include cstring 

using namespace std;

int v[100005],c[100005],t[100005],sum[100005];

int main()

 //freopen("1.txt","r",stdin);

 memset(sum,0,sizeof(sum));

 int n,m;

 cin n m;

 cin c[0] t[0];

 sum[0]=c[0]*t[0];

 for(int i=1; i i++)

 cin c[i] t[i];

 sum[i]=c[i]*t[i]+sum[i-1];

 for(int j=0; j j++)

 cin v[j];

 int k=0;

 for(int j=0; j j++)

 for(int i=k; i i++) // 第一次TLE了,这里标记一下从上次的i开始节省了时间。

 if(v[j] =sum[i])

 cout i+1 endl;

 k=i;

 break;

 return 0;


Codeforces Round #723 (Div. 2)B. I Hate 1111 Description You are given an integer x. Can you make x by summing up some number of 11,111,1111,11111,…? (You can use any number among them any number of times). For instance, 33=11+11+11 144=111+11+11+11