08-25-2025

This commit is contained in:
e2hang
2025-08-25 21:45:54 +08:00
parent 8edd0f98b5
commit 4e76498908
4 changed files with 41 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
#include <iostream>
#include <set>
using namespace std;
int main(){
set<int> s;
int n;
cin >> n;
int tmp;
for(int i = 0; i < n; i++){
cin >> tmp;
s.emplace(tmp);
}
cout << s.size() << endl;
for(auto it = s.begin(); it != s.end(); it++){
cout << *it << " ";
}
cout << endl;
return 0;
}

View File

@@ -4,14 +4,11 @@ int main(){
int n, k;
cin >> n >> k;
int tmp = n;
int js=n;
while(tmp>k){
js+=int(tmp/k);
tmp=tmp%k+tmp/k;
int js = 0;
while(tmp >= k){
tmp = tmp - k + 1;
js++;
}
cout<<js<<endl;
cout << n + js << endl;
return 0;
}
/* 4%3=1 5%3=2 2+int(5/3)=3 3%3=0
6%4=2 2+6/4=3*/

View File

@@ -0,0 +1,14 @@
#include <iostream>
#include <unordered_set>
using namespace std;
int main() {
unordered_set<string> a;
int n;
cin >> n;
string x;
for(int i = 0; i < n; i++){
cin >> x;
a.emplace(x);
}
cout << a.size() << endl;
}