uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
5fc8a883-ec85-48c1-9d49-06d02d98590c | hellowode1234/ardupilot_for_nanoradar_radar | libraries/Filter/LowPassFilter2p.cpp | #include "LowPassFilter2p.h"
////////////////////////////////////////////////////////////////////////////////////////////
// DigitalBiquadFilter
////////////////////////////////////////////////////////////////////////////////////////////
template <class T>
DigitalBiquadFilter<T>::DigitalBiquadFilter() {
_delay_elem... | ALGO | 0.985394 | 5.453814 |
1ceb8f0c-f1c8-4261-a568-952ea3a0392f | Bhushan1609/LP | LP-2/Assignment1/Graph.cpp | /*
Implement depth first search algorithm and Breadth First Search algorithm,
Use an undirected graph and develop a recursive algorithm for searching
all the vertices of a graph or tree data structure.
*/
#include <bits/stdc++.h>
using namespace std;
void inputGraphList(vector <int> adjacencyList[], int edges){
fo... | ALGO | 0.998901 | 4.941355 |
c946b3ff-17ec-409e-8126-777070d8f9ba | smlsoft/thai7_2 | 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 |
6556cfbf-b0b2-4a8c-bf38-11f018f733c9 | EnigmaVSSUT/Hacktoberfest2019 | C++/constructBSTFromInOrderAndPreOrder.cpp | //A program to construct a binary tree, given the inorder and preorder traversals of the tree.
# include <iostream>
# include <vector>
# include <map>
using namespace std;
//Structure for binary tree
struct Node
{
int Data;
Node *Left, *Right;
Node(int x)
{
Data = x;
Left = Right = NU... | ALGO | 0.999982 | 6.458812 |
2a658de2-9fc4-4418-bfde-e41faa0884c8 | hitesh-tarani/Data_Structures_and_Algorithms | Graphs_bfs/main.cpp | #include"bfs.h"
using namespace std;
#include<fstream>
#include<cstring>
int numLine(char a[])
{
char comm[70]="wc -l ";
strcat(comm,a);
char endcomm[]=" > temp.txt";
strcat(comm,endcomm);
system(comm);
ifstream infile;
infile.open("temp.txt");
int line;
infile>>line;
infile.close();
return line;... | ALGO | 0.996335 | 4.13329 |
82f05e4a-c289-4664-9570-3555952580be | tranthuy99/thuat_toan_ung_dung | max_subseq.cpp | #include<iostream>
using namespace std;
main(){
int n;
cin>>n;
int *a=new int[n];
for(int i=0; i<n; i++)
cin>>a[i];
int *f=new int[n];
int res=a[0];
f[0]=a[0];
for (int i=1; i<n; i++){
f[i]=max(a[i], f[i-1]+a[i]);
res=max(res, f[i]);
}
cout<<res;
}
| ALGO | 0.999944 | 3.616443 |
c44ea40e-a875-41ab-bcee-cc7da356c373 | MaelstromDef/Assignment_2 | bst.cpp | //
// Created by cse310 on 3/25/22.
//
#include "bst.h"
#include "utility.h"
#include "hash.h"
#include <cstring>
#include <iostream>
/*
int numNodes = 0;
int height = 0;
int heightL = 0;
int heightR = 0;
int tempHeight = 0;
int dir = -1;
*/
// Creates a leaf node for the bst being created in createBST. This leaf ... | ALGO | 0.972388 | 3.528844 |
92c77498-e5e3-4705-b0d2-b800eb170254 | ishandutta2007/codeforces | aidos/normal/810/B.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef WIN32
#define I64 "%I64d"
#else
#define I64 "%lld"
#endif
typedef long long ll;
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define all(s) s.begin(), s.end()
#define sz(s) (int(s.size()))
#define fname "a"
#define MAXN 3000003
in... | ALGO | 0.999778 | 3.678205 |
48271353-43ef-4612-92cc-01a300583362 | raincross7/code-similarity | codes/train_code/problem159/problem159_269.cpp | #include <bits/stdc++.h>
#include<stdlib.h>
#include<iostream>
#include<math.h>
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long
#define INF 2000000000
#define Min(a,b) (a<b?a:b)
#define Max(a,b) (a>b?a:b)
#define PI 3.1415926535897932
using namespace std;
int main()
{
IOS;
in... | ALGO | 0.999797 | 3.191666 |
163752f1-0cc6-47e4-9406-ab0bb1943381 | rohankumardubey/XeGTAO | Source/IntegratedExternals/meshoptimizer/indexgenerator.cpp | #include <assert.h>
#include <string.h>
namespace meshopt
{
static unsigned int hashUpdate4(unsigned int h, const unsigned char* key, size_t len)
{
// MurmurHash2
const unsigned int m = 0x5bd1e995;
const int r = 24;
while (len >= 4)
{
unsigned int k = *reinterpret_cast<const unsigned int*>(key);
k *= m;
... | ALGO | 0.962875 | 6.945102 |
6d209ba9-e750-40c9-b3ab-a070271181e8 | manas10001/BEIT | TE/Sem 2/SL-5/assign 4/minMax.cpp | /*
MAX AND MIN IN ARRAY USING DI
IF ARRAY IA ALREADY SORTED DIRECTLY DISPLAY ELSE
*/
#include<iostream>
using namespace std;
int MIN = 999;
int MAX = 0;
//accept the array
void accept(int ar[],int sz){
int i;
for(i = 0;i < sz; i++){
cout<<"Enter element: ["<<i+1<<"] : ";
cin>>ar[i];
}
}
//display the arra... | ALGO | 0.99982 | 4.278023 |
08543867-136d-491a-8331-c83c5e746b88 | ishandutta2007/codeforces | z18/normal/1246/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int n, d[maxn + 3], ch[maxn + 3], p[maxn + 3];
int m, id[maxn + 3], dfn[maxn + 3], rht[maxn + 3], k, a[maxn + 3];
vector<int> G[maxn + 3];
void dfs_1(int u) {
ch[u] = -1;
for (int i = 0, v; i < G[u].size(); i++) {
v = G[u][i];
dfs_1(v);
if (c... | ALGO | 0.99998 | 4.132176 |
2bd15f8f-bf2b-4bb8-bfd7-55ec029556ac | Mocknbrd/Codeforces_solutions | Code/A_The_Enchanted_Forest.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O2")
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wc++11-extensions"
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define see(statement) cout << statem... | ALGO | 0.99998 | 4.723114 |
407229cc-2dd5-4794-82aa-a713e4cce803 | GabrielRibeiroRodrigues/Maratona | maratonas/codeforces/A. I_love_%username%.cpp | #include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define d(x) cout<<#x<<" = "<<x<<endl;
#define pb push_back
#define pf push_front
#define mp make_pair
#define f first
#define s second
#define r(i,n) for(int i = 0; i < (n); i++)
typedef long long ll;... | ALGO | 0.999954 | 3.924415 |
4d35fadd-a6ba-41a8-99d3-8f9f6adf4791 | ishandutta2007/codeforces | saketh/normal/1187/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})
#define pb push_back
#define eb emplace... | ALGO | 0.999996 | 3.622177 |
d17e4222-859f-40e0-bdc0-df85fb9fc9c5 | atrainag/code-repo | Atcoder/ABC255/B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <utility>
#include <cmath>
#include <iomanip>
#include <map>
#include <stack>
#include <string>
#include <cstring>
#define all(x) x.begin(),x.end()
#define last(x) x.size()-1
#define ll long long
#define vi vector<int>
#define pi pair... | ALGO | 0.999978 | 4.022821 |
556d08e1-f01c-43e7-a0f6-4072ad4fbb87 | Abd44Arfat/e_commerce-advanced | 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 |
058db5b7-83a3-4e33-846a-82e1da2c3bc9 | ZhuangPeng97/BuildFaceFlowDataCode | tools/Fast_RNRR-master/include/igl/mat_to_quat.cpp | // This could be replaced by something fast
template <typename Q_type>
static inline Q_type ReciprocalSqrt( const Q_type x )
{
return 1.0/sqrt(x);
}
//// Converts row major order matrix to quat
//// http://software.intel.com/sites/default/files/m/d/4/1/d/8/293748.pdf
//template <typename Q_type>
//IGL_INLINE void ig... | ALGO | 0.998655 | 6.545238 |
8b78488e-18be-4310-8afd-ba0850fdb647 | ishandutta2007/codeforces | chaeyihwan/normal/1537/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll h[200002];
int main()
{
ios::sync_with_stdio(false); cin.tie(NULL);
int t;
cin >> t;
while(t--){
int n; cin >> n;
for(int i=1;i<=n;i++) cin >> h[i];
sort(h+1, h+n+1);
int opt = 1;
for(int i... | ALGO | 0.999953 | 3.214418 |
76dde5b6-1f53-4b89-afbf-420ee2dbed38 | Bigcheese/libcxx | test/algorithms/alg.sorting/alg.permutation.generators/prev_permutation.pass.cpp | // <algorithm>
// template<BidirectionalIterator Iter>
// requires ShuffleIterator<Iter>
// && LessThanComparable<Iter::value_type>
// bool
// prev_permutation(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "../../iterators.h"
#include <cstdio>
int factorial(int x)
{
int... | TEST | 0.974283 | 6.962414 |
8461cde4-2495-4e75-aceb-ff29b5f108f6 | ishandutta2007/codeforces | dmitrygrigorev/normal/863/C.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stdlib.h>
#include <cmath>
#include <math.h>
#include <fstream>
#include <bitset>
#include <time.h>
#include <queue>
#include <deque>
#define int long long
#define D... | ALGO | 0.99996 | 3.543463 |
a0596c4b-998c-43e3-a8f8-49fd004ea28d | nabhajit/coding | oops/oops/class-withen-class.cpp | #include<iostream>
using namespace std;
class Gun //data type
{
private:
int ammo;
int damage;
int scope;
public:
//getters
int getammo()
{
return ammo;
}
int getdamage()
{
return damage;
}
int getscope()
{
return scope;
}
/... | TOOL | 0.862419 | 3.722381 |
8abf6cec-42e2-4782-942e-621bb92b191d | displayio/unity_sample | DIO_Test_iOS/Il2CppOutputProject/Source/il2cppOutput/Generics__5.cpp | #include "pch-cpp.hpp"
template <typename R, typename T1, typename T2>
struct InterfaceFuncInvoker2
{
typedef R (*Func)(void*, T1, T2, const RuntimeMethod*);
static inline R Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1, T2 p2)
{
const VirtualInvokeData& invokeData = ... | TOOL | 0.998054 | 5.026871 |
90f453b7-3929-47aa-92c1-8622e69997c6 | vita-epfl/GEM | pseudo_labeling_pipeline/trajectory_inference/droid_trajectory/droid_slam/thirdparty/eigen/doc/examples/Tutorial_ArrayClass_interop.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = (m.array() + 4).matrix() * m;
cout << "-- Combination 1: --" << endl << result << endl << e... | ALGO | 0.999629 | 4.531452 |
87df978f-388f-4405-965c-e0d9785a995f | syurskyi/Python_Topics | 125_algorithms/_examples/_algorithms_challenges/leetcode/leetCode/TwoPointers/345_ReverseVowelsOfString.cpp | /*
* @Author: <EMAIL>
* @Last Modified time: 2016-07-04 12:20:16
*/
class Solution {
public:
string reverseVowels(string s) {
long left = 0, right = s.size()-1;
set<char> all_vowels = {'a', 'A', 'e', 'E', 'i',
'I', 'o', 'O', 'u', 'U'};
while(left < right)... | ALGO | 0.999936 | 5.841906 |
e4287e04-cf73-4308-8ecc-2d992544f048 | Mr-Magnificent/programming | cf-686-d2-a.cpp | #include<bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
int n; unsigned long long x;
int dis = 0;
cin >> n >> x;
for (int i = 0; i < n; i++) {
char ch; long long int d = 0;
cin >> ch;
cin >> d;
d = abs(d);
switch(ch) {
case '+':
x += d;
break;
case '-':
if ... | ALGO | 0.999925 | 3.688754 |
73f28ac0-04a0-49ee-b23f-d91b13c87efa | Bobbyiii21/JAR_V2 | src/JAR-Template/PID.cpp | #include "vex.h"
PID::PID(float error, float kp, float ki, float kd, float starti) :
error(error),
kp(kp),
ki(ki),
kd(kd),
starti(starti)
{};
PID::PID(float error, float kp, float ki, float kd, float starti, float settle_error, float settle_time, float timeout) :
error(error),
kp(kp),
ki(ki),
kd(kd)... | TOOL | 0.986591 | 4.965625 |
d371e215-c757-478d-96c3-83cb443fa2e6 | Ranjan-11/Assginment_C_plusPlus | SumOfReverse.cpp | //WAP to print the sum of a given number and its reverse.
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter a number :";
cin>>n;
int x=0;
int z=n;
while (z>0)
{
x*=10;
x+=(z%10);
z/=10;
}
cout<<n+x<<endl;
} | ALGO | 0.999755 | 4.235702 |
63a7fc94-1fb3-4cf9-9132-0943cf8ac25e | payal15604/Data_Structures | Linked List/Reorder List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
void reorderList(List... | ALGO | 0.999946 | 5.780234 |
c30db326-704d-40e4-bb59-eebc285950e3 | tao73bot/codes | codeforces_1541_A.cpp | #include <bits/stdc++.h>
using namespace std;
#define SIS std::ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define ll long long
#define gelo return 0
#define khela_shuru int main()
void solve()
{
int n,i;
cin >> n;
if(n%2==0){
for(i=1;i<=n;i++){
cout << (i%2==0 ? i-1 : i+1) << " ";
}
}
else{
cout <... | ALGO | 0.999833 | 4.660668 |
613a69bd-642e-4b88-b484-6005a09414de | qiushan996/helloalgorithm | LeetcodeTop100/others/Array/643_MaximumAverage.cpp | /*题目描述: 643_子数组最大平均数
You are given an integer array nums consisting of n elements, and an integer k.
Find a contiguous subarray whose length is equal to k that has the maximum average value and return this value. Any answer with a calculation error less than 10-5 will be accepted.
给定一个由 n 个元素组成的整数数组 nums 和一个整数 k。
查找一个长... | ALGO | 0.995621 | 6.69982 |
b962ea70-4bac-48d1-bc6c-c5c274788ab0 | Yaro2709/AlgoProblems | 15/1836B.cpp | #include<iostream>
using namespace std;
typedef long long LL;
int main() {
int t;
cin >> t;
while (t--) {
LL n, k, g;
cin >> n >> k >> g;
LL a = (g + 2 - 1) / 2 - 1;
LL b = a * n;
LL sum = g * k;
if (k == 0) {
cout << 0 << endl;
continue;
}
if (n == 1) {
cout << 0 << endl;
continue;
... | ALGO | 0.999809 | 3.550742 |
afea631f-5dff-41e2-bad5-83a7ee230c38 | daseyb/gpis-light-transport | src/core/math/Mat4f.cpp | #include "Mat4f.hpp"
#include "Quaternion.hpp"
#include "Angle.hpp"
#include <cmath>
namespace Tungsten {
Mat4f Mat4f::toNormalMatrix() const
{
return scale(1.0f/Vec3f(right().lengthSq(), up().lengthSq(), fwd().lengthSq()))**this;
}
Vec3f Mat4f::extractRotationVec() const
{
Mat4f m = extractRotation();
... | ALGO | 0.980132 | 6.839206 |
072e6e10-13d0-45ca-8971-60a8771488c7 | msm8660coolstuff/android_frameworks_av | media/libstagefright/codecs/amrwb/src/isp_isf.cpp | /*
------------------------------------------------------------------------------
Filename: isp_isf.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-----------------------------------------------------------------------------... | ALGO | 0.999315 | 5.655546 |
c19fb19a-d4c3-4460-b189-c7cccc19c9a5 | eshaagarwa/Leedcode_Solution | 0547-number-of-provinces/0547-number-of-provinces.cpp | class UnionFind {
public:
UnionFind(int n) : count(n), id(n), rank(n) {
iota(id.begin(), id.end(), 0);
}
void unionByRank(int u, int v) {
const int i = find(u);
const int j = find(v);
if (i == j)
return;
if (rank[i] < rank[j]) {
id[i] = j;
} else if (rank[i] > rank[j]) {
... | ALGO | 0.999979 | 6.368419 |
c6848046-f213-4236-bfea-85d2be15c8e6 | 2mulin/brushQuestion | LeetCode/algorithm/101_200/191_hammingWeight.cpp | /********************************************************************************************
* @author reddragon
* @date 2021/3/22
* @brief 1的个数
* 1. 循环检查
* 我们可以循环检查给定整数二进制的每一位是否为1
* 时间复杂度: O(K)k最大32 空间复杂度: O(1)
*
* 2. 位运算优化
* 观察这个运算:n & (n - 1),其运算结果恰为把 n 的二进制位中的最低位的 1 变为 0 之后的结果。
* 如6 & (6 - 1) = ... | ALGO | 0.99966 | 5.806184 |
d3341607-2351-491e-9b92-4a7214aa3bb7 | mogeku/MyOpenCV | samples/cpp/convexhull.cpp | #include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
static void help(char** argv)
{
cout << "\nThis sample program demonstrates the use of the convexHull() function\n"
<< "Call:\n"
<< argv[0] << endl;
}
int main( int argc, c... | ALGO | 0.988574 | 6.020255 |
3da03d59-532f-4992-93d7-469882554564 | sanjanprakash/LeetCode | paritysort.cpp | class Solution {
public:
vector<int> sortArrayByParity(vector<int>& A) {
int i = 0, j, n = A.size();
for (j = 0; j < n; j++) {
if (A[j]%2 == 0) {
swap(A[i], A[j]);
i++;
}
}
return A;
}
};
| ALGO | 0.999965 | 5.607037 |
ac351512-2dc2-4238-8628-c55c10d76830 | IshmamHaque1112/Ishmam-s-Projects | Haque_Ishmam_HW2_modified.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
bool equivalent(int a[],int b[],int n){
int h=n*2;
int c[h];
int y[n];
for(int i=0;i<n;i++) c[i]=a[i];
for(int i=0;i<n;i++) c[i+n]=b[i];
for(int i=0;i<n;i++){
for(int j=n;j<h;j++){
if(c[i]==c[j]) y[i]=abs(i-j);
}
}
int k=y[... | ALGO | 0.998465 | 3.271807 |
b23e32d7-b8ec-46aa-a26d-275e467541c4 | muthu165/C-Plus-Plus-programs-and-Data-Structures | RGYB.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string original="YRBR";
string guess="BRYY";
int ans=0;
for(int i=0;i<guess.size();i++){
if(guess[i]==original[i]){
ans+=2;
original[i]='*';
guess[i]='*';
// cout<<guess[i]<<" "<<original[i]<<" "<<ans<<endl;
}
}
for(int i=0;i<guess.size()... | ALGO | 0.999795 | 3.239932 |
b887dcbb-2e4e-4b85-bf71-90a7f8c34c2b | ishandutta2007/codeforces | aaaaajack/normal/776/D.cpp | #include<bits/stdc++.h>
#define N 100100
using namespace std;
int xr[N];
int ce[N],cv[N];
bool vis[N];
vector<int> g[N];
bool DFS(int u,int c){
if(vis[u]) return cv[u]==c;
vis[u]=true;
cv[u]=c;
for(int i=0;i<g[u].size();i++){
int e=g[u][i];
if(!DFS(u^xr[e],c^ce[e]^1)) return false;
}
return true;
}
int main()... | ALGO | 0.999982 | 3.927075 |
1a78098e-0aaa-4eab-af37-5d0cc56083a5 | Cation-Coder6/DSA-Topicwise-Practise | Binary Tree/1.Traversal.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *left;
Node *right;
Node(int val){
data = val;
left = nullptr;
right = nullptr;
}
};
void preorder_traversal(Node *root){
if(root == nullptr){
return;
}
cout<<root->data<<" ";... | ALGO | 0.99999 | 5.060734 |
93ea3ef0-7a58-48ef-812c-921017e0dcdd | 201341/AlgorithmSol | jobdu/jobdu1018.cpp | //#include <stdio.h>
//
//int main() {
// int n,b;
// int a[1000];
// while(scanf("%d",&n) != EOF) {
// int count = 0;
// if(n==0) break;
// for(int i=0;i<n;++i) {
// scanf("%d",&a[i]);
// }
// scanf("%d",&b);
// for(int i=0;i<n;++i) {
// if( b == a[i])
// count++;
// }
// printf("%d\n",count);
//
// }
/... | ALGO | 0.99899 | 3.379363 |
b5e5d25c-06f2-4793-a515-71e659cd7ea8 | obalcells/problemas | graphs/mst/system.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef long long int ll;
class UnionFind {
private: vi p, rank;
public:
UnionFind(int N) {
rank.assign(N, 0);
p.assign(N, 0);
for(int i = 0; i < N; ++i) p[i] = i;
}
int findSet(int i... | ALGO | 0.999468 | 3.493194 |
b1625276-2eb5-4207-b27f-31c6b3174842 | suzumiyayuhi/LeetCodeTrain | 随便做/优先队列/#考场就座.cpp | class ExamRoom {
public:
int N;
set<pair<int, int>, std::function<bool(const std::pair<int, int>&, const std::pair<int, int>&)>> interval;
unordered_map<int, int> left;
unordered_map<int, int> right;
ExamRoom(int n) : N(n), interval(compare__())
{
}
std::function<bool(const st... | ALGO | 0.999897 | 6.084217 |
833fea33-6f03-4724-9d5a-9b5a47395ce9 | Cellul4r/Comp_Programming | kattis/losingleaves.cpp | /*
* author : cellul4r
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
#define all(x) x.begin(), x.end()
const char nl = '\n';
const int N =1e6+1;
const int INF = 1e9+7;
const ll LINF = 1e18+7;
... | ALGO | 0.99998 | 4.428575 |
ff1f1437-87b8-436e-9b00-40d604704b18 | SanchoCC/Simulation | libs/glm/test/gtx/gtx_fast_trigonometry.cpp | #include <glm/ext/scalar_ulp.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_trigonometry.hpp>
#include <glm/gtx/integer.hpp>
#include <glm/gtx/common.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/trigonometric.hpp>
#include <cmath>
#i... | TEST | 0.961289 | 6.517436 |
0a83fa1e-3896-44f6-abe0-e970a639a76a | creekorful/orbiter-sdk | samples/Dragonfly/vectors.cpp |
#include "vectors.h"
#include <math.h>
const double PI = 3.14159265358979;
vector3 vector3::operator + (vector3 p1)
{ vector3 p2;
p2.x=x+p1.x;p2.y=y+p1.y;p2.z=z+p1.z;
return p2;
}
void vector3::operator += (vector3 p1)
{ x+=p1.x;y+=p1.y;z+=p1.z;}
vector3 vector3::operator - (vector3 p1)
{ vector3 p2;
p2.x=x-... | TOOL | 0.97508 | 3.973413 |
22a2c93f-dae3-428b-982e-12ec559df474 | cowkjw/Algorithm | 프로그래머스/unrated/181931. 등차수열의 특정한 항만 더하기/등차수열의 특정한 항만 더하기.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int a, int d, vector<bool> included) {
int answer = 0;
int temp = a;
vector<int> v;
for(int i = 1;i<=included.size();i++)
{
if(included[i-1])
{
answer+=temp;
}
temp+=d;
}
retur... | ALGO | 0.999096 | 3.857387 |
4ff498b2-cb88-424c-9f1c-be16f7908c6a | bixl007/DSA-CPP | 190_topoSortBFS.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> topologicalSort(vector<vector<int>> &edges, int v, int e)
{
// Write your code here
unordered_map<int, list<int>> adj;
for (int i = 0; i < e; i++)
{
int u = edges[i][0];
int v = edges[i][1];
adj[u].push_back(v);
}
... | ALGO | 0.99999 | 4.920101 |
8d3f8adf-2571-4df4-8a5a-19ad68bb9865 | xbaotg/training | Codeforces/456/a/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define fort(x, a, b) for (int x = a; x <= b; x++)
#define ford(x, a, b) for (int x = a; x >= b; x--)
#define printv(v, sep) if (v.size() - 2 >= 1) fort(i, 0, v.size() - 2) cout << v[i] << sep; cout << v[v.size() - 1];
#define ll long long
#define vi vector<int>
#define v... | ALGO | 0.999648 | 3.419374 |
b01cb9ad-46ae-4d02-96d0-f3c637556c1f | sarvex/leetcode-guile | solution/0500-0599/0572.Subtree of Another Tree/Solution.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.999966 | 6.312401 |
737787c5-dfa5-47a4-96db-6dfbaf813d73 | Arthur-AZ-Zhou/UCLA-CS31 | Assignment5/utilities.cpp | // utilities.cpp
#define _CRT_SECURE_NO_DEPRECATE
#include "utilities.h"
#include <iostream>
#include <fstream>
#include <cstring>
#include <cctype>
#include <random>
#include <utility>
using namespace std;
//*********************
//*** On a Windows system, if you provide a path for the wordfilename,
//***... | TOOL | 0.981446 | 5.809428 |
b6a46301-92d6-4b28-bd75-2c12a6babad6 | Lnstore03/Jobsheet_7 | 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 |
4285853d-4e5c-4d67-8659-5eccfc9f9571 | ajifoster3/Multi-Drone-Wind-Turbine-Coverage | utility_libraries/genetic_algorithm_library/src/ReproductionMechanism/IPGAHorizontalReproductionMechanism.cpp | #include "IPGAHorizontalReproductionMechanism.h"
#include <iostream>
#include <set>
IPGAHorizontalReproductionMechanism::IPGAHorizontalReproductionMechanism(std::shared_ptr<FitnessCalculator> fitnessCalculator,
double citiesPerSalesmanMutationPro... | ALGO | 0.999998 | 6.10729 |
6a6d6c77-f795-424d-9060-893898d77d0b | Ashutosh-as/data-structures | powx-n/powx-n.cpp | class Solution {
public:
double myPow(double x, int n) {
if(n==0){
return 1;
}
double val=myPow(x,n/2);
if(n<0){
x=1/x;
}
if(n%2==0){
return val*val;
}else{
return val*val*x;
}
}
}; | ALGO | 0.999675 | 5.926526 |
85d52517-aae5-4644-8e6a-ceb24569086f | ishandutta2007/codeforces | sunset/normal/1145/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
#ifdef wxh010910
freopen("input.txt", "r", stdin);
#endif
int a;
cin >> a;
for (int i = 3; ~i; --i) {
bool ok = true;
for (int j = i + 1; j < 4; ++j) {
if (!(a >> j & 1)) {
ok = false;
}
}
if (ok) {
a ^= 1 << ... | ALGO | 0.999948 | 3.641435 |
0c6d3c7d-be67-4d15-8584-39eb96f0d185 | PIlotcnc/pytorch | aten/src/ATen/native/quantized/cpu/q_adaavgpool.cpp | #include <ATen/ATen.h>
#include <ATen/NativeFunctions.h>
#include <ATen/Parallel.h>
#include <ATen/native/quantized/cpu/quantized_ops.h>
#include <c10/util/math_compat.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <ATen/native/quantized/cpu/qnnpack_utils.h>
namespace at {
name... | TOOL | 0.887481 | 6.770155 |
d528b8af-2713-4e77-ac99-2bea3e602f16 | Johniel/contests | codeforces/e85/C/main.cpp | // codeforces/e85/C/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," ... | ALGO | 0.999988 | 3.798531 |
066b84fb-7a23-42f3-91c0-00eb831b6cd8 | plumzero/memo-algo | 09_string/reverse_word_in_sentence.cpp |
// 58 1 翻转字符串
// 问题:
// 输入一个英文句子,翻转句子中单词的顺序,但单词内字符的顺序不变。
// 为简单起见,标点符号和普通字母一样处理。
// 例如,输入字符串 "I am a student.", 则输出 "student. a am I" 。
// 分析:
// 先翻转整个字符串,再翻转每个单词。
#include <stdio.h>
// 先定义一个函数,传入两个参数,分别指向要翻转字符串的首个字节及最后一个字节
void reverse(char* pb, char* pe)
{
// assert(pb != nullptr && pe != nullptr);
while (p... | ALGO | 0.99957 | 4.121045 |
82cb8c12-86b3-49c2-9c97-959b467dd350 | klutt/gecode-tuples | src/performancesrc/int.cpp | #include <gecode/kernel.hh>
#include <vector>
#include <gecode/gist.hh>
#include "../propagators/dfaint.h"
#include "../testsrc/_testbase.cpp"
#include "../common/solutionok.h"
int noSolutions;
using namespace MPG::IntPair;
using namespace MPG;
#include "../common/dfaimp.h"
Dfa *df;
int seed, nostates, notokens, m... | ALGO | 0.997684 | 5.720648 |
8c447579-4128-423e-a994-e364b9e0e4fe | raincross7/code-similarity | codes/train_code/problem480/problem480_418.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>
// output
#define SPBR(w, n... | ALGO | 0.999916 | 5.038404 |
ae1d7570-1ba4-4ac7-800b-835cbcc57b11 | Lenv12138/FPGA_ECE8893 | 2022_Spring/Final_Projects/Yolo-v3-tiny/source_code/src_24Layers/conv_3x3.cpp | //---------------------------------------------------------------------------
// Perform synthesizable tiling-based convolution for a single tile.
//---------------------------------------------------------------------------
#include "conv.h"
void conv_3x3 (
fm_t Y_buf[OUT_BUF_DEPTH][OUT_BUF_HEIGHT][OUT_BUF_WIDTH]... | ALGO | 0.984469 | 3.895984 |
515a2624-1569-49a5-b784-8896eb266b0c | Namir50/C_programming_tutorial | Better calculator C/Source.cpp | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
double num1;
double num2;
char op;
for (int i = 0; i <= 10;++i) {
printf("ENTER A NUMBER: ");
scanf("%lf", &num1);
printf("ENTER SECOND NUMBER: ");
scanf("%lf", &num2);
printf("ENTER OPERATOR: ");
scanf("%s", &op);
if (op == '+') {
... | ALGO | 0.882327 | 3.01219 |
92fb1436-f6dd-4bdf-aa18-80df16d8b69b | dhavalbhatti/CPP-Projects | hierchi_inheritance.cpp | #include <iostream>
using namespace std;
// inheritance is a process of acquiring the properties of one class into another class
// the class which is inheriting the properties is called the child class
// Heirarchical inheritance: one parent class and Multiple child classes
class grandFather
{
public:
void sum(... | TOOL | 0.995818 | 4.948009 |
a5b55c90-9330-4b97-a89e-602cb796fef3 | AstroPatty/graphity | lib/eigen/doc/special_examples/Tutorial_sparse_example_details.cpp | #include <Eigen/Sparse>
#include <vector>
#include <QImage>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs,
Eigen::VectorXd& b, con... | ALGO | 0.99794 | 5.388735 |
2003b677-3254-4771-b18e-d9dce6b12527 | ishandutta2007/codeforces | pavement/normal/1725/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
#define int long long
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define ppb pop_back... | ALGO | 0.999986 | 4.24258 |
b56fcdd7-4a6a-4f83-887d-30ba69a3c14a | devarshi002/DSA_with_CPP | bitwise_operator/b3.cpp | // XOR operator
#include <iostream>
using namespace std;
int main() {
int a = 3;
int b = 7;
cout << ( a ^ b) << endl;
return 0;
} | ALGO | 0.964153 | 4.475415 |
9978a549-e06a-4b8a-8d0b-06088ef6b46c | coilallison11/Sorting | SortDriver.cpp | //****************************************************************************************************
//
// File: SortDriver.cpp
//
// Student: Allison Coil
//
// Assignment: Assignment #10
//
// Course Name: D... | ALGO | 0.995354 | 4.882697 |
a4bb859f-7cbe-4d28-b074-33f41f5569d8 | PlatopiaCore/platopia | src/rpc/mining.cpp | #include "amount.h"
#include "chain.h"
#include "chainparams.h"
#include "config.h"
#include "consensus/consensus.h"
#include "consensus/params.h"
#include "consensus/validation.h"
#include "core_io.h"
#include "dstencode.h"
#include "init.h"
#include "miner.h"
#include "net.h"
#include "policy/policy.h"
#include "pow.... | WEB | 0.990363 | 6.643892 |
647a2832-2bb1-4faf-85e9-dae5c0234504 | MasterIceZ/IMSO | competition_upsolve/gean_dev_3/dungeons/dungeons.cpp | #include "dungeons.h"
#include <bits/stdc++.h>
using namespace std;
const int MxN = 100010;
int n;
vector<int> a, b;
void init(int N, int Q, std::vector<int> A, std::vector<int> B) {
n = N;
a = A;
b = B;
}
int solve(int X, int Y) {
array<int, 2> can_go = {X, X};
int power_have = a[X];
while(can_go[0] >... | ALGO | 0.999409 | 3.800104 |
7bf56fd6-b177-4504-9c98-20151243c6b8 | GafferHQ/gaffer | src/GafferScene/AimConstraint.cpp | #include "GafferScene/AimConstraint.h"
#include "Imath/ImathMatrixAlgo.h"
using namespace Imath;
using namespace Gaffer;
using namespace GafferScene;
GAFFER_NODE_DEFINE_TYPE( AimConstraint );
size_t AimConstraint::g_firstPlugIndex = 0;
AimConstraint::AimConstraint( const std::string &name )
: Constraint( name )
{... | TOOL | 0.955384 | 6.873291 |
4ae05713-c213-47d0-84c7-492729dad83d | osbm/CMP2003 | week_3/main/Ch3_Ex1_MainProgram.cpp | /*The function removeAt of the class arrayListType removes an element
from the list by shifting the elements of the list. However, if the element to be
removed is at the beginning of the list and the list is fairly large, it could take a
lot of computer time. Because the list elements are in no particular order, you
co... | ALGO | 0.987151 | 4.443407 |
ce78ca73-7337-4a30-9d99-0574ba385f6e | vishant007/DSA-QUESTIONS | BS/fb.cpp | // find first and last position of given element in array, facebook question, binary search approach
#include <bits/stdc++.h>
using namespace std;
int findFirst(vector<int>& nums, int target)
{
int ans = -1;
int s = 0;
int e = nums.size() - 1;
while(s <= e){
int mid =s+ (e-s) / 2;... | ALGO | 0.999979 | 5.774969 |
fa216239-d9dd-42f4-a42f-02c33d2aa7d2 | panyan7/CP | Codeforces/Div2/766/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define pll pair<long long,long long>
int tt = 1, n, m, k;
// check long long
void solve() {
cin >> n >> m;
int base_r = (n % 2) ? 1 : 2;
int base_c = (m % 2) ? 1 : 2;
int res = (n/2) + (m/2);
vector<int> ... | ALGO | 0.999911 | 3.481764 |
12d67ce5-2483-429b-95f2-4180a0e55fb9 | goforthecheez/CarND-MPC-Project | src/Eigen-3.3/bench/benchmarkX.cpp | // g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef MATTYPE
#define MATTYPE MatrixXLd
#endif
#ifndef MATSIZE
#define MATSIZE 400
#endif
#ifndef REPEAT
#define REPEAT 100
#endif
int mai... | ALGO | 0.91972 | 3.376298 |
5362f137-b8ac-4404-821e-d91e0336764d | Th0masAndy/KKRT16 | thirdparty/win/miracl/miracl_osmt/source/ps_big.cpp | /*
* C++ class to implement a power series type and to allow
* arithmetic on it
*
* WARNING: This class has been cobbled together for a specific use with
* the MIRACL library. It is not complete, and may not work in other
* applications
*
* See Knuth The Art of Computer Programming Vol.2, Chapter 4.7
*/
#i... | ALGO | 0.984104 | 3.42893 |
464e75c8-71d0-44fe-97fd-60e57f358b1e | LVutner/coc-1.5r7-patched | src/editors/ECore/WildMagic/WmlApprGaussPointsFit3.cpp | #include "WmlEigen.h"
#include "WmlApprGaussPointsFit3.h"
using namespace Wml;
//----------------------------------------------------------------------------
template <class Real>
void Wml::GaussPointsFit(
int iQuantity, const Vector3<Real>* akPoint, Vector3<Real>& rkCenter, Vector3<Real> akAxis[3], Real afExtent[... | ALGO | 0.993188 | 6.478683 |
7d1074ec-a09b-449f-86a6-8e50b06788b7 | TomaSajt/Advent-of-Code | cpp/2022/day5.cpp | #include <bits/stdc++.h>
using namespace std;
void solve1(vector<stack<char>> stc, const vector<array<int, 3>>& reqs) {
for (auto [n, u, v] : reqs) {
while (n--) stc[v].push(stc[u].top()), stc[u].pop();
}
for (int i = 1; i <= 9; i++) cout << stc[i].top();
cout << '\n';
}
void solve2(vector<st... | ALGO | 0.999935 | 5.279015 |
c63471d6-52dc-456e-8163-daa84dec3776 | MuhammadAmitHasan/Data-Structure | M12_Mid/Queries_Again.cpp | #include <bits/stdc++.h>
using namespace std;
class Node {
public:
int val;
Node *next; // next node address
Node *prev; // previous node address
Node(int val) {
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
int count_size(Node *head) {
Node *tmp = he... | ALGO | 0.999828 | 4.065246 |
68e65e9a-9fed-4fbc-832d-94f1467549ae | yy214/INF585-erosion | project_code/lib/igl/moments.cpp | #include "moments.h"
// C++17 would avoid this with an if constexpr below
//
// This makes it so that m1 can be:
// - RowVector3d
// - Vector3d
// - RowVectorXd
// - VectorXd
namespace igl
{
template <bool SingleRow, bool SingleCol> struct moments_resize_3;
template <> struct moments_resize_3<true,false>
... | ALGO | 0.991478 | 6.774904 |
d18da695-949e-476e-bddc-90cf5c7e4e70 | RAGHIBRIZWAN/CPP-Practice | LeetCode_SellStock.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> prices = {2,4,1};
int sell=0,buy=0,count1=0,count2=0,profit=0;
buy = prices[0];
for (int i = 0; i < prices.size(); i++)
{
if (prices[i] < buy)
{
buy = prices[i];
... | ALGO | 0.999923 | 4.456612 |
d0e3268c-516d-4f2d-914d-f6d401fe10a3 | BeautifulTimes/CompProgramming | Codeforces/898d4/c.cpp | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <queue>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int a,b,c,d,e;
int t;
char aa;
cin >> t;
for(int ab = 0;ab<t;ab++)
{
int tot = 0;
for(int x = 0;x<10;x++)
... | ALGO | 0.992663 | 3.473919 |
8ecb8426-58fb-4295-8135-84edccb38cfd | regitaisd/Exercise3 | no7.cpp | //programming challenge no.7
#include <iostream>
using namespace std;
int main(){
float seconds;
cout << "enter a number of seconds" << endl;
cin >> seconds;
float minute = seconds / 60;
float hour = seconds / 3600;
float day = seconds / 86400;
if(seconds >= 60 && seconds < 3600){
cout << "the time is "... | ALGO | 0.856934 | 3.231507 |
5f035114-b2f8-444c-aa06-372edaa7d482 | marimuthusanthosh/problemSolving | 0101-symmetric-tree/0101-symmetric-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.99998 | 6.225858 |
bd7a67f2-a401-4a7c-8a7e-30694ba1389e | AkshayKohad/Data-Structures-and-Algorithms-GFG | Backtracking/N-Queen Problem(1).cpp | class Solution{
public:
bool isSafe(vector<int>&b,int l)
{
if(b.size()==0)
return true;
if(b[b.size()-1]==l+1 || b[b.size()-1]==l-1)
return false;
return true;
}
void solution(int n,vector<bool>&visited,vector<int>&b,vector<vector<int>>&a,int &count,int l)
{
int j = l;
vector<in... | ALGO | 0.99993 | 5.061772 |
40daab3a-cce0-4bfd-b5e9-99ef37cfe403 | chrismars91/Linear-Kalman-Filter-Cpp-Vs-Python | cpp/eigen/bench/sparse_randomsetter.cpp |
#define NOGMM
#define NOMTL
#include <map>
#include <ext/hash_map>
#include <google/dense_hash_map>
#include <google/sparse_hash_map>
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifndef REPEAT
#define REPEAT 1
#endif
#include "BenchSparseUtil.h"
#ifndef MINDENSITY
#define M... | TOOL | 0.934339 | 4.487392 |
6a768e0d-a97a-4a6d-afab-e62382174b71 | singhaditya8499/Codeforces | 1029B.cpp | #include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#define mod 1000000007
#define PI 3.14159265358979323846264338327950
#define eps 1e-9
typedef long long ll;
using namespace std;
bool cmp()
{
//
}
int main()
{
int n;
cin>>n;
ll arr[n];
for(int i=0;i<n;i++)
cin>>arr[i]... | ALGO | 0.999971 | 4.229723 |
68ca0def-8c0c-490c-8f98-4b8f82f6f3a7 | shaowei-cai-group/Z3-Parti-Z3pp-at-SMT-COMP-2024 | solver-files/common/resources/z3pp-src/src/smt/smt_relevancy.cpp | #include "smt/smt_context.h"
#include "smt/smt_relevancy.h"
#include "ast/ast_pp.h"
#include "ast/ast_ll_pp.h"
#include "ast/ast_smt2_pp.h"
namespace smt {
void relevancy_eh::mark_as_relevant(relevancy_propagator & rp, expr * n) {
rp.mark_as_relevant(n);
}
void relevancy_eh::mark_args_as_relevant... | TOOL | 0.992148 | 7.166823 |
865cf4c6-be63-41a8-a209-7217838d49a0 | Sntai20/CPSC-5910-Data-Structures | BookReference/Chapter02/Section2.5/solveTowers.cpp | void solveTowers(int count, char source, char destination, char spare)
{
if (count == 1)
{
std::cout << "Move top disk from pole " << source
<< " to pole " << destination << endl;
}
else
{
solveTowers(count - 1, source, spare, destination); // X
solveTowers(1, source, de... | ALGO | 0.999587 | 5.489542 |
f87ddde6-bbea-489a-aa89-7307b346e307 | sasvat007/CS1804T-Data-Structures-Lab | lab7/plus.cpp | #include <iostream>
using namespace std;
#include <stack>
void plus_function(string);
int main(){
string s;
cout<<"Enter a string with plus symbols:";
cin>>s;
plus_function(s);
}
void plus_function(string s){
int len=s.length();
stack<char> st;
st.push('N');
for (int i=0;i<len;i++){
... | ALGO | 0.999829 | 4.283511 |
efa05398-75c7-4f3a-be3b-e86091dc5f1f | jovinlidan/competitive-programming | CodeForces/GNU C++17/1197B | Pillars/71354536.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
int arr[n+5] = {}, midIdx = -1, needNum = 0;
for(int i = 1; i <= n; i++)
{
cin >> arr[i];
if(arr[i] == n) midIdx = i;
}
bool valid = true;
needNum = arr[midIdx];
int l... | ALGO | 0.999994 | 3.823798 |
e671926e-c8b8-4a38-8549-8425b6b19c7c | mmmilkin/Algorithms-1-sem | LAB 7/LABA 7 C/main.cpp | #include <iostream>
using namespace std;
struct Node {
int chastota;
Node *left;
Node *right;
Node(char sym, int frequency) {
chastota = frequency;
left = nullptr;
right = nullptr;
}
};
struct ListNode {
Node* node;
ListNode* next;
ListNode(Node* newNode) {
... | ALGO | 0.999966 | 4.405351 |
d3f0c139-6798-4e97-8bab-99d696ba9e17 | Dan77721/cpp-basics | 10-templates/main.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;
template <class T>
T** ReadMatrix(string file_name, int num_rows, int num_cols);
template <class T>
void PrintMatrix(T** matrix, int num_rows, int num_cols);
template <class T>
int NumRowsWithoutZeroes(T** matrix, int n... | TOOL | 0.993898 | 3.612615 |
a670fa6b-8bb6-4f15-8dde-823372931bb7 | k352ex/Problem-Solving | BOJ/11000 ~ 12000/11279.cpp | #include <iostream>
#include <queue>
using namespace std;
int main() {
priority_queue<int> q; // 최대 힙
int testcase;
unsigned int x;
cin >> testcase;
while(testcase--) {
cin >> x;
if(x > 0) {
q.push(x);
}
else if(x == 0) {
if(!q.empty()) {
cout << q.top() << '\n';
q.pop();
}
else {
... | ALGO | 0.999959 | 4.409994 |
0606dcae-c570-44e1-bf0d-cb8264a540d8 | Rocker2102/competetive | hackerrank/30-days-of-code/day10-binary-bumbers.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
int main()
{
string n_temp;
getline(cin, n_temp);
int n = stoi(ltrim(rtrim(n_temp)));
int x = n, last = 0, curr;
int maxLen = 0, currLen = 0;
while (x > 0) {
curr = x % 2;
... | ALGO | 0.999961 | 4.945745 |
028abec3-d3df-45e0-bff4-03b881de0cb6 | novagc/prog_hw | 23. Задача №3557. Бинарное дерево (вставка, поиск, удаление)/Source.cpp | #define _CRT_SECURE_NO_WARNINGS
#define ll long long
#include <stdio.h>
#include <limits.h>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <cstdio>
#include <deque>... | ALGO | 0.999896 | 4.153207 |
b3d7a2b4-43b4-4f5d-9ab3-dfd1e5ba53b2 | jhmin-kk99/Algorithm-Study | Tree/25516.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int n, k;
vector<int> adj[100005];
int depth[100005];
int apple[100005];
int cnt = 0;
void bst(int root, int dt) {
queue<int> q;
q.push(root);
while (!q.empty()) {
int cur = q.front();
q.pop();
if (depth[cur] > k)... | ALGO | 0.999726 | 3.905849 |
c29b7bdc-d464-4184-b36f-9294fc7f6606 | gbouthenot/Steem-Engine | include/di_get_contents.cpp | /*---------------------------------------------------------------------------
FILE: di_get_contents.cpp
MODULE: Steem
DESCRIPTION: This is the code for the disk image recognition system that uses
the TOSEC database. It is written as a library to enable it to be used in
other emulators at a later date.
-----------------... | TOOL | 0.966469 | 5.93104 |
6ee9c514-9038-4517-b7ab-c97f193f4688 | reactos/reactos | sdk/lib/cpprt/ehvec.cpp | #include <stddef.h>
void __stdcall MSVCRTEX_eh_vector_constructor_iterator(void *pMem, size_t sizeOfItem, int nItems, void (__thiscall *ctor)(void *), void (__thiscall *dtor)(void *))
{
char *pEnd = static_cast<char *>(pMem) + nItems * sizeOfItem;
for (char *pItem = static_cast<char *>(pMem);
pItem < ... | TOOL | 0.875382 | 3.672312 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.