Skip to content

Instantly share code, notes, and snippets.

View victoriagjh's full-sized avatar
💻

JooHee Gwon victoriagjh

💻
View GitHub Profile
@victoriagjh
victoriagjh / 3425_고스택
Created February 5, 2020 13:16
이런.....
#include <iostream>
#include <vector>
#include <stack>
#include <string>
#include <cmath>
using namespace std;
vector<pair<string, long long>> commands;
bool isPossible = true;
long long doit(long long x){
stack<long long> st;
@victoriagjh
victoriagjh / 1103_게임
Created February 4, 2020 14:15
DP로 내가 몇번만에 갔는지를 기록하는 배열이 있어야 한다. dfs를 int형으로 짜는 DP와 결합된 문제였다
#include <iostream>
#include <string>
using namespace std;
string map[51];
int n,m;
bool visited[51][51];
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
int dp[51][51]={};
int dfs(int x, int y){
@victoriagjh
victoriagjh / 1713_후보 추천하기
Created February 4, 2020 13:15
간단한 문제인데.. 오래걸렸다..
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, per;
int recommend[101];
vector<int> res;
int main() {
cin>>n>>per;
for(int i=0; i<per; i++) {
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<char> vec;
string arr[50];
int n,k;
bool character[26];
bool isTeached[26];
int maxi=0;
@victoriagjh
victoriagjh / 15686_치킨배달
Created January 29, 2020 12:28
깔끔하게 맞아버리쥬?
#include <iostream>
#include <queue>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int n,m;
vector<pair<int, int>> chicken, house;
long mins=9999999999;
void dfs(int x, vector<pair<int, int>> v){
@victoriagjh
victoriagjh / 2580_스도쿠
Created January 21, 2020 15:06
큰일났다.. 바보가 된거같아ㅠㅠㅠ
#include <iostream>
#include <vector>
using namespace std;
int map[10][10];
vector<pair<int,int>> vec;
bool check_v(int y,int num){
for(int i=0; i<9; i++) {
if(num==map[i][y])
return false;
}
@victoriagjh
victoriagjh / 9663_N-Queen
Created January 21, 2020 13:14
너무 오랜만에 풀어서 머리가 안돌아갔다..
#include <iostream>
using namespace std;
int n,map[16];
int res=0;
bool isPossible(int x){
for(int i=1; i<x; i++) {
if(map[x]==map[i] || abs(x-i) == abs(map[x]-map[i])) {
return false;
}
}
@victoriagjh
victoriagjh / 2583_영역 구하기
Created December 2, 2019 22:50
간단한 탐색문제
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
int m,n,k;
bool map[101][101];
queue<pair<int, int>> qu;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
@victoriagjh
victoriagjh / 1707_이분그래프
Created November 22, 2019 02:13
이제는 뭐.. 기본문제는 뭐...
#include <iostream>
#include <vector>
using namespace std;
int t,v,e;
vector<int> vec[20001];
char check[20001];
bool possible=true;
void dfs(int x,char t,int cnt){
if(check[x]!='\0') {
return;
@victoriagjh
victoriagjh / 1991_트리순회
Created November 22, 2019 00:44
트리를 실제로 짤까했지만,, 문제 인풋타입이 굳이 안해도 되는 문제였다.
#include <iostream>
#include <vector>
using namespace std;
int n;
vector<pair<char, char>> vec[26];
void preorder(int x){
cout<<char(x+65);
if(vec[x][0].first!='.') {
preorder(int(vec[x][0].first)-65);
}