uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b3424ae1-3c8d-4774-941a-82617caa4714 | mcsgroi/EnderLoop | Firmware/UpdatedLatestMarlinEnderLoop/Marlin-2.0.x/Marlin/src/gcode/bedlevel/mbl/G29.cpp | /**
* G29.cpp - Mesh Bed Leveling
*/
#include "../../../inc/MarlinConfig.h"
#if ENABLED(MESH_BED_LEVELING)
#include "../../../feature/bedlevel/bedlevel.h"
#include "../../gcode.h"
#include "../../queue.h"
#include "../../../libs/buzzer.h"
#include "../../../lcd/ultralcd.h"
#include "../../../module/motion.h"
#in... | TOOL | 0.857402 | 7.86508 |
d6d80a6c-1114-4c4f-9fb4-3086d2cc67d6 | akshatagrawal4590/Leetcode | Root to leaf path sum - GFG/root-to-leaf-path-sum.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Function to Build Tree
Node *buildTree(string str) {
// Corner Case
if (str.length()... | ALGO | 0.998773 | 7.179564 |
3d7e056a-b80d-4aaf-b772-fa28078f2888 | ishandutta2007/codeforces | smax/normal/1348/B.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...)
#endif
template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typena... | ALGO | 0.999621 | 3.426813 |
28423b36-2f88-44e3-8169-18a3e4341dce | Jason-fy-wang/base_c | c++/Base-Cpp/StdLib/src/transform-demo.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
// transform 㷨
/*
:
ͬһ
ԭ:
transform(iterator begin1, iterator end1, iterator begin2, _func)
beign1: Դʼ
end1: Դ
beign2: Ŀʼ
_func: ߺ
*/
class mTransform {
public :
int operator()(int val) {
//return val;
return val + 100;
}
};
cl... | ALGO | 0.989179 | 4.788577 |
b2db805f-78de-4295-bcec-b6308854d646 | Anilbk777/neonote | project/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.99853 | 6.76775 |
d7beddea-62cf-4430-8b3b-38b4da40334d | the0cp/leetcode | src/455.Assign-Cookies.cpp | class Solution {
public:
int findContentChildren(vector<int>& g, vector<int>& s) {
sort(g.begin(), g.end());
sort(s.begin(), s.end());
int index = s.size() - 1;
int result = 0;
for (int i = g.size() - 1; i >= 0; i--){
if (index >= 0 && s[index] >= g[i]){
... | ALGO | 0.999791 | 6.079416 |
166dfa58-e3a1-44fe-8490-e7660266f934 | harshpatel63/-6Companies30days | Day 1-5/13.cpp | class Solution{
public:
string helper(string &s, int &i) {
int t = 0;
string word = "";
while(i < s.length()) {
if(s[i] >= '0' && s[i] <= '9') {
t = t * 10 + (s[i] - '0');
} else if(s[i] == '[') {
i++;
... | ALGO | 0.999199 | 5.938363 |
70ce165d-d654-4446-8770-002a625ac2bd | Akashdupathi/CPP-All-CODES | 2conditionals-1.cpp/3numinputsideoftriornot.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b, c;
cin>>a>>b>>c;
if(a + b > c && a + c > b && b + c > a)
{
cout<<"The three numbers forms a triangle";
}
else{
cout<<"The three numbers donot forms a triangle";
}
return 0;
} | ALGO | 0.999237 | 4.667133 |
76c72969-23be-4067-8831-6df341509ff5 | KratikPaliwal/Questions | practice_Problem/GCD.cpp | #include <iostream>
using namespace std;
int GCD(int a, int b){
while (a>0 && b>0)
{
if(a>b){
a=a%b;
}else{
b=b%a;
}
}
if(a==0) return b;
return a;
}
int main(){
int a;
int b;
cin>>a;
cin>>b;
cout<<GCD(a,b)<<endl;
return 0;
} | ALGO | 0.99937 | 4.574572 |
455a7619-bcb3-415d-b57e-cc6cf4b4b4b0 | edionu97/Algorithms-DataStructures-ContestsSolutions | Infoarena.ro/ture.cpp | #include <iostream>
#include <cstdio>
#include <bitset>
#include <utility>
#define NMAX 251
using namespace std;
FILE *fin = fopen("ture.in","r");
FILE *fout = fopen("ture.out","w");
bitset < NMAX > Pus[NMAX];
int N,M,K,P;
inline void Fct(int &x,int &y){
if (N > M) swap(x,y);
}
int T[NMAX][(1<<15) + 1];... | ALGO | 0.999841 | 3.642235 |
d2506bf4-5cac-4630-868e-73e87ec66c0e | muclover/pvCNN | depends/libsnark/depends/libff/depends/ate-pairing/src/zm.cpp | #include "zm.h"
#include <cstdio>
using namespace mie;
#ifdef MIE_USE_X64ASM
#define XBYAK_NO_OP_NAMES
#include "xbyak/xbyak.h"
using namespace Xbyak;
#endif
/**
out[] = x[] + y[]
@note the sizeof out >= n
@return size of x[] + y[]
*/
static inline bool in_addN(Unit *out, const Unit *x, const Unit *y, size_t n)
{... | ALGO | 0.995119 | 5.789005 |
2c061a81-34cb-4c5c-b504-8be2635b2357 | kumar-sundaram-coder/Udemy---DSA-Essentials | Leetcode Questions/744.cpp | // Method - 1 | Linear Search
class Solution
{
public:
char nextGreatestLetter(vector<char> &letters, char target)
{
for (auto ele : letters)
{
if (ele > target)
return ele;
}
return letters[0];
}
};
// Method - 2 | Binary Search
class Solution
{
... | ALGO | 0.999763 | 5.933067 |
5b3245e9-8a7a-4d65-97e3-5c71acbd6caf | Andy1229/Rock-Paper-Scissors-GAME | RandomComputer.cpp | #include "RandomComputer.h"
#include "Tournament.h"
#include <iostream> // std::cout
#include <algorithm> // std::random_shuffle
#include <vector> // std::vector
#include <ctime> // std::time
#include <cstdlib> // std::rand, std::srand
#include <iostream>
#include <stdio.h>
#include <sstream>
... | ALGO | 0.965656 | 3.015505 |
45484ea4-6fd1-4fe9-9639-51185f2df83f | DyogoBendo/cp | subject/two-pointers/books.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, t;
cin >> n >> t;
vector<int> numbers(n);
for (int i = 0; i < n; i++)
{
cin >> numbers[i];
}
int current = numbers[0];
int i = 0;
int j = 0;
int ans = 0;
while(j < n){
if(cur... | ALGO | 0.999961 | 4.427215 |
b64e827b-2bd6-48aa-a39f-0571a52c5c73 | bkedge/School-Projects | CS3130/Project 3/PartA.cpp | #include <iostream>
#include "binaryTree.h"
//Brady Kedge
//CS3130
//Project 3
using namespace std;
int main() {
//Testing
//cout << "Hello, World!" << endl;
BinarySearchTree myTree;
//Initialize array
int arr[10] = {30, 10, 45, 38, 20, 50, 25, 33, 8, 12};
//Fill tree with array values
... | ALGO | 0.998943 | 4.687615 |
b60d7f4b-ca67-4db9-9d77-842be63ffd83 | jack06215/leetcode | search-a-2d-matrix/search-a-2d-matrix.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
if (matrix.empty()) return false;
int n_cols = matrix[0].size();
int left = 0;
int right = matrix.size() * n_cols - 1;
while (left <= right) {
int mid = (right ... | ALGO | 0.999956 | 6.545959 |
0e07efda-0568-4f83-9043-db36ffd8802e | Tiny-Box/leetcode | Primer/Primer/No.29.cpp | using namespace std;
int Atoi(const char *str)
{
if (str[0] == '\0')
return 0;
vector<double> num;
vector<char> mark;
double tmp = 0;
string ele = "+-";
string par = "()";
num.push_back(0);
int i = 0;
while ((str[i] - '0' < 0 || str[i] - '0' > 9) && ele.find(str[i]) == -1 && str[i] != '\0')
{
if (str[i... | ALGO | 0.998152 | 3.946032 |
9a0f8341-d7d8-4395-bcde-e71414cca09d | viswanadhchakravarthi/Strivers_SDE_Sheet_Challenge | Find the element that appears once in a sorted array, and the rest element appears twice (Binary search).cpp | // Approach 1: works only if sorted
// for(int i=0; i<n;i++)
// {
// if((i+1==n || arr[i]!=arr[i+1]) && (i-1<0 || arr[i]!=arr[i-1]))
// return arr[i];
// }
// this would fail if array is not sorted
// return -1;
// Approach 2: simple works even if unsorted
// int xr = 0;
/... | ALGO | 0.999923 | 5.33476 |
9637316b-4232-424a-8878-d67aca134f12 | AYESDIE/CS-404 | Lab-7/01.cpp | // 7.1 Write a program to demonstrate the Huffman code using greedy approach.
// C++ program for Huffman Coding
#include <iostream>
#include <cstdlib>
using namespace std;
#define MAX_TREE_HT 100
struct MinHeapNode {
char data;
unsigned freq;
struct MinHeapNode *left, *right;
};
struct MinHeap {
... | ALGO | 0.999993 | 4.585267 |
ab234827-db4e-495c-a412-be1fcadf48b2 | Kartik-Mathur/cpp4june | Lecture-4-Revision/Test.cpp | #include <iostream>
using namespace std;
int main() {
int n, r, col, x;
cin >> n;
for (r = 1; r <= n; ++r)
{
for (col = 1; col <= r; ++col)
{
if (col == 1 || col == r) {
cout << 1;
}
else {
if (r % 2 == 0) {
x = 0;
}
else {
x = 1;
}
cout << x;
}
}
cout << e... | ALGO | 0.99998 | 3.383278 |
b6cc5cfb-ae06-48a3-b768-bd6ce9c1af33 | GalacticPresidentSuperstarMAV/Ardu-Pilot | libraries/Filter/NotchFilter.cpp | #include "NotchFilter.h"
/*
initialise filter
*/
template <class T>
void NotchFilter<T>::init(float sample_freq_hz, float center_freq_hz, float bandwidth_hz, float attenuation_dB)
{
float omega = 2.0 * M_PI * center_freq_hz / sample_freq_hz;
float octaves = log2f(center_freq_hz / (center_freq_hz - bandwidt... | TOOL | 0.984411 | 5.419453 |
5a6ae22f-8d3c-438c-b147-15049f596aa1 | ma5terdrag0n/Competitive-Programming | Project Euler/Project Euler #5: Smallest multiple.cpp | #include <iostream>
using namespace std;
int lcm(int num1,int num2){
int max=(num1>num2) ? num1 : num2;
while(1)
{
if(max%num1==0 && max%num2==0)
{
//printf("LCM of %d and %d is %d", num1, num2,max);
return(max);
break;
}
++max... | ALGO | 0.999991 | 4.377687 |
289f53b8-1897-4f37-ad85-81fcc6198e4b | VuDinhLongg/Competitive_Programming | DSA/DSA02045.cpp | // LonggVuz.
#include<bits/stdc++.h>
using namespace std;
// Noob C++
void End(){
cerr << "\n\n=> Thời gian code chạy: ";
cerr << (1.0 * clock() / CLOCKS_PER_SEC) << " giây" << string(27, '\t');
}
#define LonggVuz() ios_base::sync_with_stdio(false); cin.tie(NULL);
#define use(x) freopen(x".inp", "r", stdin); fr... | ALGO | 0.999824 | 3.933843 |
89283af7-225e-4163-8f3c-633066c852f7 | SirPseudocode/Competitive-Programming | CF/Number Theory (800)/630A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
long long n;
cin >> n;
if(n == 1) cout << "05\n";
else cout << "25\n";
return 0;
} | ALGO | 0.999049 | 3.291447 |
692dbd36-884b-4ee7-a673-633c0d254de7 | GyuJin-Cho/Algorithm | 백준/알파벳 찾기.cpp | #include<iostream>
using namespace std;
int main()
{
string answer;
cin >> answer;
bool check = false;
for (int i = 0; i < 26; i++)
{
for (int j = 0; j < answer.length(); j++)
{
check = false;
if (answer[j] == 'a' + i)
{
cout << j << " ";
break;
}
check = true;
}
if(check)
cout ... | ALGO | 0.999793 | 3.341856 |
10bb07dd-c7d1-4cea-99a1-c62a34e876b9 | ishandutta2007/codeforces | koosha_mv/normal/1363/A.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define print(v,r) f(i,0,r) cout<<v[i]<<" "; cout<<endl;
#define Get(x,y) scanf("%I64d%I64d",&x,&y);
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define Gett(x,y) scanf("%d%d",&x,&y);
#define f(i,a,b) for(int i=a;i<b;i++)
#define get(x) scanf("%I64d",&x);
#d... | ALGO | 0.998266 | 3.844661 |
dc19553c-307f-4855-b292-1f30d6b0a536 | manish-kumar123/DSA-Leetcode-Solutions | 0062-unique-paths/0062-unique-paths.cpp | class Solution {
public:
int uniquePaths(int m, int n) {
int totalPath = m+n-2;
int r = n-1;
double res = 1;
for(int i = 1; i<=r; i++) {
res = res*(totalPath - r + i)/i;
}
return int(res);
}
};
| ALGO | 0.999931 | 6.790796 |
08bcf017-d220-4803-8a7c-1de665dcedab | Isatin/GOAPPrototypes | ArithGOAP/UnfeasibleDesiredFactExample/UnfeasibleDesiredFactExample.cpp | #include <iostream>
#include <sstream>
#include "ExampleUtility/ExampleUtility.h"
using namespace ArithGOAP;
///////////////////////////////////////////////////////////////////////////////////////////////////
namespace EPlace
{
enum
{
A,
B,
C,
};
}
/////////////////////////////////... | ALGO | 0.985017 | 5.026266 |
57ae4334-cde5-43fa-b7b3-abba495bbf0d | bielusm/Sodoku-Solver | Sodoku/Sudoku.cpp | #include "Sudoku.h"
#include <iostream>
Sudoku::Sudoku(int(&board)[LEN][LEN])
:board(board)
{
}
Sudoku::~Sudoku()
{
}
//This solve follows a two step process
//First every cell is checked to see if only one number possible
//it crosses off all numbers that are in the same row, colum and square
//if there is not only... | ALGO | 0.995613 | 3.763207 |
6f303ec5-4e4e-4da8-9624-92dc9bcd6594 | Arunsid/rtabmap | corelib/src/odometry/OdometryDVO.cpp | #include "rtabmap/core/odometry/OdometryDVO.h"
#include "rtabmap/core/OdometryInfo.h"
#include "rtabmap/core/util2d.h"
#include "rtabmap/utilite/ULogger.h"
#include "rtabmap/utilite/UTimer.h"
#include "rtabmap/utilite/UStl.h"
#include <opencv2/imgproc/types_c.h>
#ifdef RTABMAP_DVO
#include <dvo/dense_tracking.h>
#incl... | ALGO | 0.914965 | 6.739654 |
c7bfaa8c-9677-42a9-9afd-58ba035c124e | palilo815/ps | baekjoon/22000/22351.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
#ifdef palilo
freopen("in", "r", stdin);
freopen("out", "w", stdout);
#endif
string s;
cin >> s;
string t;
for (int a = 1, b; a != 1000; ++a) {
t.clear();
for (b = a; t.size(... | ALGO | 0.999887 | 4.157371 |
23825ff2-a82f-431c-b657-f99608bff30d | geekygirl8/Hacktoberfest_2022_DSA | C++/C++/k-th-smallest-in-lexicographical-order.cpp | // Time: O(logn)
// Space: O(logn)
class Solution {
public:
int findKthNumber(int n, int k) {
int result = 0;
vector<int> cnts(10);
for (int i = 1; i <= 9; ++i) {
cnts[i] = cnts[i - 1] * 10 + 1;
}
vector<int> nums;
for (int i = n; i > 0; i /= 10) {
... | ALGO | 0.999931 | 7.722323 |
8ec1bb8d-2252-40ed-b4ff-de08aa1d9a15 | ishandutta2007/codeforces | ecnerwala/normal/1286/D.cpp | #include<bits/stdc++.h>
using namespace std;
template <int MOD_> struct modnum {
static constexpr int MOD = MOD_;
static_assert(MOD_ > 0, "MOD must be positive");
private:
using ll = long long;
int v;
static int minv(int a, int m) {
a %= m;
assert(a);
return a == 1 ? 1 : int(m - ll(minv(m, a)) * ll(m) / ... | ALGO | 0.999766 | 4.515959 |
77178a7a-2ced-45c6-9525-f079ddcb7a65 | inusaico90/herramientas-c | Pixar 5.cpp | #include <iostream>
#include <stdlib.h>
#include <locale.h>
using namespace std;
//Declaracion de variables globales
float *estOrden;
//Declaracion de funciones y procedimientos(tam).
void imprimirArreglos(float *arreglo, int tam, string nombre);
void printArreglosE(int *arreglo, int tam, string nombre);
void printArre... | TOOL | 0.908362 | 3.468592 |
baf19609-643f-4bce-ad94-08cde2e2eea3 | Asad-Bin/cf-ac-problems | codeforces/1623/B..cpp | // . . . Bismillahir Rahmanir Rahim . . .
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define pii pair<int, int>
#define vi vector<int>
#define vl vector<long long>
#define PB push_back
#define sz(x) (int)x.size()
#define fi first
#define se second
#define si(a... | ALGO | 0.999804 | 3.789403 |
42c70836-ff37-4901-b7cc-c1a1dbbefdb9 | SakshiRudrawar/data-structure | bubble sort descending order.cpp | #include<iostream>
using namespace std;
const int size = 5;
void bubbleSort(int *arr)
{
int temp;
for (int i = 0; i < size - 1; i++)
{
for (int j = 0; j < size - 1 - i; j++)
{
if (arr[j] < arr[j + 1])
{
temp = arr[j];
arr[j] = arr[j + 1];
... | ALGO | 0.999571 | 4.848288 |
065b63af-d182-4996-a216-063bd6b02880 | Centinoughty/leetcode | 3602.cpp | // Hexadecimal and hexatrigecimal conversion
// EASY
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
string concatHex36(int n) {
return hexDec(n) + hexTri(n);
}
private:
string hexDec(int n) {
string res;
n = n * n;
while (n) {
int temp =... | ALGO | 0.999019 | 5.329335 |
c4254c0d-43e9-4aee-b889-e92b5033e366 | abhi00rnair/LEARN_DSA | 3648-find-the-maximum-number-of-fruits-collected/3648-find-the-maximum-number-of-fruits-collected.cpp | class Solution {
public:
int maxCollectedFruits(vector<vector<int>>& fruits) {
int n=fruits.size();
int m=fruits[0].size();
int child1=0;
for(int i=0;i<n;i++){
child1+=fruits[i][i];
if(i!=n-1){
fruits[i][i]=-1;
}
}
i... | ALGO | 0.999995 | 5.84732 |
cc63461a-1ca6-440f-a142-7d521e7729a5 | lubamuromskaya/graph | graph_1.cpp | // task 1: alphabet
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <iterator>
#include <utility>
#include <fstream>
struct vertex;
struct my_time;
std::vector<std::pair<vertex, std::list<int> > > vertices;
bool contoured = false;
enum color {
white = 0,
gray,
black
... | ALGO | 0.99996 | 4.368177 |
c38f2ace-c81d-4fd8-b6db-bf32176d961b | TippingCoin/FastMineCoin | src/netbase.cpp | #include "netbase.h"
#include "util.h"
#ifndef WIN32
#include <sys/fcntl.h>
#endif
#include "strlcpy.h"
#include <boost/algorithm/string/case_conv.hpp> // for to_lower()
using namespace std;
// Settings
typedef std::pair<CService, int> proxyType;
static proxyType proxyInfo[NET_MAX];
static proxyType nameproxyInfo;
... | TOOL | 0.981585 | 3.634326 |
2d3ebd73-a240-4ea9-bc39-c84a17fc9b0a | asdadeeeee/OJ | leetcode/844/c.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string back(string str) {
string res;
for (auto c : str) {
if (c != '#') {
res.push_back(c);
} else if (!res.empty()) {
res.pop_back();
}
}
return res;
}
bool backspaceCompare(stri... | ALGO | 0.999672 | 5.431384 |
ef57b175-a451-41d8-978d-aec8f9ad64db | zhangwj0101/codestudy | algorithm/HDU-ACM/ambition0109/1133.cpp | ////////////////////System Comment////////////////////
////Welcome to Hangzhou Dianzi University Online Judge
////http://acm.hdu.edu.cn
//////////////////////////////////////////////////////
////Username: ambition0109
////Nickname: Ambition
////Run ID:
////Submit time: 2010-05-19 13:49:08
////Compiler: Visual C++
////... | ALGO | 0.999624 | 3.844753 |
2feb160e-6b6f-4018-a636-d2cb1cc744ba | 1lann/aio-camp-2015 | strings/magnum.cpp | #include <cstdio>
#include <cstring>
#include <vector>
#include <iostream>
using namespace std;
typedef struct Match {
int startPos;
int posFromZero;
bool committed;
} Match;
int main() {
char inputString[100010];
scanf("%s", inputString);
int inputLength = strlen(inputString);
// Stores
vector<Match> curre... | ALGO | 0.999982 | 3.685748 |
746b5b9f-44a9-4dfe-bd40-fbaf425843f0 | tvdv/metastorey | lib/boost_1_53_0/libs/numeric/ublas/doc/samples/matrix_row.cpp | #include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
for (unsigned i = 0; i < m.size1 (); ++ i) {
matrix_row<matrix<double> > mr (m, i);
f... | ALGO | 0.936517 | 3.347307 |
05a02fd5-38e5-4d55-9b77-a3c5d353c1d7 | PaulusBilly/leetcode | 0125-valid-palindrome/0125-valid-palindrome.cpp | class Solution {
public:
bool isPalindrome(string s) {
int l = 0;
int r = s.length() - 1;
while (l < r) {
while (l < r && !isalnum(s[l])) l++;
while (l < r && !isalnum(s[r])) r--;
if (tolower(s[l]) != tolower(s[r])) {
return false;
... | ALGO | 0.999 | 6.580397 |
1ba27708-af2c-4804-9ee3-59fddcd62277 | rbuenmon9/opencv | modules/core/src/sum.dispatch.cpp | #include "precomp.hpp"
#include "opencl_kernels_core.hpp"
#include "stat.hpp"
#include "sum.simd.hpp"
#include "sum.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content
#undef HAVE_IPP
#undef CV_IPP_RUN_FAST
#define CV_IPP_RUN_FAST(f, ...)
#undef CV_IPP_RUN
#de... | ALGO | 0.996303 | 6.1878 |
638dab93-373f-4466-88e0-e254f09faf8b | CarIsFast/DSA | lecture-17/bubbleSort.cpp | #include<iostream>
using namespace std;
void bubbleSort(int arr[], int size){
int count=0;
for(int i=0; i<size-1; i++){
bool Swapped = false;
for(int j=0; j<size-1-i; j++){
count++;
if(arr[j]>arr[j+1]){
swap(arr[j],arr[j+1]);
Swapped=true;... | ALGO | 0.999155 | 4.631063 |
ff5736c4-26eb-4a02-8923-bf42fd401b7c | divi1501/QuizApp_flutter | 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.998784 | 6.761023 |
7c8e5493-0334-4a0f-95bd-ff44e050f44c | webplusai/thc-pivx | src/denomination_functions.cpp | /**
* @file denominations_functions.cpp
*
* @brief Denomination functions for the Zerocoin library.
*
* @copyright Copyright 2017 THC Developers
* @license This project is released under the MIT license.
**/
#include "denomination_functions.h"
using namespace libzerocoin;
// -------------------... | ALGO | 0.984931 | 7.242055 |
f854bfcc-ef22-4474-9608-88a0d1ac369d | iprincekumark/LeetCode-Questions | 9-palindrome-number/9-palindrome-number.cpp | class Solution {
public:
bool isPalindrome(int x) {
if(x<0)
return false;
if(x==0)
return true;
long long rev=0, ans=x;
while(x!=0){
rev = (rev*10) + (x%10);
x = x/10;
}
if(rev == ans)
return true;
re... | ALGO | 0.99996 | 5.909379 |
cfb2513b-2b44-4cea-ada2-84584738f804 | quick-lint/quick-lint-js | benchmark/generate-code.cpp | #include <algorithm>
#include <cstddef>
#include <memory>
#include <quick-lint-js/container/padded-string.h>
#include <quick-lint-js/generate-code.h>
#include <quick-lint-js/port/char8.h>
#include <quick-lint-js/util/algorithm.h>
#include <quick-lint-js/util/cast.h>
#include <random>
#include <set>
#include <utility>
#... | TOOL | 0.938626 | 6.364594 |
53bb5432-9d03-497e-91de-8fd91b9ca60f | puzcoin/puzcoin | src/masternode-sync.cpp | #include "activemasternode.h"
#include "checkpoints.h"
#include "governance.h"
#include "main.h"
#include "masternode.h"
#include "masternode-payments.h"
#include "masternode-sync.h"
#include "masternodeman.h"
#include "netfulfilledman.h"
#include "spork.h"
#include "util.h"
class CMasternodeSync;
CMasternodeSync mast... | TOOL | 0.863738 | 4.649731 |
d23cc465-0f4d-4f73-bb7b-132a49342b12 | cosmoss-jigu/pactree | src/pactree.cpp | #include <iostream>
#include <zconf.h>
#include <cassert>
#include "numa.h"
#include "pactreeImpl.h"
#include "numa-config.h"
#include "Combiner.h"
#include "WorkerThread.h"
#include <ordo_clock.h>
#ifdef PACTREE_ENABLE_STATS
#define acc_sl_time(x) (curThreadData->sltime+=x)
#define acc_dl_time(x) (curThreadData->dlti... | ALGO | 0.992677 | 4.364632 |
f6cc9b2b-0a9a-4e4f-9788-ea031f9c64d0 | ishandutta2007/codeforces | bigbag/normal/985/F.cpp | #include <bits/stdc++.h>
using namespace std;
bool is_prime(int x) {
if (x <= 1) {
return false;
}
for (int i = 2; i * i <= x; ++i) {
if (x % i == 0) {
return false;
}
}
return true;
}
int next_prime(int x) {
for (int i = x + 1; ; ++i) {
if (is_prim... | ALGO | 0.999981 | 4.006842 |
885f902f-1edb-401f-a182-d697852f3f4f | rubal2508/CodingBlocks_Hackerblocks_Algo | DP/PLATE DROPPING.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll dp[1000][1000];
ll plateDropping(ll plates, ll floors){
if(floors==0 || floors==1) return floors;
if(plates==1) return floors;
if(dp[plates][floors] != -1) return dp[plates][floors];
ll ans = INT_MAX;
for(ll i=1; i<=floors; ... | ALGO | 0.999865 | 5.159727 |
12f69851-c7c8-4811-bce3-b816ee48513d | JasperHsieh/CrackingTheCoding | src/tmp/PassTest.cpp | #include <iostream>
using namespace std;
// pass by value
void swap1(int a, int b){
int tmp = a;
a = b;
b = tmp;
}
// pass by pointer (address)
void swap2(int *a, int *b){
int tmp = *a;
*a = *b;
*b = tmp;
}
// pass by reference
void swap3(int &a, int &b){
int tmp = a;
a = b;
b = tm... | ALGO | 0.994577 | 4.624859 |
211b74cc-6f90-4f0b-b2d1-029b89c985c5 | facebookresearch/TransCoder | data/evaluation/geeks_for_geeks_successful_test_scripts/cpp/MAKE_LARGEST_PALINDROME_CHANGING_K_DIGITS.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
string f_gold ( string str, int k ) {
string palin = str;
int l = 0;
int r = str . length ( ) - 1;
while ( l < r ) {
if ( str [ l ] != str [ r ] ) {
... | ALGO | 0.999877 | 5.500461 |
8805aa33-9072-4a14-817f-ff0e79dce178 | anubhav-pandey1/Searching-Algorithms | binarysearchoccurence.cpp | #include <iostream>
#include <vector>
using namespace std;
int binarySearchFirst(vector<int>& v, int n) {
int start = 0, end = v.size() - 1;
while (start <= end) {
int mid = start + (end - start)/2;
if (v[mid] == n) {
if (v[mid-1] != n) {
return mid;
}
... | ALGO | 0.99974 | 6.121214 |
d9ba8b2e-ddbf-4039-9231-018c4bbd00e8 | Yosiky/yandex-belts | yellow/task4.4/name_and_surname.cpp | #include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
class Person {
std::map<int, std::pair<std::string, std::string>> m;
public:
void ChangeFirstName(int year, const string& first_name) {
m[year].first = first_name;
}
void ChangeLastName(int ye... | ALGO | 0.945453 | 4.686993 |
e3591523-2323-438e-ad56-34a69651c8e3 | SOAIB56/Problem-solving-club | week 2/day 1/B_Sum_of_Digits.cpp | #include <iostream>
#include <string>
using namespace std;
// Function to return the sum of digits of a number
int sum_of_digits(string n) {
// Initialize the sum
int sum = 0;
// Loop through the characters of the string
for (char c : n) {
// Convert the character to an integer and add it to th... | ALGO | 0.999987 | 6.579189 |
a1f3ab7e-4825-4140-a434-50b631052d12 | Safwan-Ibrahim/CPP | Phase 01 P1/class 3/Problem of class 3/O.Five_in_One.cpp | #include <bits/stdc++.h>
using namespace std;
int maximum(int arr[],int n)
{
int maxi = -11;
for (int i = 0; i < n; i++)
{
maxi = max(arr[i],maxi);
}
return maxi;
}
int minimum(int arr[],int n)
{
int mini = 110;
for (int i = 0; i < n; i++)
{
mini = min(arr[i],mini)... | ALGO | 0.999053 | 4.32127 |
7cb4dace-d9f2-4590-9897-6c7d207be14f | shahzaneer/Data-Structures-and-Algorithms | Codes/DS and Algo/Tree/BinarySearchTree/DeletionGeek.cpp | // C++ program to demonstrate
// delete operation in binary
// search tree
#include <bits/stdc++.h>
using namespace std;
struct node
{
int key;
struct node *left, *right;
};
// A utility function to create a new BST node
struct node *newNode(int item)
{
struct node *temp = (struct node *)malloc(sizeof(str... | ALGO | 0.999948 | 6.566604 |
65c22904-a921-4977-b6c2-c9bf42e0b17f | Ras-hi/GFG-Problems | Difficulty: Medium/Minimize the Heights II/minimize-the-heights-ii.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:
int getMinDiff(vector<int> &arr, int k) {
// code here
int n=arr.size();
if(n==1) return 0; //base case
... | ALGO | 0.999807 | 5.659152 |
4c994001-2074-4da3-b6b2-acba5fc48083 | alokpandeygzp/GFG-Leetcode | Find kth element of spiral matrix - GFG/find-kth-element-of-spiral-matrix.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
#define MAX 1000
// } Driver Code Ends
class Solution
{
public:
/*You are required to complete this method*/
int findK(int arr[MAX][MAX],int n,int m,int k)
{
int left=0, top=0, right=m-1, bottom=n-1;
int count=0;
while(lef... | ALGO | 0.999952 | 5.209933 |
93bca750-0a5d-4f67-8e58-f0a9a63f26eb | ishandutta2007/codeforces | forested/normal/1525/D.cpp | // Template
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <tuple>
#include <utility>
#include <queue>
#include <set>
#include <map>
#include <array>
#include <cassert>
#include <cmath>
#define rep_override(x, y, z, name, ...) name
#define rep2(i, n) for (int i... | ALGO | 0.999991 | 4.340699 |
ab6a9e49-fcc5-48cc-8b29-2373649e86bf | MatejVitovec/PRO4 | src/Condensation/Mixture.cpp | #include <omp.h>
#include "Mixture.hpp"
void Mixture::updateVaporThermo(VolField<ComponentThermoVar>& vaporThermoField, const VolField<ComponentThermoVar>& liquidThermoField, const VolField<CompressibleMixture>& w) const
{
#pragma omp parallel for
for (size_t i = 0; i < vaporThermoField.size(); i++)
{
... | ALGO | 0.991084 | 6.124591 |
7d8ccac3-5809-4f77-8db1-a6c4e9bd6ccf | Ayush-chanchal/C-Programs | ReverseArray.cpp | #include<iostream>
using namespace std;
void reversearray(int arr[],int n)
{
int s=0;
int e=n-1;
while(s<e)
{
swap(arr[s++],arr[e--]);
}
}
void print(int arr[],int n)
{
for(int i=0;i<n;i++)
{
cout<<arr[i]<<endl;
}
}
int main()
{
int arr[]={1,2,3,4,5};
... | ALGO | 0.999588 | 4.915181 |
7bde1da6-5199-4cb7-8f96-d9b58dfea562 | panteluke/usaco | butter.cpp | /*
ID: ...
PROG: butter
LANG: C++11
*/
#include <vector>
#include <climits>
#include <fstream>
#include <iostream>
using namespace std;
template <class T>
class IndexMinPQ {
private:
int maxN;
int n;
vector<int> pq;
vector<int> qp;
vector<T> keys;
public:
IndexMinPQ(int maxN) : maxN(maxN), n(... | ALGO | 0.999966 | 4.019567 |
56a3101a-9bcd-46b7-b63d-cdfa2f698a27 | JaiThakur10/leetv2 | 0009-palindrome-number/0009-palindrome-number.cpp | class Solution {
public:
bool isPalindrome(int x) {
unsigned int temp, reverse = 0;
temp = x;
while(temp > 0){
int last = temp %10;
reverse = reverse *10 +last;
temp = temp/10;
}
return reverse ==x;
}
}; | ALGO | 0.999975 | 5.992021 |
ab574756-1561-4760-92f5-175f8835e20a | Mugetsu-1/Sem-3-Labs- | Sem 3 Labs/Numerical Method/Num Mth Lab-6/NM Lab-6 Q.1.cpp | //Laplace Equation
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
void gaussElimination(double A[4][4], double B[4]) {
// Forward elimination
for (int i = 0; i < 4; i++) {
// Make the diagonal element of A[i][i] as 1
for (int k = i + 1; k < 4; k++) {
d... | ALGO | 0.999992 | 3.976951 |
9c14ccd8-0a69-440c-86d5-21f867c00839 | zhushaoben/training | 2019-2020第二学期训练/AtCoder Beginner Contest 162/F.Select Half.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=2e5+5;
int a[N];
LL f[N][3];
int main(){
int n;scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%d",a+i);
for(int i=0;i<=n;i++)f[i][0]=f[i][1]=f[i][2]=-1e18;
f[1][0]=a[1],f[2][1]=a[2],f[3][2]=a[3],
f[3][0]=a[3]+a[1];
for(int i=4;i<=n;i++){
... | ALGO | 0.99999 | 3.599839 |
d86a35e2-8e26-4a69-9afd-9769fdab90cb | CyrusSE/College-Archives | Semester 3/Tree/Tree.cpp | #include "Tree.h"
adrNode newNode_103032300152(infotype x){
adrNode P = new elm;
P->left = NULL;
P->right = NULL;
P->info = x;
return P;
}
void insertNode_103032300152(adrNode &root, adrNode p){
if (root == NULL){
root = p;
}else{
if (p->info > root->info){
inse... | ALGO | 0.997884 | 3.348622 |
a0d12ad8-4822-4241-9e36-a53b4f53d716 | byam/algorithms | atcoder/contest/abc/contest/abc220/d.cpp | #include <bits/stdc++.h>
//#include <atcoder/all>
// using namespace atcoder;
using namespace std;
// debug
#define printv(v) \
for (auto x : v) { \
cerr << x << " "; \
} \
cerr << endl;
#define print2d(v) \
for (int i = 0; i < v.siz... | ALGO | 0.999528 | 5.434862 |
19cc351d-d765-4a61-b109-5c6d41988c5d | muhammadhassan2/LeetCode_Dynamic_Programming | Recursion problems/40. Combination Sum II (solution 2).cpp | class Solution {
public:
void caluclate(vector<int>&v,vector<int>&tmp,vector<vector<int>>&ans,int start,int target){
if(target == 0){
ans.push_back(tmp);
return ;
}
if(start >= v.size() || target<0){
return ;
}
for(int i = start ;i<v.size();i++){
if(i ... | ALGO | 0.999997 | 6.046904 |
e8ad4c45-f834-443f-8d26-d7c9cb0fa1be | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_12613_10.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 400010;
struct Node {
int fa, ch[2], siz, sizi;
long long siz2i;
long long siz2() { return (long long)siz * siz; }
} t[N];
bool nroot(int x);
void rotate(int x);
void Splay(int x);
void access(int x);
int findroot(int x);
void link(int x);
void cut(int x... | ALGO | 0.999757 | 3.810213 |
170fd9e4-5851-49a1-b80e-fe3a1e1188c1 | Ketan-K17/security_lab_sem7 | 09_23_oct_absent/q1.cpp | // Q1. IMPLEMENT THE DIFFIE-HELLMAN KEY EXCHANGE MECHANISM.
#include <iostream>
#include <cmath>
#include <random>
#include <iomanip>
using namespace std;
// Function for modular exponentiation (a^b mod p)
long long mod_pow(long long base, long long exponent, long long modulus) {
cout << "\nCalculating: " << base... | ALGO | 0.999947 | 6.815201 |
c63cd350-f01e-4b9c-bb64-c487b1a00009 | hitcode123/DSA_Sheet | acc_20.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int max_num=INT_MIN;
for(int i=0;i<n;i++)
{
max_num=max(max_num,arr[i]);
}
int smax=INT_MIN;
for(int i=0;i<n;i++)
{
if(sma... | ALGO | 0.999921 | 3.539216 |
5cdfabd1-69b8-4bdb-af51-bd3c3bf1c4cb | tmk-123/DSA | DSA04022.cpp | #include<bits/stdc++.h>
using namespace std;
long long len[26];
void prepare() {
len[1] = 1;
for (int i = 2; i < 26; i++) {
len[i] = 2 * len[i - 1] + 1;
}
}
char Try(long long n, long long k) {
if (n == 1) return 'A';
long long mid = len[n - 1] + 1;
if (k == mid) return 'A' + n - 1;
... | ALGO | 0.999958 | 4.811147 |
bbce41fa-1b6e-455b-ab47-3058249837f2 | rvgpu/rvgpu-llvm | libcxx/test/std/algorithms/algorithms.results/in_in_result.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// template <class I1, class I2>
// struct in_in_result;
#include <algorithm>
#include <cassert>
#include <type_traits>
#include "MoveOnly.h"
struct A {
explicit A(int);
};
// no implicit conversion
static_assert(!std::is_constructible_v<std::ranges::in_in_result<A, A>, ... | TEST | 0.907007 | 7.625478 |
506a64ab-457a-4b6f-9c98-fe5b6a529fae | ahmed19897/CPlusPlus-How-To-Program-Ninth-Edition | Searching_and_Sorting/20.6folder/20.6.cpp | //bubble sort optimized
#include <iostream>
void swap(int & var1,int & Var2);
int main()
{
//int arr[10]={5,6,7,5,2,1,5,3,4};
int arr[10]={0,1,2,3,4,5,6,7,8,9};
int n=10;
bool Swapped=false;
for (int i = 0; i < n - 1; i++)
{
Swapped=false;
//j<n-i-1 so we don't iterate ... | ALGO | 0.999936 | 5.79102 |
6c92a8c4-70b0-4eeb-8973-72b76ce153ac | DavidePiccinini/thesis_Kimera_Gazebo | gtsam/gtsam_unstable/nonlinear/tests/testNonlinearClusterTree.cpp | /**
* @file testNonlinearClusterTree.cpp
* @author Frank Dellaert
* @date March, 2016
*/
#include <gtsam_unstable/nonlinear/NonlinearClusterTree.h>
#include <gtsam/sam/BearingRangeFactor.h>
#include <gtsam/slam/BetweenFactor.h>
#include <gtsam/geometry/Pose2.h>
#include <gtsam/geometry/Point2.h>
#include <gtsam... | TEST | 0.866764 | 7.672818 |
7e95eadb-27e4-4610-956e-4bacc94055b7 | mwien/problemsolving | atcoder315/f.cpp | #include<iostream>
#include<vector>
#include<unordered_map>
#include<cmath>
#include<algorithm>
using namespace std;
const int MB = 32;
double T[10005][MB];
pair<int,int> p[10005];
double npow(int i) {
if(i < 0) return 0;
else return pow(2.0, i);
}
double dist(int i, int j) {
double dx = p[j].first - p[i].first;... | ALGO | 0.998957 | 3.82846 |
69de51c9-dd3f-4367-a5d9-a1a8d0c0fc54 | chowdhuryamit/DsaAllTopic | sorting/insertionSort.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int arr[]={72,34,90,23,56,87,34,12,74,0};
int n=10;
for(int i=1;i<n;i++){
int temp=arr[i];
int j;
for(j=i-1;j>=0;j--){
if(arr[j]>temp){
arr[j+1]=arr[j];
}
else{
... | ALGO | 0.999963 | 3.484476 |
3672b2df-56dd-4c5d-b619-21baf9ab1a94 | ishandutta2007/codeforces | 353cerega/normal/1474/D.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define X first
#define Y second
const ll mod = 1000000007;
ll gcd(ll a, ll b)
{
a = abs(a);
b = abs(b);
if (a==0 or b==0) return a+b;
return gcd(b,a%b);
}
ll sum(ll a, ll b)
{
... | ALGO | 0.999936 | 3.825215 |
d31874b2-2f18-476a-9701-f3850aaad528 | srilali26/csa-1430-compilerdesign | C14.cpp | #include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
char ip_sym[15],stack[15]; int ip_ptr=0,st_ptr=0,len,i; char temp[2],temp2[2]; char act[15];
void check(); int main()
{
//clrscr();
printf("\n\t\t SHIFT REDUCE PARSER\n"); printf("\n GRAMMER\n");
printf("\n E->E+E\n E->E/E"); printf("\n E->E*E... | ALGO | 0.999719 | 3.448761 |
6f9ece48-c147-4a8f-9d07-c0c559eac906 | AaryaK05/DSA_Qs | 2D Arrays/Rotate_Image.cpp | //Leetcode 48
class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
unordered_set<int>col;
int temp;
for(int i=0;i<matrix.size();i++){
for(int j=0;j<matrix[i].size();j++){
if(col.find(j)!=col.end()){
continue;
}
temp=m... | ALGO | 0.999988 | 5.650226 |
a1691d72-f3b6-4c0c-8564-377452045b74 | RauPro/Algorithms-on-Graphs | week2_graph_decomposition2/1_cs_curriculum/acyclicity.cpp | #include <iostream>
#include <vector>
using std::vector;
using std::pair;
using namespace std;
enum { UNVISITED = -1, EXPLORED = -2, VISITED = -3 }; // three flags
vector<int> dfs_num;
vector<int> dfs_parent;
bool flag = false;
bool cycleCheck(int u, vector<vector<int> > &adj) { // check edge properties
... | ALGO | 0.999987 | 5.30412 |
b6f978e7-ae85-4bd0-9386-f14f792a733c | AGistinger/Udemy_Beginning_CPP_Programming | STLMapsChallenge/main.cpp | //The Standard Template Library (STL) - Associative Containers - Maps
#include <iostream>
#include <fstream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <iomanip>
using namespace std;
/*
* Used for Part 1
* Display the word and count from the map<string, int>
* */
void display_words... | TOOL | 0.889002 | 5.162764 |
ff859038-0f1d-43dc-b3a5-126b568de2bf | tuan-bug/UDTT_CNTT | merga.cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.999866 | 4.632236 |
2318f035-34b0-46f4-a818-b5491d52eb37 | Chet8n/InterviewPrep | 11.Hashing 1/Longest Consecutive Sequence.cpp | /*
Longest Consecutive Sequence
Problem Description
Given an unsorted integer array A of size N.
Find the length of the longest set of consecutive elements from the array A.
Problem Constraints
1 <= N <= 106
-106 <= A[i] <= 106
Input Format
First argument is an integer array A of size N.
Output Format
Return an i... | ALGO | 0.999931 | 5.276462 |
06d28423-22a7-4eff-850f-5b240e4e1c18 | Lovedonarvenu/CSA0270-c-program | ASSIGNMENT 2-Q2.cpp | #include <stdio.h>
int main ()
{
int n = 0, i = 0, largest1 = 0, largest2 = 0, temp = 0;
printf ("Enter the size of the array\n");
scanf ("%d", &n);
int array[n];
printf ("Enter the elements\n");
for (i = 0; i < n; i++)
{
scanf ("%d", &array[i]);
}
printf ("The array elem... | ALGO | 0.999975 | 3.268998 |
3d715dc4-ac01-46a7-bb36-48f716df9692 | 95Weihe/leetcode | c++/399.cpp | class Solution {
public:
vector<double> calcEquation(vector<vector<string>>& equations, vector<double>& values, vector<vector<string>>& queries) {
vector<double> res;
unordered_set<string> ver;
map<string,vector<pair<string,double>>> G;
map<string,bool> visit;
//建图
fo... | ALGO | 0.999978 | 6.230041 |
6f6f5be5-df11-4b75-af3f-a1081bf5add3 | ashriva16/granular-force-chains | LSDEM/LSDEM2D/eigen-3.3.7/doc/examples/QuickStart_example2_dynamic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXd m = MatrixXd::Random(3,3);
m = (m + MatrixXd::Constant(3,3,1.2)) * 50;
cout << "m =" << endl << m << endl;
VectorXd v(3);
v << 1, 2, 3;
cout << "m * v =" << endl << m * v << endl;
}
| ALGO | 0.999296 | 3.497552 |
37601603-bce3-40b5-ac98-b5e41b786bdc | TriNguyenThanh/DSA | stack/bai9.cpp | #include <iostream>
#include <stack>
using namespace std;
int size(stack<int> s){
int last = s.top();
s.pop();
int n, count = 0;
if (last < s.top()) return 1;
while(s.empty()){
n = s.top();
if (last >= n) count++;
else return count;
}
}
int main(){
stack<int> s;
... | ALGO | 0.999896 | 4.248995 |
dffb9c6d-62d8-4b5b-abab-c9dd2c3bf3c6 | toufu-24/AtCoder | MCC/2024_06_11/3.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define all(v) v.begin(), v.end()
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort(v.rbegin(), v.rend())
#define REVERSE(v) reverse(v.begin(), v.end())
#define ll long
#define ld long double
#define int ll
vec... | ALGO | 0.999117 | 4.902839 |
974c0cdb-f1d4-4e87-824a-09fc4ec04a55 | Hashcode/platform_external_opencore | codecs_v2/video/m4v_h263/dec/src/idct.cpp | /*
------------------------------------------------------------------------------
MODULE DESCRIPTION
This file contains the functions that transform an 8r8 image block from
dequantized DCT coefficients to spatial domain pirel values by calculating
inverse discrete cosine transform (IDCT).
------------------------... | ALGO | 0.998953 | 4.639013 |
bd702df4-8ca8-4bd1-ac45-23629152ccf2 | Claire-YC/CppNotes | Tree/buildTree.cpp | #include <iostream>
#include <queue>
#include <vector>
#include "buildTree.h"
#include "general.h"
template <typename T>
TreeNode<T>* AddNode(TreeNode<T>* root, T value, std::queue<TreeNode<T>*>& que)
{
TreeNode<T>* newNode = new TreeNode<T>(value);
if (root == nullptr)
root = newNode;
else if (!(... | ALGO | 0.999587 | 4.642674 |
85d709e7-32ac-46b5-86a7-832b10012de2 | arlene-s/NetBeans_Projects | RomanNumerals/main.cpp | /*
* File: main.cpp
* Author: Dr. Mark E. Lehr
* Purpose: Arabic Number to Roman Numerals
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants - No Global Variables
//Only Universal Constants, Math, Physics, Conversions, Higher Dimensions
//Function Prototypes
... | ALGO | 0.982599 | 4.079454 |
f53ed8e0-562d-4444-992d-6723ca3c3191 | UriKialy/OS3 | q6/graph_server_reactor.cpp | // graph_server_reactor.cpp
#include "reactor.hpp"
#include <iostream>
#include <vector>
#include <list>
#include <functional>
#include <algorithm>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <cstring>
#include <sstream>
#include <csignal>
using namespace std;
// Global variables for ... | ALGO | 0.988592 | 6.895738 |
73d76b6e-d9e4-4cdb-970e-0a0354941bb6 | Benefactor131/Object-Oriented-Programming | WS01/lab/w1p1.cpp | // Workshop 1:
// Version: 1.0
// fixed bug for deleting the first item.
// this fix did not effect submission results
// Date: 2021/10/16
// Author: Fardad Soleimanloo
// Description:
// w1p1.cpp
//Student Name: Bair Suimaliev
//Student ID: 159350198
//I have done all the coding by myself and only copied the code... | TOOL | 0.949162 | 5.030684 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.