Gửi bài giải
Điểm:
2,50 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
beauty.inp
Output:
beauty.out
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Bình luận
include <bits/stdc++.h>
using namespace std; long long n,k,a[10000005],kq=0; int main() { freopen("BEAUTY.inp","r",stdin); freopen("BEAUTY.out","w",stdout); cin>>n>>k; for(int i=1;i<=n;i++) cin>>a[i];
}
yêu tất cả các em : DMA SCL SCL NEXT XSGA LCCDNCT ABMN KCBVK
include<bits/stdc++.h>
using namespace std;using l=long long;
define F for
define R freopen("BEAUTY.inp","r",stdin),freopen("BEAUTY.out","w",stdout)
define X(x,y)((x)>(y)?(x):(y))
l A[10000005];int main(){R; l n,k,q=0;cin>>n>>k;F(int i=1;i<=n;i++)cin>>A[i];F(int i=1;i<=n;i++){l s=0;F(int j=i;j<=n;j++){s+=A[j];l t=j-i+1;q=X(q,s==k*t?t:q);}}cout<<q;}
.
.
yêu tất cả các em : DMA SCL SCL NEXT XSGA LCCDNCT ABMN KCBVK
yeu e
Khó vcl mé