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 <bits/stdc++.h> | |
using namespace std; | |
int n; | |
int mat[100][100]; | |
pair<int, int> arr[100][100]; | |
int main(){ | |
int TestCase; | |
scanf("%d", &TestCase); | |
for(int tc=1;tc<=TestCase;tc++){ | |
scanf("%d", &n); |
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 <bits/stdc++.h> | |
using namespace std; | |
vector<vector<int> > adj; | |
int n, m; | |
int trip[201]; | |
//모순이 발생하는 경우 true를 리턴함 | |
bool dfs(int now, int type){ | |
trip[now]=type; | |
bool ret=false; | |
for(int i=0;i<adj[now].size();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
def gcd(a, b): | |
if b==0: | |
return a | |
else: | |
return gcd(b, a%b) | |
a=int(input()) | |
b=int(input()) | |
g=gcd(a, b) | |
print(g) |
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 <bits/stdc++.h> | |
using namespace std; | |
int n, k; | |
vector<int> arr; | |
bool trip[3000]; | |
int main() { | |
scanf("%d%d", &k, &n); | |
for (int i = 0; i < n; i++) { | |
int in; | |
scanf("%d", &in); |
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 <bits/stdc++.h> | |
using namespace std; | |
int n, m; | |
vector<int> adj[1000001]; | |
bool trip[1000001]; | |
typedef long long ll; | |
ll solve(int x){ | |
trip[x]=true; | |
ll ret=0; | |
ll cnt=0; |
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 <bits/stdc++.h> | |
using namespace std; | |
int n; | |
int arr[100000]; | |
int temp[100000]; | |
typedef long long ll; | |
ll solve(int le, int ri){ | |
if(le==ri) | |
return temp[le]; | |
int mid=(le+ri)/2; |
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 <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
ll b, q, l, m; | |
ll arr[100000]; | |
set<ll> s; | |
set<ll> use; | |
int main(){ | |
scanf("%lld%lld%lld%lld", &b, &q, &l, &m); | |
for(int i=0;i<m;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
#include <bits/stdc++.h> | |
using namespace std; | |
int n, k; | |
int arr[100000]; | |
int main(){ | |
scanf("%d%d", &n, &k); | |
for(int i=0;i<n;i++) | |
scanf("%d", &arr[i]); | |
int ans=0; | |
for(int i=0;i<n;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
#include <bits/stdc++.h> | |
using namespace std; | |
int n; | |
int mat[20][20]; | |
// idx = 현재 깊이 | |
int solve(int idx){ | |
// 깊이가 5인 경우 | |
if(idx==5){ | |
int ret=0; | |
// 블록중에 최대 블록을 찾음 |
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 <bits/stdc++.h> | |
using namespace std; | |
class Dinic{ | |
public: | |
const int inf = 0x3f3f3f3f; | |
struct Edge{ | |
int v, capacity, flow; | |
Edge *rev; | |
Edge(int v, int capacity):v(v), capacity(capacity), flow(0), rev(0){} |