uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
47adfe98-6a91-4bfb-95ae-6d8348191e94 | 99monisha/90-DAYS-DSA-CHALLENGES | STRING/pro-3/ascii.cpp | /*Print ascii value of a character
a
The ASCII value of a is 97
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
char ch;
cin>>ch;
cout<<"The ASCII value of "<<ch<<" is "<<(int)ch;
return 0;
} | TOOL | 0.964899 | 3.576737 |
5aa6b787-9f50-491c-ad4d-7de523c92401 | Bikubisw/Coding | DATA STRUCTURES AND ALGORITHMS/split_array.cpp | #include<iostream>
using namespace std;
bool split_array_helper(int *arr,int n,int lsum,int rsum){
if(n==0){
return lsum==rsum;
}
if(arr[0]%5==0){
lsum=lsum+arr[0];
}
else if(arr[0]%3==0){
rsum=rsum+arr[0];
}
else{
return split_array_helper(arr+1,n-1,lsum+arr[0],rsum)||split_array_helper(arr+1,n-1,lsum,r... | ALGO | 0.999926 | 4.185604 |
49cddd35-e173-4b48-8a94-3be00ea74fce | Sanjoy23/Codes | B. Kalindrome Array.cpp | #include <bits/stdc++.h>
using namespace std;
int arr[200006];
int main()
{
int tc;
cin >> tc;
while(tc--)
{
int n;
cin >> n;
memset(arr, 0, sizeof(arr));
int c[200005] = {0};
for(int i = 0; i < n; i++)
{
cin >> arr[i];
c[arr[i]]++... | ALGO | 0.999744 | 4.122695 |
d9d5ad89-82dc-4317-ae24-2eeb33f8c40b | tail-yuan/Code | 贪心算法/最长递增子数组.cpp | //https://leetcode.cn/problems/longest-continuous-increasing-subsequence/
#include<iostream>
#include<vector>
using namespace std;
//ķʽʹ˫ָ,̶left,ƶright,ҵleftΪͷĵij,ȷҶ˵right-1
//Ȼʱ[right]<[left],ô[left+1,right-1]ֵ[right],̶,
//left,ڽһС,Կֱleft=right,rightλ,Ѱ,Ч.
//̰+˫ָ
class Solution
{
public:
int findLengthOfLCIS(vecto... | ALGO | 0.999995 | 5.412616 |
b544f43b-5b96-4a8d-b3a0-62c7edcb64d8 | ishandutta2007/codeforces | kubic/normal/744/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 35
#define M 200005
#define MOD1 1000000007
#define MOD2 1000000009
#define pb push_back
const int lim=1e5;mt19937 rand1(time(0));
int n,ans,len[N],s[N],P1[M],P2[M],hs1[N][M],hs2[N][M];char a[N][M];
int dfn[M],low[M],st[M],bl[M];vector<int> e[M];
int rdm(int l,int... | ALGO | 0.999986 | 3.965322 |
f38c62d3-92fd-41d0-9000-90a7012cb704 | sarvex/leetcode-matlab | solution/1700-1799/1745.Palindrome Partitioning IV/Solution.cpp | class Solution {
public:
bool checkPartitioning(string s) {
int n = s.size();
vector<vector<bool>> g(n, vector<bool>(n, true));
for (int i = n - 1; i >= 0; --i) {
for (int j = i + 1; j < n; ++j) {
g[i][j] = s[i] == s[j] && (i + 1 == j || g[i + 1][j - 1]);
... | ALGO | 0.999988 | 5.877634 |
dacc5818-3661-41d2-8e87-dec40749e6c7 | UnendingGlory/daily_leetcode | 贪心/划分字母区间.cpp | #include <../header.h>
// 每个字符最后出现的位置一定在片段中+贪心
class Solution {
public:
vector<int> partitionLabels(string S) {
// 保存S中每个字母的最后一位
// 由于每个字母在一个片段内只能出现一次,所以片段切分到endi
vector<int> ans;
unordered_map<char, int> last_ind;
for(int i = 0; i < S.size(); ++i) last_ind[S[i]] = i;
... | ALGO | 0.999886 | 5.546081 |
cb62411f-5363-4f4d-b21a-4df84e79b9db | akash-kumar-biswas/dsa-implementations | Graph/floyd-warshall-algorithm.cpp | #include<bits/stdc++.h>
using namespace std;
void floydWarshall(vector<vector<int>> &dist, int V){
for(int k = 0; k < V; k++){
for(int i = 0; i < V; i++){
for(int j = 0; j < V; j++){
if (dist[i][k] != INT_MAX && dist[k][j] != INT_MAX)
dist[i][j] = min(dist[i... | ALGO | 0.999995 | 4.465532 |
34d3987b-baf3-4022-82e6-8f1a764d3f91 | mozilla-services/services-central-legacy | rdf/base/src/nsCompositeDataSource.cpp | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
A simple composite data source implementation. A composit data
source is just a strategy for combining individual data sources into
a collective graph.
1) A composite data source holds a sequence of data sources. The set
... | TOOL | 0.876291 | 3.509561 |
573ec16e-7f4c-4c35-a902-037f709390c7 | vinaygautam93/DSA-Problem | 3683-find-the-lexicographically-largest-string-from-the-box-i/3683-find-the-lexicographically-largest-string-from-the-box-i.cpp | class Solution {
public:
int kt=0;
string answerString(string word, int numFriends) {
map<char , int > mp1;
int big = 0;
int n = word.length();
string maxString = "";
int N = word.size();
if(numFriends == 1) return word;
char c = *max_element(wo... | ALGO | 0.999979 | 5.614367 |
b8950f7f-1feb-4466-9d8d-9e1f98d035ca | t-whiteley/ucl_rocket | airbrakes/control_system/archive/Cpp_model/thirdparty/eigen-3.4.0/test/sparseLM.cpp | #include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template <typename Scalar>
struct sparseGaussianTest : SparseFunctor<Scalar, int>
{
typedef Matrix<Scalar,Dynamic,1> VectorType;
typedef SparseFunctor<Scalar,int> Base;
typedef typename Base::JacobianType JacobianT... | TEST | 0.981199 | 6.154785 |
878d0c31-4274-486c-b785-204ec51ff110 | shreyaschavhan/Hackerrank | Contests/Project Euler/Project-Euler-#6-sum-square-difference.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for(int a0 = 0; a0 < t; a0++){
long n;
cin >> n;
long long sum = (n*(n + 1))/2;
long long square = (n*(n+1)*(2*n+1))/6;;
cout << (sum*sum) - square << endl;
}
return 0;
}
| ALGO | 0.999909 | 4.296106 |
4ae7e647-ff0a-4347-9983-dcfcac83cb6d | syy94/RTinaWeek | src/main.cpp | #include <iostream>
#include <math.h>
#include "utility.hpp"
#include "vec3.hpp"
#include "ray.hpp"
#include "color.hpp"
#include "hittable_list.hpp"
#include "sphere.hpp"
#include "camera.hpp"
#include "material.hpp"
hittable_list random_scene() {
hittable_list world;
auto ground_material = make_shared<lam... | ALGO | 0.944518 | 6.212244 |
5e685229-16b8-44a4-bdf4-9a438e29c8e0 | Sharadhaanbu/DSA | Lab_04/ADTSLL.cpp | //to perform general operations on ADT singly linked list
#include <cstdio>
#include <iostream>
//creating class
class ADTSLL
{
private:
struct node
{
int data;
struct node* next;
};
struct node* head;
public:
ADTSLL();
int count();
... | ALGO | 0.999689 | 5.389045 |
4a40140e-aacf-4349-92a3-48dff3881a93 | ChromesDuzez/GameOfFifteen | GameOfFifteen/libraries/boost_1_81_0/libs/graph/example/adjacency_matrix.cpp | int main()
{
using namespace boost;
enum
{
A,
B,
C,
D,
E,
F,
N
};
const char* name = "ABCDEF";
// A directed graph
typedef adjacency_matrix< directedS > Graph;
Graph g(N);
add_edge(B, C, g);
add_edge(B, F, g);
add_edge... | ALGO | 0.978495 | 5.288374 |
599c8fe6-ea0f-457e-8bf1-9ff9ee9ac69b | Pranay-Kamble/GFG-DSA-Course | Arrays/reverseanarray.cpp | #include <iostream>
void reverse(int arr[], int size){
int index {size-1};
for(int i{}; i<size/2 ; ++i){
int copy {arr[i]};
arr[i] = arr[index-i];
arr[index-i] = copy;
}
}
int main(){
int arr[] {9,8,0,7,6,5,4,3,2,1};
reverse(arr,sizeof(arr)/sizeof(arr[0]));
for(in... | ALGO | 0.999442 | 5.001271 |
009b2d3f-5d22-4f14-ad03-a77f1854b55a | Moin2002-tech/FaceDetectionApp | Feature_Detection1/ImageIO/LstLandmarkFormatParser.cpp |
#include "LstLandmarkFormatParser.hpp"
#include "RectLandmark.hpp"
#include "boost/lexical_cast.hpp"
#include "boost/algorithm/string.hpp"
#include "boost/filesystem.hpp"
#include <stdexcept>
#include <utility>
#include <fstream>
using cv::Rect;
using boost::filesystem::path;
using std::map;
using std::getline;
usin... | TOOL | 0.85551 | 5.742535 |
e60bf29b-fda6-41b2-a7e5-69af9621af18 | NatanielEscudero/cpp | tp16(No Terminado).cpp | #include <iostream>
#include <string>
using namespace std;
string separarConCaracteres(string caracter, string cadena);
int main(){
string caracter,cadena;
cout<<"ingresa una cadena de caracteres"<<endl;
cin>>cadena;
cout<<"ingresa un caracter"<<endl;
cin>>caracter;
cout<<"la cantidad de letras en su cad... | ALGO | 0.997332 | 4.300458 |
4a6258ca-88fa-4531-a9a7-8d7215386f09 | aaryan-sharmaa/CPP-DSA | BinNumSystem.cpp | // Binary to Decimal Conversion
#include <iostream>
using namespace std;
void binToDec(int binNum)
{
int n = binNum;
int decNum = 0;
int pow = 1;
while (n > 0)
{
int lastDig = n % 10;
decNum += lastDig * pow;
pow = pow * 2;
n = n / 10;
}
cout << decNum << end... | ALGO | 0.999135 | 6.140558 |
f8aa20a1-a88b-4bdf-9deb-29114fc1dc14 | Mackenzie-98/Solutions | CCPL/2020/R4/e.cpp | /**
* @author: Mackenzie
**/
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_wi... | ALGO | 0.998799 | 3.787873 |
d29c73ff-80f0-4e93-ad67-dfe14eaca566 | Nirav1510/leetcode-2025 | Dynamic-Programming/DP-on-Knapsack/Unbounded-Knapsack/coinChange2.cpp | // https://leetcode.com/problems/coin-change-ii/
// ----- Recursion -----
int change(int amt, vector<int>& coins) {
if (amt == 0) return 1;
if (amt < 0) return 0;
int ans = 0;
for (int coin : coins) {
ans += change(amt - coin, coins);
}
return ans;
}
// ----- Memoization -----
int so... | ALGO | 0.999976 | 6.50272 |
8ba85697-e12b-4501-9d35-9406a6e17ff3 | suma01111/LeetCode | 3447-clear-digits/3447-clear-digits.cpp | class Solution {
public:
string clearDigits(string s) {
string res;
for(char c:s){
if(c>='0' and c<='9')
res.pop_back();
else
res.push_back(c);
}
return res;
}
};
| ALGO | 0.999131 | 5.615798 |
52a7a0a0-9171-4b6f-bcab-1dbc62137789 | Hurleyworks/LWPluginDev | modules/wabi_core/excludeFromBuild/math/Tri3Tri3Dist.cpp | // ctor
template <typename T>
Tri3Tri3Dist<T>::Tri3Tri3Dist (const Triangle3 <T> & triangle0, const Triangle3 <T> & triangle1)
:mTriangle0(&triangle0),
mTriangle1(&triangle1)
{
}
// dtor
template <typename T>
Tri3Tri3Dist<T>::~Tri3Tri3Dist ()
{
}
template<typename T>
T Tri3Tri3Dist<T>::GetSquared()
{
// Compare ... | ALGO | 0.999515 | 6.238111 |
dce2dfda-bc76-4c86-a6ef-56e98ee47b74 | hieu-ln/IT81-08 | Code 2/LanPhuong_C2_Bai3.cpp | #include <iostream>
using namespace std;
const int mx = 100;
int A[mx];
void Xuat(int A[mx], int size)
{
for (int i = 0; i < size; i++)
cout << A[i] << " ";
}
void Nhap(int A[mx], int size)
{
for (int i = 0; i < size; i++)
{
cout << "Nhap phan tu so " << i + 1 << ": " << endl;
cin >> A[i];
}
}
bool KTtang(... | TOOL | 0.998632 | 3.508545 |
239f04cc-7312-4867-bf1e-243080c1f0a1 | sjm150/ps | codeforces/rounds/1036/b.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
int t; cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (int &a: a) cin >> a;
cout << a[0] + min(a[0], a[1]) << '\n';
}
} | ALGO | 0.99965 | 4.124831 |
31937ee7-c999-4237-ade3-d136534e5918 | R2nin/projeto | c++/busca binaria.cpp | #include <iostream>
#include <algorithm>
using namespace std;
struct clientes {
int codigo;
char nome[30];
char endereco[35];
char cidade[25];
char uf[2];
};
void leitura (struct clientes cli[]){
for (int i = 0; i < 10; i++){
cout << "\n\nCodigo do Cliente " << (i+1) << ": ";
c... | TOOL | 0.946478 | 3.459733 |
72721a74-9575-4d2f-a12b-8c1700c3bf20 | kks227/BOJ | 1500/1500.cpp | #include <cstdio>
using namespace std;
int main(){
int S, K;
scanf("%d %d", &S, &K);
int p = S/K, q = S%K;
long long result = 1;
for(int i=0; i<K; i++)
result *= (i<K-q ? p : p+1);
printf("%lld\n", result);
} | ALGO | 0.999898 | 3.532725 |
48e445a0-cd95-4f3f-bd8c-0126ca135e3f | SakshamSahgal/Competitive-Programming | DSA/Searching/Binary_Search_Iterative.cpp | #include<iostream>
#include<cstring>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#include<climits>
#define lli long long int
#define GO_FAST ios_base::sync_with_stdio(0);ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
bool Binary_Search(int a[],int n,int x)
{
... | ALGO | 0.999977 | 4.274578 |
764856cc-05b1-4c4d-a9ae-00c220840667 | shagil77/DSA_Sheet_Solution | Tree_Based_Data_Structure/Tries/hotel_reviews.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node {
Node *links[26];
bool flag=false;
bool containsKey(char ch) {
return (links[ch-'a'] != NULL);
}
void put(char ch, Node *node) {
links[ch-'a']=node;
}
Node *get(char ch) {
return links[ch-'a'];
}
... | ALGO | 0.99983 | 4.186059 |
a747644a-9e68-4401-8b59-0062a7e7bc27 | ronick-grammer/Algorithm | etc/어느코테_Sxxx_01.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
vector<pair<int, int> > reservation; // pc 번호, 사용 시간
int pc[101]; // 각 pc 들의 최대 이익
int hoursPerPC[101]; // 각 pc 들이 사용된 시간
int main(void){
int pcs, users, hours; // pc 수, 예약자 수, 하루 운영 시간
cin >> pcs >> users >> ho... | ALGO | 0.999486 | 3.550342 |
f729c013-19c5-484a-8724-9d8124e0aa7c | Misash/Competitive-Programing-Training | UNSA-Contest/77.cpp | //
// Created by misash on 11/11/21.
//
#include <bits/stdc++.h>
using namespace std;
#define ll long long
vector<pair <int,int> > adj[50001];
int main()
{
int n,m;
scanf("%d %d",&n,&m);
for (int i=0;i<m;i++)
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
adj[a].push_back(make_pa... | ALGO | 0.999957 | 4.640201 |
457dd948-bef5-402d-a861-93fc167041f9 | Antzed/CS466-CHERI | contrib/llvm-project/llvm/utils/TableGen/SearchableTableEmitter.cpp | #include "Basic/CodeGenIntrinsics.h"
#include "Common/CodeGenTarget.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
#include <... | TOOL | 0.85942 | 4.080413 |
fd4104cf-fc7a-4420-9db1-d904fc738b03 | raincross7/code-similarity | codes/train_code/problem479/problem479_111.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
/*int recur(vector<vector<char>>& arr,vector<vector<int>>& dp,int i,int j)
{
if(i==arr.size() || j==arr[0].size())
return 0;
if(i==0 and j==0 and arr[i][j]=='#')
return 0;
if(dp[i][j]!=1)
return dp[i][j];
... | ALGO | 0.99998 | 4.063519 |
1d4b4c63-8529-4682-888b-46d817a54f4f | 9759176595/LeetCodeQuestion | Count Elements With Strictly Smaller and Greater Elements.cpp | class Solution {
public:
int countElements(vector<int>& num)
{
int count=0;
int t=num.size();
sort(num.begin(),num.end());
for(int i=1;i<t-1;i++)
{
int res1=*max_element(num.begin()+i, num.end());
int res2=*min_element(num.begin(),num.begin... | ALGO | 0.999906 | 5.10564 |
adcf8f84-b89f-450f-97b9-2e8401caf611 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4813_19.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int a, b, c;
cin >> a >> b >> c;
long long int min = 100000;
int A, B, C;
for (int i = 1; i <= 10000; i++) {
int temp = a - i;
if (temp < 0) temp = temp * (-1);
for (int j = i; j <= 1000... | ALGO | 0.99985 | 3.516298 |
de4e46b1-28b3-4f92-aa61-91d1b3e2e51b | pedrovalerolara/skokkos-pegasus | sKokkos/mini-apps/miniFE/openmp45/basic/BoxPartition.cpp |
#include <stdio.h>
#include <stdlib.h>
#include <Box.hpp>
#include <BoxPartition.hpp>
/*--------------------------------------------------------------------*/
static int box_map_local_entry( const Box& box ,
const int ghost ,
int local_x ,
... | ALGO | 0.998666 | 4.644406 |
0ed06d07-650c-424a-8217-7743e34b7cb2 | ishandutta2007/codeforces | gullesnuffs/normal/451/C.cpp | #include <bits/stdc++.h>
using namespace std;
bool solve(long long a, long long b, long long c, long long n, long long k){
long long g1=k-a-b-c;
if(g1 < 0)
g1=-g1;
if(g1%3)
return false;
long long Min=min(min(a, b), c);
if(a+b+c-3*Min > k)
return false;
long long need=max(max(a, b), c);
long long gamesLe... | ALGO | 0.999606 | 4.000924 |
0682e14f-27e7-4dee-9ca8-5d66931b576a | MilkClouds/Competitive-Programming | BOJ/milkclouds/01209/1209.cpp17.cpp | #include <bits/stdc++.h>
#define rep(a,b,c) for(ll a = b; a < c; a++)
#define rep2(a,b,c) for(ll a = c - 1; a >=b; a--)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define x first
#define y second
using namespace std;
using ll = long long;
using tl = tuple<ll, ll, ll, ll>;
using pl = pair<ll, l... | ALGO | 0.999908 | 3.756103 |
637466ac-709c-4610-a772-f477b8157a31 | sandipan-kundu1/Leetcode-Solutions | 502-ipo/ipo.cpp | class Solution {
public:
int findMaximizedCapital(int k, int w, vector<int>& profits,
vector<int>& capital) {
int n = profits.size();
std::vector<std::pair<int, int>> projects;
// Creating vector of pairs (capital, profits)
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999991 | 5.928272 |
b203a061-b998-4dd4-ab1e-8eca5ec2ba8c | InnoFang/algo-set | LeetCode/2490. Circular Sentence/solution.cpp | /**
* Runtime: 0 ms
* Memory Usage: 6.5 MB
*/
class Solution {
public:
bool isCircularSentence(string sentence) {
if (sentence.front() != sentence.back()) return false;
for (int i = 0; i < sentence.size(); ++ i) {
if (sentence[i] == ' ' && sentence[i - 1] != sentence[i + 1]) {
... | ALGO | 0.99991 | 5.718298 |
1f04124c-e5bf-4958-9dea-ac8b4e02e517 | reeyah/Leetcode | 1081-video-stitching/1081-video-stitching.cpp | class Solution {
public:
int videoStitching(vector<vector<int>>& clips, int time) {
vector<int>clipEnd(time+1, 0);
for(int i=0; i<clips.size(); i++) {
int start = clips[i][0];
int end = clips[i][1];
if(start>time)
continue;
clipEnd[star... | ALGO | 0.999977 | 5.979522 |
3263a660-3dc2-479f-a952-4bc0c37b327b | JoyKrishan/DevGPTIPlus | data/commits/CS472_Group1_sooble13_95/526f740/dev.cpp | std::vector<std::string> binTree::zigzagLeft(binTreeNode* r, std::vector<std::string>& path);
std::vector<std::string> binTree::zigzagRight(binTreeNode* r, std::vector<std::string>& path);
* zigzagLeft(): Performs a left zigzag traversal from the given node.
* parameters: binTreeNode* r - node to start the... | ALGO | 0.999878 | 4.576569 |
abd3affc-7a64-47ac-ae9d-98a953a4663e | nsehrt/raytracer | src/cube.cpp | #include "cube.h"
#include "ray.h"
std::vector<Intersection> Cube::localIntersect(const Ray& r)
{
auto xMax = checkAxis(r.origin.x, r.direction.x);
auto yMax = checkAxis(r.origin.y, r.direction.y);
auto zMax = checkAxis(r.origin.z, r.direction.z);
float tMin = std::max(xMax.first, std::max(yMax.first,... | TOOL | 0.995672 | 5.557709 |
37bc2bc0-bf82-435e-b2bf-d95de73dc514 | dracoooooo/Plume | Tools/Viper/resources/z3/src/sat/sat_probing.cpp | #include "sat/sat_probing.h"
#include "sat/sat_solver.h"
#include "sat/sat_elim_eqs.h"
#include "sat/sat_simplifier_params.hpp"
namespace sat {
probing::probing(solver & _s, params_ref const & p):
s(_s),
m_big(s.rand()) {
updt_params(p);
reset_statistics();
m_stopped_at = 0;... | ALGO | 0.999588 | 7.409848 |
4639d075-bbb4-4fb3-9930-3bf59dfb3c85 | duyanh020405/scdtss2 | bt6.cpp | #include <stdio.h>
void sapXepTangDan(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
}... | ALGO | 0.999883 | 3.78133 |
f79ecba3-134a-4aee-b83e-016ff5e00a23 | VHPL-UIS/LeetCode | 496.cpp | // 496. Next Greater Element I
// The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.
// You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2.
// For each 0 <= i < nums1.length, find the inde... | ALGO | 0.999905 | 6.08889 |
9be00204-28fa-477c-9edd-a8191c4065f2 | sarvex/leetcode-simula | solution/1800-1899/1868.Product of Two Run-Length Encoded Arrays/Solution.cpp | class Solution {
public:
vector<vector<int>> findRLEArray(vector<vector<int>>& encoded1, vector<vector<int>>& encoded2) {
vector<vector<int>> ans;
int j = 0;
for (auto& e : encoded1) {
int vi = e[0], fi = e[1];
while (fi) {
int f = min(fi, encoded2[j][... | ALGO | 0.999966 | 5.087219 |
31720e5a-b684-44be-a965-01bdadde4f0a | Antoine6quarts/re-beau | Eigen/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.998259 | 4.015535 |
75c5a345-323e-4e2d-a726-61fabc51fe83 | harshnadar/Leetcode-Problems | 2123-the-number-of-weak-characters-in-the-game/the-number-of-weak-characters-in-the-game.cpp | class Solution {
public:
static bool cmp(vector<int>& a, vector<int>& b){
if(a[0] == b[0]) return a[1]>b[1];
return a[0]<b[0];
}
int numberOfWeakCharacters(vector<vector<int>>& prop) {
int n = prop.size();
sort(prop.begin(), prop.end(), cmp);
int mx = -1;
int ... | ALGO | 0.99995 | 5.551163 |
699d481c-cd3a-4333-9018-af935af5a7de | BGMer7/LeetCode | 541. Reverse String II/reverseString.cpp | #include <string>
#include <algorithm>
using namespace std;
class Solution
{
public:
string reverseStr(string s, int k)
{
int n = s.length();
for (int i = 0; i < n; i += 2 * k)
reverse(s.begin() + i, s.begin() + min(i + k, n));
return s;
}
};
int main() {} | ALGO | 0.999846 | 5.704391 |
1ca2b0dc-74cf-41f7-8867-ada305fd3255 | mairohanhoon/CodeForces-Files | 1146_A_Loves_A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string str;
cin >> str;
int n = str.size();
int a = 0;
for(int i=0; i<n; i++){
if(str[i] == 'a') a++;
}
if(a > n/2){
cout << n << endl;
}
else{
cout << (2*a)-1 << endl;
}
return 0;
} | ALGO | 0.999591 | 3.055513 |
52c6a440-fc1a-4c32-80bf-5c6650b470e0 | jqczeng/CarND-Path-Planning-Project | src/Eigen-3.3/bench/quat_slerp.cpp | #include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Q>
EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
{
return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
}
template<typename Q>
EIGEN_DONT_INL... | ALGO | 0.993077 | 6.251058 |
1d80f2da-bbe6-4af0-9f0d-1976da154853 | azpeteryang/leetcode | Dynamic_Programming/1320.Minimum-Distance-to-Type-a-Word-Using-Two-Fingers/1320.Minimum-Distance-to-Type-a-Word-Using-Two-Fingers_v2.cpp | class Solution {
public:
int minimumDistance(string word)
{
int n = word.size();
auto dp = vector<vector<int>>(n,vector<int>(26,INT_MAX/2));
for (int i=0; i<26; i++)
dp[0][i] = 0;
for (int k=1; k<n; k++)
{
int... | ALGO | 0.999971 | 5.632464 |
afc63d40-a33d-4b43-9dd0-d66357e48cdc | funcorange/twhl-tower-source-public | src/tier1/snappy.cpp | #include "snappy.h"
#include "snappy-internal.h"
#include "snappy-sinksource.h"
#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>
#ifdef _WIN32
#pragma warning(disable:4018) // warning C4018: '<' : signed/unsigned mismatch
#pragma warning(disable:4389) // warning C4389: '==' : signed/unsign... | ALGO | 0.99597 | 3.507616 |
7ac5af4c-3d6e-458d-8578-f3a2694c8705 | Bartonzany/NCNN-Notes | src/layer/fold.cpp | #include "fold.h"
namespace ncnn {
Fold::Fold()
{
one_blob_only = true;
}
int Fold::load_param(const ParamDict& pd)
{
kernel_w = pd.get(1, 0);
kernel_h = pd.get(11, kernel_w);
dilation_w = pd.get(2, 1);
dilation_h = pd.get(12, dilation_w);
stride_w = pd.get(3, 1);
stride_h = pd.get(13, st... | ALGO | 0.941086 | 5.89213 |
f5097971-11a9-4598-ae6b-a17d33f89e95 | lianglllll/TinySTL | TinySTL/MyList.cpp | #pragma once
#include <iostream>
#include <vector>
using namespace std;
template<typename T>
class MyList {
public:
template<typename L>
friend std::ostream& operator<<(std::ostream& os, const MyList<L>& pt);
private:
struct Node {
T data;
Node* pre;
Node* next;
Node(const T& value,Node* preNode = nullpt... | TOOL | 0.991919 | 4.515331 |
8b7c4490-2648-492f-a69e-39c6c617a685 | sency90/boj | 2566.cpp | #include <stdio.h>
#include <queue>
using namespace std;
struct Room{
int v, x, y;
Room(int vv, int xx, int yy) {
v=vv; x=xx; y=yy;
}
bool operator<(const Room &rhs) const{
return v < rhs.v;
}
};
priority_queue<Room> mxh;
int main() {
int d;
for(int i=1; i<=9; i++) {
... | ALGO | 0.997415 | 3.486338 |
cfc97020-35f8-4d4b-8d38-5bc95037eeb2 | Shashank-3002/OOPS-cpp | Basics of cpp/Functions/functions.cpp | #include<iostream>
using namespace std;
int printhello(){
cout << "Hello World" << endl;
return 3; // Return 3 to indicate successful execution
}
int sum(int a, int b){
return a + b; // Return the sum of a and b
}
int min(int a, int b){
if(a<b){
return a; // Return a if it is less than b
... | ALGO | 0.989656 | 4.663256 |
ae76d938-a96f-4a88-8955-5340c8af1358 | ishandutta2007/codeforces | bohdanpastuschak/normal/894/A.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <map>
#include <iterator>
#include <functional>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <fstream>
#include <iomanip>
#include <numeric>
#include <cma... | ALGO | 0.992083 | 3.416511 |
9d6c993f-a9ba-4d54-99c0-33cda2e3e601 | Jguan10/CS-135 | HW/e7-16.cpp | /*
Author: Jiaxiong Guan
Course: CSCI-135
Instructor: Gennadiy Maryash
Assignment: HW E7.16
*/
#include <iostream>
#include <cmath>
using namespace std;
struct Point{
public:
double x,y;
};
double distance(Point a, Point b){
return sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2));
}
int main(){
Poi... | ALGO | 0.971102 | 4.635962 |
ae96972f-d0bd-4b2e-b6ca-6e4d14dc54a6 | JiHyeokHeo/cplusplus_study | C_Plusplus_Study/Pointer/Map.cpp | //#include <iostream>
//using namespace std;
//#include <vector>
//#include <map>
//// map
//
//class Player
//{
//public:
// Player()
// :_playerId(0)
// {
//
// }
//
// Player(int playerId)
// :_playerId(playerId)
// {
//
// }
//
//public:
// int _playerId;
//};
//
//int main()
//{
//#pragma region 츮 ( vector ... | TOOL | 0.940547 | 3.582532 |
df48f6d0-6bb9-42f8-9de3-333dbe89e891 | Adinath03/CPP | Codes/doubly_linkedlist.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node* next;
node* prev;
node(int val)
{
data = val;
next = NULL;
prev = NULL;
}
};
void insertathead(node* &head,int val)
{
node* n = new node(val);
n->next= head;
if (head!=... | ALGO | 0.99975 | 3.744437 |
812c14b9-9774-4105-a205-68ea9d3c5728 | Bren0Andrad3/programacao_competitiva | dividir-e-conquistar/index.cpp | // SortingAlgorithms.h
#ifndef SORTING_ALGORITHMS_H
#define SORTING_ALGORITHMS_H
#include <vector>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
void radixSort(std::vector<int>& arr);
void countingSort(std::vector<int>& arr);
void bucketSort(std::vector<int>& arr);
#endif // SORTING_AL... | ALGO | 0.999924 | 5.082213 |
4d99e0f4-a5ee-422f-8855-04cf93c75074 | Anik-Modak/CompetitiveProgramming | BAPS/Non Super Boring Substring.cpp | //Anik_Modak
#include<bits/stdc++.h>
using namespace std;
bool pallandrome(string s)
{
string a=s;
reverse(a.begin(),a.end());
if(a==s) return 0;
else return 1;
}
int main()
{
int t,ca;
cin>>t;
for(int ca=1; ca<=t; ca++)
{
int n,ans;
cin>>n;
getchar();
... | ALGO | 0.99962 | 4.516444 |
6b75170d-ff08-44db-9601-244d34d5bf0a | Juniorbasck/Atividade-de-sala | atv 01.06 ex 3/main.cpp | #include <iostream>
#include <locale>
using namespace std;
int main()
{
setlocale (LC_ALL, "Portuguese");
int i = 1;
while( i <= 1000)
{
if (i % 10 == 0)
{
cout << i << endl;
}
i = i+ 1;
}
return 0;
}
| ALGO | 0.98444 | 4.080977 |
6037f443-564a-49c2-bb5b-a0a264c0fe73 | chenkennt/3DCreator | 3DLibrary/CircleLoftObject.cpp | // LoftObject.cpp: implementation of the CCircleLoftObject class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "CircleLoftObject.h"
#include "Geometry.h"
#include "Constants.h"
#include "math.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
... | TOOL | 0.896311 | 4.609293 |
c7d616f1-893c-4fcc-b479-884c8bf585c1 | SushiStar/LC | easy/LinkedListCycle.cpp | /*
* Given a linked list, determine if it has a cycle in it.
*
* Date: Apr/08/2019
* Author: Wei Du
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
if (!head) return false;
auto slow = head;
auto fast = head->next;
while (slow != fast) {
slow = slow->next... | ALGO | 0.999825 | 6.010409 |
ac55d068-8b4f-4405-a11e-deb9ea980154 | minje46/Problem_Solving | Baekjoon/Exhaustive Search/2146_bridge.cpp | #include<iostream>
#include<algorithm>
#include<memory.h>
#include<queue>
#define MAX 101
#define INF 987654321
using namespace std;
const int dy[4] = { -1,1,0,0 };
const int dx[4] = { 0,0,-1,1 };
struct Way // The bridge's data.
{
int y, x; // Location.
int dist; // Distance.
};
int N, K = 0; // N = The... | ALGO | 0.999724 | 4.064724 |
07a0c149-d121-4f5e-9a4a-10ec5851f959 | Account1-Anurag/TLE_ELEMINATOR_SHEET | 1000 Rating Question/robin_helps.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
int curr=0;
int count=0;
for(int i=0;i<n;i++){
int temp;
cin>>temp;
if(temp==0 and curr>0){
count++;
curr-... | ALGO | 0.999824 | 3.318501 |
6dc60dd1-29cc-4d75-9d6a-fbe62623242b | andriikushch/data-structures-and-algorithms | data-structures/stack/stack.cpp | #include <iostream>
using namespace std;
struct node {
node(int key) {
this->key = key;
this->prev = nullptr;
}
int key;
node * prev;
};
struct stack {
node * top;
stack(){
this->top = nullptr;
}
void push(node * n) {
if (this->top != nullptr) {
... | ALGO | 0.999253 | 4.969778 |
f3ab86e6-43ff-492b-8153-372593828f0f | berrzebb/boost | libs/circular_buffer/example/bounded_buffer_comparison.cpp | // Comparison of bounded buffers based on different containers.
#define BOOST_CB_DISABLE_DEBUG
#include <boost/circular_buffer.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/thread.hpp>
#include <boost/call_traits.hpp>
#include <boost/progress.hpp>
#include <boost/... | TOOL | 0.855955 | 6.988468 |
6a2d09d3-e47e-474c-8b9c-a3f3d73bd97a | jfestrada/AM8_BMG_FysetcS6 | Marlin/src/libs/crc16.cpp | #include "crc16.h"
void crc16(uint16_t *crc, const void * const data, uint16_t cnt) {
uint8_t *ptr = (uint8_t *)data;
while (cnt--) {
*crc = (uint16_t)(*crc ^ (uint16_t)(((uint16_t)*ptr++) << 8));
for (uint8_t i = 0; i < 8; i++)
*crc = (uint16_t)((*crc & 0x8000) ? ((uint16_t)(*crc << 1) ^ 0x1021) : (... | ALGO | 0.997264 | 4.764662 |
e4d32f00-5029-4a54-a04f-6aef7b07811a | mulmuri/Algorithm | contests/hackercup/Round1A/A.cpp | #include <iostream>
#include <string>
using namespace std;
int ans;
void solve(int tc) {
string s,t;
int n;
cin >> s;
n = s.size();
s += ' ';
int cnt = 0;
int last = s[0];
for (int i=0; i<n; i++) {
cnt++;
if (s[i] != s[i+1]) {
if (s[i] < s[i+1]) {
... | ALGO | 0.999894 | 3.63478 |
7746b038-3196-4bf2-9c5e-4a008c4c3387 | ShriyasnhAgarwl/Leetcode-Submissions | Next Greater Element - GFG/next-greater-element.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the next greater element for each element of the array.
vector<long long> nextLargerElement(vector<long long> a, int n){
vector<long long> ans(n,-1);
stack... | ALGO | 0.999635 | 5.8994 |
a511e11d-3c37-4690-85e5-5469651f5a09 | NazarTymoshchuk/Sea-battle | Sea battle/Sea battle.cpp | #include <iostream>
#include "Header.h"
#include "Windows.h"
#include <conio.h>
using namespace std;
int main()
{
srand(time(nullptr));
const int ROWS = 10, COLS = 10;
char* playerMap[ROWS];
char* compMap[ROWS];
char* compMapVisible[ROWS];
for (size_t i = 0; i < ROWS; i++)
{
playe... | TOOL | 0.867951 | 3.698276 |
7531675d-d2a7-44ff-aab4-9a8c442ba10e | DeathScytheZ/coding-projects | Cpp_Projects/Decimal_to_Binary.cpp | #include <iostream>
#include <string>
#include <bits/stdc++.h>
using namespace std;
int main(){
int N, reminder = 0;
string result = "";
cout << "Enter a number: ";
cin >> N;
while(N > 0){
reminder = N % 2;
N /= 2;
result += to_string(reminder);
}
reverse(result.be... | ALGO | 0.999935 | 5.149506 |
a3de233e-a8d9-4f85-b4e1-b1112e2ce2fd | r0hit9145/MyCoding | VsCode/2024/DSA/Linked_List/AllInsertion.cpp | // Insertion.
/*
Insertion:
at the first.
at the end.
at the index.
at the position[Element].
*/
#include<iostream>
#include<vector>
using namespace std;
class Node {
public:
int data;
Node *next;
Node(int val): data(val), next(NULL){}
Node (Node *next, int key): next(next), data(key){}
};
// cr... | ALGO | 0.999731 | 5.044262 |
f2f8df34-0bce-4ca4-9093-49990c03d95a | jalad-shrimali/Streak_2k23 | leetcode 1584.cpp | class Solution {
public:
int getDist(vector<int>& pi, vector<int>& pj){
return abs(pi[0]-pj[0]) + abs(pi[1]-pj[1]);
}
#ifdef ARRAY
int minnode(bool mstset[], int dist[], int n){
#else
int minnode(vector<bool>& mstset, vector<int>& dist){
int n = mstset.size();
#endif
int min... | ALGO | 0.999982 | 5.640414 |
3c089adb-2c47-4b66-86d7-b38d97407bf1 | bharatr21/leetcode-problems | 0419-battleships-in-a-board/0419-battleships-in-a-board.cpp | class Solution {
public:
bool isValid(int i, int j, int m, int n) {
return (i >= 0 && i < m && j >= 0 && j < n);
}
void dfs(int x, int y, vector<vector<bool>>& vis, vector<vector<char>>& board, int m, int n) {
vector<pair<int, int>> dirs = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
vis[x][... | ALGO | 0.999936 | 6.513728 |
522216ba-b33a-4073-bcc3-41cb50f2b8ad | delorenj/degenerate | cocos2d/cocos/math/Vec2.cpp | #include "math/Vec2.h"
#include "math/MathUtil.h"
#include "base/ccMacros.h"
NS_CC_MATH_BEGIN
// returns true if segment A-B intersects with segment C-D. S->E is the ovderlap part
bool isOneDimensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E)
{
float ABmin = std::min(A, B);
float A... | TOOL | 0.953031 | 6.923028 |
7b3a0cee-17d9-4b88-8ff1-79a155de1075 | mukk050204/polygeist | lldb/test/API/tools/intel-features/intel-pt/test/main.cpp | int fun(int a) { return a * a + 1; }
int main() {
int z = 0;
for (int i = 0; i < 10000; i++) { // Break for loop
z += fun(z);
}
return 0; // Break 1
}
| ALGO | 0.978117 | 3.600817 |
6650ce01-8987-4d11-a882-6d86a8b7de6d | ishandutta2007/codeforces | waynetuinfor/normal/48/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn], ans[maxn];
vector<int> pos[maxn];
int main() {
ios_base::sync_with_stdio(false); cin.tie(0);
int n; cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
pos[a[i]].push_back(i);
}
int t = 0;
f... | ALGO | 0.999967 | 3.967795 |
0f55b211-d860-4770-bd33-b1a221b4c476 | Priyanshu-Ganatra/Leetcode-Codestudio-And-DSA-problems | LC_108_LevelOrderTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
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), left(left), right... | ALGO | 0.999996 | 5.835918 |
be9c4b73-d165-4651-b605-7a774aa5e04d | gmusya/archiver | src/encoder.cpp | #include "encoder.h"
#include <algorithm>
#include <fstream>
namespace {
void AddAlphabetSizeToAnswer(int16_t alphabet_size, Writer& writer) {
writer.WriterBits(alphabet_size, 9);
}
void AddSymbolToAnswer(int16_t symbol, Writer& writer) {
writer.WriterBits(symbol, 9);
}
void AddV... | TOOL | 0.906294 | 5.593235 |
cb670422-51e9-4166-9279-39a628d37899 | Sachinaswal29/Leetcode | 1945-sum-of-digits-of-string-after-convert/1945-sum-of-digits-of-string-after-convert.cpp | class Solution {
public:
int getLucky(string s, int k) {
// Approach 1
// string num="";
// for(auto& ch:s){
// num+=to_string(ch-'a'+1);
// }
// while(k--){
// int sum=0;
// for(auto& ch:num){
// sum+=ch-'0';
// ... | ALGO | 0.999951 | 6.167596 |
67beb493-7ab7-4d33-b18a-33ec26771552 | AnHoang12/DSA20231 | asm2_ex1.cpp | #include <iostream>
using namespace std;
#define SIZE 5
struct CircularQueue
{
int front, rear;
int arr[SIZE];
};
void Initialize(CircularQueue &Q){
Q.front = Q.rear = -1;
}
int isFull(CircularQueue Q) {
if ((Q.front == Q.rear + 1) || (Q.front == 0 && Q.rear == SIZE - 1)) return 1;
return 0;
}
int i... | ALGO | 0.998755 | 4.678947 |
dfa63d64-c208-4f95-ba17-c69ec46ae686 | hjsjhn/Algorithms | 数据结构/Treap&Splay/Treap/Nothing/My_Wrong_treap.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#define MAX_N 10001
#define INF 2147483647
using namespace std;
int root = 1, tot = 1;
int s[MAX_N][2], fa[MAX_N];
int siz[MAX_N];
int w[MAX_N], aux[MAX_N];
int up (int& i) {return siz[s[i][0]] + siz[s[i][1]];}
void rot ... | ALGO | 0.99989 | 3.92489 |
080da8f5-283d-4948-bbe6-8a94dbdb7e30 | vgszf/Fivem-External-SilentAim | Fivem-External/FrameWork/Dependencies/crypto/md5.cpp | // md5.cpp - modified by Wei Dai from Colin Plumb's public domain md5.c
// any modifications are placed in the public domain
#include "pch.h"
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
#include "md5.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
NAMESPACE_BEGIN(Weak1)
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_... | ALGO | 0.998221 | 6.627733 |
bfda87bb-56dc-41d9-ac9a-9004eed70183 | namnguyen16082008/LQDOJ | str03.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
string s;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
getline (cin,s);
for (ll i=0;i<s.size();i++)
(s[i]>='A' && s[i]<='Z') ? cout<<char(s[i]+32) : cout<<s[i];
}
| ALGO | 0.994693 | 4.636361 |
72dbf2ff-e30b-469a-96c1-ce355c6aa22b | HPC-AI-Team/pexsi | src/utility.cpp | /// @file utility.cpp
/// @brief Implementation of the non-templated utility subroutines.
/// @date 2012-09-20
#include "pexsi/utility.hpp"
using namespace std;
using std::ifstream;
using std::ofstream;
using std::vector;
using std::cerr;
namespace PEXSI{
// **********************************************************... | TOOL | 0.887241 | 6.642002 |
fbfed7fc-a932-4797-bd41-c77e2374a6e8 | champmine/privcy | src/arith_uint256.cpp | #include <arith_uint256.h>
#include <uint256.h>
#include <utilstrencodings.h>
#include <crypto/common.h>
#include <stdio.h>
#include <string.h>
template <unsigned int BITS>
base_uint<BITS>::base_uint(const std::string& str)
{
static_assert(BITS/32 > 0 && BITS%32 == 0, "Template parameter BITS must be a positive ... | ALGO | 0.960676 | 6.630531 |
01a772ab-4ca7-4118-99ac-e6ee397fb4d8 | Anirudh2105/Sales-Forecasting | venv/Lib/site-packages/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb_2019_U8/src/test/test_parallel_sort.cpp | #include "tbb/parallel_sort.h"
#include "tbb/task_scheduler_init.h"
#include "tbb/concurrent_vector.h"
#include "harness.h"
#include <math.h>
#include <vector>
#include <exception>
#include <algorithm>
#include <iterator>
#include <functional>
#include <string>
#include <cstring>
/** Has tightly controlled interface s... | TEST | 0.974908 | 7.384946 |
4c8dca48-5b9f-4b12-a8a0-50c4fd060f8c | leoni05/PS | BOJ/8900/8985.cpp | #include <stdio.h>
#include <algorithm>
#include <vector>
#include <memory.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string.h>
#include <string>
#include <math.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int MX = 300100;
struct R... | ALGO | 0.998633 | 3.588988 |
32122a47-40b7-4f17-bccc-161355e679ca | MouryaVishal/A2Z_Questions | 15 Graphs [Concepts & Problems]/15.4 Shortest Path Algorithms and Problems/9 Number of Ways to Arrive at Destination.cpp | #include<bits/stdc++.h>
using namespace std;
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), left(left), right(... | ALGO | 0.999915 | 4.691438 |
b33ac3d9-3769-4595-a541-214b9a867308 | hjiang13/LLMs-in-IR | POJ-104/101/587.cpp | #include <iostream>
using namespace std;
int main()
{
int a[3],b[3],i=0,k=0;
char rank[3];
rank[0]='A';
rank[1]='B';
rank[2]='C';
for(a[0]=0; a[0]<3; a[0]++)
{
for(a[1]=0; a[1]<3; a[1]++)
{
for(a[2]=0; a[2]<3; a[2]++)
{
b[0]=(a[1]>a[0])+(a[2]==a[0]);
b[1]=(a[0]>a[1])+(a[0]>a[2]);
b[2]=(a[2]>a[1])+(a[1]>a[0]);
if(a[0]+b... | ALGO | 0.999777 | 3.383861 |
922f9e08-73ab-47db-8a8e-916dcd430ed8 | Chetan-Patil-52/MyDSA_Practice | 2D_Arrays/Binary Search/540. Single Element in a Sorted Array.cpp | // using XOR
class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
int n = nums.size();
int xOR = 0;
for(int i=0;i<n;i++){
xOR ^= nums[i];
}
return xOR;
}
};
//Approach : 2 (Using Binary Search) : O(log(n))
class Solution {
public:
int sing... | ALGO | 0.999985 | 5.815784 |
50df7087-a63d-4b52-88ef-49214f2a235e | EPantelaios/knn-and-clustering-with-timeseries | Part_B/Common/main.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
#include "../Curve/Clustering_Frechet.hpp"
//#include "../Vector/Clustering.hpp"
//#include "Clustering.hpp"
int main(int argc, char *argv[]){
int number_of_clusters=0, hash_tables_lsh=3, hash_functions_lsh=4;
int max_number_hypercube... | ALGO | 0.998405 | 4.376874 |
130bb612-4747-4b4e-a854-5f44d81ead63 | alexandraback/datacollection | solutions_1595491_1/C++/nghiand/B.cpp | #include <iostream>
#include <cstdio>
#define MAXN 111
using namespace std;
int n, s, p, a[MAXN], t, test, res;
void sort(){
for (int i = 1; i < n; i++)
for (int j = i + 1; j <= n; j++)
if (a[i] < a[j]){
int temp = a[i];
a[i] = a[j];
a[j] = temp... | ALGO | 0.999535 | 3.040163 |
d4c58882-dc09-4357-a5d3-191bda9d9d7a | Project-Traunce/.github | src/libmw/src/mmr/IMMR.cpp | #include <mw/mmr/MMR.h>
#include <mw/mmr/MMRUtil.h>
using namespace mmr;
mw::Hash IMMR::Root() const
{
const uint64_t num_nodes = mmr::LeafIndex::At(GetNumLeaves()).GetPosition();
if (num_nodes == 0) {
return mw::Hash{};
}
// Find the "peaks"
std::vector<uint64_t> peakIndices;
uint64... | ALGO | 0.982372 | 5.441173 |
c1b517e3-f28c-4612-a1f1-3be7cc3d590c | EchoMemory/AcmSolutions | Zjut_ACM/1173 格式阵列二.cpp | #include <iostream>
using namespace std;
int main()
{
unsigned n;
int i,j;
int g=0;
while( cin>>n )
{
if( g++ )
cout<<endl;
for( i=1; i<=n; i++ )
{
for( j=1; j<=n; j++ )
cout<<" "<<"("<<i<<","<<j<<")";
cout<<endl;
}
}
return 0;
} | ALGO | 0.943254 | 3.426844 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.