Tên đăng nhập Điểm Bài tập ▴ Giới thiệu
20501
lamnkhdk
Nguyễn Khánh Lâm
375 4
20502
STR07Hieu
Trần Ngọc Hiếu
457 4
20503
STR60Thang
Lê Tiến Thăng
375 4
20504
STRB14Phuc
Nguyễn Huỳnh Anh Phúc
855 4
20505
STRB16Nhat
Lê Bá Minh Nhật
945 4
20506
STRB17Huy
Trần Võ Quốc Huy
855 4
20506
STRB19Bao
Phùng Anh Bảo
855 4
20506
STRB37Khoa
Võ Như Khoa
855 4
20506
STRB43Chuong
Nguyễn Hữu Chương
855 4
20506
STRB56Hang
Nguyễn Thị Thanh Hằng
855 4
20506
STRB59Phong
Nguyễn Trung Hải Phong
855 4
20512 375 4
20512 375 4
20514 2161 4
20515 821 4
20516 475 4
20517 4334 4
20518 2143 4
20519 1178 4
20520 1038 4
20521 941 4
20522
yueakayue
TranVuAnh
187 4

Nothing here

20523 4040 4
20524 375 4
20525 746 4
20526 1170 4
20527 834 4
20528 1170 4
20529 594 4
20530 1011 4
20531 375 4
20532 726 4
20533 971 4
20534 800 4
20535 561 4
20536 375 4
20536 375 4
20538 2880 4
20539 375 4
20540 2558 4
20541 2660 4
20542 1047 4
20543 2009 4
20544 1022 4
20545 1117 4
20546 1075 4
20546 1075 4
20546 1075 4
20546 1075 4
20546 1075 4
20546 1075 4
20552 1324 4
20553 348 4
20554 765 4
20555 1075 4
20556 1034 4

Account này đã bị ban vì phát hiện hành vi không trung thực khi làm bài tập: chép code, if test để AC. Chi tiết xin liên hệ Lê Tăng Phú Quý

20557 375 4
20558 1075 4
20558 1075 4
20558 1075 4

import java.util.*;
public class bai41{
public static void array(int[] c){
for(int i = 0 ; i < c.length-1 ;i++) {
for(int j = i +1 ; j < c.length ; j++) {
if(c[i] > c[j]) {
int temp = c[i];
c[i] = c[j];
c[j] = temp;
}
}
}
}
public static void main(String[] args){
Scanner reader = new Scanner(System.in);
int n = reader.nextInt();
int[] a = new int[n];
for(int i = 0 ; i < a.length ;i++){
a[i] = reader.nextInt();
}
array(a);
for(int i = 0 ; i < a.length ;i++){
System.out.print(a[i] + " ");
}
}
}

20558 1075 4
20562 2981 4
20563 2440 4
20564 1075 4
20564 1075 4
20564 1075 4
20567 994 4
20568 1075 4
20568 1075 4
20570 3457 4
20571
tienmy09
Nguyễn Tiến Mỹ
3131 4
20572 2120 4
20573 3828 4

NOthing

20574 2333 4
20575 4468 4

include <bits/stdc++.h>

using namespace std;

int x,y;

int main()

{

  cin>>x>>y;

  cout<<max(x,y); //tgc có 2 cạnh bằng nhau nên chọn cạnh lớn hơn để có diện tích lớn nhất.

}

20576 2154 4
20577 1064 4
20578 1075 4
20579 2011 4
20580 912 4
20581 2008 4
20582 2785 4
20583
vuhung08062009 1277
Vũ T.N Hùng
3336 4

hehe

20584 626 4
20585 412 4
20586 4654 4

include<bits/stdc++.h>

using namespace std;

define endl "\n"

define pb push_back

define ll long long

const int maxn=1e6+1;

vector<int>adj[maxn],queries[maxn];
int n,q,par[maxn],rnk[maxn],ancestor[maxn];
bool visited[maxn];
map<pair\<int,int>,int>mp;
vector<pair\<int,int>>ans;

int find_set(int u){
while(par[u]!=u)u=par[u];
return u;
}

void union_set(int x,int y){
int xroot=find_set(x);
int yroot=find_set(y);
if(xroot==yroot)return;
if(rnk[xroot]<rnk[yroot])par[xroot]=yroot; else if(rnk[xroot]>rnk[yroot])par[yroot] = xroot;
else{
par[xroot]=yroot;
rnk[yroot]++;
}
}

void dfs(int w){
visited[w]=true;
ancestor[w]=w;
for(int u:adj[w]){
if(!visited[u]){
dfs(u);
union_set(w,u);
ancestor[find_set(u)] = w;
}
}
for(int u:queries[w]){
if(visited[u]){
mp[{min(w,u),max(u,w)}]=ancestor[find_set(u)];
}
}
}

int main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n>>q;
for(int i = 1; i < n; i++) {
int u, v;
cin >> u >> v;
adj[u].push_back(v);
adj[v].push_back(u);
}
for(int i = 1; i <= n; i++)
par[i] = i;
for (int i=1;i<=q;i++) {
int u, v;
cin >> u >> v;if (u>v)swap(u,v);ans.pb({u,v});
queries[u].push_back(v);
queries[v].push_back(u);
}
dfs(1);
for (auto u:ans)cout<<mp[u]<<endl;
}

20587 1237 4
20588 375 4
20589 4911 4
20590 4630 4
20591 158 4
20592 1170 4
20593 570 4
20594
PY1ETranKhanhHa
Trần Khánh Hà
375 4
20594 375 4
20594 375 4
20597 1888 4
20598 575 4
20599 923 4
20600 1075 4