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
#include<iostream> | |
using namespace std; | |
int main() | |
{ | |
int n; //입력하는 데이터 갯수 | |
int ind = 0; //d 인덱스 | |
int arr[1000] = { 0 }; | |
int d[1000] = { 0 }; |
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
#include<iostream> | |
#include<vector> | |
#include<algorithm> | |
using namespace std; | |
//swap | |
void swap(int &a, int &b) | |
{ | |
int temp; |
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
#include<stdio.h> | |
#include<stdlib.h> | |
#include<string.h> | |
#pragma warning(disable:4996) | |
#define MAX 100 | |
//트리 노드 | |
typedef struct node | |
{ | |
char alphabet; //알파벳 |
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
#include<stdio.h> | |
#include<stdlib.h> | |
#include<string.h> | |
#pragma warning(disable:4996) | |
#define MAX 100 | |
#define alph_num 26 | |
//트리 노드 | |
typedef struct node | |
{ |
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
#include<iostream> | |
using namespace std; | |
int main() | |
{ | |
float ans, temp; | |
ans = 4.7777; | |
temp = ans; |
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
data class Member(val no:Long, val name: String) | |
fun main() { | |
val list = listOf(Member(1, "일"), Member(1, "이"), Member(3, "삼")) | |
val result = list.groupBy({it.no}, {it.name}) | |
println(result) // {1=[일, 이], 3=[삼]} | |
println(result[1]) // [일, 이] | |
println(result[2]) // null | |
} |
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
#include<iostream> | |
#include<map> | |
#include<functional> | |
using namespace std; | |
//print map element | |
void print(map<int, char> m) | |
{ | |
//empth function |
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
class Solution { | |
public: | |
/* | |
* 시간복잡도 : O(N) | |
*/ | |
// sliding window | |
int maxSatisfied(vector<int>& customers, vector<int>& grumpy, int X) { | |
int l = 0; |
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
#include <string> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
using namespace std; | |
bool compare(pair<int,int>& a, pair<int,int>& b){ | |
// 3. 장르 내에서 재생 횟수가 같은 노래 중에서는 고유 번호가 낮은 노래를 먼저 수록합니다. | |
if(a.first == b.first){ |
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
/** | |
* Definition for a binary tree node. | |
* struct TreeNode { | |
* int val; | |
* TreeNode *left; | |
* TreeNode *right; | |
* TreeNode(int x) : val(x), left(NULL), right(NULL) {} | |
* }; | |
*/ | |
class Solution { |
NewerOlder