Tên đăng nhập Điểm Bài tập ▾ Giới thiệu
16301 3498 3
16302 288 3
16303
minh10b2
Đinh Văn Minh
269 3
16304 1103 3
16305 274 3
16306 288 3
16306 288 3
16308 203 3
16309 288 3
16310 215 3
16311
29201454892
Nguyễn Thục Khuê
988 3
16312
29219241998
Phạm Thanh Sang
288 3
16312
29211458149
Nguyễn Văn Thắng
288 3
16314
29211441367
Lê Hồng Tiến
988 3
16315
29211453885
Phạm Tấn Văn
288 3
16316 1616 3
16317 204 3
16318 673 3
16319 1811 3
16320 288 3
16320 288 3
16322 1297 3
16323 778 3
16324 3559 3
16325 488 3
16326
khoihuynh2409
Huỳnh Minh Khôi
1958 3
16327 858 3
16328 488 3

hehê

16329 1973 3
16330 673 3
16331 1041 3
16332 288 3
16333 588 3
16334
yennhiyi
CAO YEN NHI
2586 3
16335 269 3
16336 288 3
16337 399 3
16338 2258 3
16339 205 3
16340 573 3
16340 573 3
16342 388 3
16343 347 3
16344 1146 3
16345 2096 3

include<bits/stdc++.h>

using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long n,a[1000001],f[1000001],k,i,cnt=0;
cin>>n>>k;
f[0]=0;
for(i=1;i<=n;i++){
cin>>a[i];
f[i]=f[i-1]+a[i];
}
for(i=1;i<=n;i++){
for(long long j=i;j<=n;j++){
if(f[j]-f[i]==k){
cnt++;
}
}
}
cout<<cnt;
return 0;
}

16346 288 3
16347 3750 3
16348 427 3
16349 673 3
16350 2765 3
16351 583 3
16352 2548 3
16353 188 3
16354
buigialoc1207
Bùi Gia Lộc
307 3
16355 1299 3
16356 388 3
16357 1144 3
16358
hthang07
Đinh Văn Hoàng Thắng
858 3
16359 488 3
16360 288 3
16361 488 3

include <bits/stdc++.h>

using namespace std;
long long n;
int main()
{
cin >>n;
if (n%2==0)
{
cout <<n/2(-1);
}
if (n%2!=0)
{
cout <<(n-1)/2
(-1)+n%10;
}
return 0;
}

16362 1664 3
16363 288 3
16364 988 3
16365 288 3
16366 2516 3

hihihi

16367 1968 3
16368 377 3
16369 1872 3

16370 3448 3

include<bits/stdc++.h>

define maxn 10005

define ll long long

define vec vector

define pb push_back

define str string

define fi first

define se second

using namespace std;

int n,a[maxn],sum;
bool f[101][100000];
vec<int> result;

void nhap(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i]; sum+=a[i];
}
for(int i=0;i<=n;i++) f[i][0]= true;
}

void xuly(){
for(int i=1;i<=n;i++){
for(int j=1;j<=sum;j++){
f[i][j]=f[i-1][j];
if(f[i][j]==false&&j>=a[i]){
f[i][j]=f[i-1][j-a[i]];
}
}
}
for(int j=1;j<=sum;j++){
if (f[n][j]) result.pb(j);
}
cout<<result.size()<<endl;
for(auto x:result) cout<<x<<" ";
}

int main(){
// freopen("tester.inp","r",stdin);
// freopen("tester.out","w",stdout);
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
nhap();
xuly();
}

16371 2230 3
16372
khoa4356 830
Nguyễn Văn Đăng Khoa
1788 3

I am pro
The day I created this account was the day I reached the top 4500 =v

16373 2993 3
16374
Mikek 1441
1843 3
16375 508 3
16376 768 3
16377
kietlvcto999
Travotbot
2970 3
16378 509 3
16379 410 3
16380 858 3
16381 288 3
16382 866 3
16383 1873 3

include <iostream>

include <math.h>

include <algorithm>

include <climits>

include <queue>

include <vector>

include <stack>

include <string>

include <iomanip>

include <tuple>

include <set>

include <map>

using namespace std;

define int long long

const int MAXN = 300005;
int a[MAXN];
int s;
int n;

void solve(){
cin >> n >> s;
for(int i = 1 ; i <= n ;i++){
cin >> a[i];
}
int i = 1;
int j = n ;
while(i <= j){
if(a[i] + a[j] < s){
i++;
}else if(a[i] + a[j] > s){
j--;
}else if(a[i]+a[j] == s){
cout << i << " " << j << endl;
return;
}
}
cout << "No solution" << endl;
return;

}

signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int t=1;
// cin >> t;
while(t--){
solve();
}
return 0;
}

16384 288 3
16385 720 3
16386 601 3
16387 988 3
16388 288 3
16388 288 3
16390 335 3
16391
NHU32
Hồ Khánh Đan
4396 3
16392
NHU41
Trần Bình Nguyên
397 3
16393 274 3
16394 811 3
16395 809 3
16396 2738 3
16397
phungdinhtuansn04052008
Phùng Đình Tuấn
1732 3
16398 145 3
16399 1188 3
16400 988 3