uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
8b785e6c-0954-4f2e-9af9-3b1135d80c71 | pranaypourkar/Numerical_Linear_Algebra | inverse_by_gauss_jordan_elimination.cpp | #include<iostream>
#include<math.h>
#define N 3
using namespace std;
int main()
{
int i,j,k,p;
float q,r;
float c,sum=0;
//Augmented matrix A|I
float A[N][N+N] = { {5,7,9,1,0,0 },
{ 4,3,8,0,1,0},
{ 7,5,6,0,0,1} };
float A_inverse[N][N];
... | ALGO | 0.999847 | 3.076012 |
98d1aac7-8562-41fd-a5b8-cf3b4c361831 | OneUpWallStreet/Data-Structrues-And-Algorithms | 74. Search a 2D Matrix.cpp | #include<vector>
#include<iostream>
using namespace std;
class Solution {
public:
bool binarySearch(vector<int> nums, int left,int right,int target){
if(left<=right){
int mid = left + (right - left)/2;
if(nums[mid] == target){
return true... | ALGO | 0.999935 | 5.908589 |
e2e1c10b-98e0-40fa-928b-97d6491497ea | lgds/TwoChNRG | src/OneChQS/OneChQS_old.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <vector>
#include <cmath>
#include <cstring>
#include <unistd.h>
#include "NRGclasses.hpp"
#include "NRGfunctions.hpp"
#include... | ALGO | 0.993891 | 3.659714 |
f9b8defb-1054-4b7e-b0c8-f4d42a215dbb | Alice87877/Zerojudge-cpp | e465.cpp | //https://zerojudge.tw/ShowProblem?problemid=e465
#include<bits/stdc++.h>
using namespace std;
int main(){
int m,s,n,tt=0;
cin>>m>>s>>n;
vector<int> x(n),dp(m+1,0);
for(int i=0;i<n;i++){
cin>>x[i];
tt+=x[i];
}
dp[0]=1;
for(int i=0;i<n;i++){
for(int j=m;j>=x[i];j--){
... | ALGO | 0.999975 | 3.758306 |
2a7d3971-4f1f-47f2-8088-5618c090f6fb | ishansharma8/Leetcode-solutions | 524-longest-word-in-dictionary-through-deleting/524-longest-word-in-dictionary-through-deleting.cpp | class Solution {
public:
string findLongestWord(string s, vector<string>& dictionary) {
string ans="";
for(int d=0;d<dictionary.size();d++){
string temp=dictionary[d];
int i=0;
int j=0;
while(i<s.size() && j<temp.size()){
... | ALGO | 0.999879 | 5.818628 |
fff9f61b-eb29-4a37-8187-e6a65502de47 | dddExperiments/V3DSfMToolkit | CycleInference/verify_EG_edges/src/verify_EG_edges.cpp | #include "reconstruction_common.h"
#include "cycle_inference.h"
#include "inference_common.h"
#include <iostream>
#include <sstream>
#include "Base/v3d_cfgfile.h"
#include "Base/v3d_storage.h"
#include "Math/v3d_mathutilities.h"
using namespace std;
using namespace V3D;
namespace
{
template <typename Mat>
in... | ALGO | 0.998803 | 4.321188 |
cc358c9d-f22f-4462-8429-fc34544f4840 | Italia2407/Mackerel-Engine | Mackerel-Core/ext/Eigen 3.4.0/bench/benchVecAdd.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
#ifndef SIZE
#define SIZE 50
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef float Scalar;
__attribute__ ((noinline)) void benchVec(Scalar* a, Scalar* b, Scalar* c, int size);
__attribute__ ((noinline)) void be... | TOOL | 0.895145 | 5.111393 |
e0c85409-9242-433c-9ce0-18f577153d20 | 2400770262/minioo | deps/common/os/path.cpp | //
// Created by Longda on 2010
//
#include <dirent.h>
#include <regex.h>
#include <string.h>
#include <sys/stat.h>
#include "common/defs.h"
#include "common/log/log.h"
#include "common/os/path.h"
#include "common/lang/string.h"
#include "common/lang/vector.h"
namespace common {
string getFileName(const string &full... | TOOL | 0.864259 | 5.45015 |
48d5062e-0934-4c68-bea6-e1efc4bf7bee | Quynh181226/Ctdl-gt_Ptit | DSA_RA/PTIT_CNTT2_IT201_Ss01/Ex5.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void print(vector<int> &a) {
for (int s: a) {
cout << s << " ";
}
cout<<"\n";
}
// Time: Bubble_sort2: O(n^2)
// Space: O(n)
void sort(vector<int> &a) {
for (int i = 0; i < a.size() - 1; i++) {
for (int j =... | ALGO | 0.999853 | 5.184752 |
1b57e027-f387-4865-8c2b-7e4a36004d82 | mruegenberg/houdini-transform-matcher | eigen/doc/examples/tut_matrix_resize.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,5);
m.resize(4,3);
std::cout << "The matrix m is of size "
<< m.rows() << "x" << m.cols() << std::endl;
std::cout << "It has " << m.size() << " coefficients" << std::endl;
VectorXd v(2);
v.resize(5);
... | ALGO | 0.970154 | 3.894544 |
66915e6f-b5da-4381-b8d4-ea0c119716bf | AkshatAggarwal14/Competitive-Programming | CodeForces/546/c.cpp | #ifndef ONLINE_JUDGE
#include "Akshat.hpp"
#else
#include "bits/stdc++.h"
using namespace std;
#define dbg(...)
#define debug(...)
#endif
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using o_set = tree<T, null_type, less<T>, rb_tree_tag... | ALGO | 0.999913 | 4.153929 |
6191ad56-b896-45d9-bdf4-32beb3b87dac | Shivmasaurr/DsaSolutions | 75-sort-colors/sort-colors.cpp | class Solution {
public:
void sortColors(vector<int>& nums) {
int count0 = 0, count1 = 0, count2 = 0;
for (int num : nums) {
if (num == 0) count0++;
else if (num == 1) count1++;
else count2++;
}
int index = 0;
for (int i = 0; i < count0; ... | ALGO | 0.999911 | 6.109221 |
2f3a5694-0ab7-4142-b33b-f67fc571e061 | DyhaCreator/programming_tasks | CodeForcesRound/926/c.cpp | #include <iostream>
#define ll long long
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
int k, x, a;
cin >> k >> x >> a;
if (k * (a - x) > a) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
... | ALGO | 0.994362 | 3.635522 |
81768a4c-de9a-4c3a-91d1-82bb910f8ff5 | ReidBix/C | CS2150/binarysearchtree.cpp | /*
* Reid Bixler
* rmb3yz
* October 7, 2014
* CS 2150 In-Lab binarysearchtree.cpp
*/
/* binarysearchtree.cpp: method implementations for binary search tree */
#include "binarysearchtree.h"
/**
* Implements an unbalanced binary search tree.
* Note that all "matching" is based on the < method.
*/
/**
* Construct... | ALGO | 0.999642 | 6.22015 |
9a7c0616-6a22-48c2-bd2b-7bfa6e7e9972 | MelasMalephar/DSA | number-of-recent-calls/number-of-recent-calls.cpp | class RecentCounter {
public:
vector<int> m;
int ping(int t) {
m.push_back(t);
auto i =lower_bound(m.begin(),m.end(),t-3000)-m.begin();
return m.size()-i;
}
};
/**
* Your RecentCounter object will be instantiated and called as such:
* RecentCounter* obj = new RecentCounter();... | ALGO | 0.994411 | 6.540548 |
d49f249b-3bec-4bc1-bfd4-5afa6ed86f0a | Tushar-exe/Cpp-codes | passbyreference.cpp | #include<iostream>
using namespace std;
void swap (int&, int&);
int main()
{
int a,b;
cout<<"Enter values";
cin>>a>>b;
cout<<"values before swappng:"<<a<<b<<endl;
swap(a,b);
cout<<"after swapping values of a and b"<<a<<b<<endl;
}
void swap(int&p,int&q)
{
int temp;
temp=p;
p=q;
q=temp;
cout<<"after s... | ALGO | 0.999371 | 3.883513 |
0ac8ac01-efb2-4e90-89ce-ad3b8d5405a3 | BruhNav/PracticeCodes | cpp programs/DSA/CheckIfKBitSet.cpp | #include<bits/stdc++.h>
using namespace std;
//method 1
void kthbit(int n,int k){
if(n&(1<<(k-1))) cout<<"yes"<<endl;
else cout<<"no"<<endl;
}
//method 2
void kthbit2(int n,int k){
if(n>>(k-1)&1) cout<<"yes";
else cout<<"No";
}
int main(){
int n;cout<<"N: ";cin>>n;int k;cout<<"K: ";cin>>k;... | ALGO | 0.99977 | 3.855258 |
e3f98146-2574-4921-94b8-f3287e9bd1a2 | PSS1998/OpenMP-parallelism | exer04_2/main.cpp | // Example Chapter 3 OpenMP Program
#include <stdio.h>
#include <math.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <omp.h>
double timeGetTime()
{
struct timeval time;
struct timezone zone;
gettimeofday(&time, &zone);
return time.tv_sec + time.tv_usec*1e-6;
}
const long int ... | ALGO | 0.972503 | 4.234661 |
a4888ce2-4ce2-41de-b824-78277da8f645 | ruved/180DaysProblemSolving | 330-patching-array/patching-array.cpp | class Solution {
public:
int minPatches(vector<int>& nums, int n) {
ios_base::sync_with_stdio(0);
long long int currentSum = 1;
int patches = 0, index = 0;
while (currentSum <= n)
{
if (index < nums.size() && nums[index] <= currentSum)
... | ALGO | 0.999829 | 6.435701 |
e3cf66ad-05d6-419f-a902-ccbd434f3c72 | junghyun21/coding-test | 프로그래머스/2/12902. 3 x n 타일링/3 x n 타일링.cpp | #include <vector>
using namespace std;
const int MOD = 1000000007;
int solution(int n) {
int answer = 0;
vector<long long> dp(n + 1);
dp[0] = 1;
dp[2] = 3;
if(n % 2 == 0) {
for(int i = 4; i <= n; i += 2) {
// dp[i] = ((dp[i - 2] * 3) + (dp[i - 4] * 2) + (dp[i - 2] - ... | ALGO | 0.999983 | 4.901577 |
fe3258b2-c5c1-43bc-9c5c-ed137a35a154 | rluk001/rshell | src/new.cpp | #include <cstring>
#include <iostream>
#include <string>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <pwd.h>
#include <vector>
#include <signal.h>
using namespace std;
//... | TOOL | 0.893802 | 3.319981 |
e5fbdccf-c3a4-45e3-b327-1650decd50b2 | PriyanshuSharma0326/a2z-dsa-sheet | Basic Recursion/PrintLinearlyNTo1.cpp | #include <bits/stdc++.h>
using namespace std;
void print(int i, int n) {
if(i < 1) return;
cout << i << endl;
print(i - 1, n);
}
int main() {
int limit = 5;
print(limit, limit);
return 0;
}
| ALGO | 0.999478 | 4.201272 |
3b9fc9b3-a440-4856-987b-f07123173732 | dlwogns/PS | ~2024/5615.cpp | #include <iostream>
using namespace std;
#define ll unsigned long long
ll N, ans;
int a_param[5] = {2, 3, 5, 7, 11};
ll power(ll x, ll y, ll mod) {
ll result = 1;
x %= mod;
while(y) {
if(y%2) result = (result*x)%mod;
y/=2;
x = (x*x)%mod;
}
return result;
}
bool miller(ll n, ... | ALGO | 0.999647 | 3.995702 |
2fed71c8-8875-4562-abb7-98df77ba9572 | rupak26/Codeforces | C_Particles.cpp | #include <bits/stdc++.h>
#define FastIO \
ios_base::sync_with_stdio(false); \
cin.tie(0);
#define pb push_back
#define all(x) (x).begin(), (x).end()
using ll = long long;
inline ll vin()
{
ll x;
std::cin >> x;
return x;
}
using namespace std;
void solve()
{
ll n;
cin >... | ALGO | 0.999947 | 5.482925 |
1d0c2f1f-4fa3-4011-9b96-b31308730051 | ishefalichopra/CPP | basic/006_printnorecursively.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void PrintNos(int n)
{
if(n>0){ PrintNos(n - 1);
cout << n << " " << endl;}
return;
}
int main()
{
int n;
cin >> n;
PrintNos(n);
return 0;
} | ALGO | 0.99907 | 3.932086 |
dcc21615-a29d-414d-ad41-9b0e4a3125d4 | vitorguidi/Competitive-Programming | judges/spoj/rmqsq.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define ms(x,i) memset(x,i,sizeof(x))
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begi... | ALGO | 0.999942 | 4.263329 |
d6da238f-6b40-45ef-b9f0-b192e248a20d | kyx0r/VEther | bullet3/BulletCollision/Gimpact/gim_box_set.cpp | #include "gim_box_set.h"
GUINT GIM_BOX_TREE::_calc_splitting_axis(
gim_array<GIM_AABB_DATA>& primitive_boxes, GUINT startIndex, GUINT endIndex)
{
GUINT i;
btVector3 means(btScalar(0.), btScalar(0.), btScalar(0.));
btVector3 variance(btScalar(0.), btScalar(0.), btScalar(0.));
GUINT numIndices = endIndex - star... | ALGO | 0.999913 | 6.418659 |
1df668d4-c105-4a55-9414-4353ebfd33bc | JuanManuelB001/c- | c++Programas/Automata.cpp | #include <iostream>
#include <cstdlib>
#include <cctype>
using namespace std;
/**tipo enumerado es una constante**/
enum class Estado{Inicio,q1,q2,Entero,Real,no_reconocido};
//fuertemente tipado
Estado reconocerNumero(const string& inputString );//solo se pasa por referencia
//paso por referencia
int main(){
cou... | TOOL | 0.987183 | 3.591333 |
7cdaa088-65d2-4f5e-b81a-7b0e3b0d3bf2 | monerov/monerov | tests/core_tests/chain_split_1.cpp | #include "chaingen.h"
#include "chain_split_1.h"
using namespace std;
using namespace epee;
using namespace cryptonote;
gen_simple_chain_split_1::gen_simple_chain_split_1()
{
REGISTER_CALLBACK("check_split_not_switched", gen_simple_chain_split_1::check_split_not_switched);
REGISTER_CALLBACK("check_split_not_swit... | TEST | 0.911628 | 3.776177 |
5d451adb-2cbb-48e0-8322-9fb573a81cc2 | Minhaj-Mahim/Simple_Form_by_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.9988 | 6.76073 |
681814cf-f1f4-43f5-85c4-7b32ea2bf44e | kashcointech/kashcoin | src/crypto/scrypt.cpp | #include "crypto/scrypt.h"
//#include "util.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <openssl/sha.h>
#if defined(USE_SSE2) && !defined(USE_SSE2_ALWAYS)
#ifdef _MSC_VER
// MSVC 64bit is unable to use inline asm
#include <intrin.h>
#else
// GCC Linux or i686-w64-mingw32
#include <cpuid.h>
... | ALGO | 0.985498 | 4.554567 |
78cc96cb-582a-4d44-b110-6b7b96fccb23 | cycles2022/cc | networkit/cpp/cycles/ChordlessCyclesUno3.cpp | // no-networkit-format
#include "networkit/cycles/ChordlessCyclesUno3.hpp"
namespace NetworKit {
using paths = std::vector<node>;
void ChordlessCyclesUno3::reset() {
hasRun = false;
result.clear();
G_copy = Graph(*G);
num_tree_nodes = 0;
num_leafs = 0;
}
void ChordlessCyclesUno3::allChordlessP... | ALGO | 0.99289 | 7.441889 |
9099c6f5-2c71-4b18-bca8-5d20f5014831 | Avish04/C--Progarmming | 14.Queue/queue.cpp | #include<iostream>
#include<queue>
using namespace std;
int main() {
cout << (-1)%1<< endl;
deque<int> d;
d.push_front(12);
d.push_back(14);
cout << d.front() << endl;
cout << d.back() << endl;
d.pop_front();
cout << d.front() << endl;
cout << d.back() << endl;
d.pop_bac... | TOOL | 0.962763 | 3.498233 |
95abae70-67b1-460e-b9bc-b9eaa3680cd5 | ishandutta2007/codeforces | antontrygubo_o/normal/920/B.cpp | #include<bits/stdc++.h>
using namespace std;
struct student
{
int l;
int r;
int idx;
};
bool sortstudent(student a, student b)
{
if (a.l==b.l) return a.idx<b.idx;
return (a.l<b.l);
}
int main()
{
int t;
cin>>t;
for (int h = 0; h<t; h++)
{
int n;
cin>>n;
student a[n];
for (int i = ... | ALGO | 0.999991 | 4.179538 |
d8d69182-8dcd-43ac-b0ec-1d92b25e205d | suhas4122/Competitive-Programming | AtCoder DP Series/F_-_LCS.cpp | #include <bits/stdc++.h>
using namespace std;
string to_string(string s) { return '"' + s + '"'; }
string to_string(char s) { return string(1, s); }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A>
string to_string(A);
te... | ALGO | 0.999991 | 5.150656 |
dcdc3406-4053-4564-b5c2-b45a8b38c433 | PhilipLin0211/NTUT-Programming-Lesson-1 | Homework 3/3-2/fibonacci/新文件2.cpp | #include <stdio.h>
int main()
{
unsigned int i;
unsigned long long int j;
float a[200];
a[0] = 0;
a[1] = 1;
//JnXƶq
printf("пJƦr0~186: ");
scanf("%d", &i);
//U@ƭȬe2M
//M@Ӥ@Ӧsia[j]̭
for(j = 2; j <= i; j++)
a[j] = a[j - 1] + a[j - 2];
//N}CC@LX
for(j = 0; j <= i; ... | ALGO | 0.999855 | 3.179124 |
b3a2296b-d8e1-4385-8236-f8f25fc10cb7 | guori12321/leetcode | Search_a_2D_Matrix.cpp | class Solution {
public:
int t = 0;
bool DFS(int rowl, int rowr, int l, int r, vector<vector<int>> &matrix)
{
if (rowl > rowr || l > r || rowl > matrix.size()-1 || rowr < 0 || l > matrix[0].size() -1|| r < 0)
return false;
if (rowl == rowr && l == r)
if (matrix[rowl... | ALGO | 0.999994 | 5.754152 |
bb9152d3-2861-4302-9a3e-7c976cbc004c | PJSliable/Algorithm_study | BOJ/Greedy/1931_회의실_배정.cpp | #include <bits/stdc++.h>
using namespace std;
int N, s, e, ret = 1;
vector<pair<int, int>> v;
void fastIO()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
int main(){
fastIO();
cin >> N;
for (int i = 0; i < N; i++){
cin >> s >> e;
v.push_back({s, e});
}
... | ALGO | 0.999955 | 4.543993 |
33cc9a0f-7cb7-460a-b206-49e9b0392595 | Kroenenn/ie0217 | Laboratorios/Laboratorio3/Libro.cpp | #include "Funciones.hpp"
#include <iostream>
void agregarLibro(Libro*& lista){ // Se usa una referencia a un puntero de Libro para poder modificar la lista de libros
Libro* nuevoLibro = new Libro; // Se asigna memoria dinámicamente para un nuevo libro, el new Libro asigna un libro en el heap y devuelve la direcció... | TOOL | 0.974662 | 4.501814 |
3f6b3c7e-40c4-45e2-acbb-3d69341345db | pranamibhatt/booksim | branches/age_based/src/allocators/separable_output_first.cpp | // $Id: separable_output_first.cpp 5188 2012-08-30 00:31:31Z dub $
// ----------------------------------------------------------------------
//
// SeparableOutputFirstAllocator: Separable Output-First Allocator
//
// ----------------------------------------------------------------------
#include "separable_output_fi... | ALGO | 0.982771 | 6.605954 |
54fe4d16-207c-464b-bd54-c79ea6766238 | NateWhitehead96/Template-v6 | include/GLM/test/gtx/gtx_simd_mat4.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... | TEST | 0.992812 | 6.515547 |
89f29e0d-b42e-4fda-ba7c-e891c5d3db08 | foxesknow/questions | cpp/367-ValidPerfectSqaure/main.cpp | #include <iostream>
class Solution
{
public:
bool isPerfectSquare(int num)
{
if(num == 0 || num == 1) return true;
long lower = 0;
long upper = num;
long last = -1;
while(true)
{
long mid = (lower + upper) / 2;
long squared = mid * mi... | ALGO | 0.999713 | 5.746447 |
7f6093e6-3171-468f-aecc-28afa5b57791 | buckle2000/love2d | src/libraries/Box2D/Collision/b2CollideEdge.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
// Compute contact points for edge versus circle.
// This accounts for edge connectivity.
void b2CollideEdgeAndCircle(b2Manifold*... | ALGO | 0.999736 | 7.537114 |
7df55272-eba2-424a-a35b-a2ccf2563ef5 | ishandutta2007/codeforces | krijgertje/normal/1569/B.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <list>
#include <cassert>
#include <climits>
#inclu... | ALGO | 0.999985 | 3.616139 |
0b35980d-0596-42d2-af20-23ddc0d5672b | SL3333PY/UVa | 10480_max flow.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int cost[55][55], flow[55][55], x[505], y[505];
int parent[55], a[55]; //the flow at each vertex
void max_flow(int s, int t)
{
queue<int> q;
memset(flow, 0, sizeof(flow));
//int mf = 0;
while (1) {
memset(a, 0, sizeof(a));
a[s] =... | ALGO | 0.999899 | 3.783024 |
436b796f-900f-4a3f-87cd-08bf664dbb8e | tattoosfour/mandelbulber | src/common_math.cpp | /*
* common_math.cpp
*
* Created on: 2010-01-23
* Author: krzysztof
*/
#include "common_math.h"
#include <cstdlib>
#ifdef __sgi
#include <stdlib.h>
#endif
//********** Random ******************************
int Random(int max)
{
#ifdef WIN32
return (rand()+rand()*32768) % (max + 1);
#else
return rand() % (... | ALGO | 0.987443 | 5.938272 |
fda24c65-a1b5-4eb2-a98e-35624f2f5705 | JoeDinn/ShreddedDocumentReconstrcution | initial_solution/initial_solution/LinearRegressionSimilarity.cpp | #include "stdafx.h"
#include "LinearRegressionSimilarity.h"
#define DEBUG
std::vector<double> LinearRegressionSimilarity::process(Fragment & left_image, Fragment & right_image)
{
//Combine images
int best_height = best_height_match(left_image, right_image);
Fragment combined_image{ combine(left_image,right_image,be... | ALGO | 0.967472 | 5.102607 |
69285f52-bd42-4c59-aa47-b252ea5aadf4 | Mu-Ahmad/CodeForces | CodeForces/GNU C++17/1624D | Palindromes Coloring/154138458.cpp | #include <bits/stdc++.h>
using namespace std;
void stale_flippant() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
int main()
{
stale_flippant();
int t; cin >> t;
while (t--)
{
int n, k; cin >> n ... | ALGO | 0.999922 | 4.158496 |
c4c87dfd-3035-40a3-a400-07fd389fbf64 | ismaelnaciri/world_timer_app_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 |
d23b9c13-b2da-4f16-b29b-b473c7e52c63 | Meghul/leetcode | 0283-move-zeroes/0283-move-zeroes.cpp | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int left=0;
for(int right=0;right<nums.size();right++){
if(nums[right]!=0){
swap(nums[left],nums[right]);
left++;
}
}
}
}; | ALGO | 0.999957 | 6.192279 |
6cfaba6f-828f-4868-910e-1bb7c46637d1 | AhmedMZaher/CP | G. Years .cpp | #include<set>
#include<map>
#include<list>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<complex>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<utility>
#include <functional>
#include<stdio.h>
#include<assert.h>
#includ... | ALGO | 0.99999 | 3.907274 |
1fd94648-5ca8-4baa-9660-b8a79e657b00 | UtkarshShukla-dev01/leet-code-solutions | 0112-path-sum/0112-path-sum.cpp | class Solution {
public:
bool hasPathSum(TreeNode* root, int targetSum) {
// Base case: if the tree is empty
if (!root) return false;
// If we reach a leaf node, check if the remaining sum equals the node's value
if (!root->left && !root->right) {
return targetSum == roo... | ALGO | 0.999964 | 7.261873 |
0344aec7-55b0-4a48-9e17-89360623da1d | zdkstr/codes_for_data_structures_and_algorithms | 【04】单链表_不带头结点/【应用】DeleteMIn.cpp | #include"head.h"
void DelMin(LinkList& L) {
if (L == NULL)
return;
if (L->next == NULL) {
LNode* q = L;
L = NULL;
free(q);
}
LNode* p, * pre, * premin, * pmin;
pre = L;p = L->next;premin = L;pmin = L->next;
while (p != NULL) {
if (p->data < pmin->data) {
pmin = p;
premin = pre;
}
pre = p;
p ... | ALGO | 0.999964 | 3.116697 |
480cb3c7-5452-4514-9dbd-64b8e755dff8 | bsttoken/bstproject | src/crypto/hmac_sha256.cpp | #include "crypto/hmac_sha256.h"
#include <string.h>
CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen)
{
unsigned char rkey[64];
if (keylen <= 64) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 64 - keylen);
} else {
CSHA256().Write(key, keylen).Finalize(rke... | ALGO | 0.985362 | 5.856034 |
fdc486d3-fa52-4bf2-a597-88397910387b | erresonj/blackjack | blackjack.cpp | //
// Created by erres on 2020-03-06.
//
#include "blackjack.h"
#include <random>
#include <chrono>
using namespace std;
//Card methods
Card::Card(enum card_rank rank, enum card_type type):rank(rank),type(type){}
int Card::getValue() const {
if(rank==JACK||rank==QUEEN||rank==KING)return 10;
return rank;
}
v... | ALGO | 0.956305 | 7.634679 |
e7d0c1ad-3342-4675-b063-f8ae8508620d | annshine-wu/Stanford-Summer-College | GrammarSolver/grammarsolver.cpp | // Submitted by: Justin Lee, Annshine Wu
// Assignment: Grammer Solver
// Grammer Solver takes in an input file with grammar rules, then reads it into a map.
// It utilizes the map (with rules) to generate a certain number of symbols and returns it in a vector.
#include "grammarsolver.h"
#include "map.h"
#include "str... | ALGO | 0.993164 | 4.782233 |
90602ff5-7d2c-48fc-96d3-b22a5fe95628 | kean0212/learning | reverseWordsInString.cpp | #include <string>
#include <iostream>
using namespace std;
class Solution {
void swapChars(string& str, size_t& start, size_t& end) {
while (start < end) {
swap(str[start++], str[end--]);
}
}
public:
void reverseWords(string &s) {
// find the last non-trailing character... | ALGO | 0.999966 | 6.257103 |
a3963fc6-1b03-4330-8094-967c226b7244 | Suraj-Dhankad2025/DSA-Problems-Leetcode | 1731-even-odd-tree/even-odd-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.999896 | 5.920432 |
16423787-bcd6-4815-a583-75f36d720e32 | bennettlindberg/2DGrapher | OldSource.cpp | // Old version of the Source.cpp file
//#include <SFML/Graphics.hpp>
//#include <vector>
//#include <string>
//#include <cmath>
//#include <iostream>
//
//// true cords = x and y cords in terms of the actual function values
//// pixel cords = x and y raster cords of the display pixel for each point
//double y_pixelToT... | TOOL | 0.917225 | 4.673016 |
1ed18bce-9d0c-417d-b5a6-8980bb95e4cf | ShaikRiyaz2003/Algorithms | triplet.cpp | // #include<bits/stdc++.h>
// using namespace std;
// void solve(vector<int>arr){
// int n=arr.size();
// int max1,max2,max3,min1,min2;
// max1=max2=max3=min1=min2=arr[0];
// for(int i=1;i<n;i++){
// if(max1<arr[i]){
// max3=max2;
// max2=max1;
// max1=arr[i];... | ALGO | 0.999957 | 3.825056 |
c0d87378-fedb-4253-9c51-e4cb2c97389b | iman41k/school228 | lab1.1.cpp | #include <iostream>
#include <vector>
#include <string>
#include <math.h>
using namespace std;
int main()
{
setlocale(LC_ALL,"Russian");
double x, y, r, phi; // задаем действительную часть к-ого ур-ния + переменные для рассчета формулы
cin >> x >> y;
int z, x1, y1; // переменные для рассчета формул... | ALGO | 0.997943 | 4.671075 |
f0ad2945-8a7f-404f-aee6-2d263e3169bd | ishandutta2007/codeforces | ivan100sic/normal/1496/C.cpp | // Retired?
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = long unsigned long;
using ld = double long;
template<class P, class T = ll>
T det(const P& a, const P& b, const P& c) {
return (a-b).template vp<T>(a-c);
}
template<class T>
T sgn(T x) {
return x < 0 ? -1 : !!x;
}
te... | ALGO | 0.999781 | 4.27914 |
af9fdb8c-4386-4309-a26e-27760618ae09 | transgwender/Advent_of_Code_2022 | day16.cpp |
using namespace std;
#include <iostream>
#include <string>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <vector>
#include <cmath>
#include "Helpers/HelperFunctions.h"
struct valve {
string name;
int rate;
vector<valve*> connections;
friend std::ostream& opera... | ALGO | 0.999117 | 6.289085 |
ef4d520c-3a5c-4e63-b4cf-a7128b4366c9 | jowonju/LeetCode | PeekingIterator.cpp | /*
* Below is the interface for Iterator, which is already defined for you.
* **DO NOT** modify the interface for Iterator.
*
* class Iterator {
* struct Data;
* Data* data;
* public:
* Iterator(const vector<int>& nums);
* Iterator(const Iterator& iter);
*
* // Returns the next element in the itera... | ALGO | 0.998869 | 6.085719 |
6337cfc7-85e7-486d-a5e5-93eb2eada613 | havadora/GAME1011_W2021_lab3_LeNguyeTruongHai | Main.cpp | #include <iostream>
#include "Vector.h"
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
const int Size = 10;
int find;
int num = 10;
SearchableVector<int> Array(Size);
SortableVector<int> Array1(Size);
srand((unsigned int)time(NULL));
for (int i = 0; i < Size; i++)
{
Array[i] = i*2;
... | ALGO | 0.997215 | 3.56165 |
a31cf3b4-bf84-4823-ab58-7d3fcc192be1 | gulshan4688/25_assignment_question | basics/ques23.cpp | #include <iostream>
#include <sstream>
using namespace std;
int main()
{
string binary = "1101";
int decimal = stoi(binary, 0, 2);
stringstream ss;
ss << hex << uppercase << decimal;
cout << "HexaDecimal value: " << ss.str();
return 0;
}
| ALGO | 0.900254 | 5.669773 |
783b1c55-bc0d-4741-bcdf-307d29e84080 | bartvbl/Radial-Intersection-Count-Image-reproduction | src/libSpinImage/lib/glm/test/core/core_func_matrix.cpp | #include <glm/matrix.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/ulp.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/gtc/constants.hpp>
#include <vector>
#include <ctime>
#include <cstdio>
using namespace glm;
int test_matrixCompMult()
{
int Error(0);
{
mat2 m(0, 1, 2, 3);
mat2 n = matrixC... | TEST | 0.928352 | 6.690315 |
07052f26-1ce8-4352-b7e8-7db7569aa10b | ChromesDuzez/GameOfFifteen | GameOfFifteen/libraries/boost_1_81_0/libs/math/tools/igamma_temme_large_coef.cpp | #include "mp_t.hpp"
#include <boost/math/special_functions/log1p.hpp>
#include <boost/math/special_functions/erf.hpp>
#include <boost/math/constants/constants.hpp>
#include <map>
#include <iostream>
#include <iomanip>
using namespace std;
using namespace boost::math;
//
// This program calculates the coefficients of ... | ALGO | 0.999219 | 4.484201 |
96f972e6-dd50-4db8-9520-d70fff529b3c | 46ra20/Programming | Data_Structure_And_Algoritham/Module_15/reverse_stack_recursion.cpp | #include <bits/stdc++.h>
using namespace std;
void reverse(stack<int> &st)
{
if (st.empty())
return;
int x = st.top();
st.pop();
reverse(st);
st.push(x);
// stack<int> c;
// while (!st.empty())
// {
// c.push(st.top());
// st.pop();
// }
// c.push(x);
... | ALGO | 0.999776 | 4.657055 |
bf7ddd1b-5a6a-4cab-a24c-6a8d01728ab6 | DaeunOh/ALGORITHM | BOJ/[BF, 9506] 약수들의 합.cpp | // 소요시간: 30분
// 실행시간: 888ms, 76ms
/*
시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 244 105 89 45.876%
문제
암호화 방식 중에는 소수를 이용하는 것들이 많다.
보통은 매우 큰 두 개의 소수를 선택하고, 두 소수를 곱한 값을 암호화에서의 키로 사용하고는 한다.
이러한 방법이 좋은 이유는 일반적으로 매우 큰 수를 소인수분해 하는 것이 어렵기 때문이다.
소수를 택할 때 큰 수를 택하면, 이 둘을 곱해서 얻어지는 키 값도 커지게 된다.
하지만 그 반대는 성립하지 않을 수도 있다. 즉, 키... | ALGO | 0.999846 | 5.473114 |
51278f88-4e00-4a1f-a3d6-855b452c1580 | rakeshda7/Projects | DebuggingMadeEasy/src/DebuggingMadeEasy.cpp | // For Trim
#include <algorithm>
#include <functional>
#include <cctype>
#include <locale>
// End For Trim
using namespace std;
//***********************//Trim Start******************************
// trim from start
static inline std::string <rim(std::string &s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(),... | TOOL | 0.9013 | 3.348515 |
532d88d3-de46-45a1-a75a-ee3e412e2551 | Thinklab-SJTU/ML4CO-Kit | ml4co_kit/solver/mis/kamis-source/extern/KaHIP/lib/tools/graph_extractor.cpp | /******************************************************************************
* graph_extractor.cpp
*
* Source of KaHIP -- Karlsruhe High Quality Partitioning.
*
*****************************************************************************/
#include <unordered_map>
#include "graph_extractor.h"
graph_extractor... | ALGO | 0.990014 | 3.724581 |
1ea376eb-7661-40f3-88a1-4e0e628e0e39 | Nidhideveloper/SDEchallenge-By-Nidhi | longestcommonprefix.cpp | #include <bits/stdc++.h>
string longestCommonPrefix(vector<string> &str, int n)
{
// Write your code here
string ans="";
sort(str.begin(), str.end());
string s1=str[0];
string s2=str[str.size()-1];
for(int i=0; i<min(s1.size(), s2.size()); i++){
if(s1[i]==s2[i]){
... | ALGO | 0.999925 | 4.876284 |
ca4953ef-968d-45e8-b177-0fc565179f2a | sizhewan/Data-Structure-Course | 队列.cpp | #include<iostream>
using namespace std;
#define max 10
typedef int atype;
struct node
{
atype data;
node* next;
};
class lin_queue
{
public:
node* front;
node* rear;
lin_queue();
void initial();
void destroy();
void enqueue(atype e);
void dequeue(atype& e);
int is_empty();
void gethead(atype &e);
void dis... | ALGO | 0.998261 | 3.359682 |
5e41d22c-68d5-4dba-bb47-011693b7c47b | Infinity164/cppFuncProjects | guess_the_number.cpp |
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
srand(time(NULL));
int player, computer, c_c, c_p;
c_c = 0, c_p = 0;
computer = 1 + rand() % 101;
cout << "Компьютер загадал число в диапазоне от 1 до 100" << endl;
for (int count = 0; ; ++count) {
cin >> player;
if (player < ... | ALGO | 0.999445 | 3.119856 |
6d6b33f2-6981-4547-8e77-b029ad98304a | crazy-kid/learning-boost | boost_1_88_0/libs/math/example/series.cpp | #include <boost/math/tools/series.hpp>
#include <boost/math/tools/assert.hpp>
#include <iostream>
#include <complex>
#include <cassert>
//[series_log1p
template <class T>
struct log1p_series
{
// we must define a result_type typedef:
typedef T result_type;
log1p_series(T x)
: k(0), m_mult(-x), m_prod(... | ALGO | 0.981779 | 4.053386 |
914902aa-1823-4cb1-a944-f52393334e08 | AlexeyKatkov/AIP-2-semestr | Неделя 5-6/задача 1/main.cpp | #include <iostream>
#include <cmath>
int main(){
// Вывести на экран Н строк из нулей, причем количество нулей в каждой строке равно номеру строки. Количество строк Н вводит пользователь
int n;
std::cin>>n;
std::cout<<std::endl;
for (int i =0;i<n;i++){
for (int i1 =0; i1 <=i;i1++){
... | ALGO | 0.999035 | 3.605133 |
259ef651-fcf9-419e-afae-713278efba67 | codacy-open-source-projects-scans/mesa | src/nouveau/codegen/nv50_ir_lowering_nv50.cpp | #include "nv50_ir.h"
#include "nv50_ir_build_util.h"
#include "nv50_ir_target_nv50.h"
#define NV50_SU_INFO_SIZE_X 0x00
#define NV50_SU_INFO_SIZE_Y 0x04
#define NV50_SU_INFO_SIZE_Z 0x08
#define NV50_SU_INFO_BSIZE 0x0c
#define NV50_SU_INFO_STRIDE_Y 0x10
#define NV50_SU_INFO_MS_X 0x18
#define NV50_SU_INFO_M... | ALGO | 0.906574 | 5.974535 |
4b09b719-f4e8-4649-95c8-510551377d1a | yukti-says/My_CPP_STL_Learnings | set.cpp | /*
do not hold same values(duplicate)
stores unique data
useed for finding elements
prints data into sorted order
*/
#include<iostream>
#include<set>
using namespace std;
int main()
{
set<int> s;
s.insert(78);
s.insert(2);
s.insert(11);
s.insert(188);
//printing the set
cout<<"set is: ";
... | ALGO | 0.959684 | 4.221427 |
741a7b8b-4695-4c08-96c9-fb41aa994507 | andres-dalisay/PrimeChecker-Distributed | PrimeChecker-Distributed/PrimeChecker-Server.cpp | // master_server.cpp
#include <iostream>
#include <winsock2.h>
#include <sstream>
#include <string>
#include <vector>
#include <thread>
#include <mutex>
#include <iomanip>
#pragma comment(lib, "ws2_32.lib")
#define USE_SLAVE true
#define THREAD_COUNT 16
#define MAX_BUFFER_SIZE 100000000
std::mutex mtx;
std::vector<i... | WEB | 0.990759 | 6.333154 |
416992ab-12f6-4daf-9639-8cf01f1615dc | riser44/Gem5_Thesaurus_Compression | src/systemc/tests/systemc/examples/trie/trie.cpp | #include <stdio.h>
#include "systemc.h"
SC_MODULE(lc)
{
sc_out<bool> DIN_rdy;
sc_in<bool> DIN_vld;
#define LOAD_ADDR 0
#define LOAD_DATA 1
#define LOOKUP 2 // really op(1) == 1 and op(0) - don't care
sc_in<sc_uint<2> > DIN_op;
sc_in<sc_uint<32> > DIN_data_in;
sc_in<bool> DOUT_rdy;
sc_out<bool> DOUT_vld;
... | ALGO | 0.999626 | 4.281518 |
b1b85e28-442b-4b06-baa0-05c10be25d5b | 244Walyson/Dam-TF-llama3.2 | contact_list/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.998387 | 6.76775 |
e75a7376-aefc-43b1-9c01-0fb87caafe36 | Orange-OpenSource/RAVENS | hugin/CLI/authentication.cpp | /**
* @author Emile-Hugo Spir
*/
#include <iostream>
#include <cstring>
#include <vector>
#include <sys/stat.h>
#include "../Scheduler/public_command.h"
#include "scheduler_cli.h"
#include <libhydrogen/hydrogen.h>
#include "../Scheduler/config.h"
#include <layout.h>
#include <crypto_utils.h>
#include <rapidjson/docu... | TOOL | 0.893532 | 5.097109 |
c25642f1-2143-4d50-91be-47ab3fb4617a | ishandutta2007/codeforces | dmga44/normal/1495/A.cpp | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops","omit-frame-pointer","inline")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,avx2,fma,tune=native")
#pragma GCC option("arch=native","no-zero-upper") //Enable AVX
#include <bits/stdc++.h>
#define db(x) cout << (x) << '\n';
#de... | ALGO | 0.999653 | 4.047218 |
c0e1c7dd-3bc5-49e9-8fdb-364e4327bc59 | ajmat6/DSA | L_Distribution_of_cookies.cpp | class Solution {
public:
int solve(vector<int>& cookies, vector<int>& v, int index)
{
// Base Case:
if(index == cookies.size())
{
int ans = 0;
for(auto a: v) ans = max(ans, a);
return ans;
}
int ans = INT_MAX;
for(int i=0; i<v.... | ALGO | 0.999857 | 5.31932 |
161927cd-ddb8-4f43-b304-bffcb3b92508 | chickenchobab/BOJ-problem-solving | 6_greedy/2217_로프.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int rope[100001];
int n;
void input(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
for (int i = 1; i <= n; i ++){
cin >> rope[i];
}
}
int main(){
input();
sort(rope + 1, rope + n + 1);
int ... | ALGO | 0.999756 | 3.900155 |
6b22166a-af38-4325-b017-0930adf3716a | JPomorski/MN-2025 | lab-01/main.cpp | #include <cmath>
#include <iostream>
#include <iomanip>
using namespace std;
double f(double x) {
return sqrt(pow(x, 2.0) + 1.0);
}
double g(double x) {
return pow(x, 2.0) / (sqrt(pow(x, 2.0) + 1.0) + 1.0);
}
bool epsilon_float(float e) {
return 1.0 == 1.0 + e;
}
bool epsilon_double(double e) {
ret... | ALGO | 0.970912 | 3.711331 |
0d3660b7-87de-4d48-b5f4-283c40a49b84 | Adwait-Borate/CodeForces | H_Peak_Productivity_Forces.cpp | //****ADWAIT PRASHANT BORATE****
#include "bits/stdc++.h"
#define ll long long
#define uint unsigned long long
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define Yes cout << "YES" << endl
#define No cout << "NO" << endl
#define fr(i,n) for(int i=0; i<(n); i++)
#defin... | ALGO | 0.999693 | 4.341585 |
e94ba647-f442-4625-a02e-735234073925 | ishandutta2007/codeforces | wangzhifang/normal/1704/C.cpp | #include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
constexpr int max_m=100000;
int a[max_m+1];
void test(){
int n,m;
scanf("%d%d",&n,&m);
for(int i=1; i<=m; ++i)
scanf("%d",a+i);
sort(a+1,a+m+1);
a[0]=a[m]-n;
for(int i=m; i; --i)
a[i]-=a[i-1]+... | ALGO | 0.999806 | 3.654568 |
bc355e48-2970-428b-a803-d758c4d4e12a | SinghRajan41/code | MY_CPP/segmentTree/noOfMinOnSegment.cpp | #include <iostream>
using namespace std;
int segTree[400005], count[400005], arr[100001];
pair<int, int> buildSegTree(int low, int high, int i);
pair<int, int> query(int l, int r, int low, int high, int i);
pair<int, int> set(int idx, int val, int low, int high, int i);
int M = 2000000000;
int main()
{
ios_base::syn... | ALGO | 0.999957 | 4.438098 |
e7553171-eb29-4c50-9e10-9b83356ea10a | Ch3chS/Taller_de_progracion | Tarea 1/src/Binary.cpp | #include <iostream>
#include <cmath>
#include "Binary.h"
Binary::Binary(){
}
string Binary::toBinary(int number){
string binary = "";
while (number > 0) {
binary = to_string(number % 2) + binary;
number = number / 2;
}
return binary;
}
int Binary::toDecimal(string binary){
in... | ALGO | 0.958243 | 5.08533 |
78676eab-5445-4c3a-813f-10a0a0aa36cc | daniel-ankit/Leetcode | 0382. Linked List Random Node.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
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) {}
};
struct TreeNode {
int val;
TreeNode *left;
... | ALGO | 0.992221 | 4.218618 |
d285a8bb-7e14-4bc0-b3f4-e2a28ebb51a7 | sungmen/Solve_Algorithms | Programmers/C++/신고_결과_받기.cpp | #include <string>
#include <vector>
#include <map>
#include <set>
#include <sstream>
using namespace std;
vector<string> split(string str) {
vector<string> res;
istringstream ss(str);
string token;
while (getline(ss, token, ' ')) {
res.push_back(token);
}
return res;
}
vector<int> soluti... | ALGO | 0.999736 | 5.360128 |
435447f2-e8ec-4ad7-8578-6a16cde3d6d1 | cbajs12/BOJ | automata/2592.cpp | #include <iostream>
using namespace std;
int main(void){
int t, total, temp, max;
int arr[10][2];
total = 0;
max = -1;
for(int i=0; i<10; ++i){
for(int j=0; j<2; ++j){
arr[i][j] = 0;
}
}
for(int i=0 ; i<10; ++i){
cin>>t;
total += t;
arr... | ALGO | 0.999698 | 3.554415 |
a93a0e5e-336a-4e8c-8463-bf71f899f69d | HowardDreemurr/pl-slam-compat | depends/opencv/samples/gpu/super_resolution.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <ctype.h>
#include "opencv2/core.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/superres.hpp"
#include "opencv2/superres/optical_flow.hpp"
#include "opencv2/opencv_modules.hpp"
u... | ALGO | 0.936182 | 6.075352 |
051419f6-825b-4770-a8a3-dd534a6c8c5a | cicuvc/LLVM-LA32R | libc/src/stdbit/stdc_trailing_ones_ul.cpp | #include "src/stdbit/stdc_trailing_ones_ul.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(unsigned, stdc_trailing_ones_ul, (unsigned long value)) {
return static_cast<unsigned>(cpp::countr_one(value... | TOOL | 0.953124 | 6.470302 |
1f5b3bc0-b5c9-413e-bfcb-df27a5f9c024 | idityaGE/DSA | 05. LinkedList/05. Hard problem LL/05. mergeKsortedList.cpp | #include <bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node *next;
Node(int val)
: data(val), next(nullptr) {}
Node(int val, Node *nextNode)
: data(val), next(nextNode) {}
};
void print(Node *head) {
if (head == nullptr) return;
Node *temp = head;
while (temp != nullp... | ALGO | 0.999985 | 5.650788 |
42b97edd-51e5-46bb-a6b7-34a15faf78e4 | MaggieLee01/Coding | Queue02_StackWithTwoQueues/StackWithTwoQueues.cpp | /*ʹöʵջв
push(x) --Ԫ x ջ
pop() --ƳջԪ
top() --ȡջԪ
empty() --ջǷΪ
https://leetcode-cn.com/problems/implement-stack-using-queues */
//Ҳһʵ֣Ԫѹβ
#include<queue>
using std::queue;
class MyStack {
private:
queue<int> first;
queue<int> second;
public:
/** Initialize your data structure here. */
MyStack() { }
/** Push... | ALGO | 0.994242 | 5.095514 |
a9a0ceb7-1362-4f4b-9e67-095625d8d034 | VedantParanjape/libcamera | src/ipa/raspberrypi/controller/rpi/sdn.cpp | #include <libcamera/base/log.h>
#include "../denoise_status.h"
#include "../noise_status.h"
#include "sdn.hpp"
using namespace RPiController;
using namespace libcamera;
LOG_DEFINE_CATEGORY(RPiSdn)
// Calculate settings for the spatial denoise block using the noise profile in
// the image metadata.
#define NAME "r... | TOOL | 0.979506 | 7.091952 |
b336e685-771e-4fdc-a138-c3c4ee1c9021 | OmarHafez1/Competitive_Programming_Solutions | codeforces.com/1647_C.cpp | /*
**
** author: Omar_Hafez
** created: 11 March 2022 (Friday) 5:17:42 PM
**
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexe... | ALGO | 0.999516 | 4.038626 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.