Tên đăng nhập Điểm Bài tập ▴ Giới thiệu
19801 2765 3
19802 583 3
19803 2548 3
19804 188 3
19805
buigialoc1207
Bùi Gia Lộc
307 3
19806 1299 3
19807 388 3
19808 1144 3
19809
hthang07
Đinh Văn Hoàng Thắng
858 3
19810 488 3
19811 288 3
19812 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;
}

19813 1973 3
19814 1664 3
19815 288 3
19816 988 3
19817 288 3
19818 2516 3

hihihi

19819 1968 3
19820 377 3
19821 1872 3

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

19823 2230 3
19824
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

19825 2993 3
19826
Mikek 1441
1843 3
19827 508 3
19828 269 3

Chỉ ta mới được ngồi lên ngai vàng của đấng chí tôn

19829 768 3
19830
kietlvcto999
Travotbot
2970 3
19831 509 3
19832 410 3
19833 858 3
19834 288 3
19835 866 3
19836 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;
}

19837 288 3
19838 720 3
19839 601 3
19840 988 3
19841 288 3
19841 288 3
19843 335 3
19844
NHU32
Hồ Khánh Đan
4396 3
19845
NHU41
Trần Bình Nguyên
397 3
19846 274 3
19847 811 3
19848 809 3
19849 2738 3
19850
phungdinhtuansn04052008
Phùng Đình Tuấn
1732 3
19851 1188 3
19852 988 3
19852 988 3
19852 988 3
19855 288 3
19856
Articulation_po
Articulation_points
2785 3
19857 988 3
19858 288 3
19859 988 3
19860 288 3
19861 1674 3
19862 288 3
19862 288 3
19862 288 3
19862 288 3
19866 1441 3
19867 522 3
19868 688 3
19869 740 3
19870 206 3
19871 351 3
19872 288 3
19873 590 3
19874 2353 3
19875 4033 3
19876 583 3
19877 988 3

moai

19878
killerboy2866
Nguyễn Đình Văn Cương
817 3
19879 130 3
19880 288 3
19881
24BSTR17
Nguyễn Đức Hiếu
243 3
19882 385 3
19883 1054 3
19884 1697 3
19885 2836 3
19886 104 3
19887 808 3
19888 388 3
19889 288 3
19889 288 3
19891 532 3
19892
ICT24A00112
Nguyễn Ngọc Minh Khang
1038 3
19893
ICT24A00118
Lê Trần Ngân Khánh
895 3
19894
ICT24A00120
Phan Công Khoa
2191 3
19895
ICT24A00218
Hồ Tấn Phúc
288 3
19896
ICT24B00402
Nguyễn Văn Gia Bảo
388 3
19897
ICT24B00414
Trần Văn Hoàng Sơn
1054 3
19898 858 3
19899 285 3
19900 210 3