Tên đăng nhập Điểm Bài tập ▾ Giới thiệu
19501 401 1
19502 301 1

include <bits/stdc++.h>

define task ""

define for(i, a, b) for(int i = (a); i <= (b); i++)

define pii pair<int, int>

using namespace std;
int const N = 1e7+2;

int a[N];
int n,m,x,y;
pii sum[N];

int main()
{
//freopen(task".inp","r",stdin);
//freopen(task".out","w",stdout);
cin>>n>>m;
cout<<n-(m-2n)/2<<" "<<(m-2n)/2;

return 0;

}

19503 1201 1
19504 1301 1
19505 1 1
19506 201 1
19507 1409 1
19508 301 1
19509 201 1

tt

19510 301 1
19511 267 1
19512 96 1
19513 101 1
19513 101 1
19515 60 1
19516 1001 1
19517 101 1

Tôi thích code

19517 101 1

include <bits/stdc++.h>

using namespace std;
int main(){
int a,b;
cin>>a>>b;
if(a<b){
cout<<a<<" "<<b;
}
else cout<<b<<" "<<a;

return 0;

}

19519
dungle 1303
Lê Tiến Dũng, T.Nguyên
1301 1
19520
TS_2392 1576
Trần Nguyễn Thái Sơn, Nam Định
1405 1
19521 15 1
19522 1301 1
19523 273 1
19524 801 1
19525 225 1
19526 201 1
19527 1 1
19528 818 1
19529 455 1
19530 1201 1
19531
green_cheese 1532
Hồ Đoàn Bảo Châu, Hà Nội
101 1
19532 201 1

Casihaideptrai

19533 240 1
19534 67 1
19535
cht_kien 1172
Nguyễn Hồng Kiên, H.Tĩnh
1601 1
19536
rabit
Nguyễn Hữu Mạnh Tường, ĐHV
801 1
19537 360 1
19538
chanhongvh2006
Tăng Chấn Hồng
351 1
19539 1801 1
19540 140 1
19541 240 1
19542 101 1
19542 101 1
19544 301 1
19545 201 1
19546 801 1
19547 301 1
19548 351 1
19549 301 1

Linh Trung - Thủ Đức

19549 301 1
19549 301 1
19549 301 1
19553 180 1

include<iostream>

include<algorithm>

using namespace std;

int main () {
int n;
cin >> n;
int a[n];
for (int i=0;i<n;i++) { cin >> a[i];
}
int dem=0;
sort (a,a+n);
int i=0,j=1,k=n-1;
while (true) {
while ((a[i]+a[j])<=a[k]) {
if (j<k-1) j++; else i++; if (i==(j-1) && j == (k-1) ) break; } if ( (a[i]+a[j])>a[k] && i<j && j < k) {
dem=dem+(k-j)*(j-i);
}
i=0;j=1;k=k-1;
if (k==1)break;
}
cout << dem;
}

19554 301 1
19554 301 1
19556 801 1
19557 301 1
19558 1701 1
19559 100 1
19560 301 1
19561 1601 1
19562 101 1
19562
zhaozhaozhao
Bui Tuan Dung
101 1
19564 201 1
19565 801 1
19566 900 1
19567 801 1
19568 656 1
19569 201 1
19569 200 1
19569 201 1
19572 101 1
19573 1701 1
19574 101 1
19575 1 1

A newbie :))

19576 201 1
19577 901 1
19578 120 1
19579 1601 1
19580 101 1
19581 301 1
19582 101 1
19582 101 1
19584 201 1
19585 980 1
19586 180 1
19587 201 1
19588 801 1
19589 1601 1
19590 201 1
19590 201 1
19592 101 1
19593 201 1
19594 175 1
19595 101 1
19595 101 1
19595 101 1
19595 101 1
19599 0 1
19600 1601 1