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 <map> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
map<string, int> m; | |
map<string, int> midx; | |
vector<pair<int, int>> mv[100]; |
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 <string> | |
#include <vector> | |
#include <cstring> | |
using namespace std; | |
bool check1[10], check2[10]; | |
int solution(vector<vector<int>> baseball) { | |
int answer = 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 <queue> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
int solution(int stock, vector<int> dates, vector<int> supplies, int k) { | |
int answer = 0; | |
int idx = 0; | |
int rstock = stock; |
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 <cmath> | |
#include <string> | |
#include <vector> | |
#include <iostream> | |
using namespace std; | |
int tsize; | |
bool check[20000]; | |
vector<pair<int, int>> mat[20000]; |
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 <string> | |
#include <vector> | |
using namespace std; | |
vector<int> mat[51]; | |
bool visit[51]; | |
int wsize; | |
int idx; |
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 <string> | |
#include <vector> | |
using namespace std; | |
vector<int> mat[200]; | |
bool visit[200]; | |
void go(int idx) { | |
if (visit[idx]) { |
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 <string> | |
#include <vector> | |
using namespace std; | |
void go(int idx, int sum, const vector<int> &numbers, int &cnt, int target) { | |
if(idx == numbers.size()) { | |
if(sum == target) { | |
cnt += 1; | |
} |
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 <string> | |
#include <vector> | |
using namespace std; | |
int cnt[10001]; | |
int solution(vector<int> citations) { | |
int answer = 0; | |
int size = citations.size(); |
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 <string> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
bool cmp(const string& u, const string& v) { | |
if (u == v) return false; |
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 <queue> | |
#include <iostream> | |
#include <functional> | |
using namespace std; | |
int solution(vector<int> scoville, int K) { | |
int answer = 0; | |
priority_queue<int, vector<int>, greater<int>> pq; | |
for (int i = 0; i < scoville.size(); i++) { |