Tên đăng nhập Điểm Bài tập Giới thiệu
1
memeq 1931
8806 17
2
trvhung 1727
Trần Việt Hưng
29858 157
3
phamducminh538 1709
Pham Duc Minh
37746 623


me

me

4
khactrung1912 1670
Nguyễn Khắc Trung
36691 253
5
vongocsinh 1647
Võ Ngọc Sinh, Quảng Bình
36774 341
6
huyquang_25 1630
Lê Quang Huy
32505 487
7 5929 6
8
Sang522008 1525
Nguyễn Ngọc Cao Sang
34422 801

Nick Phụ: nguyenngoccaosang , NNCS

Newbie


#include <bits/stdc++.h>

using namespace std;

signed main()
{
    ios_base::sync_with_stdio(NULL);
    cin.tie(NULL);
    cout<<"Cao Sangg";
}

Profile
FaceBook

9
nguyenngoccaosang 1442
Nguyễn Ngọc Cao Sang
20061 76

Acc phụ của Sang522008

10 0 0
11 1203 3
12
Syn 1325
4521 8
13
tk22NguyenPhuongLam 1301
Nguyễn Phương Lâm
16383 262
Ma vương Tulen đã nói gì với chúng ta?

-Chỉ ta mới được ngồi vào ngai vàng của đấng chí tôn
-Kẻ sống trong nắng hạ sao hiểu được giá lạnh ngày đông
-Hahaha ngươi chẳng biết được tham vọng của ta đâu
-Trăn trối đi ta là chúa tể của sấm sét
-Tại sao phải làm vua khi ta có thể làm thần
-Lôi điện là sức mạnh chí tôn trong vũ trụ này
-Ta ghét những kẻ không quyết đoán
-Hahahaha lôi động,công thủ toàn diện,ta là chủ nhân mới của sức mạnh này
-Nếm thử nỗi đau lôi điện đi
-Chẳng ai kiểm soát được ta
-Tội của ngươi đáng ch*t trăm lần,nhận đòn đi
-đoàn kết là sức mạnh
-Thích nghi và trỗi dậy,chúng ta ở đây để tồn tại
-Đây là trận chiến của các vị thần
-Lôi điểu!hóa thành tro đi hahahaha

Ma vương Tulen

14
n2loclm 1233
Lê Minh Lộc
32753 665
15
nguyenanhdaoht12 1223
nguyenvangiabao
5854 74

tôi tên là nguyễn văn giabao học sinh lớp 3/1.ha

16 10187 14
17 26146 331

TRÔN VN =)

18
Ragnakrog 1069
Quá khó để quên em
16052 50
19
elsu 989
NoNameNoBody
25301 209

I am elsu
Bị aaiibbxx phá hoại cuộc sống

20 0 0
20 0 0
22 2050 6
23 11554 15
24
thuongvng
Nguyễn Thị Thương
0 0
25
nguyenthinhuquynh
Nguyễn Thị Như Quỳnh
21006 84

an tê ô

26 25606 164
27 6421 20
28
yenmai2832008
Vũ Thị Yến Mai
12864 120

hi 🙂

29 22033 63
30 12170 23
31 101 1
32 1685 6
33 2957 6
34 1876 7
35 9702 29
36 621 2
37
anhuynt
Trịnh Nguyễn An Huy
1541 3
38 1849 15
39 0 0
39 0 0

include<bits/stdc++.h>

using namespace std;
vector<int> p,sl, mx;
void init(int n) {
p.resize(n+1);
sl.resize(n+1);
mx.resize(n+1);
for (int i=1; i<=n; i++){
p[i] = i;
sl[i]= 1;
mx[i]=i;
}

}

int find (int a) {
if (a == p[a]) return a;
return p[a]=find(p[a]);
}

void union_set (int a, int b) {
a = find(a);
b = find(b);
if (p[a]>p[b]) {
swap(a,b);
p[a]+= p[b];
p[b] = a;
}
}

int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int n,m;
cin>> n>> m;
init(n);
int tg =n;
while (m--){
int a,b;
cin>> a>> b;
if (union_set(a, b)) {
sl = max(sl, p.size(a));
tg--;
}
cout<< tg << ' ' << sl << '\n';
}
return 0;
}

41 1501 1
42 1132 4
43 288 3
44 0 0
44 0 0
44 0 0
47 200 1
48
hnhlongvbh
Võ Hoàng Bảo Long
872 11
49
hnhlongtm
Trần Minh Long
906 12
50 0 0
50 0 0
52 269 1
53 0 0
54 101 1
55 8535 43
56 0 0
56 0 0
58 401 1
59 0 0
60 541 2
61 0 0
62 45 1
62 45 1
64 943 9
65
BaAnhHT
Hoàng Bá Anh
0 0
65 0 0
67 2161 4
68 0 0
68 0 0
70 225 2
71 9795 13
72 0 0
72 0 0
72 0 0

nothing

75
Critcal
Nguyen Le Chau
4085 30

This account was made to exercise coding skill ,which my program languages teacher tell me and his other pupils to do. Now it's time to moving to other things.
I know this doesn't talk about my information but that is PRIVATE INFO that i can't tell to YOU, the one who is reading this. I was pretty nervous when i see the problems tab of me are different, but it's just a setting. it took me some time to found it's a setting, pretty fun case, right? Alright, thanks for reading this! BTW, I love Nyan cat!

76 0 0
77 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;
}

78 1268 9
79 1310 7
80 5856 37
81 5860 70
82 0 0
83 7561 40
84 0 0
85 923 4
86 197 2
87 40 1
88 0 0
89 1423 9
90 197 2
91 0 0

bhhh

92 13859 67
93 1447 5
94
nguyenminhkhoi1234
NguyenMinhKhoi
6322 56
95 3197 5

sssss

96 201 1
97 1880 13
98 197 2
99 0 0
99 0 0