uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
311bd1dc-0555-464e-a815-689c8a004786 | omtrivediw/Leetcode_Questions | MaximumNumberofWordsYouCanType.cpp | class Solution {
public:
int canBeTypedWords(string text, string brokenLetters) {
unordered_map<int,int>umap;
for(auto i : brokenLetters){
if(umap.find(i) == umap.end()){
umap[i] = 1;
}
else{
umap[i]++;
}
}
... | ALGO | 0.999196 | 5.355605 |
05b9a6b7-c414-4be0-839f-22f280efa5e9 | J-A-Cgyt/3SRC_XJ | 3SRC_XJ/Before.cpp | #include "Func.h"
Mat Gaosi_Mohu(Mat Src, int Ksize)
{
Mat temp1 = Src.clone();
Size Ks = Size(Ksize, Ksize);
GaussianBlur(temp1, temp1, Ks, 0, 0);
return temp1;
}
Mat Gaosi_˫(Mat Src) //˹˫˲ֱԵ˲ 2019/11/14
{
int d = 0;
double Sigma_Color = 100;
double Sigma_Space = 15;
Mat Dst;
bilateralFilter(Src, Dst, d, ... | TOOL | 0.986275 | 4.412394 |
0255bff1-9585-4354-beda-e96b4a0ef16c | AbhijeetAnand45/DSA_Basics | Programs/Recursion/Sum_N_no.cpp | #include<bits/stdc++.h>
using namespace std;
int sum(int n){
if(n == 0){
return 1;
}
return n + sum(n-1);
}
int main() {
int n;
cin>>n;
cout<<sum(n);
} | ALGO | 0.999939 | 4.660947 |
cdf9a919-573b-42e7-995d-0cc7f1d37e20 | nikhiljain-413/Data_Structures_Problems_solution | dp code c++/tree2.cpp | #include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define ll long long int
struct node{
int data;
node* left;
node* right;
node(int data){
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
class tree{
public:
int indx;
tree(){
... | ALGO | 0.999798 | 4.16068 |
eb43c229-4892-4a12-b9ec-6015f7b566e9 | simon0x0/codebook | Computational Geometry/Half_Plain_Interection.cpp | //半平面為st到ed的逆時針方向
// for point or line solution, change > to >=
bool onleft(Line L, Pt p) {
return dcmp(L.v^(p-L.s)) > 0;
} // segment should add Counterclockwise
// assume that Lines intersect
vector<Pt> HPI(vector<Line>& L) {
sort(L.begin(), L.end()); // sort by angle
int n = L.size(), fir, las;
Pt *p = new Pt... | ALGO | 0.99996 | 4.435681 |
e419e1f0-dcb8-4293-82b1-c3227b3fddad | Jayashsatolia403/CP | CF/Practice Problems/A_Beautiful_Matrix.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long l... | ALGO | 0.999955 | 3.129738 |
f1944143-98cd-40a0-9955-e5b3690a05bd | silverwest8/Baekjoon | step7/10798.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(int argc, char* argv[]) {
string S;
char temp;
vector<vector<char>> words(15, vector<char> (15, 0));
for (int i = 0; i < 5; i++) {
cin >> S;
for (int j = 0; j < S.size(); j++) {
words[i][j... | ALGO | 0.999596 | 3.194443 |
0ee2200a-29f5-4a10-a09d-61d1084fd55e | ShiWenyan04/LeetCode | Cpp/3479.cpp | #include <cmath>
//
// Created by 20538 on 2025/8/7.
//
using namespace std;
#include <iostream>
#include <algorithm>
#include <vector>
#include <unordered_map>
class Solution {
public:
int numOfUnplacedFruits(vector<int>& fruits, vector<int>& baskets) {
int n = fruits.size();
int m = sqrt((n));//分块的大小
i... | ALGO | 0.999957 | 5.577849 |
5af2a7b8-aac7-4a1a-9d8c-afd9f97d0c5c | Kartik2301/Recurrence | algorithms/strivers_sheet/113_Symmetric_Binary_Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.99999 | 7.141151 |
93d791bb-b3fa-4513-a37b-f23f51261314 | 2teez/Learner | c++-projects/ch02/exec1.cpp | #include <iostream>
#include <cstddef>
#include <vector>
int &get(int *array, int index) { return array[index];}
void recu_vec_pt(std::vector<int>, std::vector<int>::size_type);
int main(int argc, char** argv)
{
int ia[10];
for (std::size_t i = 0; i < 10; ++i)
{
get(ia, i) = i;
}
for(std:... | ALGO | 0.951991 | 5.190859 |
a091173f-23d7-4e37-b4f8-9ca0113b1938 | luqmanarifin/cp | Codeforces/605A.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, a[N], p[N];
int main() {
scanf("%d", &n);
for(int i = 0; i < n; i++) {
scanf("%d", a + i);
p[a[i]] = i;
}
int last = -1, best = 0;
int cur = 0;
for(int i = 1; i <= n; i++) {
if(p[i] > last) {
last = p[i];
... | ALGO | 0.99986 | 4.23363 |
77960bc2-97f7-4d96-8b84-ca16b6e4e694 | AllegriM/utn_c-_practice | estructura-decision/ej15.cpp | // 15. Hacer un programa para ingresar por teclado las cuatro notas de los exámenes obtenidas por un alumno y luego emitir uno solo de los cartel de acuerdo a las siguientes condiciones:
// - “Promociona”, si obtuvo en los cuatro exámenes nota 7 o más.
// - “Rinde examen final”, si obtuvo nota 4 o más en por lo menos... | ALGO | 0.990528 | 4.542406 |
9f83dd9b-e783-4be3-914c-606f470cbaec | algebra84/leetcode | src/greedy/sellStock2.cpp | /*Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times). However, you may not engage in multiple transactions at the same time... | ALGO | 0.997606 | 5.624967 |
b653c734-6406-4885-bdab-12a3d9ce03fc | snwagh/securenn-public | util/Miracl/zzn4.cpp | /*
* MIRACL C++ Implementation file zzn4.cpp
*
* AUTHOR : M. Scott
*
* PURPOSE : Implementation of class ZZn4 (Arithmetic over n^4)
*
* WARNING: This class has been cobbled together for a specific use with
* the MIRACL library. It is not complete, and may not work in other
* applications
*
* ... | ALGO | 0.994357 | 5.219211 |
a0349a31-069f-43f1-9031-1d25a2d74fa0 | turneja123/competitive-programming-library | Problem/Data Structures/Dolan and Nephews.cpp | //https://www.spoj.com/problems/CARDFLIP/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl "\n"
#define ll long long
#define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr);
const int N = 1e5 + 5;
mt19937 generator(chrono::steady_... | ALGO | 0.999964 | 4.674262 |
c071afae-7500-47d2-a3f1-482268acbd9f | interactivevislab/TrianglePlugin-UE5 | TrianglePlugin/Source/libigl-static/include/igl/harmonic.cpp | template <
typename DerivedV,
typename DerivedF,
typename Derivedb,
typename Derivedbc,
typename DerivedW>
IGL_INLINE bool igl::harmonic(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<Derivedb> & b,
const Eigen::MatrixBase<Derivedbc> & bc,
cons... | ALGO | 0.998595 | 5.806787 |
58fe7fc7-c758-4662-aa67-2a387d491661 | Niraj-1729/Hacktoberfest-2023 | DSA/Algorithm/RECURSION/indirectRecursion.cpp | #include<iostream>
using namespace std;
void funcB(int);
void funcA(int n){
if (n>0)
{
cout<<n<<" ";
funcB(n-1);
}
}
void funcB(int n){
if (n>1)
{
cout<<n<<" ";
funcA(n/2);
}
}
int main(){
funcA(20);
return 0;
} | ALGO | 0.999942 | 3.975744 |
2d741d59-4a6b-42ec-be8f-2d66f62edf6e | MuditaShakya/Leetcode | 0701-insert-into-a-binary-search-tree/0701-insert-into-a-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 6.157728 |
84392538-8a31-4e67-be74-34825efbdb3c | ddiniz-m/CPP_Modules | cpp02/ex03/src/main.cpp |
#include "../inc/Point.hpp"
bool bsp( Point const a, Point const b, Point const c, Point const point);
bool checkTriangle(Point const a, Point const b, Point const c);
int main(void)
{
Point a(2.5f, 3.5f);
Point b(1.2f, 2.2f);
Point c(5.4f, 3.0f);
if (checkTriangle(a, b, c))
{
std::cout << "Not a Valid Trian... | ALGO | 0.988275 | 5.107576 |
a1a420bf-b19a-48a3-b78b-b2808298e98c | Pratik772846/leetcode | 0046-permutations/0046-permutations.cpp | class Solution {
public:
// vector<vector<int>> ans;
void solve(vector<int>&nums,vector<int>&freq,vector<int>&res,vector<vector<int>> &ans){
int num = nums.size();
if(res.size()==nums.size()){
ans.push_back(res);
for(auto it:res){
cout<<it<<" ";
... | ALGO | 0.999999 | 5.956621 |
1fa21c61-38ae-442d-ba5b-99b2e0fb02b3 | k-kavya-28/DSA | 110.reverseString.cpp | #include<iostream>
using namespace std;
void reverse(char name[], int n){
int s=0;
int e=n-1;
while(s<e){
swap(name[s++],name[e--]);
}
}
int main()
{
char name[20]="khushi";
reverse(name,6);
cout<<name<<endl;
return 0;
} | ALGO | 0.997768 | 3.612714 |
a3b3942a-a142-49a0-bae0-22a75d2042e5 | Bomboclatdag/informatyka | 1.2.5/switch.cpp | #include <iostream>
using namespace std;
int main(){
char zmienna;
float pierwszaliczba;
float drugaliczba;
cout << "Podaj pierwsza liczbe: ";
cin >> pierwszaliczba;
cout << "Podaj druga liczbe: ";
cin >> drugaliczba;
cout << "Co zrobic?";
cin >> zmienna;
switch( zmienna )
{
case '-':
cout << pierwszaliczba << ... | TOOL | 0.967353 | 3.19071 |
e228b2cf-2a5a-4be7-9d22-1fc17affd967 | ChenYangyao/project-leetcode-solution | cpp/problem605.cpp | #include <mystd.h>
using namespace MYSTD;
using namespace std;
/**
* solution by first determining how many empty plots are
* there between each two filled plots, and then calculate
* how many plants can be inserted between two filled plots.
*
* Author: Yangyao, 2019/02/19
*/
class Solution {
public:
bool ... | ALGO | 0.999992 | 6.622632 |
e0e1fd72-041c-43b5-a443-efe8e83c8590 | SunSimiao2024/Hello | zh-hant/codes/cpp/chapter_dynamic_programming/climbing_stairs_dfs.cpp | /**
* File: climbing_stairs_dfs.cpp
* Created Time: 2023-06-30
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 搜尋 */
int dfs(int i) {
// 已知 dp[1] 和 dp[2] ,返回之
if (i == 1 || i == 2)
return i;
// dp[i] = dp[i-1] + dp[i-2]
int count = dfs(i - 1) + dfs(i - 2);
return count... | ALGO | 0.999976 | 5.838987 |
b79e340c-c719-495f-8fcd-8fa14383480d | oldlick/CompetitiveProgramming | atcoder/5 other/2019_1123 DISCO presents ディスカバリーチャンネル コードコンテスト2020 予選/C2.cpp | /*ver 7*/
#include <bits/stdc++.h>
using namespace std;
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vd = vector<ld>;
using vs = vector<string>;
using vb = vector<bool>;
using vvl = vector<vector<ll>>;
... | ALGO | 0.999993 | 3.160872 |
f974fa7b-1f7d-4dec-ac39-9ea50d84716a | sakhiasyam18/pokok-vscode | soal uts/soal7.cpp | #include <iostream>
using namespace std;
int sumArray(int arr[], int size){
if (size == 0) return 0;
return arr[size - 1] + sumArray(arr, size - 1);
}
float calculateAverage(int arr[], int size) {
if (size == 0) return 0;
return (float) + sumArray(arr, size ) / size;
}
int main() {
int grades[4] = ... | ALGO | 0.999627 | 5.325506 |
bcfec453-daa7-47fd-90f7-949878d7aca2 | nishantbhakar/code | a8.cpp | #include <bits/stdc++.h>
using namespace std;
int fifo(const vector<int>& req, int head, int seekTime) {
int total = 0, curr = head;
cout << "\nFIFO Order:\nHead at: " << curr;
for (int r : req) {
cout << " -> " << r;
total += abs(r - curr);
curr = r;
}
int totalTime = total... | ALGO | 0.999842 | 5.447507 |
e6c18e9e-9e3e-4ae0-ac38-179e23f64d43 | gabrielcassolbach/programming_training | cses-problem-set/Edit Distance.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MAX 5123
typedef long long ll;
const ll INF = 1e14 + 10;
string a, b;
ll dp[MAX][MAX];
ll solve(string a, string b){
for(int i = 1; i <= a.size(); i++) {
for(int j = 1; j <= b.size();... | ALGO | 0.999949 | 4.243239 |
466bbb58-0bba-4465-b956-fd5dc6b0b9ea | 8e7/ioicamp2023-advDP | SampleProblem_refcodes/TOI2022-2-Roller.cpp | //Challenge: Accepted
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define maxn 505
#define mod 1000000007
#define pii pair<int, int>
#define ff first
#define ss second
vector<int> adj[maxn];
int p[maxn];
ll c[maxn][maxn], fac[maxn], finv[maxn];
vector<ll> f[maxn], g[maxn];
ll modpow(ll a, ll x) {... | ALGO | 0.999955 | 4.240792 |
cf06f6cc-f747-45e9-a087-4773320a7411 | adhello007/vs-c-- | STL/Vectors/ArrayOfVectors.cpp | #include <iostream>
#include <cstdlib>
#include <vector>
using namespace std;
void printVector(vector<int> &v)
{
for(int i=0;i<v.size();i++)
{
cout << v[i] << " ";
}
cout << endl;
}
int main()
{
int N;
cin >>N;
vector<int> v[N];
/*here, the above line means that there is an... | ALGO | 0.994855 | 4.692318 |
cd697537-f4ed-4621-ba36-1b0a7ebe3916 | AnselCmy/LeetCode | 031. Next Permutation/test.cpp | //
// Created by Chen on 2018/2/7.
//
#include "../Catch2/single_include/catch.hpp"
#include "solution.h"
TEST_CASE("Next Permutation", "[nextPermutation]")
{
Solution s;
vector<int> v1{1, 2, 3};
vector<int> v2{1, 3, 2};
s.nextPermutation(v1);
REQUIRE(v1 == v2);
vector<int> v3{1, 4, 3, 2};
... | TEST | 0.99553 | 5.871105 |
f8b5ab7b-ad99-4c52-9430-7b91f69d12ff | Juliana127/CFBCursoss | curso_c++/aula012/aula012-brincando_com_o_código.cpp | #include <iostream>
using namespace std;
int main() {
int n1, n2, nota;
string res; //o retorno deve ser string (palavras)
cout << "Digite a primeira nota: ";
cin >> n1;
cout << "Digite a segunda nota: ";
cin >> n2;
nota = n1+n2;
res = (nota >= 60) ? "aprovado" : "Reprovado"; //no mais simplesmente impr... | TOOL | 0.960188 | 4.211299 |
eb980ba7-28ba-4b87-8a7c-28fcc85bb0f9 | YoganshWagh/Leetcode | 215-kth-largest-element-in-an-array/SOL2.cpp | //REFERENCE VIDEO: https://www.youtube.com/watch?v=g5mmW0GOTx8
//IN O(N) TIME COMPLEXITY:
class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
//Question Based on Heap Sort:
//Solving using Priority Queue and making a Heap:
priority_queue<int> pq( nums.begin(), n... | ALGO | 0.999955 | 5.39122 |
bfb7c36d-2dc3-4f81-8a7b-36d6eea64e84 | OlaAbdallahM/Competitive-Programming | CodeForces/C_Category/812C/20756487_AC_124ms_1568kB.cpp | #define _CRT_SECURE_NO_WARNINGS
// Allah_Almost3aan *{فَصَبْرٌ جَمِيلٌ وَاللَّهُ الْمُسْتَعَانُ }*
// *{ربى.. كنْ لىِ خيرَ مدبر فإنى لا احسنُ التدبير}*
#include<bits/stdc++.h>
using namespace std;
using lli = long long int;
#define endl "\n"
#define mod 100000007 //1e9+7
#define I... | ALGO | 0.99989 | 3.648634 |
b0987c4e-89c5-400e-877c-0924ef74b5e0 | ruturajch/neetcode-main | cpp/0217-contains-duplicate.cpp | /*
Given int array, return true if any value appears at least twice
Ex. nums = [1,2,3,1] -> true, nums = [1,2,3,4] -> false
If the number has been seen previously, then it has a duplicate. Otherwise, insert it into the hash set.
Time: O(n)
Space: O(n)
*/
class Solution {
public:
bool contains... | ALGO | 0.99953 | 6.660573 |
d0e07922-a586-4dae-a1ea-74e941a72f34 | PolulyakhSofiya/Practice-2017 | CPA Programming Essentials C++/Chapter4/Lab 4.2/lab 4.2.2.cpp | #include <iostream>
#include <math.h>
using namespace std;
bool is_close(double a, double b, double tolerance) {
double result;
if (a < b)
result = b - a;
else
result = a - b;
if (result <= tolerance)
return true;
else
return false;
}
int main(void) {
if (0.3 == 3 * 0.1) {
cout << "The... | ALGO | 0.995873 | 4.202915 |
83172c2b-7a4e-4961-97bd-9be4ed259533 | 2sevenabhi/DSA-Questions | Stickler Thief - GFG/stickler-thief.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
// } Driver Code Ends
class Solution
{
public:
//Function to find the maximum money the thief can get.
int FindMaxSum(int arr[], int n)
{
int curr=arr[0];
int prev=0;
for(int ind=1;ind... | ALGO | 0.999263 | 6.25837 |
7bd0a549-9c77-4638-978a-a03e79d5ceed | itish-agarwal/CP-submissions | CodeChef/C++17/MAXPRIZE/42716603.cpp | #ifndef ONLINE_JUDGE
#include "pch.h"
#else
#include <bits/stdc++.h>
#endif
using namespace std;
#define int long long
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int nxt = 1;
vector<int> ans;
set<int> t;
int s = 0;
while(1) {
ans.emplace_back(nxt);
s += nx... | ALGO | 0.999983 | 4.114843 |
3a1fc828-0b07-44e7-b83f-4161fdd2fa04 | seraph27/competitve-programming | codeforces/1486/d.cpp | // Problem: D. Max Median
// Contest: Codeforces Round 703 (Div. 2)
// URL: https://codeforces.com/contest/1486/problem/D
// Time Limit: 2000
// Start: Fri May 30 23:21:56 2025
// mintemplate
#ifdef MISAKA
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#define int long long
#define sz(x) (int)x.size()
#define a... | ALGO | 0.999998 | 5.00487 |
99f2b767-22f9-4586-b625-34e2abb36b74 | TRECN/hackerRank-problems | repeateddnaSequences.cpp | class Solution {
public:
vector<string> findRepeatedDnaSequences(string s) {
int k=10;
int l=s.size();
int i=0;
int j=0;
string t="";
vector<string>result;
unordered_map<string,int>m;
while(j<l){
t=t+s[j];
if(j-i+1<k){
... | ALGO | 0.999671 | 5.341731 |
dc806d2b-80c0-45aa-a8ac-2f47c2349add | Arya0201/Cpp-with-Dsa | LinkedList/circulersinglyLL.cpp |
#include<iostream>
#include<map>
using namespace std;
class Node {
public:
int data;
Node* next;
//constrcutor
Node(int d) {
this->data = d;
this->next = NULL;
}
~Node() {
int value = this->data;
if(this->next != NULL) {
delete next;
... | ALGO | 0.99979 | 5.144036 |
d224ef1e-81b6-4721-af8c-ad3ec4cadf28 | swapnilhota/interviewBit | DP/Best Time to Buy and Sell Stocks I.cpp | /*
Problem Description
Say you have an array, A, for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (i.e, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
Return the maximum possible profit.
*/
int ... | ALGO | 0.999577 | 6.045377 |
5b3ae5bd-023d-4c9a-837e-7e1198379616 | rayhanulmukul/Structural-Programming-Language | @Contest && Codeforce/1626A.cpp | #include <bits/stdc++.h>
#include<vector>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define ft front()
#define bk back()
#define pi 2*acos(0.0) /// acos(-1) , 3.14159265359
const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll BIG =... | ALGO | 0.999858 | 5.227845 |
77d76e18-6c50-45d8-96bc-95cbc8e4b996 | rutgers-apl/Atomicity-Violation-Detector | tbb-lib/examples/graph/binpack/binpack.cpp | /* Bin-packing algorithm that attempts to use minimal number of bins B of
size V to contain N items of varying sizes. */
#include <string>
#include <iostream>
#include <cmath>
#include "tbb/atomic.h"
#include "tbb/task_scheduler_init.h"
#include "tbb/tick_count.h"
#include "tbb/flow_graph.h"
#include "../../common/... | ALGO | 0.999992 | 7.423409 |
145ba92f-e428-4f25-83be-783e6c41fbef | imulan/procon | kattis/singapore_2018_prelim/h.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pa... | ALGO | 0.999785 | 3.426103 |
8624ef75-d843-4300-b722-8ac2fcc9d60a | tanmaypardeshi/CPP-Programs | Programs/P61.CPP | /*define a class "FLOAT" with single data member of type float.
Overload the operators + - * / as friend functions to return the sum,
difference, product and quotient of 2 FLOAT objects*/
#include<iostream.h>
#include<conio.h>
class FLOAT
{
float no1;
public:
FLOAT(float n1=0);
friend FLOAT operator +(FLOAT &,... | TOOL | 0.881424 | 4.9365 |
61ff722f-ec9c-4a67-ab97-d1f639cb3102 | wangru25/HERMES | 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.998489 | 6.326138 |
ef966250-406f-47f6-a9b0-703255ddbf4e | Amylo-jh/baekjoon | 9000s/9414.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
int tc;
cin >> tc;
while(tc--)
{
vector <int> price;
int value = 1;
while(value)
{
cin >> value;
if(value)
{
... | ALGO | 0.998647 | 4.034731 |
82d36976-f9dd-4d8d-b09f-e9f8f5a7196c | shahid-n/path-planning-project | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,4);
Eigen::VectorXf v(2);
m << 1, 23, 6, 9,
3, 11, 7, 2;
v << 2,
3;
MatrixXf::Index index;
// find nearest neighbour
(m.colwise() - v).colwise().squaredNorm()... | ALGO | 0.999885 | 4.138078 |
026db25b-3f59-45c8-b96f-94be82e23b8c | RosaOttoni/Huffman | Arvores.cpp | #include <iostream>
#include <ctime>
#include <chrono>
#include <fstream>
#include <cstdlib>
#include <sstream>
#include "Arvores.h"
#include "ArvoreVermelhoPreto.h"
using namespace std;
using namespace chrono;
void analise(int b, int m, int n, char *diretorio){
ofstream arq;
arq.open("saida.txt");
int c... | ALGO | 0.981095 | 3.326113 |
fba2934a-d8f9-47ac-9fb7-1708244cce9d | ishandutta2007/codeforces | fanache99/normal/900/A.cpp | #include <fstream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <bitset>
#include <cassert>
#include <ctime>
#include <cstdlib>
#include <set>
#include <complex>
using namespace std;
const int SIZE = 1 << 10;
int pointer = SIZE;... | ALGO | 0.999982 | 3.942855 |
f3f9abbf-e22e-4026-851f-881076637717 | MoekDiab/algorithm-exercises | ex9.cpp | /*9. Accumulating Array
Write a function that takes in array and returns a new array containing the accumulating sum.
accumArray([1,2,3,4]) -> [1,3,6,10]
accumArray([1,5,7]) -> [1,6,13]
*/
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<int> accumArray ( vector<int> m)
{
int sum=m... | ALGO | 0.999129 | 5.357097 |
b37ad8ce-0733-49ef-8466-752e3a2e66a1 | RoshanThapa7/LEC_CPP | Assignments/Operator Overloading/Matrix_Overloading.cpp | #include <iostream>
using namespace std;
class matrix
{
int a[3][3];
public:
void get()
{
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
cin >> a[i][j];
}
}
}
matrix operator * (matrix b)
{
matrix ... | ALGO | 0.999733 | 3.697038 |
02a8c155-67ad-418d-8f74-d38122b54e4a | spunkymj/LEETCODE | 1657-determine-if-two-strings-are-close/1657-determine-if-two-strings-are-close.cpp | class Solution {
public:
bool closeStrings(string word1, string word2) {
vector<int> v1(26,0),v2(26,0),v3(26,0),v4(26,0);
for(char c:word1)
v1[c-'a']++,v3[c-'a'] = 1;
for(char c:word2)
v2[c-'a']++,v4[c-'a'] = 1;
sort(begin(v1),end(v1));
s... | ALGO | 0.999985 | 5.973569 |
329194ab-2d49-4ea2-9b67-3e1cc1093865 | ayush9h/DSA-Sheet | Graphs/Djikstra.cpp | vector<int> djikstra(int V, vector<vector<int>> adj[], int S)
{
priority_queue < pair<int, int>, vector<pair<int, int>, greater<pair<int>>> pq;
vector<int> dist(V);
for (int i = 0; i < V; i++)
dist[i] = 1e9;
dist[S] = 0;
pq.push({0, S});
while (!pq.empty())
{
int dis = p... | ALGO | 0.99969 | 4.840771 |
d5d17ec4-045e-4c0c-adc7-35af55c5c2da | suzumiyayuhi/LeetCodeTrain | 面试经典150题/区间/插入区间.cpp | class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) {
int n = intervals.size();
vector<vector<int>> res;
int i = 0, j = 0;
bool flag = true;
while(i < n)
{
int left = intervals[i][0], right = interv... | ALGO | 0.999992 | 6.222749 |
620ad0c4-3434-4e7f-a258-0f5c5a7f82d0 | bloops/Algorithms-and-Data-Structures | suffix_automata_dictionary.cpp |
#include <iostream>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <cstdio>
#include <cstring>
#include <cassert>
using namespace std;
#define FOR(i,a,n) for(int i=int(a);i<int(n);i++)
#define REP(... | ALGO | 0.998835 | 3.682371 |
ef357958-92f8-4bb4-b190-9cbedf0f6a08 | Pushpendra100/CSES-Problems | 3.Dynamic_Programming/4.Coin_Combinations_2/main.cpp | #include <bits/stdc++.h>
using namespace std;
// https://www.youtube.com/watch?v=-pXjopzMVrE
// For finding ordered ways in knapsack
//we need to open elements one by one
/*
Given n coins c1, c2, c3, ... , cn; make sum x
N,X
0 1
N-1,X N, X-cn
*/
/*
dp(i, x): valid ways to make x using c1... | ALGO | 0.999983 | 4.921535 |
1bbcebd9-cd5e-49fe-a5e6-8c5ae8652237 | Pranjalis241/Leetcode-Daily-Practice | 448-find-all-numbers-disappeared-in-an-array/448-find-all-numbers-disappeared-in-an-array.cpp | class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& arr) {
int i=0;
while (i<arr.size())
{
int correct = arr[i]-1;
if(arr[i] != arr[correct])
{
int temp=arr[i];
arr[i]=arr[correct];
arr[c... | ALGO | 0.99925 | 5.219707 |
9961fbb9-cb2c-4b0d-8c1f-4c00042a36ea | Mayankjoshi670/cpAlgo | CSES/Room_Allocation.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL)
#define vpi vector<pair<int, int>>
#define vi vector<int>
#define int long long int
void findAns() {
int n;
cin >> n;
vpi events;
vector<pair<int, int>> intervals(n);
vi roomAssignment(n);
... | ALGO | 0.999975 | 4.910446 |
7f0c9c6f-55ed-4a5c-8294-51da5384faae | makiba-1212/individual-assignment | ternaryandinterpolation.cpp | #include <iostream>
using namespace std;
int interpolationSearch(int arr[], int size, int target) {
int low = 0;
int high = size - 1;
while (low <= high && target >= arr[low] && target <= arr[high]) {
if (arr[high] == arr[low]) {
if (arr[low] == target) return low;
... | ALGO | 0.999946 | 6.035319 |
409fe400-3be8-4507-9efa-1e3a880723e2 | Rony1031/PrepBytes | DecreasingOrderString.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string s;
cin>>s;
int freq[s.length()]={0};
int n=s.length();
for(int i=0;i<n;i++){
freq[s[i]-97]++;
}
for(int i=n-1;i>=0;i--){
... | ALGO | 0.999985 | 4.846051 |
190b81ee-0017-492a-ab29-0004db3c70c4 | raincross7/code-similarity | codes/train_code/problem134/problem134_264.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
#define maxn 1005
using namespace std;
int dp[maxn][maxn];
int len1, len2;
string s1, s2;
int lcs()
{
memset(dp, 0, sizeof(dp));
for(int i=1;i<=len1;i++)
for (int j = 1; j <= len2; j++)
{
if (s1[i] == s2[j]) {
dp[i... | ALGO | 0.999923 | 4.029873 |
0aac58ff-076d-42e0-9415-95ba768740ed | soumen-s/c_code_practice | c recursion powerCalculationOfAnumber.cpp | // Program to print the power of a number n using recursion
// Method- 1 (large space & time complexity)
#include <stdio.h>
int result = 1;
//int recordB = b; because we can not assign a value from outside a function
int power(int a, int b, int recordB)
{
if (b==0)
{
printf ("\n%d raised to the power %d is: %d ... | ALGO | 0.999445 | 5.012873 |
5c65f7e9-1efc-4e0b-a63b-ee5a25645f8c | danielfdz123/CSCI_135 | 1a.cpp | //Daniel Andres Fernandez
//<EMAIL>
//August 25, 2022
//Finding the smaller number of two integers
#include <iostream>
using namespace std;
int main()
{
int x, y;
cout << "Enter the first number: ";
cin >> x;
cout << "Enter another number: ";
cin >> y;
if (x > y){
cout << "The smaller o... | ALGO | 0.999577 | 4.201769 |
17c363e6-ba18-480f-982e-3e25070ab23b | fujitsu/compiler-test-suite | C++/0030/0030_0021.cpp | #include <cmath>
#include <iostream>
#if defined(ROLL_TIMES)
#define N ROLL_TIMES
#else
#define N 17
#endif
#define derr 1E-14
#define ferr 1E-7
#define is_fequal(a, b) \
((a == 0 && fabs(b) < ferr) || (b == 0 && fabs(a) < ferr) || \
(fabs(a ... | ALGO | 0.979291 | 3.337347 |
99a3f4e7-a1d4-425e-962b-f4a5449f1e31 | yuforest/contests | abc_024/d/main.cpp | // ここは競プロではサボりがちです
#include <bits/stdc++.h>
using namespace std;
// デバッグ用マクロです。詳しくは https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
// 節操ないですが、競プロでは便利です。
using ll = long ... | ALGO | 0.998944 | 3.576566 |
2700a20d-8c68-41d6-ab4e-777506732554 | csiimnida/codetree-TILs | 240723/점수 비교/score-comparison.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int a,b,c,d;
cin >> a >> b >> c >> d;
cout << (a > c && b > d);
return 0;
} | ALGO | 0.998157 | 3.364249 |
bbecec7c-ead5-48f5-8f95-8da101f675e9 | shah-antriksh/Coding | Tree/write-an-efficient-c-function-to-convert-a-tree-into-its-mirror-tree.cpp | //http://www.geeksforgeeks.org/write-an-efficient-c-function-to-convert-a-tree-into-its-mirror-tree/
/*
Test Cases:
1. Node has no children
2. Node has only left child
3. Node has only right child
4. Node has both left and right
*/
#include<bits/stdc++.h>
using namespace std;
struct node
{
node *left,*right;
int val... | ALGO | 0.999995 | 5.619358 |
90e119d8-9ef6-4775-8206-209f2521829a | ishaansehgal99/CS491 | Argus/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct Element{
int id, period, step;
Element(int id, int period, int step) : id(id), period(period), step(step) {}
};
struct custom_comparator{
bool operator()(const Element& e1, const Element& e2) const{
... | ALGO | 0.998426 | 3.57125 |
33353b42-6c12-46c5-b53a-87b3040957af | yfliu017258/CPP_programs | CodeForce/Div2/ECRound112/pE.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for(int i = a; i < b; i++)
const int MAX_N = 300005;
int n, m;
ll Min = 1000000000000;
struct S{
int l, r, w;
bool operator<(const S &x){
if(w != x.w){
return w < x.w;
}
if(l != x.l){
... | ALGO | 0.999954 | 4.006701 |
2ea81e7d-91f3-4728-af3e-74d6acfb0582 | omaremad74/klei-adobe-tools | lib/squish/squish.cpp | #include <string.h>
#include "squish.h"
#include "colourset.h"
#include "maths.h"
#include "rangefit.h"
#include "clusterfit.h"
#include "colourblock.h"
#include "alpha.h"
#include "singlecolourfit.h"
namespace squish {
static int FixFlags( int flags )
{
// grab the flag bits
int method = flags & ( kDxt1 | kD... | TOOL | 0.879574 | 6.343936 |
a7ff5d54-7c82-490a-886f-42ccee87eff0 | Lahari1501-b/lahari1501 | libraries/SITL/SIM_Tracker.cpp | /*
antenna-tracker simulator class
*/
#include "SIM_Tracker.h"
#include <stdio.h>
namespace SITL {
Tracker::Tracker(const char *frame_str) :
Aircraft(frame_str)
{}
/*
update function for position (normal) servos.
*/
void Tracker::update_position_servos(float delta_time, float &yaw_rate, float &pitch_rate)
{
... | TOOL | 0.872403 | 6.08527 |
ab4f4080-df22-4661-b193-f6c93a0684ff | GabJL/TLO | code/sumo-wrapper.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <sstream>
#include <map>
#include "cInstance.hpp"
#include "simpleXMLParser.hpp"
using namespace std;
typedef struct
{
double GvR; // Original Green vs Red
double nGvR; // Normalized GvR
... | ALGO | 0.972537 | 4.384773 |
7ae0ff0d-8a7c-4b2d-9f1c-01a498d91ef6 | stringing/Federated-LLM-Based-APR | RoPGen/src/coding style attacks/author-style-transform/transform/program_file/target_author_file/160/160.cpp | #include<bits/stdc++.h>
using namespace std;
struct st{
int f,b;
}a[12];
int n,minn=10000000;
void dfs(int dep,int fen,int bao){
if(dep!=1)
minn=min(minn,abs(fen-bao));
if(dep>=n)
return;
dfs(dep+1,fen*a[dep].f,bao+a[dep].b);
dfs(dep+1,fen,bao);
}
int main(){
freopen("stone.in","r",s... | ALGO | 0.999765 | 3.609021 |
4f3d223a-9030-41af-aa32-11530ec96717 | sarvex/leetcode-purescript | solution/0600-0699/0605.Can Place Flowers/Solution.cpp | class Solution {
public:
bool canPlaceFlowers(vector<int>& flowerbed, int n) {
int m = flowerbed.size();
for (int i = 0; i < m; ++i) {
int l = i == 0 ? 0 : flowerbed[i - 1];
int r = i == m - 1 ? 0 : flowerbed[i + 1];
if (l + flowerbed[i] + r == 0) {
... | ALGO | 0.999998 | 6.954871 |
12aeba9d-cf3d-4afa-b346-f461f1754947 | itsShnik/Algorithms-and-Data-Structures | dp and greedy/longIncreSeq.cpp | #include <bits/stdc++.h>
using namespace std;
int solve(int seq[], int n){
int arr[n];
int maxi = 1;
for(int i = 0; i < n; i++){
arr[i] = 1;
}
for(int i = 1; i < n; i++){
for(int j = i - 1; j >= 0; j--){
if(seq[j] < seq[i] && arr[j] + 1 > arr[i]){
arr[i] = arr[j] + 1;
}
}
maxi = max(maxi, arr[i... | ALGO | 0.999714 | 5.133142 |
89b4314f-71c9-4692-8f2a-f21adaef3ca4 | rexbron/blender-ocio | intern/elbeem/intern/mvmcoords.cpp | /** \file elbeem/intern/mvmcoords.cpp
* \ingroup elbeem
*/
#include "mvmcoords.h"
#include <algorithm>
using std::vector;
void MeanValueMeshCoords::clear()
{
mVertices.resize(0);
mNumVerts = 0;
}
void MeanValueMeshCoords::calculateMVMCs(vector<ntlVec3Gfx> &reference_vertices, vector<ntlTriangle> &tris,
vect... | ALGO | 0.98378 | 5.358182 |
9bcb3e9b-cefb-42fa-af8e-05ad9bee1a99 | arshya-garg/app-basic | 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.998859 | 6.785645 |
7009d753-363f-4c87-97b1-d0d19de12793 | walkccc/LeetCode | solutions/1993. Operations on Tree/1993.cpp | struct Node {
vector<int> children;
int lockedBy = -1;
};
class LockingTree {
public:
LockingTree(vector<int>& parent) : parent(parent) {
nodes.resize(parent.size());
for (int i = 1; i < parent.size(); ++i)
nodes[parent[i]].children.push_back(i);
}
bool lock(int num, int user) {
if (nodes... | ALGO | 0.999153 | 5.898874 |
74a80879-c91d-4093-bdc4-d532a813fb9b | SrayanBhattacharyya/CP_SolvedProblems | codeforces/1701/D.cpp | //Srayan Bhattachrayya JU EE
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(ll i=0;i<n;i++)
#define rev(i,n) for(ll i=n;i>=0;i--)
#define rev_a(i,a,n) for(ll i=n;i>=a;i--)
#define rep_a(i,a,n) for(ll i=a;i<n;i++)
typedef pair <ll, ll> pll;
typedef vector <l... | ALGO | 0.999978 | 3.59448 |
c224eea0-06de-4ac1-96a7-a9261824407e | CogitoJsT/CppExercise | BJCodingTest/AlgorithmBasic/1978_FindPrime.cpp | #include <iostream>
void init()
{
std::cin.tie(nullptr);
std::cout.tie(nullptr);
std::ios_base::sync_with_stdio(false);
}
int main()
{
int numOfInput{0};
std::cin >> numOfInput;
auto isPrime = [](int num) {
if(num == 1 || num == 0)
{
return false;
}
... | ALGO | 0.999923 | 5.305705 |
b64a4dd1-8f40-4908-b39d-0da004ceb30c | ishandutta2007/codeforces | ziyi_wang1/normal/1466/A.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int T,n,a[110],ok[110];
int main()
{
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
for(int i=1;i<=n;++i)scanf("%d",&a[i]);
for(int i=1;i<=n;++i)
for(int j=i+1;j<=n;++j)
ok[a[j]-a[i]]=1;
int cnt=0;
for(int i=1;i<=50;++i)cnt+=o... | ALGO | 0.999606 | 3.947729 |
d89a04d8-3b76-4815-aec3-1167d9497d4b | adit2005/LEETCODE-CPP-DSA-QUESTIONS | 109-convert-sorted-list-to-binary-search-tree/convert-sorted-list-to-binary-search-tree.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) {}
* };
*/
/**
* Definition for a binary tree node.
* struc... | ALGO | 0.999996 | 6.685078 |
cd17445f-5ca4-4469-9c92-e1d28d0a1baa | ishandutta2007/codeforces | subconscious/normal/1326/C.cpp | #include<bits/stdc++.h>
#define rep(i,n) for(int i=1;i<=n;++i)
#define x0 fuck1
#define y0 fuck2
#define x1 fuck3
#define y1 fuck4
#define mp make_pair
#define pb push_back
#define st first
#define nd second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pr;
const int N=3e6+5,m... | ALGO | 0.999971 | 3.678026 |
4799aa8e-bb83-4fdb-8d47-20ee712ffd07 | 1ARZAMAS/ovm_laba4 | dgemm.cpp | #include <iostream>
#include <vector>
#include <cstdlib> // для rand() и srand()
#include <ctime> // для time()
#include <chrono>
using namespace std;
void dgemm(int n, const vector<vector<double>>& A, const vector<vector<double>>& B,
vector<vector<double>>& C, double alpha = 1.0, double beta = 0.0) {
for (i... | ALGO | 0.998783 | 5.196795 |
8aaf6944-95a0-4d7f-bf8c-2ba623d050bf | ishandutta2007/codeforces | andreasyan/normal/1076/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
const int N = 300005;
long long t[N * 4];
void ubd(int tl, int tr, int l, int r, long long y, int pos)
{
if (r < l)
return;
if (tl == l && tr == r)
{
t[pos] += y;
return;
}
int m = (tl + tr) / 2;
ubd(tl... | ALGO | 0.999968 | 4.317535 |
debc8ecb-7bea-4074-ac6d-e73519d8ab38 | SundownRises/LEETCODE | 8-string-to-integer-atoi/string-to-integer-atoi.cpp | class Solution {
public:
int myAtoi(string s) {
int i = 0, n = s.length();
long long result = 0;
int sign = 1;
while (i < n && s[i] == ' ') {
i++;
}
if (i < n && (s[i] == '-' || s[i] == '+')) {
sign = (s[i] == '-') ? -1 : 1;
i++;
... | ALGO | 0.99878 | 5.505447 |
d7370053-6d5b-4359-bd65-8d147d47883a | Zdertis420/SaAoDP | prac1/utilities.cpp | #include "utilities.hpp"
#include <cstdlib>
#include <ctime>
#include <random>
#include <stdio.h>
#include <vector>
void fillarr_random(std::vector<char> &x, int &n) {
x.resize(n);
static std::mt19937 generator(std::time(0));
std::uniform_int_distribution<char> distribution('a', 'z');
for (int i = 0; i < n; ... | TOOL | 0.864703 | 5.112192 |
afd975e2-97a4-4d76-9e6b-69519578e243 | marjanhasan/BeeCrowd | problem-1143.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
for(int i=1; i<=n; i++)
{
cout<<i<<" "<<i*i<<" "<<i*i*i<<"\n";
}
return 0;
}
| ALGO | 0.996377 | 3.137659 |
692a7e87-5047-4693-a40b-dabcbdb0cbcb | wmjtxt/PAT | Basic/patB1033.旧键盘打字(20).cpp | ///
/// @file :patB1033.cc
/// @author :wmjtxt(<EMAIL>)
/// @date :2018-04-18 03:31:27(NewYork time)
/// @quote :
///
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <iomanip>
#include <string.h>
using namespace std;
int main()
{
char a[100000], b[100000], c[100000];
gets(a... | ALGO | 0.999874 | 3.615245 |
eb202306-22c2-4840-89cd-9c15c70def43 | samek567/ZadaniaAlgorytmiczne | OI/Jedynki_i_zera2_100_pkt.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int k = 0, n = 0;
bool czy_mamy = false;
string res;
vector<int> dp;
vector<int> idx_poprzedniej;
queue<int> Q;
int main()
{
// O(N*K), ten sam kod co zadanie zera i jedynki
ios_base::sync_with_stdio(0);
cin.... | ALGO | 0.999934 | 5.119433 |
0f8dd7f8-219d-46cc-9806-3e63e3bad57b | Sobuj54/DSA-with-CPP | semester_2_data_structure_and_algorithm/Algorithm/module_6_dijkstra_algorithm/1_dijkstra_naive_version.cpp | // complexity is O(V*E)
#include <bits/stdc++.h>
using namespace std;
const int N = 100;
vector<pair<int, int> > v[N];
int dis[N];
void bfs(int src)
{
queue<pair<int, int> > q;
q.push({src, 0});
dis[src] = 0;
while (!q.empty())
{
pair<int, int> parent = q.front();
q.pop();
... | ALGO | 0.99999 | 4.149651 |
2cb0663e-f9df-4c09-9229-fa6ffe9dadb9 | fanjinhua/DataStructure_Algorithm | AOAPC/permutation.cpp | /** /
#include <algorithm>
int main()
{
int n = 10;
int p[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
std::sort(p, p + n);
do
{
for (int i = 0; i < n; ++i)
std::cout << p[i] << " ";
std::cout << std::endl;
} while (std::next_permutation(p, p + n));
return 0;
}
#include <iostream>
void print_permutation(int... | ALGO | 0.999523 | 4.347816 |
932c26fd-8ae1-4357-8d4e-7f712aec04e6 | netscianalysis/netsci | netcalc/src/mutual_information.cpp | //
// Created by andy on 4/11/23.
//
#include <iostream>
#include <regex>
#include "mutual_information.h"
int netcalc::mutualInformation(
CuArray<float> *X,
CuArray<float> *I,
CuArray<int> *ab,
int k,
int n,
int xd,
int d,
int platform,
int checkp... | ALGO | 0.996497 | 6.108815 |
75c3a180-4970-4134-bd37-475036eed413 | abdulhakeemidr/GAME3001-W2020-Lesson3D-master | include/GLM/test/core/core_func_integer_find_lsb.cpp | // This has the programs for computing the number of trailing zeros
// in a word.
// Max line length is 57, to fit in hacker.book.
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
int nlz(unsigned x) {
int pop(unsigned x);
x = x | (x >> 1);
x = x | (x >> 2);
x = ... | ALGO | 0.998943 | 5.181918 |
071172c9-86c1-4d08-9e87-1356512693f7 | m9dfukc/Transform-Face | blocks/asm/include/util.cpp | #include "util.h"
void fillConvexFromPoints(Mat &img, vector< cv::Point > &pList, cv::Scalar s){
cv::Mat_< cv::Vec2i > pointMat(1, pList.size());
for (size_t i=0; i<pList.size(); i++)
pointMat(0, i) = cv::Vec2i(pList[i].x, pList[i].y);
vector< cv::Point > vP;
cv::convexHull(pointMat, vP);
cv::... | TOOL | 0.896349 | 3.938373 |
e16ed080-5a96-4f05-8566-366e9df12cac | ljmf00/lldb-d | lldb/tools/lldb-server/lldb-gdbserver.cpp | #include <cerrno>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#ifndef _WIN32
#include <csignal>
#include <unistd.h>
#endif
#include "LLDBServerUtilities.h"
#include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h"
#include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h... | TOOL | 0.872878 | 7.627706 |
09f8124e-1838-4d85-b6a4-633fc2ccc880 | mahjabeen2810/Data-Structure | queue.cpp | #include<iostream>
using namespace std;
class queue
{
int q[30],front=-1,rear=-1,i,max,item,temp;
public:
void read()
{
cout<<"Enter the size of the queue : ";
cin>>max;
}
void enqueue()
{
cout<<"Enter the element to be inserted : ";
cin>>item;
if(rear==max-1)
{
cout<<endl<<"QUEUE IS F... | ALGO | 0.91799 | 3.892753 |
1163d670-18dc-438e-b4e6-eb227ab6e7fb | ivanradanov/rodinia | cuda/cmp-cuda/su_gather.cpp | ////////////////////////////////////////////////////////////////////////////////
/**
* @file su_gather.cpp
* @date 2017-03-06
* @author Tiago Lobato Gimenes (<EMAIL>)
*
* @copyright
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as... | TOOL | 0.945615 | 4.867126 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.