This file contains hidden or 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
#include <algorithm> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
void solve() { | |
int n; | |
cin >> n; | |
vector<int> arr(n); | |
for (int i = 0; i < n; i++) cin >> arr[i]; |
This file contains hidden or 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
void solve() { | |
int n; | |
cin >> n; | |
vector<int> arr(n); | |
for (int i = 0; i < n; i++) cin >> arr[i]; | |
sort(arr.begin(), arr.end()); | |
for (int i = 0; i < n; i++) cout << arr[i] << endl; | |
} |
This file contains hidden or 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
N, M = map(int, input().split()) | |
A = set(map(int, input().split())) | |
B = set(map(int, input().split())) | |
C = set() | |
for a in A: | |
if a not in B: | |
C.add(a) |
This file contains hidden or 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
N, M = map(int, input().split()) | |
all_names = set() | |
name1 = set() | |
name2 = set() | |
for _ in range(N): | |
name = input() | |
name1.add(name) | |
all_names.add(name) |
This file contains hidden or 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
arr = [1, 5, 7, 7] | |
arr = list(set(arr)) | |
print(arr) # [1, 5, 7] |
This file contains hidden or 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
hash_set = set() | |
hash_map = {} |
This file contains hidden or 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
hash_set = set() | |
hash_map = {} |
This file contains hidden or 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
import java.util.*; | |
class Main { | |
public static void main(String[] args) { | |
TreeSet<Integer> treeSet = new TreeSet(); | |
TreeMap<Integer, Integer> treeMap = new TreeMap(); | |
HashSet<Integer> hashSet = new HashSet(); | |
HashMap<Integer, Integer> hashMap = new HashMap(); | |
} |
This file contains hidden or 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
#include <set> | |
#include <map> | |
#include <unordered_set> | |
#include <unordered_map> | |
void solve() { | |
// 트리를 이용한 셋 | |
std::set<int> tree_set; | |
// 트리를 이용한 맵 | |
std::map<int, int> tree_map; |
This file contains hidden or 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
#!/bin/bash | |
CUR_DIR=$(pwd | grep -o '[^/]*$') | |
if [[ $CUR_DIR != "icon" ]] | |
then | |
if [ -d icon ] | |
then | |
cd icon | |
else |