-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8fe0f2b
commit e27f147
Showing
274 changed files
with
250 additions
and
447 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
Archive/BOJ/.cph/.1080.cpp_f9838c636af6f38bcb1d107964195d9b.prob
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"Local: 1080","url":"/Users/peter/Desktop/Study/Coding/BOJ/1080.cpp","tests":[{"id":1602423845311,"input":"","output":""}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/peter/Desktop/Study/Coding/BOJ/1080.cpp","group":"local","local":true} |
1 change: 1 addition & 0 deletions
1
Archive/BOJ/.cph/.11931.cpp_0d851001d9ff4bdff4d230acc1f35373.prob
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"Local: 11931","url":"/Users/peter/Desktop/Study/Coding/BOJ/11931.cpp","tests":[{"id":1602422484747,"input":"5\n1\n2\n3\n4\n5","output":"5\n4\n3\n2\n1"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"/Users/peter/Desktop/Study/Coding/BOJ/11931.cpp","group":"local","local":true} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,71 @@ | ||
#include <bits/stdc++.h> | ||
|
||
using namespace std; | ||
|
||
const int ALPHABET = 26; | ||
int toNumber(char ch){return ch - 'a';} | ||
|
||
struct TrieNode{ | ||
TrieNode* children[ALPHABET]; | ||
bool terminal; | ||
|
||
TrieNode() : terminal(false){ | ||
memset(children, 0, sizeof(children)); | ||
} | ||
|
||
~TrieNode(){ | ||
for(int i=0; i<ALPHABET; ++i){ | ||
if(children[i]) | ||
delete children[i]; | ||
} | ||
} | ||
|
||
void insert(const char* key){ | ||
if(*key == 0){ | ||
terminal = true; | ||
} | ||
else{ | ||
int next = toNumber(*key); | ||
if(children[next] == NULL){ | ||
children[next] = new TrieNode(); | ||
} | ||
children[next]->insert(key + 1); | ||
} | ||
|
||
} | ||
|
||
bool find(const char* key){ | ||
if(*key == 0) return terminal; | ||
int next = toNumber(*key); | ||
if(children[next] == NULL) return false; | ||
return children[next]->find(key + 1); | ||
} | ||
}; | ||
|
||
int N,M; | ||
|
||
int main(){ | ||
ios::sync_with_stdio(false); | ||
cin.tie(NULL); | ||
cout.tie(NULL); | ||
cin >> N >> M; | ||
|
||
TrieNode* node = new TrieNode(); | ||
|
||
for(int i=0; i<N; ++i){ | ||
char ch[500]; | ||
cin >> ch; | ||
node->insert(ch); | ||
} | ||
int cnt = 0; | ||
for(int i=0; i<M; ++i){ | ||
char ch[500]; | ||
cin >> ch; | ||
if(node->find(ch)){ | ||
cnt++; | ||
} | ||
} | ||
|
||
cout << cnt << '\n'; | ||
return 0; | ||
#include <bits/stdc++.h> | ||
|
||
using namespace std; | ||
|
||
const int ALPHABET = 26; | ||
int toNumber(char ch){return ch - 'a';} | ||
|
||
struct TrieNode{ | ||
TrieNode* children[ALPHABET]; | ||
bool terminal; | ||
|
||
TrieNode() : terminal(false){ | ||
memset(children, 0, sizeof(children)); | ||
} | ||
|
||
~TrieNode(){ | ||
for(int i=0; i<ALPHABET; ++i){ | ||
if(children[i]) | ||
delete children[i]; | ||
} | ||
} | ||
|
||
void insert(const char* key){ | ||
if(*key == 0){ | ||
terminal = true; | ||
} | ||
else{ | ||
int next = toNumber(*key); | ||
if(children[next] == NULL){ | ||
children[next] = new TrieNode(); | ||
} | ||
children[next]->insert(key + 1); | ||
} | ||
|
||
} | ||
|
||
bool find(const char* key){ | ||
if(*key == 0) return terminal; | ||
int next = toNumber(*key); | ||
if(children[next] == NULL) return false; | ||
return children[next]->find(key + 1); | ||
} | ||
}; | ||
|
||
int N,M; | ||
|
||
int main(){ | ||
ios::sync_with_stdio(false); | ||
cin.tie(NULL); | ||
cout.tie(NULL); | ||
cin >> N >> M; | ||
|
||
TrieNode* node = new TrieNode(); | ||
|
||
for(int i=0; i<N; ++i){ | ||
char ch[500]; | ||
cin >> ch; | ||
node->insert(ch); | ||
} | ||
int cnt = 0; | ||
for(int i=0; i<M; ++i){ | ||
char ch[500]; | ||
cin >> ch; | ||
if(node->find(ch)){ | ||
cnt++; | ||
} | ||
} | ||
|
||
cout << cnt << '\n'; | ||
return 0; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
#include <bits/stdc++.h> | ||
#define endl '\n' | ||
using namespace std; | ||
|
||
char arr[16]; | ||
char tmp[16]; | ||
int N,M; | ||
|
||
|
||
void dfs(int start, int cnt){ | ||
if(cnt == N){ | ||
int vowelN = 0, consonant = 0; | ||
for(int i=0; i<N; ++i){ | ||
if(tmp[i] == 'a' || tmp[i] == 'e' || tmp[i] == 'i' || tmp[i] == 'o' || tmp[i] == 'u') { | ||
vowelN++; | ||
} | ||
} | ||
consonant = N - vowelN; | ||
|
||
if(vowelN >= 1 && consonant >= 2){ | ||
for(int i=0; i<N; ++i){ | ||
cout << tmp[i]; | ||
} | ||
cout << endl; | ||
} | ||
return; | ||
} | ||
|
||
for(int i=start; i<M; ++i){ | ||
tmp[cnt] = arr[i]; | ||
dfs(i+1, cnt+1); | ||
} | ||
} | ||
|
||
int main(){ | ||
cin >> N >> M; | ||
for(int i=0; i<M; ++i){ | ||
cin >> arr[i]; | ||
} | ||
|
||
sort(arr, arr+M); | ||
dfs(0,0); | ||
|
||
return 0; | ||
#include <bits/stdc++.h> | ||
#define endl '\n' | ||
using namespace std; | ||
|
||
char arr[16]; | ||
char tmp[16]; | ||
int N,M; | ||
|
||
|
||
void dfs(int start, int cnt){ | ||
if(cnt == N){ | ||
int vowelN = 0, consonant = 0; | ||
for(int i=0; i<N; ++i){ | ||
if(tmp[i] == 'a' || tmp[i] == 'e' || tmp[i] == 'i' || tmp[i] == 'o' || tmp[i] == 'u') { | ||
vowelN++; | ||
} | ||
} | ||
consonant = N - vowelN; | ||
|
||
if(vowelN >= 1 && consonant >= 2){ | ||
for(int i=0; i<N; ++i){ | ||
cout << tmp[i]; | ||
} | ||
cout << endl; | ||
} | ||
return; | ||
} | ||
|
||
for(int i=start; i<M; ++i){ | ||
tmp[cnt] = arr[i]; | ||
dfs(i+1, cnt+1); | ||
} | ||
} | ||
|
||
int main(){ | ||
cin >> N >> M; | ||
for(int i=0; i<M; ++i){ | ||
cin >> arr[i]; | ||
} | ||
|
||
sort(arr, arr+M); | ||
dfs(0,0); | ||
|
||
return 0; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
#include <bits/stdc++.h> | ||
#define endl '\n' | ||
using namespace std; | ||
|
||
map<string, int> m; | ||
map<string, int> result; | ||
int N, M; | ||
|
||
int main(){ | ||
ios::sync_with_stdio(0); | ||
cin.tie(0); | ||
cout.tie(0); | ||
cin >> N >> M; | ||
|
||
while(N--){ | ||
string temp; cin >> temp; | ||
m[temp] = 1; | ||
} | ||
|
||
while(M--){ | ||
string temp; cin >> temp; | ||
if(m.find(temp) != m.end()){ | ||
result[temp] = 1; | ||
} | ||
} | ||
|
||
cout << result.size() << endl; | ||
for(auto i : result){ | ||
cout << i.first << endl; | ||
} | ||
#include <bits/stdc++.h> | ||
#define endl '\n' | ||
using namespace std; | ||
|
||
map<string, int> m; | ||
map<string, int> result; | ||
int N, M; | ||
|
||
int main(){ | ||
ios::sync_with_stdio(0); | ||
cin.tie(0); | ||
cout.tie(0); | ||
cin >> N >> M; | ||
|
||
while(N--){ | ||
string temp; cin >> temp; | ||
m[temp] = 1; | ||
} | ||
|
||
while(M--){ | ||
string temp; cin >> temp; | ||
if(m.find(temp) != m.end()){ | ||
result[temp] = 1; | ||
} | ||
} | ||
|
||
cout << result.size() << endl; | ||
for(auto i : result){ | ||
cout << i.first << endl; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
#include <bits/stdc++.h> | ||
#define endl '\n' | ||
using namespace std; | ||
|
||
int C; | ||
vector<int> vec; | ||
map<int, int> result; | ||
int main(){ | ||
ios::sync_with_stdio(0); | ||
cin.tie(0); | ||
cout.tie(0); | ||
cin >> C; | ||
for(int i=0; i<C; ++i){ | ||
int temp; cin >> temp; | ||
vec.push_back(temp); | ||
} | ||
vector<int> copy(vec); | ||
|
||
sort(vec.begin(), vec.end()); | ||
|
||
result[vec[0]] = 0; | ||
int k = 1; | ||
for(int i=1; i<C; ++i){ | ||
if(vec[i] == vec[i-1]) continue; | ||
else{ | ||
result[vec[i]] = k++; | ||
} | ||
} | ||
|
||
for(auto i : copy){ | ||
cout << result[i] << " "; | ||
} | ||
cout << endl; | ||
#include <bits/stdc++.h> | ||
#define endl '\n' | ||
using namespace std; | ||
|
||
int C; | ||
vector<int> vec; | ||
map<int, int> result; | ||
int main(){ | ||
ios::sync_with_stdio(0); | ||
cin.tie(0); | ||
cout.tie(0); | ||
cin >> C; | ||
for(int i=0; i<C; ++i){ | ||
int temp; cin >> temp; | ||
vec.push_back(temp); | ||
} | ||
vector<int> copy(vec); | ||
|
||
sort(vec.begin(), vec.end()); | ||
|
||
result[vec[0]] = 0; | ||
int k = 1; | ||
for(int i=1; i<C; ++i){ | ||
if(vec[i] == vec[i-1]) continue; | ||
else{ | ||
result[vec[i]] = k++; | ||
} | ||
} | ||
|
||
for(auto i : copy){ | ||
cout << result[i] << " "; | ||
} | ||
cout << endl; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Preparing Coding Test |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.