Skip to content

Instantly share code, notes, and snippets.

@heejoonshin
heejoonshin / DAG.kt
Created June 11, 2023 07:20
DAG 판별
fun isCycle(indegree: Array<Int>, G : MutableList<MutableList<Int> >) :Boolean {
val queue = ArrayDeque<Int>()
var cnt = 0
for(idx in 0..indegree.size-1){
if(indegree[idx] === 0){
queue.add(idx);
cnt++;
}
#include <iostream>
#include <algorithm>
using namespace std;
const int MAXN = 200010;
const long long MOD = 998244353;
long long tree[MAXN];
int N,M;
char A[MAXN],B[MAXN];
#include <iostream>
#include <queue>
#include <memory.h>
using namespace std;
int N;
int arr[21][21];
int currx,curry;
int dist[21][21];
int dx[4] = {1,-1,0,0}, dy[4] = {0,0,1,-1};
int w,adder,my,mx;
@heejoonshin
heejoonshin / boj2579.cpp
Last active October 25, 2018 14:03
boj2579
#include <iostream>
#include <memory.h>
#include <algorithm>
using namespace std;
const int MAXN = 301;
int a[MAXN];
int DT[MAXN][3];
int n;
int memo(int curr,int step){
#include <iostream>
#include <vector>
using namespace std;
const int MAXN = 1000001;
const long long mod = 1000000007;
long long Tree[MAXN * 4];
int N;
long long update(int left,int right,int node,int idx,int value){
if(right < idx || idx < left)return Tree[node];
#include <iostream>
#include <queue>
#include <vector>
#include <memory.h>
using namespace std;
const int MAXN = 101;
vector<int> G[MAXN];
int n;
int teamcolor[MAXN];
int team[2][101];
#include <iostream>
#include <vector>
#include <queue>
#include <cstdio>
#include <memory.h>
using namespace std;
const int MAXN = 10001;
vector<pair<int,int> >G[MAXN];
int mcheck[MAXN],scheck[MAXN];
int dist[MAXN];
@heejoonshin
heejoonshin / boj13911.go
Created October 25, 2018 07:18
GO언어로 작성한 코드
package main
import (
"bufio"
"container/heap"
"fmt"
"os"
"strconv"
"strings"
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" -)
add_custom_target(qtum COMMAND make -C ${qtum_SOURCE_DIR} CLION_EXE_DIR=${PROJECT_BINARY_DIR}) -j4
$ ./autogen.sh
$./configure