uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
50c857e4-369e-4b42-b82f-038d64780b1b | HPC-Fortran2CPP/Fortran2Cpp | data/readable_format/cpp/file066.cpp | #include <iostream>
#include <vector>
#include <string>
// Function Declaration
void checkTrueContact(int ntie, const std::vector<std::string>& tieset,
const std::vector<std::vector<double>>& tietol,
const std::vector<std::vector<std::vector<double>>>& elcon,
... | TEST | 0.954877 | 6.226931 |
675ba582-d265-4c61-8d78-c5386f7cdae9 | istupsm/C-Primer- | ch03/ex3_41.cpp | #include <iostream>
#include <vector>
using std::vector; using std::cout; using std::endl; using std::begin; using std::end;
int main()
{
int arr[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
vector<int> v(begin(arr), end(arr));
for (auto i : v) cout << i << " ";
cout << endl;
return 0;
}
| TOOL | 0.901295 | 3.627095 |
0b88b42e-33a8-4743-bbad-eb1f4bfbd66c | ishandutta2007/codeforces | shzhang/normal/1305/F.cpp | #include <cstdio>
#include <set>
#include <random>
#include <chrono>
using namespace std;
#define ll long long
void factor(ll val, set<ll>& factors)
{
if (val <= 1) return;
ll orig = val;
for (ll fac = 2; fac * fac <= orig; fac++) {
if (val % fac == 0) {
factors.insert(fac);
... | ALGO | 0.999926 | 3.535738 |
4d256a39-525e-4b28-b7af-9d59636d3425 | ishandutta2007/codeforces | huhaoo/normal/666/E.cpp | /***************************************************************
File name: E.cpp
Author: huhao
Create time: Tue 17 Dec 2019 05:47:34 PM CST
***************************************************************/
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#define fr(i,a,b) for(int i=(a),end_#... | ALGO | 0.999948 | 3.739034 |
d5b11582-75e5-42ae-82da-de5788c263cc | Arghajyoti/hacktober_2022 | Problem 14 Solution.cpp | /* Write a program that takes 3 lengths, 𝑎, 𝑏 and 𝑐 as input and check whether they correspond in forming a
right-angled triangle and returns the string “YES” or “NO” without quotes accordingly */
#include <stdio.h>
int main()
{
int a, b, c;
printf("Enter three lengths:");
scanf ("%d %d %d", &a, &b, &c);
if (a>... | ALGO | 0.999699 | 3.997656 |
79aedfad-3940-49d6-a972-ac1bf2e31a7c | sazid/codes | problem_solving/vjudge/2017_08_12/N.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string::size_type ssize;
int freq[128];
int nums[10000];
void sieve_primes(ll n) {
for (ll i = 2; i <= n; i++) {
if (nums[i] == 0) {
ll upto = n/i;
for (ll k = 2; k <= upto; k++) {
nums[k*i... | ALGO | 0.999802 | 4.699338 |
7ea48c97-b1cc-4a2a-b332-b37f9691857a | nenuon/CompetitiveProgramming | Atcoder/ARC067/E3.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <lim... | ALGO | 0.99994 | 4.842858 |
e9977ab4-cfe9-483a-b4c5-6c4ab804400d | privateLLM001/Private-LLM-Inference | OpenCheetah/deps/hexl/hexl/eltwise/eltwise-cmp-add.cpp | #include "hexl/eltwise/eltwise-cmp-add.hpp"
#include "eltwise/eltwise-cmp-add-avx512.hpp"
#include "eltwise/eltwise-cmp-add-internal.hpp"
#include "hexl/logging/logging.hpp"
#include "hexl/number-theory/number-theory.hpp"
#include "hexl/util/check.hpp"
#include "util/cpu-features.hpp"
namespace intel {
namespace hexl... | ALGO | 0.997594 | 7.36731 |
8f5db810-1389-4396-a6f1-a8cfa320498c | mars-flat/competitive-programming-archive | solutions/ccc19s5.cpp | // author: Shane Chen (MarsFlat)
// concepts: 2-d BIT
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <cstring>
// #define int long long
#define boost() ios::sync_with_stdio(0); cin.tie(0);
#define sca... | ALGO | 0.999918 | 3.677645 |
9be7e54f-dc4f-4765-a897-3d192b4d3a84 | asad5059/CP | B_XOR_Specia_LIS_t.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define ff first
#define INF 1e18
#define ss second
using namespace std;
using namespace __gnu_pbds;
template <typename PB>
using ordere... | ALGO | 0.999937 | 4.478593 |
e48d79ac-7a0b-42f8-bfbe-c0f2379cb0e5 | yeohj0710/old-solutions | 09000s/9366.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int T, a, b, c;
cin >> T;
for(int i=1; i<=T; i++) {
cout << "Case #" << i << ": ";
cin >> a >> b >> c;
if(a+b <= c || b+c <= a || c+a <= b) cout << "invalid!";
else if(a == b && b == c) cout << "equilateral";
... | ALGO | 0.999703 | 5.114833 |
64eb97bd-9cdb-418a-95d4-775a77959aef | mdalauddin45/Algorithm | Assignment 2/Distance.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
vector<int>adj[N];
int level[N];
void bfs(int s, int destination) {
queue<int>q;
q.push(s);
level[s] = 0;
while (!q.empty()) {
int u = q.front();
q.pop();
for (int v:adj[u]) {
if (level[v]==-1) {
... | ALGO | 0.999978 | 4.972009 |
269ee18d-2c74-4a3c-b06e-a6c861bf8dbd | debapriyo007/DSA-College | Data Structure In C/03_Linklist/01_SINGLY LINKLIST/LINKLIST DELETION ONLY/01 Deletion first node,....cpp | #include<stdio.h>
#include<stdlib.h>
struct Node
{
int data;
struct Node*next;
}*head;
void Display(struct Node*p)
{
while(p!=0)
{
printf(" element : %d\n",p->data);
p=p->next;
}
}
struct Node* Delete (struct Node *head)
{
struct Node*p=head;
head=head->next;
free(p);
return head;
}
int main()
... | ALGO | 0.999324 | 3.091139 |
28bacb43-234d-446a-997b-62d8c01b0490 | fishy15/competitive_programming | online/topcoder/srm814/jump.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <array>
#include <algorithm>
#include <utility>
#include <map>
#include <queue>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstring>
#define ll long long
#define ld long double
#define eps 1e-8
#define MOD 1000000007
... | ALGO | 0.999752 | 3.223032 |
b6a5f380-60fa-4202-bc60-d8a4b1fc2676 | karin0/problems | conts/cf/r480d2/d.cpp | #include <cstdio>
#include <cctype>
#include <algorithm>
#include <cmath>
#define rep(__i,__s,__t) for((__i)=(__s);(__i)<=(__t);++(__i))
#define re(__i,__s,__t) for((__i)=(__s);(__i)<(__t);++(__i))
#define per(__i,__s,__t) for((__i)=(__s);(__i)>=(__t);--(__i))
#define pe(__i,__s,__t) for((__i)=(__s);(__i)>(__t);--(__i)... | ALGO | 0.99973 | 3.53021 |
3b551d3a-b64a-4838-98e7-89eb97d1ca13 | Socialfew146575/DSA | Array/Sorting/bubble_sort.cpp | #include <iostream>
using namespace std;
void bubble_sort(int array[], int size)
{
for (int i = 0; i < size - 1; i++)
{
for (int j = 0; j < size - i - 1; j++)
{
if (array[j] > array[j + 1])
{
swap(array[j], array[j + 1]);
}
// for (... | ALGO | 0.999819 | 4.335856 |
43ffe222-501f-48ce-8f3d-420456c114d6 | hryyan/AUHCI | AUHCI_crossplatform/Detection/facedet.cpp | // facedet.cpp: 人脸检测
//
// Created by Vincent Yan in 2014/03/17
#include "facedet.h"
#include "../Feature/haarclassifier.h"
// source中每一帧的Mat
extern Mat frame;
// 数据流中的人脸信息
extern DetPar frame_detpar;
// 级联分类器
static cv::CascadeClassifier facedet_g;
// GPU级联分类器
static cv::gpu::CascadeClassifier_GPU facedet_gpu_g;... | ALGO | 0.990904 | 4.657854 |
c0dff9e6-6fbd-47df-bb83-c604795a85b0 | manikanta2901/ubuntu | .history/practice/cpp/codeforces/ThreeSwimmers_20210408232046.cpp | #include <bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define trav(dataType,DataStruct,name) for(dataType<DataStruct>::itt ip = name.bb(); ip != name.ee(); ip++)
//Pre processors & typedefs
... | ALGO | 0.999935 | 3.978998 |
6b957b57-9738-461d-b97d-c5ac2a642be2 | camdennis/pyCudaMeta | src/model.cpp | #include <iostream>
#include <vector>
#include "model.hpp"
#include <cuda_runtime.h>
#include <math.h>
#include <algorithm>
double pi = 3.14159265358979323846264338328;
// Declaration of pointwiseMultiply function (defined in model.cu)
extern "C" void updatePsiPosVelCUDA(double* psi, double* psiVel, double* psiForces... | ALGO | 0.997013 | 5.026971 |
0e5f85b9-afbd-497c-a201-99f6195ac3d6 | googlebaba/machinelearning | EnjoySport/EnjoySport/Find_S.cpp | #include "Find_S.h"
using namespace std;
std::multimap<std::string,std::vector<std::string> > Find_S::eval(std::ifstream& is)
{
//int count = 0;
string line;
vector<string>currfind;
vector<string>prefind;
while(getline(is,line))
{
++count;
currfind.clear();
istringstream stream(line);
string word;
while... | ALGO | 0.9962 | 3.032656 |
e9758e37-5bab-45f7-a76f-c63acd64674b | AnasImloul/Leetcode-Solutions | scripts/algorithms/T/Tweet Counts Per Frequency/Tweet Counts Per Frequency.cpp | // Runtime: 69 ms (Top 82.47%) | Memory: 38.40 MB (Top 84.54%)
class TweetCounts {
private:
unordered_map<string, vector<int>> mp;
public:
TweetCounts() {
}
void recordTweet(string tweetName, int time) {
mp[tweetName].push_back(time);
}
vector<int> getTweetCountsPerFrequency(... | ALGO | 0.998056 | 6.288544 |
4af1bc09-fec0-4c66-826f-d8333d726017 | NemesisAbdurRahman/Optimized-LinkedList-O-1- | Full__LINK--LIST.cpp | #include<iostream>
#include<unordered_map>
#include<unordered_set>
using namespace std;
// static int i=0;
class globalV{
public:
int size=0;
int i=0;
int pass=0,bpass=0;
};
class node{
public:
int val;
node* ptr;
node(int val){
this->val=val;
ptr=NULL;
}
};
class list:public globalV{
public:
node* ... | ALGO | 0.999195 | 4.036213 |
d284f3e5-a592-4042-8697-b845ffd294ec | FlorianCliquet/Kattis-solutions | src/klippaprotein.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define inf int(1e18)
#define fast() ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int32_t main()
{
fast();
string s;
int k;
cin >> s >> k;
int n = s.size();
int ans = n;
set<char> st(s.begi... | ALGO | 0.999901 | 5.003201 |
15894982-bdd1-4b90-937b-3318611f5e7a | hhh446/plant_vs_zombie | pvz_maps.cpp | // Windowsϵͳ
#include <Windows.h>
// ֲսʬIJֵͼ
#include "pvz_maps.h"
//ʵ ֲսʬĹؿ1죨ߣֵԱԣб
// ֲսʬĵͼ죨ߣ{ʼǰؿͼ}
pvz_map_1::pvz_map_1(unsigned short w, unsigned short h)
:pvz_map(w, h)
{
unsigned short a = 0, b = w + 1, c = b * h - 1,
d = w - 1, e = b * 26, f = b * 3 + 2;
for (a; a < c; a++)
{
if (a < w || a > c - b || ... | TOOL | 0.864116 | 3.20579 |
a49c2eac-a59e-4870-87f4-1fd3e48f9c47 | sumitsojha88/Placement-Preparation | Leetcode Solution/Tree/Medium/236. Lowest Common Ancestor of a Binary Tree.cpp |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
/*... | ALGO | 0.999974 | 6.217637 |
5c2b1ff5-36b5-4863-a1b8-9ffc7066c248 | oceanbase/obproxy | src/lib/hash_func/murmur_hash.cpp | //-----------------------------------------------------------------------------
// MurmurHash2, by Austin Appleby
// (public domain, cf. http://murmurhash.googlepages.com/)
// Note - This code makes a few assumptions about how your machine behaves -
// 1. We can read a 4-byte value from any address without crashing... | ALGO | 0.985229 | 7.40412 |
bfc1b10d-0392-4b20-835f-3fbc4acd80bc | youayou121/my_drone_sim | uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/stepper_details.cpp | #include <iostream>
#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
using namespace std;
using namespace boost::numeric::odeint;
const size_t N = 3;
typedef boost::array< double , N > state_type;
//[ system_function_structure
void sys( const state_type & /*x*/ , state_type & /*dxdt*/ , const double ... | ALGO | 0.981521 | 6.463598 |
38b6a562-4b9f-4f91-8c58-2ff35f605f4e | Samiul191139/CPP-Practice | 136A_Presents.cpp | #include <iostream>
using namespace std;
int main()
{
int n,k;
cin >> n;
int arr[n];
for (int i = 1; i <= n; i++)
{
cin >> k;
arr[k] = i;
}
for (int i = 1; i <=n; i++)
{
cout << arr[i] << " ";
}
return 0;
} | ALGO | 0.999958 | 3.35288 |
0e7ae59c-3157-49a7-9fb2-18fe646b62ca | heavenMOJANG/ICPC | .history/programmes_C_Cpp/HDU/2025“钉耙编程”中国大学生算法设计春季联赛(3)/1009_20250322131147.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
int n, q; cin >> n >> q;
vector<int> fa(n + 1), h0(n + 1), h1(n + 1);
iota(fa.begin(), fa.end(), 0);
... | ALGO | 0.999942 | 4.931974 |
a0f8bf2d-9cac-46cf-a95f-6b421e4b71e1 | Daves1245/codeforces | contest/1914/c/c.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = int;
int main() {
int t; cin >> t;
while (t--) {
int n, k; cin >> n >> k; vector<ll> a(n), b(n);
for (auto &i : a) cin >> i;
for (auto &i : b) cin >> i;
for (int i = 1; i < n; i++) b[i] = max(b[i], b[i - 1]);
int mx... | ALGO | 0.999955 | 3.454582 |
746d4d46-ccb7-48a2-88fd-b1885c3d9fa0 | jyliew1912/Year2-2 | itsa_done/1-2-21.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int input;
cin >> input;
int sum = 0;
for(int i = 1; i <= input; i++)
{
if(i % 6 == 0)
{
sum += i;
if(i % 12 == 0) sum -= i;
}
}
cout << sum << endl;
} | ALGO | 0.99992 | 3.820011 |
2a20a223-09ad-4aa1-a707-bc05a04f8454 | IcedDoggie/PlanetX | sweep.cpp | #include "sweep.hpp"
#include<iostream>
#include<cmath>
using namespace std;
void MySweepSurface::setup(const GLfloat* profilePoints,GLint numOfProfilePoints,GLfloat degreeStart,GLfloat degreeEnd,
GLfloat degreeStep )
{
profilepoints = profilePoints;
numofprofilepoints = numOfProfilePoints;
// if (surfa... | ALGO | 0.987598 | 4.135029 |
b6cfd557-7f04-46ae-9d5a-0d7d750eb71d | MaTianmao/src | src/boost/libs/numeric/ublas/doc/samples/triangular_matrix.cpp | #include <boost/numeric/ublas/triangular.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
triangular_matrix<double, lower> ml (3, 3);
for (unsigned i = 0; i < ml.size1 (); ++ i)
for (unsigned j = 0; j <= i; ++ j)
ml (i, j) = 3 * i + j;
... | ALGO | 0.864932 | 3.772041 |
bee406fe-9bb8-49dd-9f6d-467f024c064b | hcnhcn012/algorithms | DynamicProgramming/coins_change/coins_change/main.cpp | //
// main.cpp
// coins_change
//
// Created by ChengnanHu on 1/12/21.
//
#include <iostream>
#include <vector>
#include <algorithm>
#define CHANGE 9
using namespace std;
int coins_change(int change, vector<int> &coins);
int main(int argc, const char * argv[])
{
/* coins vector should be sorted */
vecto... | ALGO | 0.999938 | 5.542145 |
403df2a5-babb-456e-8e41-bf9601523f8e | manmeet199/Leetcode | Nth Fibonacci Number - GFG/nth-fibonacci-number.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:
long long int nthFibonacci(long long int n){
// code here
long long f[n+1];
const int m= 1e9+7;
... | ALGO | 0.999817 | 6.19727 |
4b7b9a7a-3368-4927-8874-dd9fd04e9cc4 | ayushh201/LEETCODE_POTD2025 | January25/18_1368. Minimum Cost to Make at Least One Valid Path in a Grid.cpp | class Solution {
public:
vector<vector<int>> directions{{0,1},{0,-1},{1,0},{-1,0}};
int m,n;
int minCost(vector<vector<int>>& grid) {
m=grid.size();
n=grid[0].size();
priority_queue<vector<int>,vector<vector<int>>,greater<>> pq;
vector<vector<int>> result(m,vector<int>(n,INT_... | ALGO | 0.99994 | 6.040039 |
741e2b31-b954-4a6f-b0d5-6409bdb4baa6 | rameezr07/DSA | DP/MinimumSubsetSumDifference.cpp | // Given an array arr of size N containing non-negative integers, the task is to divide it into two sets S1 and S2 such that the absolute difference between their sums is minimum and find the minimum difference
// Example 1:
// Input: N = 4, arr[] = {1, 6, 11, 5}
// Output: 1
// Explanation:
// Subset1 = {1, 5, 6},... | ALGO | 0.999992 | 5.647321 |
53988c65-2cec-44ff-ac9b-d5995ff37c4a | solonas13/ius | WST/input.cpp | #include <iostream>
#include <string>
#include <getopt.h>
#include "input.h"
using std::cerr;
using std::endl;
void usage ( ) {
std::cerr << "Usage: Weighted Index <options>" << std::endl;
std::cerr << "Standard:" << std::endl;
std::cerr << " -t, --text\t<str>\tFilename for Text. Default: standard input.... | TOOL | 0.908414 | 5.362136 |
18f8fd04-2972-4257-9e8f-5a47ab9cf5af | kzamanbd/hackerrank-problem | Give_Current_Min.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
priority_queue<int, vector<int>, greater<>> pq;
for (int i = 0; i < n; i++)
{
int x;
cin >> x;
pq.push(x);
}
int query;
cin >> query;
for (int i = 0; i < query; i++)
{
... | ALGO | 0.999622 | 4.713609 |
343c6f4e-8df1-4273-afa3-4503e4765e18 | WesPereira/exerc-maratona | bixecamp/basicos/divisao.cpp | /* Problem link:
https://neps.academy/br/exercise/85
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
float a, b;
cin >> a >> b;
printf("%.2lf", a/b);
return 0;
} | ALGO | 0.99665 | 3.4281 |
130faf7c-e760-495d-bc0e-d4d8811e879f | EasyDae/CodeTest | BOJ/09XXX/09251.cpp | //https://www.acmicpc.net/problem/9251
#include <iostream>
#include <cmath>
using namespace std;
int dp[1001][1001];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string s1, s2; cin >> s1 >> s2;
int Max = 0, len1 = s1.size(), len2 = s2.size();
for (int i = 1... | ALGO | 0.999967 | 4.831732 |
cacc5a0a-8c00-4dba-b74a-d9d014f1e5f6 | limeojin363/algorithm-training | cpp-examples/topology-sort.cpp | /*
Origin: https://github.com/ndb796/python-for-coding-test/blob/master/10/6.cpp
Edited by limeojin363(https://github.com/limeojin363)
*/
#include <bits/stdc++.h>
#define NODE_MAXNUM 100001
void topologySort();
void input();
using namespace std;
int v, e; // 노드개수 v, 간선개수 e
int indegree[NODE_MAXN... | ALGO | 0.999995 | 5.301106 |
2d730323-8ba5-4ac1-91eb-ed0d151fb863 | prathamtechops/Cpp- | number_reverse.cpp | #include<iostream>
using namespace std;
int main()
{
int num = 123;
int rem;
int new_num = 0;
for(int i = num; i > 0; i = i/10){
rem = i % 10;
new_num = new_num * 10 + rem;
}
cout << new_num;
}
| ALGO | 0.999934 | 3.906938 |
ad1ffe37-8b83-43e1-9060-9d0dd21356cd | ZacharyWesterman/paisley | src/libs/cpp/functions/round.cpp | #include "round.hpp"
#include <cmath>
void round(Context &context) noexcept
{
auto value = std::get<std::vector<Value>>(context.stack.pop())[0].to_number();
context.stack.push(std::round(value));
}
| ALGO | 0.960443 | 6.536983 |
b8e67f40-bca5-4f2b-802e-f76b125e61bb | sarvex/leetcode-julia | solution/2400-2499/2467.Most Profitable Path in a Tree/Solution.cpp | class Solution {
public:
int mostProfitablePath(vector<vector<int>>& edges, int bob, vector<int>& amount) {
int n = edges.size() + 1;
vector<vector<int>> g(n);
for (auto& e : edges) {
int a = e[0], b = e[1];
g[a].emplace_back(b);
g[b].emplace_back(a);
... | ALGO | 0.999899 | 5.140233 |
8eb04e1e-fdbf-4f31-8ead-fbd328214edd | dwhaynes/leetcode-solutions | 1128-remove-all-adjacent-duplicates-in-string/2022-03-07 20.36.06 - Accepted - runtime 28ms - memory 11.6MB.cpp | class Solution {
deque<char> stack;
public:
string removeDuplicates(string s) {
for(auto c: s){
if(!stack.empty() && stack.back() == c) stack.pop_back();
else stack.push_back(c);
}
string res = "";
while(!stack.empty()){
res+=stack.front();
... | ALGO | 0.999986 | 6.613528 |
f8eb756c-dfe9-492e-bde4-1b66cea67e08 | haiyuem/pintool | source/tools/ToolUnitTests/sse.cpp | #include <iostream>
#include <iomanip>
using std::cout;
using std::endl;
#define N 1024
int main(int argc, char** argv);
#if defined(__GNUC__)
#include <stdint.h>
typedef uint8_t UINT8; //LINUX HOSTS
typedef uint16_t UINT16;
typedef uint32_t UINT32;
typedef uint64_t UINT64;
typedef int8_t INT8;
typedef int16_t INT16;... | TOOL | 0.910182 | 3.656212 |
26853128-4a71-4607-a14b-865a89723be3 | aziz-tamim/Phitron_course | Basic Data Structures/Week 05 Binary Tree/Module 18.5/get_max_height.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node* left;
Node* right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node* input_tree()
{
int val;
cin >> val;
Node* root;
if(val ... | ALGO | 0.999438 | 4.613194 |
3ef6412f-2a20-4625-b0d9-47d9a888ffeb | syedDayim/whats_app_clone | 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.998809 | 6.763549 |
e6643aa0-47b2-447b-a9a8-163eefe15171 | Sakshamchawla19/DSA | 6_2DArray/Challenges2D_Array/2WavePrintColumnWise.cpp | //wave print column wise from 2D array
#include <iostream>
using namespace std;
void WavePrintColumnWise(int a[][10], int m, int n){
for(int col = 0; col<n; col++){
if(col%2 == 0){
for(int row=0; row<m; row++){
cout << a[row][col] << ", ";
}
}
else{... | ALGO | 0.998527 | 4.199764 |
b626ed06-5367-4322-9e16-b3bbe6137bd2 | ishandutta2007/codeforces | mango_lassi/normal/1168/B.cpp | #include <iostream>
#include <vector>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
bool contains(int a, int b, const string& str) {
for (int i = a; i <= b; ++i) {
for (int k = 1; i+2*k <= b; ++k) {
if (str[i] == str[i+k] && str[i+k] == str[i+2*k]) return true;
}
}
return false;
}
int m... | ALGO | 0.999971 | 4.949872 |
a0297af8-63c0-4c99-9264-a9e165dbb3f8 | tahsinturag/Codeforces | A - Soft Drinking-2.cpp | #include <iostream>
using namespace std;
int main()
{
int n, k, l, c, d, p, nl, np;
cin >> n >> k >> l >> c >> d >> p >> nl >> np;
cout << min(min(k * l / nl, c * d), p / np) / n << endl;
return 0;
}
| ALGO | 0.99906 | 3.324681 |
a8ee6f02-872b-44a0-ab2e-f3ceaa30e322 | RafiuAlam/Uni-Works | C_codes/QuickSort.cpp | #include<bits/stdc++.h>
using namespace std;
int part(int ar[],int low,int high)
{
int pivot = ar[low];
int i= low,j= high;
while(i<j)
{
while(ar[i] <= pivot)
{
i++;
}
while(ar[j] >= pivot)
{
j--;
}
if(i<j)
{
... | ALGO | 0.999961 | 5.11019 |
c1a18b17-c118-436a-bd92-25f4625896ca | ishandutta2007/codeforces | reyna/normal/549/G.cpp | //In the name of God
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e6 + 9;
int arr[Maxn];
int main(){
ios_base::sync_with_stdio(0);
int n;
cin >> n;
for(int i = 0; i < n;i++) cin >> arr[i],arr[i] += i + 1;
sort(arr,arr+n);
for(int i = 1 ; i < n;i++){
if(arr[i] == arr[i-1]){
cout << ":(\n";
... | ALGO | 0.998816 | 3.035857 |
114ea73b-92b0-40f8-a706-7a337401d16f | catoraa/cpp-exercise | 408-真题/2013-2.cpp | #include<stdio.h>
//找出主元素
//摩尔投票法
//简单
int findmain(int *a,int len){
int main=a[0],count=1,sum=0;
for (int i = 1; i < len; i++)
{
if (a[i]==main)count++,sum++;//元素相同,“提升支持率”
else count--;//元素不同,“降低支持率”
if(count==0)main=a[i],sum=0;//支持率归零,更换元素,个数计数归零
}
if(sum>len/2)return ... | ALGO | 0.999909 | 3.495318 |
c656993c-8e5c-4857-b78f-aab8f85e923b | san-dr0/FlutterApp1 | 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.998733 | 6.76775 |
52767383-e546-4f58-b468-b770094ba761 | aryans1319/LeetCode | stream-of-characters/stream-of-characters.cpp | class StreamChecker {
private:
class Trie { // Trie construction
public:
bool is_wordEnd;
Trie* children[26];
Trie() {
this->is_wordEnd = false;
for(int i=0;i<26;i++)
this->children[i] = NULL;
}
void insert(string word... | ALGO | 0.999421 | 6.541661 |
4ab9ae8f-5cc6-4f10-b6a4-9985ffdf944a | mooner92/2022algo | 14606-피자(small)/14606-피자S.cpp | #include <iostream>
using namespace std;
int e=0;
int pizza(int n){
if(n==1){
return 0;
}
int q,w;
q = n/2; //n의반값
w = n-q; //n-q
e+=(q*w);
return pizza(q) + pizza(w);
}
int main(){
int r=0;
cin>>r;
int t = pizza(r);
cout <<e;
} | ALGO | 0.999943 | 3.971315 |
6cda86bf-a154-4822-823c-e85115d778b8 | fivevfive2/webServer | src/http/testHttpRequest.cpp | #include "HttpRequest.hpp"
using namespace bre;
using namespace std;
void testFuncPrase() {
Buffer buffer;
HttpRequest request;
string str = "GET / HTTP/1.1\r\n"
"Host: www.baidu.com\r\n"
"Connection: keep-alive\r\n"
"Cache-Control: max-age=0\r\n... | TEST | 0.85091 | 3.650557 |
3321510e-c7ec-4159-a6da-355f5fb12c8f | ZahidAlNahid1/Grendel | Tutorials/C++/Functions/ScopeExample/main.cpp | // Section 11
// Scope example
#include <iostream>
using namespace std;
void local_example();
void global_example();
void static_local_example();
int num {300}; // Global variable - declared outside any class or function
void global_example() {
cout << "\nGlobal num is: " << num << " in global_example - star... | TOOL | 0.867397 | 4.327997 |
fdff8394-9291-4080-928d-4e714b1ce5c7 | shreyansh28801/StriverCpSheet | Tree&Graph/Tree/LuvTree/MultiSourceBfs.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long int li;
#define int long long int
typedef long double ld;
#define lb lower_bound
#define ub upper_bound
#define pub push_back
#define pob pop_back
#define nl "\n"
typedef long double ld;
template <typename ... | ALGO | 0.999957 | 5.217682 |
245f7f88-ade9-4154-bbc2-6b6f71b1ab4f | AndreGomesSilva/42SP_CPP | module02/ex03/main.cpp | #include "Fixed.hpp"
#include "Point.hpp"
int main() {
Triangle *triangles[] = {
new Triangle(Point(0, 10), Point(10, 10), Point(10, 0)),
new Triangle(Point(20, 0), Point(20, 20), Point(20, 0))};
int triangleCount = sizeof(triangles) / sizeof(triangles[0]);
BSPNode *bspRoot = constructBSP(triangles,... | ALGO | 0.958357 | 6.062209 |
4f82a655-02b2-4745-b9eb-24b7ca8cee41 | gaelwjl/Leetcode-Solution | solutions/0141-linked-list-cycle/linked-list-cycle.cpp | // Given head, the head of a linked list, determine if the linked list has a cycle in it.
//
// There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is co... | ALGO | 0.999556 | 4.61076 |
e1023017-d219-4f12-9cba-72af763297b7 | whoisatharv/DSApractice | day41TrappingWater.cpp | //Leet code hard trapping water problem
#include<iostream>
#include<vector>
using namespace std;
int trap(vector<int>&arr){
int n=arr.size();
int prefix[n] ;
int suffix[n];
prefix[0]=arr[0];
for (int i=1;i<n;i++){
prefix[i]=max(prefix[i-1],arr[i]);
}
suffix[n-1]=arr[n-1];
for(in... | ALGO | 0.999963 | 6.155084 |
c48abcdd-fada-4157-8d48-1d3da18a07d4 | Bloodee/GraphicsLab | Desktop/G-Lab/Lab2.13/src/utils/bvh.cpp | #include "bvh.h"
#include <cassert>
#include <iostream>
#include <optional>
#include <Eigen/Geometry>
#include "formatter.hpp"
#include <spdlog/spdlog.h>
#include "math.hpp"
using Eigen::Vector3f;
using std::optional;
using std::vector;
BVHNode::BVHNode() : left(nullptr), right(nullptr), face_idx(0)
{
}
BVH::BVH(... | ALGO | 0.995759 | 6.123221 |
239c89bb-259e-48fd-a87a-f9a313810cdc | g-j-chen/gina | Codeforces/VasyaAndCubes.cpp | #include <iostream>
int main() {
int n;
std::cin >> n;
int level = 0;
int cubes = 1;
while(n - cubes >= 0) {
n -= cubes;
level++;
cubes += (level + 1);
}
std::cout << level;
return 0;
} | ALGO | 0.999688 | 3.921835 |
a1bda4dc-3154-471d-b0ad-973e7ae777b3 | sousabianca/c-faculdade | Pacotes de download/arquivos-c/Ponteiro/exprof.cpp | #include <stdio.h>
#include <conio.h>
float Vetor(int *Pa){
int i;
printf("\nImpressao na Funcao Vetor \n");
for (i=0;i<10;i++)
{
printf(" A[%d] = %d ",i,Pa[i]);
printf(" *(a + %d) = %d \n",i,*(Pa+i));
}
printf("\n");
return(*Pa);
}
int main(){
int i, Z;
int A[10] = { 1, 2, 3, 4, ... | TOOL | 0.989595 | 3.429559 |
1bcdf498-0e6c-429e-824b-d763693f58a5 | Palak-soni-coder/C-decision-making-statements | Finding whether a character is vowel or consonant.cpp | // EXP-5
// PALAK SONI
// 24070123069
// ENTC A3
//Problem statement: Write a program to find whether character entered by user is vowel or consonant.
#include <iostream>
using namespace std;
int main(){
char ch;
cout<<"Enter a character."<<endl;
cin>>ch;
if(ch=='a'|| ch=='e' || ch=='i' || ch=='o... | ALGO | 0.99613 | 4.18615 |
c888a30e-5328-4470-9e8e-124667f39a1c | rafid211/online-judge-solution | codeforces/C. Exams.cpp | #include <bits/stdc++.h>
using namespace std;
#define i64 long long
#define input freopen("input.txt", "r", stdin)
#define output freopen("output.txt", "w", stdout)
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);
#define mp make_pair
#define pii pair<int,int>
#define pss pair<string,string>
#define fi first
#d... | ALGO | 0.999957 | 4.44163 |
441f6f4a-ab87-440a-a5bb-759845872fb4 | KIRITOASUNAFOREVER/Binusian2024AlgoritmaPemrograman | BINUSIAN 2024 WEEK 5 BAWA PULANG/Stairs Jumping (Problem G).cpp | #include <stdio.h>
int main() {
long long int t,k,n,i,j,beda,arr[100000],tinggiMaksimal,lompatMinimal;
scanf("%lld", &t);
for (k = 1; k <= t; k++) {
scanf("%lld", &n);
tinggiMaksimal = -1;
lompatMinimal = 0;
for (i = 0; i < n; i++) {
scanf("%lld", &arr[i]);
... | ALGO | 0.999495 | 3.140467 |
4262cc1e-65d0-43ab-96aa-99e7145a35ed | Nhatsp-ops/btc- | bt231.cpp |
#include<bits/stdc++.h>
using namespace std;
void nhapmang(unordered_map<int,int> a,int n){
for(int i=0;i<n;i++){
int x;
cin >> x;
a[x]++;
}
for(auto x:a){
if(x.second==1)
cout << x.first << ",";
}
}
int main(){
int n,x,y;
cin >> n;
unordered_map<int,int> a;
nhapmang(a,n);
return 0... | ALGO | 0.999435 | 3.863181 |
de79d83d-8c37-4b26-8219-ea227c8a9c8a | UdjinM6/dash_unforked | src/llmq/chainlocks.cpp | #include <llmq/chainlocks.h>
#include <llmq/quorums.h>
#include <llmq/instantsend.h>
#include <llmq/utils.h>
#include <llmq/signing_shares.h>
#include <chain.h>
#include <chainparams.h>
#include <consensus/validation.h>
#include <masternode/sync.h>
#include <net_processing.h>
#include <scheduler.h>
#include <spork.h>
... | TOOL | 0.970498 | 6.370121 |
908b1b97-7d6c-45a6-bcd4-e84fef347a83 | abhijeet141/Leetcode-DSA-Question | Striver SDE Sheet/SORTING/selection.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int *a = new int[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
// for (int i = 0; i <= n - 1; i++)
// {
// int min = i;
// for (int j = i + 1; j < n; j++)
// {
// i... | ALGO | 0.999982 | 3.968576 |
74d1684e-2802-4db4-ae56-8a01b48c46ef | Goddard/path-planning | src/Eigen-3.3/test/sparse_solvers.cpp | #include "sparse.h"
template<typename Scalar> void
initSPD(double density,
Matrix<Scalar,Dynamic,Dynamic>& refMat,
SparseMatrix<Scalar>& sparseMat)
{
Matrix<Scalar,Dynamic,Dynamic> aux(refMat.rows(),refMat.cols());
initSparse(density,refMat,sparseMat);
refMat = refMat * refMat.adjoint();
for (i... | TEST | 0.907385 | 5.216745 |
91f197b2-8cc4-4362-806a-416101492c4f | so0oppy/Algorithm | 프로그래머스/2/12914. 멀리 뛰기/멀리 뛰기.cpp | #include <string>
#include <vector>
using namespace std;
// 1, 2, 3, 5, 8, 13, ...
// dp(n) = dp(n-1) + dp(n-2)
long long solution(int n) {
long long answer = 0;
vector<int> dp(3, 0); // n-2, n-1, n
dp[0] = 1;
dp[1] = 2;
if(n==1) return 1;
if(n==2) return 2;
for(int i=2; i<n; i++)
{
... | ALGO | 0.999959 | 5.042822 |
6eb57ee4-1a3c-41bf-99e7-8ee206c72f1c | zhouchen1996/cpp_projects | memory_pool/memory_pool.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
#define MEM_PAGE_SIZE 0x1000 // 4k
// total 4kB, block 32B
struct MemoryPool
{
int block_size; // 32B
int free_count; // 128
void* pMem; // position of the first block
void* ptr; // position of the... | TOOL | 0.869487 | 3.355675 |
1799c01a-e7f8-4a9e-bb83-a20ffffdda24 | billmccord/OpenCV-Android | jni/cvaux/src/cvcalibfilter.cpp | #include "_cvaux.h"
#include <stdio.h>
#undef quad
#if _MSC_VER >= 1200
#pragma warning( disable: 4701 )
#endif
CvCalibFilter::CvCalibFilter()
{
/* etalon data */
etalonType = CV_CALIB_ETALON_USER;
etalonParamCount = 0;
etalonParams = 0;
etalonPointCount = 0;
etalonPoints = 0;
/* camera ... | TOOL | 0.892104 | 4.583013 |
df906fcc-6a76-4ad1-b97b-f49aea87ebdb | MangoFF/algorithm_cpp | 数据结构/二维数组中的查找.cpp | #include "tool.h"
#include <bits/stdc++.h>
using namespace std;
/*
在一个 n * m 的二维数组中,每一行都按照从左到右 非递减 的顺序排序,每一列都按照从上到下 非递减 的顺序排序。
请完成一个高效的函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
*/
bool findNumberIn2DArray(vector<vector<int>>& matrix, int target) {
if(matrix.empty())
{
return false;
}
... | ALGO | 0.999815 | 5.264672 |
aaa20039-cba4-4366-8b3a-2973858b76a8 | hongjianMa/cpp | Algorithm/Acwing/动态规划/线性dp/896最长上升子序列2.cpp | #include <iostream>
using namespace std;
const int N = 1e5 + 10;
int cnt = 0, a[N];
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
{
int x;
cin >> x;
int l = 0, r = cnt;
while (l < r)
{
int mid = l + r >> 1;
if (a[mid] >= x) // ... | ALGO | 0.999993 | 4.088361 |
61bb7a50-492c-4186-9791-675b584786c5 | sandialabs/GenTen | tpls/kokkos/algorithms/unit_tests/TestStdAlgorithmsTeamRemove.cpp | #include <TestStdAlgorithmsCommon.hpp>
#include <algorithm>
namespace Test {
namespace stdalgos {
namespace TeamRemove {
namespace KE = Kokkos::Experimental;
template <class ValueType>
struct UnifDist;
template <>
struct UnifDist<int> {
using dist_type = std::uniform_int_distribution<int>;
std::mt19937 m_gen;
... | TEST | 0.914354 | 7.658037 |
bf363575-f7aa-48c0-91ff-9fa702e76a0e | pawan-nirpal-031/Algorithms-And-ProblemSolving | Active/CodeForces/D_Even_Odd_Game.cpp | // Problem Link : https://codeforces.com/contest/1472/problem/D
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define Mod 1000000007
#define Infinity (ll)1e18
#define Append(a) push_back(a)
#define Pair(a,b) make_pair(a,b)
#define Cle... | ALGO | 0.999964 | 5.125031 |
2b91eb36-4f33-42f0-9a88-6a2bac18e838 | Ryednap/Coding-Competition | CodeChef/JulyCook/e.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "uj.h"
#endif
using vi = vector<int>;
using pii = pair<int, int>;
#define f first
#define s second
int main() {
int qq;
scanf("%d", &qq);
while (qq--) {
int n;
scanf("%d", &n);
int a[n];
for(int i = 0; i < n; ++i) {
scanf("%d", &a[i]);... | ALGO | 0.999458 | 3.659826 |
bdf3e4ac-6023-4e63-bd8b-e4f6db257d56 | nicolas-hernandez/SO-1c-2017 | tp1/simusched/sched_psjf.cpp | #include <vector>
#include <iterator>
#include <queue>
#include "sched_psjf.h"
#include "basesched.h"
#include <iostream>
#include <algorithm>
#include <iostream>
using namespace std;
bool porPrior (Tuple a,Tuple b) { return (a.prior < b.prior); }
bool porCpu (Tuple a,Tuple b) { return (a.cpu < b.cpu); }
SchedPSJF::... | ALGO | 0.999732 | 3.556421 |
403d802a-4e1d-4296-aa25-1da1a74ea64e | langningchen/Etiger | 0016.cpp | #include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main()
{
cin >> a >> b >> c;
cout << max(a, max(b, c)) << endl;
return 0;
}
| ALGO | 0.993373 | 4.039755 |
1a7cb902-5a9f-4fcf-bec3-1c43a5c1d39f | Lakshita2002/LeetCode-Problems-Summers-2021 | miscellaneous problems/fibo_dp.cpp | ll fibo(ll n, int* dp){
// base case
if(n<=1) return n;
// check if we already have the ans in our memo pad
if(dp[n] != -1){
return dp[n];
}
// recursive case
ll ans = fibo(n-1, dp) + fibo(n-2, dp);
// if not then store it in the memo pad
dp[n] = ans;
return ans;
//... | ALGO | 0.999995 | 5.587708 |
a989503d-4683-42e5-80f6-4fc7c026909a | csf0429/Leetcode-Solutions | Array/217. Contains Duplicate .cpp | //
// Created by 蔡少凡 on 6/14/17.
//
#include <iostream>
using namespace std;
#include <vector>
#include <algorithm>
#include <unordered_map>
//class Solution {
//public:
// bool containsDuplicate(vector<int>& nums) {
// if(nums.empty())
// return false;
// sort(nums.begin(),nums.end());
//... | ALGO | 0.998703 | 5.282365 |
a9c315fd-371b-4a6a-94bf-6012fbcc7565 | liyuesolo/Wukong2024 | Projects/RodNetwork/src/Rod.cpp | #include "../include/Rod.h"
#include "../include/Util.h"
void Rod::setupBishopFrame()
{
// rest_tangents.resize(indices.size() - 1);
reference_frame_us.resize(indices.size() - 1);
reference_twist.resize(indices.size() - 1);
prev_tangents.resize(indices.size() - 1);
reference_twist.setZero();
ref... | ALGO | 0.995463 | 3.533036 |
2cba47f7-3713-4b4e-bc69-b94ef864646e | Struna1292/LeetCode | 2121-find-if-path-exists-in-graph/2121-find-if-path-exists-in-graph.cpp | class Solution {
public:
bool BFS(vector<vector<int>>& graph, int source, int target) {
vector<bool> seen(graph.size(), false);
queue<int> q;
q.push(source);
seen[source] = true;
while (!q.empty()) {
int curr = q.front();
q.pop();
if (cu... | ALGO | 0.999977 | 6.244614 |
6915dbf9-9195-4c41-b269-0cf354937532 | Yxin1a/yancy_server | thirdparty/boost_1_87_0/libs/graph/example/r_c_shortest_paths_example.cpp | // Example use of the resource-constrained shortest paths algorithm.
#include <boost/config.hpp>
#ifdef BOOST_MSVC
#pragma warning(disable : 4267)
#endif
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/r_c_shortest_paths.hpp>
#include <iostream>
using namespace boost;
struct SPPRC_Example_Graph_Ver... | ALGO | 0.999905 | 3.783796 |
813000e3-f57d-45a7-8d46-4a800de25cd0 | Tsukumo3/Atcoder | ABC/008/cpp/F.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
int h1;
int h2;
cin >> h1 >> h2;
int ans;
ans = h1 - h2;
cout << ans << endl;
return 0;
} | ALGO | 0.999367 | 3.026366 |
a3414117-6771-4ab7-935e-72f5b4524e14 | the-lockjaw/a2z-sheet | 06_Linked_Lists/03_Medium_LL/12_sort_012_in_ll.cpp | #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) {}
};
void print_LL(ListNode *head)
{
ListNode *temp = head;
while ... | ALGO | 0.999989 | 5.573245 |
85d2ca96-cd3a-43b8-91c3-f36242fd4d6a | tayloryash/myshopping-app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
80f66899-9deb-4f59-814f-fad21db6ce2f | Yg070212/GameProject4 | Program/Class1th (Single Linked List)/Source.cpp | #include <iostream>
using namespace std;
template<typename T>
class SingleLinkedList
{
private:
int size;
struct Node
{
T data;
Node* next;
};
Node* head;
public:
SingleLinkedList()
{
size = 0;
head = nullptr;
}
void push_front(T data)
{
... | ALGO | 0.994845 | 5.501671 |
45dab2a9-e1a8-469a-92dc-76c616b1901d | sarvex/leetcode-solidity | solution/2400-2499/2423.Remove Letter To Equalize Frequency/Solution.cpp | class Solution {
public:
bool equalFrequency(string word) {
for (int i = 0; i < word.size(); ++i) {
int cnt[26] = {0};
for (int j = 0; j < word.size(); ++j) {
if (j != i) {
++cnt[word[j] - 'a'];
}
}
unordered... | ALGO | 0.999973 | 5.706378 |
84093410-baef-48a5-b9ef-e48c9b61b248 | hc-tt/cpp-homework | 2024-11-16/happy.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c,mul;
cin>>a>>b>>c;
mul=a+b;
cout<<mul*5<<endl;
}
| ALGO | 0.999089 | 3.35939 |
06c86604-b88b-4bd4-be27-20265d70235d | guangyuanh/RaS_Cache | gem5/src/systemc/tests/systemc/misc/user_guide/chpt10.1/paramadd.cpp | /*****************************************************************************
paramadd.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/***************************************************************************... | ALGO | 0.985093 | 5.820003 |
153f8f24-656e-4772-a91a-30b673f75e48 | AndrewGls/CarND-MPC-Project | src/Eigen-3.3/doc/examples/TutorialLinAlgSVDSolve.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXf A = MatrixXf::Random(3, 2);
cout << "Here is the matrix A:\n" << A << endl;
VectorXf b = VectorXf::Random(3);
cout << "Here is the right hand side b:\n" << b << endl;
cout << "The least-squares ... | ALGO | 0.999659 | 3.908823 |
9a1c51bf-e949-4f96-959b-add1157ce39f | MaoMao-zk/Introduction-to-Algorithms | Code/Algorithms/A-07-1-QuickSort/randomized_quick_sort_realization.cpp | #include "Utils.h"
#include <stdlib.h>
#include <time.h>
int randomized_partition(int* array, int start, int end)
{
// Chose a random data to end
int pos = start + (rand() % (end - start));
Utils::Exchange(&array[pos], &array[end]);
int x = array[end];
int i = start -1;
int j = start;
whi... | ALGO | 0.99934 | 5.155434 |
96e01462-8e0c-4757-a060-c24e28751616 | lcnzg/lammps-pi | src/USER-MISC/angle_quartic.cpp | /* ----------------------------------------------------------------------
Contributing author: Loukas D. Peristeras (Scienomics SARL)
[ based on angle_harmonic.cpp]
------------------------------------------------------------------------- */
#include "angle_quartic.h"
#include <cmath>
#include "atom.h"
#include... | ALGO | 0.998068 | 5.859569 |
0a637fbd-7186-4821-83ae-b12259c3adae | NicoTheStrongest/laAcademia | lab1/ejercicios_p1/main.cpp | #include <iostream>
#include <limits>
#include <cctype>
#include <string>
using namespace std;
int ejercicio3();
int ejercicio1();
int ejercicio5();
int ejercicio7();
int ejercicio9();
int ejercicio11();
int ejercicio13();
int ejercicio15();
int ejercicio17();
int ejercicio19();
int ejercicio21();
int ejercicio23();
... | ALGO | 0.96236 | 3.226243 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.