uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a2c2b4e2-fe15-457b-bce4-5fec09955ca4 | raydzast/labworks | DM_labwork2.2/taskF.cpp | #include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
unordered_set<int> terminals1, terminals2;
vector<unordered_map<char, int>> graph1, graph2;
vector<bool> used1, used2;
bool isomorphic(int p1, int p2) {
if (used1[p1] && used2[p2]) return true;
if (us... | ALGO | 0.999963 | 4.96208 |
a3d44753-a5f0-4d05-80f3-8ab4eadd5331 | ChinmayMittal/COL761-Data-Mining | A1/fptree.cpp | #include <algorithm>
#include <cstdint>
#include <utility>
#include <set>
#include <iostream>
#include <fstream>
#include <sstream>
#include "fptree.h"
void printProgressBar(int progress, int total, int barWidth = 50) {
float percentage = static_cast<float>(progress) / total;
int barProgress = static_cast<int... | ALGO | 0.998346 | 4.824795 |
14d9e4c5-a0be-4766-8f56-8ae54a8f3031 | n1uf/USTC-CS-COURSES | 计算机程序设计A/作业及习题/1.6.1.cpp | #include<stdio.h>
int main()
{
int max(int x,int y,int z);
int a,b,c,d;
scanf("%d,%d,%d",&a,&b,&c);
d=max(a,b,c);
printf("max=%d\n",d);
return 0;
}
int max(int x,int y,int z)
{
int p;
if(x>y)
{
if(x>z)
p=x;
else
p=z;
}
else
{
if(y>z)
p=y;
else
p=z;
}
return(p);
}
| ALGO | 0.999852 | 3.734475 |
de9da4ad-c7a7-4707-bc37-bb0c43d8fa28 | Amisha328/SDE_Sheet_Challenge | LinkedList-II/Palindrome_LL.cpp | // Palindrome Linked List
#include <bits/stdc++.h>
/****************************************************************
Following is the class structure of the LinkedListNode class:
template <typename T>
class LinkedListNode
{
public:
T data;
LinkedListNode<T> *next;
LinkedL... | ALGO | 0.999925 | 5.799152 |
dbac6258-58be-428a-a386-a54974024c05 | Kanita-Haider/CP-Codes | bipartite_bfs.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define mp make_pair
#define pb push_back
#define mset(a, b) memset(a, b, sizeof(a))
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL)
using namespace std;
const int lim=1e5+5;
vector<int>adj[lim];
int vis[lim];
bool flag=true;
voi... | ALGO | 0.999981 | 4.170213 |
79a5042f-9a9b-4b24-be39-69d20e6419d9 | Ahmad-hunter/tick_tick | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998841 | 6.783336 |
04aa7f28-adb0-4407-8c4c-4d7e96c47f98 | LearnerMN/Algorithm-Problems | Leetcode/Path Sum.cpp | /**
* 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 {
public:
bool hasPathSum(TreeNode* root, int sum) {
if (root != NULL && sum - root->val == 0 && ... | ALGO | 0.999936 | 6.206277 |
93cc132e-345e-4c2b-bcc8-884720b23128 | L-Spiro/L.-Spiro-Engine-2022 | Modules/LSPhysicsLib/Src/Box2D/Collision/b2DynamicTree.cpp | #include <Box2D/Collision/b2DynamicTree.h>
#include <string.h>
b2DynamicTree::b2DynamicTree()
{
m_root = b2_nullNode;
m_nodeCapacity = 16;
m_nodeCount = 0;
m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode));
memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode));
// Build a linked list for th... | ALGO | 0.998001 | 7.786732 |
5b89430b-580a-4821-aaa5-ea03132afca1 | TanviChhabra13/Leetcode | 2299-merge-nodes-in-between-zeros/2299-merge-nodes-in-between-zeros.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeNodes(... | ALGO | 0.999949 | 5.388825 |
2cdd88bf-9a47-441c-9886-a4c5fb8ec9a8 | RohitJV/spoj-solutions | CARNIVAL.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.99992 | 3.926965 |
2ad8a5c8-d4d6-4e5d-84e5-0b9dbda81681 | NEM-NE/AlgorithmStudy | JungBin/배달.cpp | //첫 번째 시도 보자 마자 kruskal's algorithm 으로 mst를 찾아야 겠다는 생각이듦
//그런데 kruskal's algo를 쓰면 mst 만 얻고 distance 는 또 다시 1 노드부터 탐색해야함-> 비효율적
// 그래서 prim's algorithm을 구현함
#include <iostream>
#include <vector>
#include<queue>
#include<utility>
#include<cstring>
#include<limits>
#include<utility>
#include<unordered_map>
using namespac... | ALGO | 0.999915 | 4.993927 |
a361b1bb-8462-4c0e-a69b-a9adb9495233 | maruf55/C-Cpp | CPPbubble_short_usingGeneric_function.cpp | #include<iostream>
#include<cmath>
using namespace std;
template<class X> void bubble(X *item,int count){
register int a,b;
X t;
for(a=0;a<count;a++){
for(b=count-1;b>=1;b--){
if(item[b-1]>item[b]){
t=item[b-1];
item[b-1]=item[b];
item[b]=t... | ALGO | 0.998323 | 3.704531 |
fae5ec34-aeb1-48cc-b75d-6c948cfed595 | npnkhoi/Competitive-programming | LQDTraining/170710/hfamous.cpp | using namespace std;
#include <stdio.h>
#include <set>
#include <vector>
const int N = 1e5 + 10;
typedef pair<int, int> ii;
int n, m, k;
vector<int> adj[N];
int adjN[N];
set<ii> data;
set<ii> edge;
int main () {
freopen("hfamous.inp", "r", stdin);
freopen("hfamous.out", "w", stdout);
scanf("%d %d %d", &n ,... | ALGO | 0.999985 | 3.747855 |
083102e9-af85-440a-a1b9-c68376316e47 | JonathanYuan23/DMOJ-Solutions | Solutions/gfssoc16s4.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize "Ofast"
#define frein freopen("input.txt", "r", stdin)
#define freout freopen("output.txt", "w", stdout)
#define ll long long
#define ull unsigned long long
#define MOD 1000000007
// #define fi first
// #define se second
#define INF 0x3f3f3f3f
#define ... | ALGO | 0.999858 | 4.095896 |
ac674d6c-0338-4d02-a18a-e779c039134a | SudhanshuPurohit/C---Program-by-CN | fabonacci_check.cpp | #include<iostream>
using namespace std;
bool check_fabo(int n)
{
int a=1 , b=1;
int c=1;
if (n==0||n==1){
return true;
}
for(int i=4; ; i++){
if(n < c){
return false;
}
else if(n>c){
c = a+b;
a = b;
b = c;
}
... | ALGO | 0.999974 | 3.912064 |
1cd7b1ad-9387-478d-91b4-f740c8bb2e66 | prathamjamwal/DAA2022_Pratham_Jamwal_2017352 | daapractical/Week 7/2.cpp | #include <bits/stdc++.h>
using namespace std;
void calulate(vector<int> &pa, int i)
{
cout << i + 1 << " ";
if (pa[i] >= 0)
calulate(pa, pa[i]);
}
void find_path(int **graph, int m, int sour)
{
vector<int> dis(m, INT_MAX), pa(m, -1);
dis[sour] = 0;
for (int ki = 0; ki < m - 1; ki++)
... | ALGO | 0.999949 | 3.636191 |
79b2e91f-3e13-4109-809f-3c7e2804b82e | trinhhe/CMM_projects | a4-trinhhe/ext/eigen/bench/dense_solvers.cpp | #include <iostream>
#include "BenchTimer.h"
#include <Eigen/Dense>
#include <map>
#include <vector>
#include <string>
#include <sstream>
using namespace Eigen;
std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
std::vector<std::string> labels;
std::vector<Array2i> sizes;
template<typename Solver,type... | TOOL | 0.998687 | 6.328718 |
2ee0b94a-e9ee-4999-b023-5c4a3a0d5212 | Yili-code/LeetCode-CPP-Optimal-Solutions | easy/0459-Repeated-Substring-Pattern/solution.cpp | class Solution {
public:
bool repeatedSubstringPattern(string s) {
string doubled = s + s;
string trimmed = doubled.substr(1, doubled.size() - 2);
return trimmed.find(s) != string::npos;
}
};
class Solution {
public:
bool repeatedSubstringPattern(string s) {
string trimmed = s.substr(1, s.size() ... | ALGO | 0.999658 | 6.464069 |
34af23ca-7ca3-4f26-af7f-ff910f667975 | a-farooq/ProblemsAndSolutions | DataStructuresAndAlgorithms/arrays/all-left-smaller-all-right-bigger.cpp | /****
Given an unsorted array of size N. Find the first element in array such that all of its left elements are smaller and all right elements to it are greater than it.
Note: Left and right side elements can be equal to required element. And extreme elements cannot be required element.
Input:
The first line of input... | ALGO | 0.999918 | 5.201532 |
1bbb9a98-547e-499f-ac13-17d7e07ea16a | lozim/old_opcv | 新建文件夹/test6/test6/test6.cpp | // test6.cpp : ̨Ӧóڵ㡣
//
// test9.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include <opencv2/opencv.hpp>
#include <iostream>
#include <list>
#include <vector>
using namespace cv;
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
Mat input = imread("f:\\a38.tif");
Mat origin = input.clone();//findcontours֮ͼı䣬or... | ALGO | 0.958882 | 3.299241 |
7346cbde-1c4b-438c-94bd-4cd652c4e982 | IllCher/oop_exercise_08 | quadrate.cpp | #include "quadrate.h"
quadrate::quadrate(): _a{0, 0}, _c{0, 0}{}
quadrate::quadrate(const point& a, const point& c) : _a{a}, _c{c}{}
quadrate::quadrate(std::istream &is) {
is >> _a >> _c;
};
double quadrate::square() const {
return ((_c.x - _a.x) * (_c.x - _a.x) + (_c.y - _a.y) * (_c.y - _a.y))/2;
}
point quadr... | ALGO | 0.997194 | 4.218774 |
a7188fe4-127f-4d29-a847-7517a2789905 | DevSWYoon/InitStudy | DevSWYoon/CS/Implementation/BAEKJOON_23289.cpp | //Memory Usage : 2696KB, Time Rquired : 40ms
#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
using namespace std;
int R, C, K;
const int Dir[4][2] = {{0,1},{0,-1},{-1,0},{1,0}};
struct Point {
int row;
int col;
bool chkRange(void) {
return row >= 0 && row < R && col >... | ALGO | 0.999937 | 4.427014 |
3357f643-0f24-4098-bd1a-51d665a7c29a | joan12222/algorithme | iai/iai-2-最长平台.cpp | #include<bits/stdc++.h>
using namespace std;
int n,a[500005],bucket[1000005]={0};
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
for(int i=1;i<=n;i++){
bucket[a[i]]++;
}
int maxn=0;
for(int i=1;i<=1000000;i++){
maxn=max(maxn,bucket[i]);
}
int ans=0;
for(int i=1;i<=1000000;i++){
if(bucket[i]==... | ALGO | 0.999902 | 3.964237 |
3107c286-5d67-4957-8519-7f1384d05206 | postive12/Algorithm | Backjun/Greedy/16120.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
string input;
cin >> input;
int p_count = 0;
bool is_front_a = false;
for (int i = 0; i < input.size(); i++) {
char current_char = input.at(i);
if (current_char == 'P') {
if (p_count >= 2 && is_front_a... | ALGO | 0.999823 | 4.122308 |
3e3da2ef-f638-4628-9691-58d4731429fd | balajimohan80/Graphs | Graphs/find-shortest-path-src-dest-mat-satisfies-given-constraints.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<bitset>
#include<tuple>
/*
Find shortest path from source to destination in a matrix that satisfies given constraints
https://www.techiedelight.com/find-shortest-path-source-destination-matrix-satisfies-given-constraints/
We can move to location:
1. M[i + M[... | ALGO | 0.999937 | 5.261029 |
43eb46ec-c7cd-44a7-982a-2b7d715f4734 | harsh-sharma-sde/DSA | Arrays/Hard/reversePairs.cpp | // Given an integer array nums, return the number of reverse pairs in the array.
// A reverse pair is a pair (i, j) where:
// 0 <= i < j < nums.length and
// nums[i] > 2 * nums[j].
// Example 1:
// Input: nums = [1,3,2,3,1]
// Output: 2
// Explanation: The reverse pairs are:
// (1, 4) --> nums[1] = 3, nums[4] = 1, ... | ALGO | 0.999995 | 6.053523 |
a5527f5d-23fc-4980-96a9-437f52f53b45 | Sudhir919/My_Sheet | 02_Arrays/03_Matrix question/04_Find the row with maximum no of 1's.cpp |
// ******************** BRUTE FORCE APPROACH ********************************
/*
****** APPROACH ***
->> in this approach is to do a row-wise linear search and count the number of 1s in each row , and
track the row-index with a max 1 count.
1. rowOneCount is used to track the count of 1's in each row.
2. ... | ALGO | 0.999985 | 6.344501 |
f8e33d67-40bb-4ac2-8f52-08892a40f120 | C0ldSmi1e/CompetitiveProgramming | Contests/CodeChefSTART113B/MaximumScore.cpp | /**
* Author: C0ldSmi1e
* Created Time: 2023-12-20 06:35:36
**/
// time-limit: 1000
// problem-url: https://www.codechef.com/START113B/problems/MAXSCORE7
#include <bits/stdc++.h>
using namespace std;
#ifdef DANIEL_DEBUG_TEMPLATE
#include "../debug.h"
#else
#define debug(...) 42
#endif
int main() {
cin.tie(nullp... | ALGO | 0.999916 | 5.449523 |
1ce0a159-9b3e-41d6-bd31-4c65d87279ef | fpdjsns/Algorithm | algospot/ITES.cpp | /**
* problem : https://algospot.com/judge/problem/read/ITES
* data structure : queue
* time complexity : O(N)
*/
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <iostream>
using namespace std;
int solve(int K, int N) {
long long int outsideSignal = 1983;
long long int TMP = ... | ALGO | 0.998973 | 4.358443 |
d54cf8ec-b61f-4f6b-82c9-63b19b59ae99 | pppppppppppp-North/TOI-Zero | A2-001.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 501;
int a[N] , b[N];
int ans = 1;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int n,m; cin >> n >> m;
for (int i=1;i<=n;i++) cin >> a[i];
for (int i=1;i<=m;i++) cin >> b[i];
for (int i=1;i<=n;i++) {
... | ALGO | 0.999969 | 3.02207 |
69d4a064-8e4d-430b-aac9-f2c306334503 | Yash-Solanki6803/Leetcode-Cpp | splitArrayLargestSum.cpp | #include <bits/stdc++.h>
using namespace std;
int splitArray(int arr[], int N, int K)
{
int start = 0, end = 0, mid = -1, ans = -1;
for (int i = 0; i < N; i++)
{
start = max(start, arr[i]);
end += arr[i];
}
while (start <= end)
{
mid = start + (end - start) / 2;
... | ALGO | 0.999972 | 5.081679 |
53276102-671f-4c5f-a653-3af6742007f5 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7103_0.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int t;
string str = "", ss = "", s1 = "";
char ch;
set<long long> st, stt;
unordered_map<char, long long> mp, mpp;
long long d, ct = 0, q = 0, l, n = 0, k = 0, m = 0, i, x = 0,... | ALGO | 0.999768 | 4.112971 |
0dc0b5b4-6302-4b8c-b2e8-ea2b77b701e2 | koreakk/Algorithm-Example | Graph/Shortest Path/Dijkstra.cpp | #include <algorithm>
#include <vector>
#include <queue>
using namespace std;
using NODE = pair<int, int>; // weight, adjacent vertex
using GRAPH = vector<vector<NODE>>; // adjacency list
using PQ = priority_queue<NODE, vector<NODE>, greater<NODE>>;
vector<int> Dijkstra(const GRAPH& graph, int source) {
... | ALGO | 0.999972 | 5.426383 |
43cbdc17-725c-42c1-95b1-98c2d225a3c7 | Lophophora24/Quench_2.0 | thirdparty/eigen-3.4.0/unsupported/doc/examples/MatrixSquareRoot.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(2,2);
A << cos(pi/3), -sin(pi/3),
sin(pi/3), cos(pi/3);
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix square root of A is:... | ALGO | 0.99932 | 3.930508 |
11077531-b2d6-4354-8b22-45084cf0bc25 | swarna-j/Thesis | FHE/FFT/1D_FFT/v1_WithoutStream/fft_tb.cpp | #include "fft.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
complex_t result[N], test_in[2*N];
int i;
// Init inputs
for (i=0; i < N; i++) {
test_in[i].re = (double) i;
test_in[i].im = 0.0;
}
for (i=N; i < 2*N; i++) {
test_in[i].re = 0.0;
tes... | ALGO | 0.9964 | 4.276831 |
a50c8312-6d41-4642-adfb-68eb87cc4fba | jongas124/TAP_UFG | Treino_2/c.cpp | #include <bits/stdc++.h>
using namespace std;
int distance(int bl, int bc, int wl, int wc, int power);
int main () {
ios::sync_with_stdio(false);
cin.tie(NULL);
int r, c, bombs[3][441], walls[2][441], n_bombs = 0, n_walls = 0;
char m[21][21];
scanf("%d %d", &r, &c);
for (int i = 0; i < r; i++... | ALGO | 0.999557 | 3.631479 |
e3d00fee-a6ff-4a42-bc70-bde70db28d22 | Ngufuli/cpp | Templates/templates_example.cpp | /* WAP to create a generic class which will take input of an integer array, float array and calculate the
sum of all.The number of elements is 5
*/
using namespace std;
#include<iostream>
template <class T>
class sum
{
T a[5] ;
public:
void get()
{
cout<<"Enter five values\n";
for(int i=0;i<=4;i++)
cin... | ALGO | 0.952211 | 4.63856 |
ac5df429-fb6d-46ee-8e72-f06ae2adb01c | 58Tinkal/Leetcode | 1352-maximum-profit-in-job-scheduling/maximum-profit-in-job-scheduling.cpp | class Solution {
public:
vector<int> dp;
int solve(int idx, vector<int>& startTime, vector<vector<int>>& job) {
if (idx == startTime.size()) {
return 0;
}
if (dp[idx] != -1) return dp[idx];
int notTake = solve(idx + 1, startTime, job);
int i = lower_bound(s... | ALGO | 0.999988 | 6.083346 |
d51aeecb-1ad5-417b-9981-eaa20f626495 | Deepak619261/DATA-STRUCTURES-ALGORITHMS | 0040-combination-sum-ii/0040-combination-sum-ii.cpp | class Solution {
void solve(int index, vector<vector<int>>&ans,vector<int>temp,vector<int>&nums,int target){
if(target==0){
ans.push_back(temp);
return;
}
for(int i=index;i<nums.size();i++){
if(i>index && nums[i]==nums[i-1])continue;
// don't... | ALGO | 0.999993 | 6.021934 |
60c532a2-d3a6-4d20-b5ad-540c53e9ce90 | ChienNguyenDac/DSA | heap/main.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Max heap
*/
class Heap{
private:
int* data;
int size;
int capacity;
public:
Heap(): data(NULL), size(0), capacity(0) {}
~Heap(){}
void copyFromArray(int* arr, int n) {
this->size = n;
thi... | ALGO | 0.999694 | 4.354525 |
9447430f-0913-4178-b128-5450671b488d | VishalGit911/Othere_UI | 100-DaysOf-Futter-main/online_learning/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998825 | 6.76073 |
5085cd99-aa95-4f8b-bf6c-5ceb1c7a14ed | ishandutta2007/codeforces | linkct/normal/571/C.cpp | #include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
const int MAXN = 200005;
typedef pair <int, int> pii;
#define fi first
#define se second
int f[MAXN], n, m, d[MAXN], value[MAXN];
bool freed[MAXN];
vector <int> clause[MAXN];
vector <pii> pos[MAXN];
queue <int> q;
inline int ... | ALGO | 0.999988 | 3.699415 |
8e291444-05e9-4576-800e-aefbd00c5675 | animesh156/DSA-Important-Problems | New 21 Game.cpp | class Solution {
public:
double new21Game(int n, int k, int maxPts) {
if (k == 0 || n >= k + maxPts) return 1.0;
vector<double> dp(n + maxPts + 1, 0.0);
for (int score = k; score <= n; score++) {
dp[score] = 1.0;
}
double windowSum = 0.0;
for (int score... | ALGO | 0.999855 | 4.598844 |
1d91708e-1258-4d86-ad23-a8b497af1ac6 | ishandutta2007/codeforces | a_g/normal/1644/F.cpp | #include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const int N = 2e5+7;
int fact[N];
int invfact[N];
int dp[N];
int expmod(long long a, long long b, int m) {
int ans = 1;
a %= m;
while (b) {
if (b&1) ans = 1LL*ans*a % m;
b >>= 1;
a = 1LL*a*a % m;
}
return ans;
}
int calc(i... | ALGO | 0.999991 | 4.801179 |
3776a2cf-9db5-4eb0-ae7a-4d5752fefede | u5ele55/bayesian_optimisation_application | main.cpp | #include <iostream>
#include <cmath>
#include <Eigen/Core>
#include <LBFGS.h>
#include "backward_solution/BayesianOptimizer.h"
#include "functions/PendulumMSE.h"
#include "functions/SimpleFunction.h"
#include "functions/Simple2DFunction.h"
#include "backward_solution/kernel/SquaredExponentialKernel.h"
#include "backw... | ALGO | 0.999948 | 5.820272 |
130cf28d-315b-48a1-9f9b-735ca84972a0 | xie-xyh/cpp_learning_pratice | 第五章/程序清单/5.3/express.cpp | #include <iostream>
int main()
{
using namespace std;
int x;
cout << "the expression 'x = 100' has the value ";
cout << (x = 100) << endl;
cout << "the expression 'x < 3' has the value ";
cout << (x < 3) << endl;
cout << "the expression 'x > 3' has the value ";
cout << (x > 3) << endl... | TOOL | 0.929427 | 3.335596 |
cb2df437-9950-4d9e-a33b-dd5430dc7a90 | UsmanZafar47/Shortest-Path-Algorithem_toFindHamiltonianCircuit | Source.cpp |
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <climits> // For INT_MAX
using namespace std;
//--------------functions to find hamiltion circuit-----------------
bool is_valid(int** graph, int num_vertices, int* path, int indx, int path_weight, int min_weight) {
// Ch... | ALGO | 0.999532 | 3.358476 |
e608cc1c-7776-4a33-9143-8c263ee2a982 | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J00711/explore/explore.cpp | #include<bits/stdc++.h>
using namespace std;
int vi[1010][1010],dx[7]={0,1,0,-1},dy[7]={1,0,-1,0}, n,m,k;
char a[1010][1010];
int ss(int x){
if(x==3)return 0;
else return x+1;
}
void dfs(int sx,int sy,int d,int s,int c){
vi[sx][sy]=1;
if(s>=k){
cout<<c<<endl;
return;
}
int x=sx+dx[d],y=sy+dy[d];
if(x>n||x<1|... | ALGO | 0.999661 | 4.25835 |
5abc5811-468e-4143-931c-9b2bda8f1181 | makisto/Vychmat | VM/Лаб. 7/Первая Формула Ньютона.cpp | #include <iostream>
#include <math.h>
#include <graphics.h>
using namespace std;
double f(double x)
{
return (sqrt(x));
}
double factorial(int x)
{
double sum = 1;
for(int i = 1; i <= x; i++)
{
sum *= i;
}
return sum;
}
double Newton(int n, double * x, double ** y, double xi, double h)
{
double q = (xi - ... | ALGO | 0.999753 | 3.38086 |
87d1ace6-463f-48f1-af9b-0a6ebeefcdb1 | ArsalAbbas/CodingProblems | 287-find-the-duplicate-number/287-find-the-duplicate-number.cpp | class Solution {
public:
int findDuplicate(vector<int>& nums) {
int slow = nums[0] ;
int fast = nums[0] ;
do{
slow = nums[slow];
fast = nums[nums[fast]] ;
}while(slow!=fast) ;
fast = nums[0] ;
while(slow!=fast){
slow = nums[slow] ;
fast = nums[fast] ;
}
return slow ;
}
}; | ALGO | 0.99997 | 6.159823 |
42dc5738-19eb-48cb-9b3f-a3bd81b54b03 | hezhaojiang/leetcode-cpp | 155.最小栈.cpp | /*
* @lc app=leetcode.cn id=155 lang=cpp
*
* [155] 最小栈
*/
#include<vector>
#include<algorithm>
#include<stack>
using namespace std;
// @lc code=start
class MinStack {
private:
int minValue;
std::stack<int> minStack;
public:
/** initialize your data structure here. */
MinStack() {
}
vo... | ALGO | 0.999833 | 6.96005 |
a46adbda-ff12-4112-bd65-0c2f88a5702e | llvm/clangir | clang/utils/TableGen/ClangSyntaxEmitter.cpp | #include <deque>
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
using namespace llvm;
namespace {
// The class hierarchy of Node types.
// We assemble this in order to be a... | TOOL | 0.850567 | 7.923561 |
ccb23cf8-ab01-4213-9d3b-704e3358a370 | JonathanYin/Leetcode | WholeMinuteDilemma.cpp | #include <vector>
#include <algorithm>
using namespace std;
long playlist(vector<int> songs) {
long count = 0;
vector<int> vec(60);
// stores remainders
for (int i = 0; i < songs.size(); i++){
// loop through each song length
int rem = songs[i] % 60;
if (rem == 0){
... | ALGO | 0.998291 | 4.138681 |
702b95ea-beba-46c1-bbb5-30fa99da9a9a | hjiang13/LLMs-in-IR | processed_data/decompilation_result/GPT40_mini/AnimalTransport.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
struct _IO_FILE;
extern "C" _IO_FILE* freopen(const char*, const char*, _IO_FILE*);
extern "C" int __isoc99_scanf(const char*, ...);
extern "C" int printf(const char*, ...);
extern "C" void* operator new(size_t);
extern "C" void operator delete... | ALGO | 0.999035 | 5.693653 |
f274a42b-fa24-44bb-b34c-8aab48fa4f97 | smtth2018/SMTH | rest.cpp | #include "chain.h"
#include "chainparams.h"
#include "primitives/block.h"
#include "primitives/transaction.h"
#include "main.h"
#include "httpserver.h"
#include "rpcserver.h"
#include "streams.h"
#include "sync.h"
#include "txmempool.h"
#include "utilstrencodings.h"
#include "version.h"
#include <boost/algorithm/strin... | WEB | 0.909287 | 3.508275 |
a92b0cae-2b0c-4638-bcc3-4d4c2a2cd517 | szlifierks/leetcodez | isPowerOfThree.cpp | class Solution {
public:
bool isPowerOfThree(int n) {
if(n <= 0) return false;
return n % 2 == 1;
}
};
| ALGO | 0.999392 | 6.109404 |
3e1998a0-b186-42aa-900a-63ebd827ec64 | Rijul1204/Algorithm_ACM | Source_Code/String Matching/1334 Genes In DNA.cpp | #include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
#define maxm 51010
#define ii int
int pi[maxm],pre[5][maxm];
ii num[4][maxm],dp1[maxm],dp2[maxm];
char s[maxm],s2[maxm],s3[maxm],sinv[maxm];
void cal1(char s[],char p[]);
void process(char s[],int fl);
ii cal(char s[],char p[]);
int main(... | ALGO | 0.999799 | 3.569996 |
5c8e631b-00f2-407a-8293-1c68deecb085 | pragmadox/data_structures | finalmaze/main.cpp | /* Jay Price
Homework 5
Data Structures
October 21, 2016
*/
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include "finalmaze.h"
#include "stack6.h"
int main()
{
//Create an object 'maze1' of type Maze;
Maze maze1;
//... | ALGO | 0.924879 | 4.356165 |
b6044205-381e-4392-afff-f7a41da14932 | willianpireslima/exercicios-cplusplus | 07_Classes/QUESTAO 11 Turma.cpp | #include <iostream>
#include <math.h>
using namespace std;
class Aluno {
private:
string Matricula ,Nome;
int Presenca;
double A1,A2,A3,A4;
public:
void setMatricula (string aux);
void setNome (string aux);
void setPresenca (int aux);
void setA1 (double aux);
void setA2 (doub... | TOOL | 0.866605 | 3.461354 |
4886d83a-9a45-490f-bc51-4463c9fbdce9 | ishandutta2007/codeforces | noimi/normal/547/C.cpp | #pragma region Macros
#pragma GCC optimize("O3")
#pragma GCC target("avx2,avx")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define rep3(i, a, b) for(ll i = a; i >= ... | ALGO | 0.999813 | 4.020365 |
d7f657f8-32d8-4407-9f37-cc95dea6e6de | se9fault/LeetCode-400 | 02-String/266_Palindrome_Permutation.cpp | /*
Given a string, determine if a permutation of the string could form a
palindrome.
Example 1: Input: "code" Output: false
Example 2: Input: "aab" Output: true
Example 3: Input: "carerac" Output: true
Hint:
Consider the palindromes of odd vs even length. What difference do you notice?
Count ... | ALGO | 0.999613 | 6.631093 |
27f973d4-ede4-4bb1-b398-6eee4756ffa4 | MAKIYAMA-ma/AtCoder | EducationalDP/T.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#if 1
using mint = modint1000000007;
#else
using mint = modint998244353;
#endif
using ll = long long;
using ull = unsigned long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = v... | ALGO | 0.999981 | 3.791103 |
687bb7d1-e080-4045-a75e-4f1ef434200f | huaiqi220/Apex-Yolov5-TensorRT-ai-aimcore | tensorrtx/lprnet/LPRnet.cpp | #include <iostream>
#include <chrono>
#include <map>
#include <opencv2/opencv.hpp>
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#include <fstream>
#include <map>
#include <sstream>
#define CHECK(status) \
do\
{\
auto ret = (status);\
if (ret != 0)\
{\
... | DATA | 0.873485 | 3.489794 |
95f7c4ad-d267-4502-854b-3e2893323e37 | Rxgxyv/Problem-solving | Code/21celebrtyprb.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution
{
public:
//Function to find if there is a celebrity in the party or not.
int celebrity(vector<vector<int> >& M, int n)
{
int c... | ALGO | 0.9997 | 6.040504 |
9ae556b8-b159-4a15-beb4-b5fdf7a0b2db | williamwill1860/opencv_test | opencv/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp | /**
* @function cornerSubPix_Demo.cpp
* @brief Demo code for refining corner locations
* @author OpenCV team
*/
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
/// Global variables
Mat src, src_gray;
int maxCorners = 10;
int maxTrackbar ... | ALGO | 0.999468 | 7.00325 |
2923e15c-046c-4bce-8bca-f1f8e5549e94 | sunkaiiii/study_computer_science | Algorithm_Exercises/algorithm/dp/LCS.cpp | #include<vector>
#include<string>
#include<iostream>
#include"LCS.h"
void LCS(const std::string s1, const std::string s2) {
static const int UPPER_LEFT = 0;
static const int UP = 1;
static const int LEFT = 2;
const int m = s1.length();
const int n = s2.length();
std::vector<std::vector<int>> c(m);
for (int i = 0... | ALGO | 0.999995 | 3.933361 |
3a49fddc-b4ef-4937-bfbd-6472cdcaf363 | youzichaa/Skyline | extern/eigen/unsupported/doc/examples/BVH_Example.cpp | #include <Eigen/StdVector>
#include <unsupported/Eigen/BVH>
#include <iostream>
using namespace Eigen;
typedef AlignedBox<double, 2> Box2d;
namespace Eigen {
Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point
}
struct PointPointMinimizer //how to compute squa... | ALGO | 0.999896 | 6.502348 |
8bafbced-6dc0-4291-9fef-50e9d1dfd986 | Wells-yuan/mds | libsnark/depends/libsnark/depends/libff/libff/algebra/curves/edwards/edwards_init.cpp | /** @file
*****************************************************************************
* @author This file is part of libff, developed by SCIPR Lab
* and contributors (see AUTHORS).
* @copyright MIT license (see LICENSE file)
***********************************************************************... | ALGO | 0.942565 | 5.462518 |
f1d80631-df39-4206-8dd2-9e2848f1ccd1 | algostudy0720/Problem_Solving_Jail | Programmers/lev2/전화번호_목록/전화번호_목록_PHJ.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
//greedy
bool solution(vector<string> phone_book) {
sort(phone_book.begin(), phone_book.end());
//for(auto i : phone_book)cout<<i<<endl;
for(int i = 0 ; i<phone_book.size()-1 ; i++)
{
string str =... | ALGO | 0.999708 | 5.036612 |
75723655-3c2f-450b-adea-dc1d600124b1 | Afifhasan2003/all_code | C++/not bigineer/bit manipulation/set_bit.cpp | #include<iostream>
using namespace std;
int main() {
int n=10; //n=10 =0 1 0 1 0
int m= n | 1<<2 ;
cout << m <<endl; //n=14= 0 1 1 1 0 added 1 on 2nd position(actually 3rd position)
int a= n | 1<<3; //this wont change,, coz there is already a 1 on 3rd position, so no point of adding ... | ALGO | 0.998693 | 3.132291 |
3a8947b0-f01f-4f0f-be4e-e3f1284b60bf | vatsaashwin/Parallel-Programming-Projects | project7/openMP/openmpsingle.cpp | #include <stdio.h>
#include <fstream>
#include <iostream>
#include <omp.h>
#define SIZE 32768
float Array[2*SIZE];
float Sums[1*SIZE];
int main(int argc, char const *argv[])
{
omp_set_num_threads(0);
FILE *fp = fopen( "signal.txt", "r" );
if( fp == NULL )
{
fprintf( st... | ALGO | 0.995607 | 3.375989 |
a985ec08-d776-4ec1-a901-c8dd4fa72598 | Ash-KODES/Leetcode-Solutions | 547-number-of-provinces/547-number-of-provinces.cpp | class Solution {
public:
void DFS(vector<vector<int>>& isConnected,vector<int>& vis,int row)
{
vis[row]=1;
for(int i=0;i<isConnected[row].size();i++)
{
if(i==row)
continue;
if(vis[i]==0&&isConnected[row][i]==1)
DFS(isConnected,vis,i);
... | ALGO | 0.999983 | 6.151877 |
c826ee91-2db7-4c86-bc9e-68bdfeaa41b1 | houpingze/hpzfile | 1108.cpp | #include<iostream>
#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize(... | ALGO | 0.998673 | 3.344649 |
e7543967-28ca-4950-a979-1803bdcec07e | RashidSidreck/Projects | Lab_Exercise_5_6.exe.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
string Reverse(const string&input){
string reversed = input;
reverse(reversed.begin(), reversed.end());
return reversed;
}
bool isVowel(char ch) {
ch = tolower(ch);
return (ch ==... | TOOL | 0.975417 | 4.148828 |
9a441a87-249d-41ec-9cbc-69e90a478155 | nashiong/cantera | cantera/branches/2.1/src/numerics/BEulerInt.cpp | /**
* @file BEulerInt.cpp
*/
#include "cantera/numerics/BEulerInt.h"
using namespace std;
namespace Cantera
{
BEulerErr::BEulerErr(const std::string& msg) :
CanteraError("BEulerInt", msg)
{
}
BEulerInt::BEulerInt() :
m_iter(Newton_Iter),
m_method(BEulerVarStep),
m_jacFormMethod(BEULER_JAC_NUM),
... | TOOL | 0.938459 | 6.657312 |
492e0fd2-8f15-4e8a-86cc-9218e9c616e5 | Avinash-706/DSA-Practice | LinkedList/Operations/Creation/DoublyLinkedList/creation.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <iomanip>
#include <algorithm>
#include <string>
#include <string.h>
#include <limits>
using namespace std;
struct Node{
int data;
Node *prev;
Node *next;
Node(int x){
data = x;
prev = NULL;
next = NULL;
}
};
int main() ... | ALGO | 0.992399 | 3.293408 |
43ca2a6b-e474-40ca-b8af-d04de93e453a | khaled3ttia/ipdps21-poster | testCoo.cpp | #include <math.h>
#include <iostream>
#include <random>
#include <vector>
#include <string.h>
#include "khaledUtil.h"
#include <chrono>
int main(){
// datastructures for COO
int * nnzRowIdx;
int * nnzColIdx;
float * nnzVal;
int n,m, nnz;
std::string filename = "fb.mtx";
// Load the... | DATA | 0.985222 | 3.889101 |
4c23f69f-0abf-44c4-ba85-6be8657586a8 | Nishant4574/Food_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998757 | 6.771107 |
d3f4856c-cfa2-48ae-a7c5-00ccc46557a9 | Wild-Donkey/Code | Tests/2021/2021.12/ICPC2021/B.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
inline unsigned RD() {
unsigned RTmp(0);
char Rch(getchar());
while (Rch < '0' || Rch > '9') Rch = getchar();
while (Rch >= '0' && Rch <= '9') RTmp = (RTmp << 3) + (RTmp << 1) + Rch - '0', Rch = getchar();
return RTmp;
}
const unsigned... | ALGO | 0.999925 | 3.806097 |
c83b917d-87bb-4707-91c8-fe01c8e2071b | yahaa/Cpp | codevs/1077.cpp | /*************************************************************************
> File Name: 1077.cpp
> Author: yahaa
> Mail: <EMAIL>
> Created Time: 2016年08月18日 星期四 12时37分51秒
************************************************************************/
#include <iostream>
#include <cstdio>
#include <vector>
#include <ma... | ALGO | 0.999797 | 3.633136 |
0378e92c-1c71-4071-b65e-1715e36b035c | shaikh-alhelal/Contest_File | অ্যালগরিদম/DP/BITMASK DP/z.Prime.cpp | using namespace std;
#include<bits/stdc++.h>
typedef long long ll;
typedef pair<ll,ll> pii;
typedef vector< pii > vpii;
typedef vector<long long> vi;
typedef map<string,ll> msi;
typedef map<ll,ll> mii;
///Print
#define pf(a) printf("%lld",a)
#define pff(a,b) printf("%lld %lld",a,b)
#define pfff(a,b,c)... | ALGO | 0.999892 | 3.5228 |
a6423c90-7c84-4d38-8055-84d1ffe12687 | codercly/estrutura_dados_trabalho | torneio_nitro_cadu/feijao.cpp | #include <iostream>
using namespace std;
int main()
{
int vetor[4], i;
for (i = 0; i < 4; i++)
{
cin >> vetor[i];
}
for(i = 0; i < 4; i++){
if(vetor[i] == 1)
cout << i + 1 << endl;
}
return 0;
} | ALGO | 0.998464 | 3.260085 |
1d4475d6-e0d2-4d2f-af41-10abd9f3e663 | LeNguyenAnhKhoa/DataStructures_Algorithms | CTDL/LAZY_SEGMENTREE.cpp | struct Lazy_Seg{
int st[4*N], lz[4*N];
void build(int id = 1, int l = 1, int r = n){
if(l == r){
st[id] = a[l];
return;
}
int mid = l + r >> 1;
build(id<<1, l, mid);
build(id<<1|1, mid+1, r);
st[id] = st[id<<1] + st[id<<1|1];
}
void... | ALGO | 0.999961 | 4.030053 |
2a5ceb99-db43-4537-a3af-f84dfa537b99 | weizhouUMICH/SAIGE | thirdParty/bgen/3rd_party/boost_1_55_0/libs/multi_index/example/rearrange.cpp | #if !defined(NDEBUG)
#define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING
#define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
#endif
#include <boost/config.hpp>
#include <boost/detail/iterator.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/random_access_index.hpp>
#include <boost/random/binomial_dis... | TEST | 0.986918 | 6.92056 |
e5d22f5b-012d-4201-bf7c-0ad1113a3ff5 | yash-93/Coding-Practice | Codeforces/Round661/A.cpp | #include <bits/stdc++.h>
using namespace std;
void test(){
int n; cin >> n;
vector<int> a(n);
for(int i=0;i<n;i++)
cin >> a[i];
sort(a.begin(), a.end());
for(int i=0;i<n-1;i++){
if(a[i+1]-a[i]>1){
cout << "NO\n";
return;
}
}
cout << "YES\n";... | ALGO | 0.999702 | 4.357758 |
1c1a7845-9e14-415c-bc51-42f1603e67b9 | ishandutta2007/codeforces | heart_blue/normal/120/D.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999964 | 3.561126 |
5ec96427-5454-4353-a0fa-ad922bca24c7 | da1234cao/programming-language-entry-record | autotools/参考代码/flaim-ch8-10/flaim/util/sharutil.cpp | #include "sharutil.h"
FSTATIC RCODE propertyExists(
const char * pszProperty,
const char * pszBuffer,
char ** ppszValue);
/********************************************************************
Desc: Parses command-line parameters
*********************************************************************/
void flmUt... | TOOL | 0.96137 | 5.802047 |
7d64b928-4292-4f43-9974-227955d53788 | Sumit1608/CodingNinjas-C-Data-Strutures-and-Algorithms-Solutions | Lecture 12-Binary Trees/13 Construct tree from inorder and postorder.cpp | #include <iostream>
using namespace std;
#include <queue>
template <typename T>
class BinaryTreeNode {
public :
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this -> data = data;
left = NULL;
right = NULL;
}
};
BinaryTreeNode<int... | ALGO | 0.99999 | 5.060694 |
7f90ea70-6ad9-4425-b6f9-421a8eb717ce | hyeonybraincloud/DSA | 프로그래머스/2/42578. 의상/의상.cpp | #include <string>
#include <vector>
#include <unordered_map>
#include <iostream>
using namespace std;
int solution(vector<vector<string>> clothes) {
int answer = 1;
unordered_map<string, int> hash_map;
for (const auto& item : clothes)
hash_map[item[1]]++;
for (const auto& pair : hash... | ALGO | 0.998502 | 5.493965 |
f700c724-b5ed-4a8b-b34f-812d7a935960 | shivani26-bot/DSA-questions | 1684-count-the-number-of-consistent-strings/1684-count-the-number-of-consistent-strings.cpp | class Solution {
public:
bool check(string word , int mask){
int maskWord=0;
for(char c:word){
maskWord|= 1<<(c-'a');
}
return (maskWord & ~mask) ==0;
}
int countConsistentStrings(string allowed, vector<string>& words) {
// set<char>st(allowed.begin(),allowed.end());
//... | ALGO | 0.999967 | 5.794239 |
9bf50652-c3f4-49aa-9839-8152424ab800 | SilverPlate3/Data-Structures-Implementation-C-CPP | Union Find (Path Compress)/Union Find.cpp | #include "Union Find.h"
#include <iostream>
void UnionFind::Union(int elementA, int elementB)
{
auto rootA = Find(elementA);
auto rootB = Find(elementB);
if (rootA == rootB)
{
std::cout << "Both elements are already in the same group" << std::endl;
return;
}
auto smaller = std::min(rootA, rootB);
auto big... | ALGO | 0.982937 | 4.551316 |
e1b5705e-e399-4359-b572-00aef725a62e | DayAlgorithm/park_je_young | 4_FRI/6087.cpp | #include<iostream>
#include<deque>
#include<vector>
#include<cstring>
#include<algorithm>
#include<tuple>
using namespace std;
int main(){
vector<pair<int, int>>se;
int h, w;
cin >> w >> h;
vector<string>v(h);
for(auto& iter : v){
cin >> iter;
}
for(int i = 0; i < h; i++)
for(int j = 0; j < w; j++)
... | ALGO | 0.999847 | 3.940149 |
fcab142b-b0b6-4202-a37d-266f2b05cf13 | huashu996/Ubuntu20.04LSD_SLAM | lsd_slam_core/src/GlobalMapping/KeyFrameGraph.cpp | #include "GlobalMapping/KeyFrameGraph.h"
#include "DataStructures/Frame.h"
#include <g2o/core/sparse_optimizer.h>
#include <g2o/solvers/pcg/linear_solver_pcg.h>
#include <g2o/solvers/csparse/linear_solver_csparse.h>
#include <g2o/core/block_solver.h>
#include <g2o/core/solver.h>
#include <g2o/core/optimization_algorit... | ALGO | 0.986173 | 4.149149 |
a4939c55-cfaf-494d-a8ac-1870577483a5 | sidjha57/Coding-Data-Transfer | Competitive/A_Array_Balancing.cpp | //Siddharth Jha
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
//typedef trie<... | ALGO | 0.999959 | 3.834824 |
16196da6-f668-4efd-abd5-6efe8587732c | AskatAsh/Cpp-programming | Binary Search/last_occurance.cpp | #include<iostream>
using namespace std;
int last_occurance(int arr[], int n, int value)
{
if(arr[n-1] == value) return n-1;
int left = 0, right = n-1, mid, index = -1;
while(left<=right)
{
mid = left+(right-left)/2;
if(arr[mid] == value){
index = mid;
left = mi... | ALGO | 0.999651 | 5.784988 |
3876c9a8-fc44-4e2f-afdd-12afaaf10099 | DimitarM45/UPPractice10 | Task_06/Task_06.cpp | #include <iostream>
constexpr unsigned short MAX_STR_LENGTH = 100;
int main()
{
char str[MAX_STR_LENGTH];
std::cin.getline(str, MAX_STR_LENGTH);
unsigned short vowelCounter = 0;
for (int i = 0; str[i] != '\0'; i++)
{
switch (str[i])
{
case 'u':
case 'a':
case 'e':
case 'i':
case 'o':
vo... | ALGO | 0.997205 | 6.642361 |
35173293-3e76-45a4-9181-326ead280f20 | Himanshu12211967/GeeksForGeeks | Difficulty: Medium/Largest number in K swaps/largest-number-in-k-swaps.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void solve(string str,string &ans,int k,int index){
if(k == 0 || index == str.length()) return;
for(int i=index+1; i<str.length(); i++){
... | ALGO | 0.999912 | 6.096185 |
ed4f77ab-fe7a-4480-a713-8c1614a03121 | abhiranjankumar00/Random_Contests | FlipKart/2012/A.cpp | //Name : Shinchan Nohara
//Age : 5 years
//Organisation : Kasukabe Defense Force
#include <iostream>
#include <ctime>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include... | ALGO | 0.99989 | 3.279138 |
51670251-eca5-4ef1-8ade-6a52c40a4891 | ThinkMuk/BaekJoon-solution | 백준풀이용/13549_PQ.cpp | //#include <iostream>
//#include <queue>
//using namespace std;
//
//// 1697
//// BFS ʺẔ̌ ִ ġ ִ Ž
//// ̵ ð 1 0 ٲ , 켱 ť Ǯ̸ ߰,
//// if ̵ Ǯ ְ Ǯ̿ ̵ ̵ Ŵ
////
//// 켱 ť ؾ .. (c++ )
//
//const int MAX = 100001;
//int check[MAX] = { 0 };
//
//int BFS(int startNum, int endNum)
//{
// priority_queue... | ALGO | 0.999941 | 4.15621 |
64db16be-3db1-4b0e-8396-70ab02a63598 | ktr03rtk/study-algorithm | atcoder.jp/abc051/abc051_c/Main.cpp | #include <bits/stdc++.h>
#define rep(i, j, n) for (int i = j; i < (int)(n); i++)
using namespace std;
using ll = long long;
int main() {
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
string ans = "";
rep(i, 0, ty - sy) { ans += "U"; }
rep(i, 0, tx - sx) { ans += "R"; }
rep(i, 0, ty - sy) { ans += "D... | ALGO | 0.999876 | 3.420321 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.