Tên đăng nhập Điểm Bài tập ▾ Giới thiệu
16201 288 3
16202 215 3
16203
29201454892
Nguyễn Thục Khuê
988 3
16204
29219241998
Phạm Thanh Sang
288 3
16204
29211458149
Nguyễn Văn Thắng
288 3
16206
29211441367
Lê Hồng Tiến
988 3
16207
29211453885
Phạm Tấn Văn
288 3
16208 1616 3
16209 204 3
16210 673 3
16211 1811 3
16212 288 3
16212 288 3
16214 778 3
16215 3559 3
16216 488 3
16217
khoihuynh2409
Huỳnh Minh Khôi
1958 3
16218 858 3
16219 488 3

hehê

16220 1973 3
16221 673 3
16222 1041 3
16223 288 3
16224 588 3
16225
yennhiyi
CAO YEN NHI
2586 3
16226 269 3
16227 288 3
16228 399 3
16229 2258 3
16230 3562 3
16231 205 3
16232 573 3
16232 573 3
16234 388 3
16235 347 3
16236 1146 3
16237 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;
}

16238 288 3
16239 3750 3
16240 673 3
16241 2765 3
16242 3389 3
16243 583 3
16244 2548 3
16245 188 3
16246
buigialoc1207
Bùi Gia Lộc
307 3
16247 1299 3
16248 388 3
16249 1144 3
16250
hthang07
Đinh Văn Hoàng Thắng
858 3
16251 488 3
16251 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;
}

16253 288 3
16254 988 3
16255 288 3
16256 2516 3

hihihi

16257 1968 3
16258 377 3
16259 1872 3

16260 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();
}

16261 2230 3
16262
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

16263 2993 3
16264
Mikek 1441
1843 3
16265 508 3
16266 768 3
16267
kietlvcto999
Travotbot
2970 3
16268 509 3
16269 410 3
16270 858 3
16271 288 3
16272 866 3
16273 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;
}

16274 288 3
16275 720 3
16276 601 3
16277 988 3
16278 288 3
16278 288 3
16280 335 3
16281
NHU32
Hồ Khánh Đan
4396 3
16282
NHU39
Lê Việt Thái
1736 3
16283
NHU41
Trần Bình Nguyên
397 3
16284 274 3
16285 811 3
16286 809 3
16287
phungdinhtuansn04052008
Phùng Đình Tuấn
1732 3
16288 988 3
16288 988 3
16288 988 3
16291 288 3
16292
Articulation_po
Articulation_points
2785 3
16293 988 3
16294 288 3
16295 988 3
16296 288 3
16297 1674 3
16298 288 3
16298 288 3
16298 288 3