uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1d343d2f-3068-4a18-adde-a2b671747c07 | ishandutta2007/codeforces | amshz/normal/1628/B.cpp | //khodaya khodet komak kon
# include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <pii, int> ppi... | ALGO | 0.999996 | 4.626502 |
c223c19f-34f4-4d9b-b441-7c304939624c | Kartikey-Kabdwal/LeetCode-Solutions-by-Kartikey | 700-search-in-a-binary-search-tree/700-search-in-a-binary-search-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.999989 | 6.164949 |
38ab4fc4-29be-4784-ad5b-053a6338d12b | ktr03rtk/study-algorithm | atcoder.jp/abc069/arc080_a/Main.cpp | #include <bits/stdc++.h>
#define rep(i, j, n) for (int i = j; i < (int)(n); i++)
using namespace std;
using ll = long long;
int main() {
int N;
cin >> N;
vector<int> A(N);
for (auto &a : A) cin >> a;
int c2 = 0;
int c4 = 0;
int c = 0;
for (auto a : A) {
if (a % 4 == 0) {
c4++;
} else... | ALGO | 0.999933 | 3.794447 |
2dd9753d-5747-4f87-9258-b97daf933c96 | OpenDataCyprus/KIOS | algorithmv5/algorithmv5/ConsoleApplication1/Haversine.cpp | #include "Haversine.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define R 6373
#define TO_RAD (3.1415926536 / 180)
using namespace std;
double ToRad( double nVal )
{
return nVal * (3.1415926536/180);
}
double Haversine( long double nLat1, long double nLon1, long double nLat2, long double nLon2 )
{... | ALGO | 0.999523 | 4.330046 |
6dcd73ec-6434-4c58-84bf-3ee48d093e72 | Vinayak182002/Sem3-ProjectBasedLearning1 | MatrixOperations.cpp | /*
* ======================================
* Program Name: MatrixOperations.cpp
* Created on: December 06, 2022
* Author: Vinayak Shete
* ======================================
*/
#include<iostream>
#define maxSize 25
using namespace std;
class Matrix
{
int mat1[10][10],mat2[10][10],resAdd[10][10],... | ALGO | 0.955426 | 4.284055 |
1bcccda4-5c55-4c0c-81dd-e6016aaa08ab | raincross7/code-similarity | codes/train_code/problem270/problem270_482.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorit... | ALGO | 0.999928 | 3.576091 |
8b09ec67-501c-4417-8ba1-be9b02daf5d6 | ewilbur/ucr-work | CS12/Lab/Lab 3/src/ex1.cpp | #include <iostream>
using namespace std;
const int M = 2,
N = 3;
void printArray(int a[], int arrayLength)
{
for(int i = 0; i < arrayLength; i++)
{
if(i % N == 0 && i != 0)
{
cout << endl;
}
cout << a[i] << ' ';
}
cout << endl;
}
void matrixAdd(i... | ALGO | 0.998955 | 4.029101 |
b0f1044e-2697-4b11-9195-f3b88aa310e1 | k4sud0n/codetree-TILs | 231225/비교에 따른 연산/operation-based-on-comparison.cpp | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if (a > b) {
cout << a * b << endl;
} else {
cout << b / a << endl;
}
return 0;
} | ALGO | 0.997133 | 3.981445 |
8d7dc469-99e7-43e0-8ae4-2adde5424bd1 | sanjanprakash/LeetCode | mergeklists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeKLists(vector<ListNode*>& lists) {
int k = lists.size();
ListNode *mv;
ListNode *ans = ne... | ALGO | 0.999824 | 5.841429 |
3a58d161-7e86-46fd-a6bd-7862d52d7f34 | wenweiming/Program_Language_Learn | CPP/SAMSCalculator/10min code/12Arrays/Main.cpp | #include <iostream>
#include <exception>
#include "PromptModule.h"
#include "ErrorHandlingModule.h"
using namespace std;
char GetOperator(void)
{
char Operator = 0;
cout << "Operator: ";
cin >> Operator;
return Operator;
}
float GetOperand(void)
{
float Operand = 1;
cout << "Operand: ";
cin ... | TOOL | 0.851065 | 5.645753 |
55d2530e-bc89-4bd5-8beb-c8dbe00f43e0 | ishandutta2007/codeforces | _nyusha_/normal/1358/A.cpp | #include<bits/stdc++.h>
using namespace std;
main() {
#ifdef HOME
freopen("input.txt", "r", stdin);
#endif // HOME
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t, n, m;
cin >> t;
while (t--) {
cin >> n >> m;
if (n % 2 == 0) cout << n / 2 * m << '\n';
e... | ALGO | 0.999987 | 5.412172 |
434947c7-0422-43b6-afbf-eab5414a51da | donautech/Telegram-Android-Behaiv | TMessagesProj/jni/libtgvoip/audio/Resampler.cpp | //
// Created by Grishka on 01.04.17.
//
#include <math.h>
#include <string.h>
#include "Resampler.h"
using namespace tgvoip::audio;
static const int16_t hann[960]={
0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0002, 0x0003, 0x0004, 0x0006, 0x0007, 0x0009, 0x000B, 0x000D, 0x000F, 0x0011, 0x0014, 0x0016, 0x0019, 0x001C... | ALGO | 0.898493 | 5.008728 |
60cb442d-9dd4-49ca-8964-878f190c3004 | luyan0422/ProblemSolving | zerojudge/UVa/12250 - Language Detection.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
string str;
int i = 1;
while(1){
getline(cin, str);
if(str[0] == '#') break;
if(str.compare("HELLO") == 0)
cout << "Case " << i << ": ENGLISH\n";
else if(str.compare("HOLA") == 0)
... | TOOL | 0.925725 | 3.872442 |
9baa3ff5-ab72-4f10-9ae5-830239d32b50 | ciobaca/rmt-from-2019 | src/queryacuunify.cpp | #include "queryacuunify.h"
#include "parse.h"
#include "factories.h"
#include <string>
#include <map>
#include <iostream>
#include <algorithm>
#include <vector>
#include <tuple>
#include <chrono>
#include <functional>
#include "factories.h"
#include "variable.h"
#include "varterm.h"
#include "funterm.h"
#include "ldeco... | ALGO | 0.95167 | 4.949056 |
1898e70c-3452-47e2-8de5-56ed76d99436 | Prince-Choudhury/LeetCode-Daily-Challenge | 0025-reverse-nodes-in-k-group/0025-reverse-nodes-in-k-group.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:
ListNode* reverse... | ALGO | 0.999992 | 5.702559 |
8918f920-d1f8-4930-97f1-c3c4bd61cd0d | pr7prashant/Leetcode | 328-odd-even-linked-list/328-odd-even-linked-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:
ListNode* oddEvenList... | ALGO | 0.999927 | 6.039784 |
4be5fac0-7b06-42b2-b04d-ff75a4ab6c46 | Alexander-Ploskin/MathMechReposSemester1 | Homeworks/HW7/7.3/7.3(2).cpp | #include <stdio.h>
#include <string.h>
#include <locale.h>
#include "List.h"
#include "MergeSort.h"
bool test()
{
List* list = createList();
FILE* filePtr = fopen("test.txt", "r");
while (!feof(filePtr))
{
char name[maxLength]{};
char phoneNumber[maxLength]{};
fscanf(filePtr, "%[^-]%*c%*c", name);
fscanf... | ALGO | 0.999309 | 3.907783 |
bc3923d8-3e80-4900-bcfd-827bf862eb73 | Vaibhav-srivastava-knit/compatative-programming | concept/dp/problem based on knapsack/knapsack_ problem_bottom_up_way.cpp | #include<bits/stdc++.h>
using namespace std;
int f[1001][1001];
int knapsack(int wt[],int val[],int n,int size)
{
int ans;
if(n==0||size==0)
return f[0][0]= 0;
if(f[n][size]!=-1)
return f[n][size];
if(size<wt[n-1])
ans=f[n][size]=knapsack(wt,val,n-1,size);
if(size>=wt[n-1])
ans=f[n][si... | ALGO | 0.999993 | 3.946393 |
846baa76-0415-4be4-a228-1726f8b2504e | Abhishekyadavdev/c-_program | loopex1.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int i=1;
while(i<=n){
cout<<i<<" ";
i=i+1;
}
} | ALGO | 0.99931 | 3.714943 |
d9e5a01e-6345-461d-a0e6-a9b2db59a281 | 7cristovao/cpp | exercicios/capitulo08/08-22.cpp | #include <iostream>
#include <string>
using namespace std;
string classifica(double a, double b, double c)
{
if (a*a == b*b == c*c)
return "Retangulo";
if (a*a > b*b + c*c)
return "Obtusangulo";
if (a*a < b*b + c*c)
return "Acutangulo";
else
return 0;
}
int main(int a... | ALGO | 0.999368 | 4.340991 |
75332f88-9cb7-4505-b761-2c079e937a56 | Nasirkamal78/MAD-Assignment | Task/task3/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.998629 | 6.76073 |
12aaf9fc-fc1e-4001-be42-04c1064e02e1 | nadayousryelghandour1/task6 | day6_moster_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.997295 | 6.76775 |
c0594e5e-3df8-4416-999c-41741bc10720 | praveenmunukutla/leetcode | 2722-prime-in-diagonal/prime-in-diagonal.cpp | class Solution {
public:
int diagonalPrime(vector<vector<int>>& nums) {
int rows = nums.size(), cols = nums[0].size();
// Lambda to check if a number is prime
auto isPrime = [&](int a){
if(a <= 1) return false; // 0 and 1 are not prime
for(int i = 2; i * i <= a; i++)... | ALGO | 0.999652 | 6.361095 |
4051ac82-facd-4ed2-b9f8-638e906a8333 | qq378287007/Cpp | thread/threadPool2.cpp | #include <vector>
#include <queue>
#include <memory>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <future>
#include <functional>
#include <stdexcept>
#include <cassert>
#include <iostream>
#include <chrono>
using namespace std;
class ThreadPool
{
public:
explicit ThreadPool(size_t thr... | TOOL | 0.977149 | 5.216982 |
42636ac3-1e17-4ca4-aca3-bec6bd3b58d1 | wol101/GaitSym5 | threepp/src/threepp/geometries/TorusKnotGeometry.cpp |
#include "threepp/geometries/TorusKnotGeometry.hpp"
#include "threepp/math/MathUtils.hpp"
#include <cmath>
#include <vector>
using namespace threepp;
namespace {
void calculatePositionOnCurve(float u, unsigned int p, unsigned int q, float radius, Vector3& position) {
const float cu = std::cos(u);
... | TOOL | 0.947857 | 6.533409 |
0bffa42a-b650-4ad1-a3a5-15f7c229ad1e | iamrahulmeena/DSA | week 2/07. pattern continues/fullpyramid.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
for (int i = 0; i < 5; i++)
{
for (int j = 0; j <= n-i-1; j++)
{
cout<<" ";
}
for (int j = 0; j < i+1; j++)
{
cout<<"* ";
}
cout<<endl;
... | ALGO | 0.999805 | 3.571915 |
4e82c4c3-e987-47bd-910b-149ca451b040 | r-icks/RM_Taskphase | Worksheet1/ 6.cpp | #include<iostream>
using namespace std;
int sumfact(int n)
{
int sum=0;
for(int i=1; i<n; i++)
{
if(n%i==0)
{
sum+=i;
}
}
return sum;
}
int main()
{
int n1,n2;
cout<<"Enter 2 numbers:";
cin>>n1>>n2;
int s1=sumfact(n1);
int s2=sumfact(n2);
i... | ALGO | 0.999855 | 4.387279 |
2cd2c03e-d1f9-4b6e-a0c7-553d6c438f54 | pomelo00o/LEETCODE | src/662.maximum-width-of-binary-tree.cpp | /*
* @lc app=leetcode id=662 lang=cpp
*
* [662] Maximum Width of Binary Tree
*/
/**
* 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:
int widthOf... | ALGO | 0.999838 | 6.390517 |
81379207-c5fe-4d2f-8229-162a3077baca | hwa-yeon/BOJ | 10773.cpp | #include <iostream>
#include <stack>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int K;
cin >> K;
stack<int> mystack;
for (int i = 0; i < K; i++) {
int n;
cin >> n;
if (n == 0) {
mystack.pop();
}
else {
mystack.push(n);
}
}
int sum = 0;
... | ALGO | 0.999872 | 4.623145 |
eb484ab2-2492-4f56-a3b3-8a530f25d9ac | SatyaSusarla/Questions | DSA/general practice/circularLLimplementation.cpp | #include <iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int val){
data=val;
next=NULL;
}
};
void insertathead(node* &head,int val){
node* n=new node(val);
if(head==NULL){
n->next=n;
head=n;
return;
}
node* temp=h... | ALGO | 0.999814 | 4.027853 |
4ba91096-e4fa-4216-872e-ed94c415e10f | mymetalseed/Computing_Geometry_Demo | Computing_Geometry/CppDemo/FunctionFaker.cpp | #include <iostream>
#include<vector>
using namespace std;
//operator(),plusһº
template <class T>
struct M_plus {
T operator()(const T& x, const T& y) const { return x + y; }
};
template<class T>
struct M_minus {
T operator()(const T& x, const T& y) const { return x - y; }
};
int main() {
M_plus<int> plusobj;
M_m... | ALGO | 0.99238 | 4.496346 |
9b87d584-fc5d-4947-817a-884cfd809063 | ppraval/Codez | cplusplus/printingbracketrepresentation.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.999922 | 4.911386 |
93da106d-07a1-4cde-a209-f0c121b28cc6 | veraposeidon/CodeWar2LeetCode | 124.binary-tree-maximum-path-sum.cpp | /*
* @lc app=leetcode id=124 lang=cpp
*
* [124] Binary Tree Maximum Path Sum
*/
/**
* 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:
int maxsum_... | ALGO | 0.999955 | 6.407815 |
528b1125-336d-4365-a956-5427c6c47738 | raincross7/code-similarity | codes/train_code/problem004/problem004_54.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long ans = 0;
int N, K, R, S, P;
cin >> N >> K >> R >> S >> P;
vector<char> T(N);
for(int i = 0; i < N; i++) {
cin >> T.at(i);
}
map<char, int> Points{{'r', R}, {'s', S}, {'p', P}};
map<char, char> my_hands{{'r', 'p... | ALGO | 0.99929 | 3.655238 |
2bef2b2c-84c5-4ef5-8cac-1d64a4c4b428 | Itachi1905/dsa | STL/Queue.cpp | #include<iostream>
#include<queue>
using namespace std;
int main() {
queue<string> q;
q.push("love");
q.push("babbar");
q.push("kumar");
cout<<"Size Before Pop "<<q.size()<<endl;
cout<<"First Element "<<q.front()<<endl;
q.pop();
cout<<"First Element "<<q.front()<<endl;
cout<<"Size... | ALGO | 0.952216 | 4.14264 |
34222754-c766-4005-b72f-d75fd46d2757 | bionicle564/boat-prototype | OpenGLMadness/BulletSource/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp | #include "btConvexPointCloudShape.h"
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
#include "LinearMath/btQuaternion.h"
void btConvexPointCloudShape::setLocalScaling(const btVector3& scaling)
{
m_localScaling = scaling;
recalcLocalAabb();
}
#ifndef __SPU__
btVector3 btConvexPointCloudShape::localG... | ALGO | 0.869266 | 7.407167 |
0cb0eeaa-a8c6-486e-ad75-18efb7eccb6e | jombaek/Leetcode | C++/404._Sum_of_Left_Leaves.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.999859 | 6.604363 |
51e8b5e9-cdfe-4e8a-8545-abf261e48499 | zyin422/CPGrind | X_Camp/402H/H_Cubic.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f first
#define s second
int INF;
vector<int> add(vector<int> v1, vector<int> v2) {
for (int i = 0; i < 64; i++) v1[i] = (v1[i] + v2[i]) % 3;
retur... | ALGO | 0.999961 | 4.220393 |
9c073d46-8a8e-497c-b917-9c2092fa222c | BraianOtondo/Cpp | circulo/main.cpp | #include <cstdlib>
#include <iostream>
#include "circulo/circulo.h"
using namespace std;
int main(int argc, char *argv[]) {
// declaro e inicializo las variables.
int opcion = 0;
bool seguir = true;
float grados = 0;
float iRadio = 0;
cout << "Ingrese el radio del circulo: ";
cin >> iRadi... | TOOL | 0.917322 | 4.466795 |
d72e6f7c-730f-436f-addd-645ad51c82d8 | AkhilSoni0102/Learning-Data-Structures | Segment Tree/Query on Segment tree.cpp | // Given an array A. you need to perform the following two queries:
// 1. Assign A[i] = x
// 2. Print the sum of all the elements of the subarray from L to R.
#include<bits/stdc++.h>
using namespace std;
void BuildTree(vector<int> &A, vector<int> &T, int s, int e, int t){
if(s == e){
T[t] = A[s];
r... | ALGO | 0.999969 | 3.833555 |
eb99c456-da67-41d4-ac3c-9d7a219b0db6 | beomsuong/Programmers | Lv.0/문자열 겹쳐쓰기.cpp | #include <string>
#include <vector>
using namespace std;
string solution(string my_string, string overwrite_string, int s) {
string answer = "";
for(int i=0;i<s;i++){
answer+=my_string[i];
}
answer+=overwrite_string;
for(int i=overwrite_string.size()+s;i<my_string.size();i++... | ALGO | 0.998755 | 3.792412 |
3adacf00-ba09-4021-8d93-da4d40a8623b | aplqo/exercises | others/2020.08/2020.08.31-Exam/maze.cpp | #ifdef APTEST
#include "debug_tools/program.h"
#endif
#include <algorithm>
#include <climits>
#include <iostream>
using namespace std;
constexpr unsigned int inf = UINT_MAX / 4;
const unsigned int maxn = 5, maxm = 200000;
unsigned int n, m;
bool ban[maxm + 3][maxn + 3];
struct Matrix {
Matrix()
{
for (unsigned... | ALGO | 0.999875 | 4.448246 |
43b7469d-88b4-4294-8121-f06c0ea4664e | FP-CC112/BIC01 | Lab13/p3.cpp | /*Escribir una función recursiva
que permita calcular la suma de los n
primeros números naturales.*/
#include <iostream>
using namespace std;
int sumaRec(int n) {
//Caso base
if (n == 0)
return 0;
//Caso recursivo
return n + sumaRec(n-1);
}
int main(){
return 0;
} | ALGO | 0.999325 | 5.416652 |
bc562ba2-6b17-44c9-b460-49f9bd2deb0c | tanvirss13/Leetcode_Solutions_Cpp | LeetcodeLearnSolutions/HashTable/HashSet.cpp | //Using Linked List as Buckets
class MyHashSet {
public:
struct LinkedList{
int val;
LinkedList *next;
LinkedList(): val(0), next(nullptr){}
LinkedList(int x): val(x), next(nullptr){}
LinkedList(int x, LinkedList *next): val(x), next(next){}
};
LinkedList* head;
... | ALGO | 0.999873 | 5.132028 |
1675f3ec-fb4a-492d-aac2-5aac5df4e412 | hasnat0006/CP_SOLUTION | MCC/All About Math/Season 02/G_Binary_Number_4.cpp | //!-----------------------------------------------------!//
//! Author: YUSUF REZA HASNAT !//
//! Created: 13|10|2024 09:14:50 !//
//!-----------------------------------------------------!//
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#def... | ALGO | 0.999795 | 5.153273 |
8b63a2c9-72a3-48aa-8d91-4c7757449784 | huhkyun1275/boost_realize | libs/graph/example/graph_as_tree.cpp | #include <boost/graph/graph_as_tree.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/cstdlib.hpp>
#include <iostream>
class tree_printer
{
public:
template < typename Node, typename Tree > void preorder(Node, Tree&)
{
std::cout << "(";
}
template < typename Node, typename Tree > v... | ALGO | 0.99921 | 6.230203 |
21bd3f48-2b36-4a52-b2f1-5c69ccc28bc0 | Tarela4ka/Programming | Training/CodeForces/All problems/189A.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define mk(a,b) make_pair(a,b)
using vi = vector<int>;
using vvi = vector<vi>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using ii = pair<int, i... | ALGO | 0.999824 | 3.703857 |
7ede77b4-700d-44bc-828f-738b392dbfb2 | hhu1506010220/ACM_Repository | 牛客小白月赛3/B.cpp | #include<bits/stdc++.h>
#define ll long long
const ll mod = 2000120420010122;
using namespace std;
char s[200005];
int main(){
char t[6];
for(int i=0;i<=3;i++){
if(i==0)t[i]='c';
else if(i==1)t[i]='w';
else if(i==2)t[i]='b';
else t[i]='c';
}
while(cin>>s){
int len = strlen(s);
for(int i=0;i<len;i++){
... | ALGO | 0.999975 | 3.865583 |
3d3ab679-6095-4770-a143-e71d84514f31 | HEltim7/cpcode | Luogu/P4556.cpp | #include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <cassert>
using namespace std;
#define endl '\n'
using LL=long long;
const int N=1e5+10,M=20,INF=0x3f3f3f3f;
struct Node {
int l,r;
int ch[2];
int cnt;
} tr[4*20*N];
int idx;
int fa[N][M+1],dep[N];
int ans[N];
vector<int>... | ALGO | 0.999977 | 4.620528 |
6918a9bc-dd22-4cb6-9752-6d45d3d9be1c | koush/android_system_core | libpixelflinger/tinyutils/VectorImpl.cpp | #define LOG_TAG "Vector"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <cutils/log.h>
#include "tinyutils/SharedBuffer.h"
#include "tinyutils/VectorImpl.h"
/*****************************************************************************/
namespace android {
enum {
NO_ERR... | TOOL | 0.974081 | 7.176424 |
4b0333ab-d397-428a-8de6-ed898e2e8cc7 | natansouza2010/project_zeta | 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 |
c6f17560-2ba6-462d-83b8-3708f175be59 | Harleen365/100_Days_Coding_Challenge | Day 20/container_with_most_water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
int maxwater=0;
int left=0;
int right=height.size()-1;
while(left<right){
int width=right-left;
int minhei=min(height[left],height[right]);
int currwater=width*minhei;
maxwater... | ALGO | 0.999944 | 6.701401 |
dbc5be5c-75c1-4b36-a11c-285dbfc72dda | Junichi-K/leetcode-solutions | arrays/prob_3255.cpp | class Solution {
public:
vector<int> resultsArray(vector<int>& nums, int k) {
if(k == 1)
return nums;
int n = nums.size();
vector<int> dp(n, 0);
dp[0] = 1;
int prev_wrong = -1;
for(int i = 1; i < n; i++) {
if(nums[i] != nums[i - 1] +... | ALGO | 0.99996 | 5.486816 |
067dea47-a0e8-4704-8105-c2b34c4924a6 | Raihan-89/CodeChef-Problems | Kitchen_timings.cpp | #include<iostream>
using namespace std;
int main()
{
int i,n,x,y;
cin>>n;
for(i=0;i<n;i++)
{
cin>>x>>y;
cout<<y-x<<endl;
}
return 0;
} | ALGO | 0.999704 | 3.082124 |
496319d4-bd0d-4f14-bd68-67140fccb002 | ishandutta2007/codeforces | hld67890/normal/822/F.cpp | #include <stdio.h>
#include <algorithm>
using namespace std;
const int NN = 120;
struct node {
int v , i;
node *next;
} pool[NN*2] , *g[NN];
int top;
int n;
int d[NN];
void add ( int u , int v , int i ) {
node *tmp = &pool[++top];
tmp -> v = v; tmp -> i = i; tmp -> next = g[u]; g[u] = tmp;
}
void dfs ( int i , in... | ALGO | 0.999637 | 3.984057 |
371e647c-5041-46be-816e-2d8a5cdc53e3 | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Secure/5140422e0d7319a8e2fe07f02cbcafc4d6538732-5.cpp | int cdk_pk_get_npkey(int algo)
{
if (is_RSA(algo))
return RSA_PUBLIC_PARAMS;
else if (is_DSA(algo))
return DSA_PUBLIC_PARAMS;
else if (is_ELG(algo))
return 3;
else {
gnutls_assert();
return 0;
}
} | TOOL | 0.953818 | 3.94068 |
a2a97b73-1463-4c25-959e-d3a0ea167620 | metobtw/metaheuristics_research | main.cpp | #include <iostream>
#include <opencv2/opencv.hpp>
#include <fstream>
#include <string>
#include <random>
#include <vector>
#include <cmath>
#include <filesystem>
#include <cstdlib>
#include <ctime>
using namespace std;
int sign(double x){
// Функция определяет знак числа
return (x > 0) - (x < 0);
}
vector <in... | ALGO | 0.998256 | 4.111782 |
0dcd1f0e-5ab3-419c-acb0-57df20a3943f | TonyTangYu/llvm-project | llvm/lib/Support/Program.cpp | #include "llvm/Support/Program.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace sys;
//===----------------------------------------------------------------------===//
//=== WARNING: Implementation here must contain only T... | TOOL | 0.953796 | 7.194286 |
0dbdf7ce-d9c2-4337-a5f4-b2eac4d6cac0 | stardog-union/boost | libs/circular_buffer/example/circular_buffer_sum_example.cpp | //[circular_buffer_sum_example_1
/*`This example shows several functions, including summing all valid values.
*/
#include <boost/circular_buffer.hpp>
#include <numeric>
#include <assert.h>
int main(int /*argc*/, char* /*argv*/[])
{
// Create a circular buffer of capacity 3.
boost::circular... | TEST | 0.950754 | 6.428323 |
c97a4af4-6b61-4bcb-9ba9-c40884512082 | Pratham2411/DSA-in-CPP | 14. Object Oriented Programming/3. OOPS 2/MyVector.cpp | // Creating a personal vector
#include<iostream>
using namespace std;
class Vector{
public:
int size;
int capacity;
int* arr;
Vector(){
size =0;
capacity =1;
arr = new int[1];
}
void add(int ele){
if(size==capacity){
capacity*=2;
int* arr2 = new int[ca... | ALGO | 0.982281 | 4.161294 |
db05dbc1-e8be-460f-bd57-d27d79e7fc69 | FurryGhoul/Physics | Physics2_class3 - handout/Box2D/Box2D/Collision/b2CollideEdge.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
// Compute contact points for edge versus circle.
// This accounts for edge connectivity.
void b2CollideEdgeAndCircle(b2Manifold*... | ALGO | 0.99964 | 7.528518 |
8509d359-5c7b-4ba2-869d-cf7de1d18a38 | solanki505/CSES-Solutions | sumoftwonum.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define LD long double
const int N = 100010;
int inf = 1e9;
int mod = 1e9 + 7;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ll n,x;
cin>>n>>x;
vector<pair<ll,ll>>arr(n);
for(ll i=0;i<n;++i){
... | ALGO | 0.999957 | 4.409853 |
2904f37c-3170-496f-bbe1-e48010bdcff4 | Neevs1/graphics-assignments | Assignment3/circleGen.cpp | /*
* Author : Neevan Redkar
* Date : 2025-01-31
*/
#include <GL/glut.h>
#include <iostream>
#include <cmath>
int choice =0;
void myInit(void){
glClearColor(1.0,1.0,1.0,1.0);
glPointSize(5.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(-640.0,640.0,-360.0,360.0);
}
void plotAxes(){
for(int... | ALGO | 0.966847 | 5.678037 |
75330aab-e610-4c7f-83b5-bc749e1ee513 | FahimCC/Problem-Solving | Codeforces/A. Opponents.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n, d, maxx, count;
char c;
cin>>n>>d;
int win[d+1] = {0};
for(int i=1;i<=d;i++)
{
for(int j=1;j<=n;j++)
{
cin>>c;
if(c == '0')
{
win[i] = 1;
}
... | ALGO | 0.999121 | 3.604325 |
c4ceb738-aeff-4090-be7c-dc86d0650f6d | daeunohh/SystemExpert | pararellprogramming/HW3/prefix_sum/main.cpp | #include <getopt.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "prefix_sum.h"
#include "util.h"
static void print_help(const char *prog_name) {
printf("Usage: %s [-pvh] [-m method] [-n num_iterations] N\n", prog_name);
printf("Options:\n");
printf(" -h : print t... | ALGO | 0.99975 | 5.244718 |
596a3c2a-93fa-40d8-aea6-17a0a8d33cbd | AmitrajitDas/DSA-CP | 0547-number-of-provinces/0547-number-of-provinces.cpp | ///////////// UNION FIND APPROACH ////////////
class DisjointSet {
public:
vector<int> rank, size, parent;
DisjointSet(int n) {
rank.resize(n + 1, 0);
size.resize(n + 1);
parent.resize(n + 1);
for(int i = 0; i < n; i++) {
size[i] = 1;
parent[i] = i;
... | ALGO | 0.999987 | 6.206335 |
37762905-a7a1-4b63-b2dd-e36eca280a8e | Gauravsharma7299/DSA | Arrays/Question8.cpp | // if an Array contain a spacific element or not
#include<iostream>
using namespace std;
bool specificElement(int arr[],int n ,int specEle){
for(int i=0;i<n;i++){
if(arr[i]==specEle){
cout<<"element found";
return true ;
}
}cout<<"Elemtn not found";
return false;
}... | ALGO | 0.998873 | 4.395065 |
aacfdf35-164e-481b-af42-04a340bffa97 | francescozoccheddu/max-flow-tests | lib/src/graphs/algorithms/residual.cpp | #include <max-flow/graphs/algorithms/residual.hpp>
using MaxFlow::Graphs::ResidualGraph;
using MaxFlow::Graphs::ResidualVertex;
using MaxFlow::Graphs::ResidualEdge;
using MaxFlow::Graphs::flow_t;
namespace MaxFlow::Graphs::Algorithms
{
void augment (ResidualEdge& _edge, flow_t _amount, bool _removeZeroEdge)
{
*_... | ALGO | 0.980554 | 6.923536 |
14479b61-4483-4746-9a99-cb17e9ea48a3 | Anirudh257/Leetcode_Solutions | 1423-maximum-points-you-can-obtain-from-cards/sliding_window.cpp | class Solution {
public:
int maxScore(vector<int>& cardPoints, int k) {
// Time complexity: O(n), Space complexity: O(1)
int len = cardPoints.size();
int subSc = 0;
for (int i = 0; i < k; i++) {
subSc += cardPoints[i];
}
int maxS... | ALGO | 0.999924 | 6.35373 |
a635fa72-d6a5-4c2f-8161-00ada06ddf99 | shubhamnag14/Let-s-C | C INSTRUCTIONS/j.WIND CHILL FACTOR.cpp | #include<stdio.h>
#include<math.h>
main()
{
float temp,vel,wcf;
printf("Enter values of temp in velocity:");
scanf("%f%f",&temp,&vel);
wcf = 35.74 + 0.6215*temp+(0.4275*temp-35.75)*pow(vel,0.16f); // wind chilling factor formule
printf("WIND CHILL FACTOR = %f\n",wcf);
}
| ALGO | 0.996491 | 3.438339 |
6a814879-4d82-4bd0-8912-ff8e937949c8 | ibsarbca/bca1-programs | C++/Solved questions by Siddhant/Armstrong_number.cpp | #include <iostream>
using namespace std;
int main()
{
int origNum, num, rem, sum = 0,digit;
cout << "Enter a positive integer: ";
cin >> origNum;
num = origNum;
while(num != 0)
{
digit = num % 10;
sum += digit * digit * digit;
num /= 10;
}
if(sum == origNum)
cout << origNum <<... | ALGO | 0.999782 | 4.303794 |
550e86c3-a71c-4098-a422-cca28bb59aab | ishandutta2007/codeforces | mhq/normal/911/E.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k;
const int maxN = 2 * (int)1e5 + 10;
int a[maxN];
int main() {
ios_base::sync_with_stdio(false);
//freopen("input.txt", "r", stdin);
cin >> n >> k;
int cur = 1;
stack < int > t;
for (int i = 1; i <= k; i++) {
cin >> a[i];
in... | ALGO | 0.999979 | 3.30865 |
b7444415-4fdc-4f45-8b01-b97ad950d3fe | takamtd/deepmimic | bullet3/src/Bullet3OpenCL/ParallelPrimitives/b3PrefixScanCL.cpp | #include "b3PrefixScanCL.h"
#include "b3FillCL.h"
#define B3_PREFIXSCAN_PROG_PATH "src/Bullet3OpenCL/ParallelPrimitives/kernels/PrefixScanKernels.cl"
#include "b3LauncherCL.h"
#include "Bullet3OpenCL/Initialize/b3OpenCLUtils.h"
#include "kernels/PrefixScanKernelsCL.h"
b3PrefixScanCL::b3PrefixScanCL(cl_context ctx, cl... | ALGO | 0.875812 | 3.363814 |
6d1968fe-1990-4193-a50e-bac0d96696a7 | kxrndy/ENGCE117_Computer_Programming_for_Computer_Engineering | test-midterm/swapnode.cpp | // นาย กรณ์ดนัย ศรีสุริยานุรักษ์
// https://youtu.be/05Xe4QwM6qQ
#include <stdlib.h>
#include <stdio.h>
typedef struct node {
int value ;
struct node *link ;
} NODE ;
void ShowAll( NODE *start ) ;
void AddNode( NODE **start , int value ) ;
void Update( NODE **start , int find , int edit ) ;
void ShowBack (NODE ... | ALGO | 0.999495 | 4.397188 |
cc56ae08-a14c-4346-849f-658aa835dc72 | Harshkaushik04/dsa_cs205 | sorting_algos copy.cpp | #include <iostream>
using namespace std;
int* BubbleSort(int arr[],int arr_length){
int x;
int y;
int* arr_pointer=arr;
for(int i=0;i<arr_length;i++){
for(int j=0;j<arr_length;j++){
//ascending
if(arr[j]>arr[j+1]){
//swaping
x=arr[j];
... | ALGO | 0.99996 | 4.61135 |
19d0aeab-7156-4068-a118-0e59a2a0476f | ndinevski/FINKI-FAX-I-godina | I godina/Objektno-orientirano Programiranje (C++)/prv kolokvium/lab3/lab3_2.cpp | // Да се дефинира класа Potpisuvac во која се чуваат информации за:
// име (низа од максимум 20 знаци)
// презиме (низа од максимум 20 знаци)
// ЕМБГ (низа од максимум 14 знаци)
// За класата да се дефинира copy конструктор, default конструктор и конструктор со аргументи.
// Да се дефинира класа Dogovor, во која се чув... | ALGO | 0.9684 | 4.20591 |
1349dc3e-f21b-4131-8e10-1a937186040d | nguyenductripro/CPP | WITHDRAW MONEY.cpp | #include<bits/stdc++.h>
#define ll long long
#define f(i,a,b) for(int i=a;i<=b;i++)
#define f1(i,a,b) for(int i=a;i>=b;i--)
using namespace std;
void goi()
{
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
}
//1, 2, 5, 10, 20, 50, 100, 200, 500, 1000.
int doi(int n)
{
if(n>=1000)return 1000;
if(n... | ALGO | 0.999714 | 4.68533 |
9089e361-f166-48fe-b1f5-c742181379bd | TusharPachouri/DSA_AtoZ | AtoZ/01_Basics/Recursion/checkPrimeOrNot.cpp | #include <iostream>
using namespace std;
bool primeOrNot(int num)
{
if (num == 2)
{
return true;
}
return primeOrNot(num - 1);
}
int main()
{
int num;
cin >> num;
cout << "number " << num << " is: " << primeOrNot(num);
return 0;
} | ALGO | 0.99988 | 4.243034 |
daf72235-3835-4467-85c9-44e6f315736c | ProjectInfinity-X/frameworks_av | media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Process.cpp | #include "LVPSA.h"
#include "LVPSA_Private.h"
#include "LVM_Macros.h"
#include "VectorArithmetic.h"
#define LVM_MININT_32 0x80000000
static LVM_INT32 mult32x32in32_shiftr(LVM_INT32 a, LVM_INT32 b, LVM_INT32 c) {
LVM_INT64 result = ((LVM_INT64)a * b) >> c;
if (result >= INT32_MAX) {
return INT32_MAX;
... | ALGO | 0.994601 | 4.364079 |
6cc7705a-1b09-4f13-8518-0b31138d3a21 | MahinAshraful/CodeWatch_Data | sample-data/p00013/s315818938.cpp | #include<iostream>
#include<stack>
using namespace std;
int main(void){
stack<int> st;
int n,a;
while(cin>>n){
if(n!=0){
st.push(n);
}else{
a=st.top();
cout<<a<<endl;
st.pop();
}
}
return 0;
} | ALGO | 0.999802 | 3.778727 |
6459773e-4992-44a0-9913-83a6690ae155 | android-la64/bionic | tools/versioner/src/DeclarationDatabase.cpp | #include "DeclarationDatabase.h"
#include <err.h>
#include <iostream>
#include <map>
#include <mutex>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <clang/AST/AST.h>
#include <clang/AST/Attr.h>
#include <clang/AST/Mangle.h>
#include <clang/AST/RecursiveASTVisitor.h>
#include <clang/... | TOOL | 0.857912 | 7.909299 |
41b9673d-eb65-43d0-b805-4e44aa1e7524 | vanryan/pso-related | vr-vicpso/vicpso0.0/func2/main.cpp | /*
Canonical Particle Swarm Optimization
By Van Ryan
@Constant Inertia Weight
@No restraints for velocities or positions
-For A Specific Function
*/
#include"stdio.h"
#include"math.h"
#include"stdlib.h"
#include"time.h"
#include"limits.h"
#include"../settings.h"
int main()
{
srand((unsigned)time(NULL));... | ALGO | 0.999243 | 4.361226 |
e71aa891-0da1-4ebc-8869-49388b655fb7 | Halip26/material-of-cpp | guess-number-game/guess-number-game.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand(time(0));
int number = rand() % 99 + 1;
string name;
cout << "Welcome to Guess Number Game" << endl;
// buat garis doang
for (int i = 0; i <= 35; i++)
{
cout << "-";
}
cout << ... | ALGO | 0.993998 | 4.489943 |
aa8b4413-3e9f-432f-bbd8-048bbe9ebd68 | pacmancoder/dcdr | dcdr-renderer/src/renderer/PathTracer.cpp | #include <dcdr/renderer/PathTracer.h>
#include <dcdr/Constants.h>
#include <dcdr/utils/Rng.h>
#include <cmath>
using namespace Dcdr::Renderer;
using namespace Dcdr::Types;
using namespace Dcdr::Utils;
using namespace Dcdr;
namespace
{
Color get_diffuse(const Material& material, UVCoord uv)
{
return ... | ALGO | 0.985318 | 6.208789 |
8b22af5e-b90f-4523-9e5b-1b136c879d75 | CocoJumbo06/Tyuiu.GandaloevMG.Sprint0 | Tyuiu.GandaloevMG.Sprint0.Task4.V2/Tyuiu.GandaloevMG.Sprint0.Task4.V2.cpp | // Tyuiu.GandaloevMG.Sprint0.Task4.V2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "../Tyuiu.GandaloevMG.Sprint0.Task4.V2.Lib/Tyuiu.GandaloevMG.Sprint0.Task4.V2.Lib.cpp"
using namespace std;
int main()
{
ISprint0Task4* date = new Service1();... | TOOL | 0.982276 | 4.683086 |
333d46aa-0970-4848-a326-7e9b58f3ad38 | raincross7/code-similarity | codes/train_code/problem052/problem052_283.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string str, func;
int n;
cin >> str >> n;
for(int i=0;i<n;i++)
{
cin >> func;
if(func=="print")
{
int a, b;
cin >> a >> b;
cout << str.substr(a, b-a+1) << endl;
}
if(func=="replace")
{
int a, b;... | ALGO | 0.990139 | 4.044496 |
ec785953-a38c-41e9-b9f9-ef0e7b41c1a3 | zopsicle/blender | extern/bullet2/src/BulletCollision/CollisionShapes/btConvexShape.cpp | #if defined(_WIN32) || defined(__i386__)
#define BT_USE_SSE_IN_API
#endif
#include "btConvexShape.h"
#include "btTriangleShape.h"
#include "btSphereShape.h"
#include "btCylinderShape.h"
#include "btConeShape.h"
#include "btCapsuleShape.h"
#include "btConvexHullShape.h"
#include "btConvexPointCloudShape.h"
///not supp... | ALGO | 0.998762 | 7.72768 |
82c63691-0b4f-4472-865c-8be993f23ce8 | RamaSandhy/ExerciseProsedural_029 | ExerciseProsedural_029/ExerciseProsedural_029.cpp | #include <iostream>
using namespace std;
double rerata(double a, double b)
{
return (a + b) / 20;
}
#include <iostream>
using namespace std;
double rerata(double a, double b)
{
return (a + b) / 20;
}
string status(double d)
{
if (d >= 70)
return "diterima";
else
return "diterima";
}
string status2(double r, ... | ALGO | 0.988409 | 4.092643 |
4bf71bb8-837f-4459-8ba8-88f56a3cb776 | denSmashh/pkims_mmpis | lab2/lab2/lab2.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <unordered_map>
#include <climits>
#include <string>
#include <limits>
#include <iomanip>
using namespace std;
struct Vertex {
string name;
double delay = 0.0;
double aat = 0.0;
double rat = numeric_limits<double>::infinity();
};
class... | ALGO | 0.999828 | 5.28237 |
a85d0da0-c074-4eb6-bfcc-668c89de071f | babynghe2003/CPP | ICPC-CenTral-2023/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void indef(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
}
struct Rank{
int a,b;
bool operator<(const Rank &r) const{
return a < r.a && b < r.b;
}
};
void solve() {
int... | ALGO | 0.999976 | 4.158071 |
368a62c3-d76d-4262-95e2-ae37302cbc25 | Distrotech/djvulibre | libdjvu/GURL.cpp | #ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if NEED_GNUG_PRAGMAS
# pragma implementation
#endif
// From: Leon Bottou, 1/31/2002
// This has been heavily changed by Lizardtech.
// They decided to use URLs for everyting, including
// the most basic file access. The URL class now is a unholy
// mixture of code fo... | TOOL | 0.876562 | 5.823976 |
6a76075d-bf07-41ac-86b2-c9aa4e3644e8 | damianomuzzolon2/pid_controller | project/pid_controller/motion_planner.cpp | /**********************************************
* Self-Driving Car Nano-degree - Udacity
* Created on: September 20, 2020
* Author: Munir Jojo-Verge
**********************************************/
#include "motion_planner.h"
MotionPlanner::~MotionPlanner() {}
State MotionPlanner::get_goal_state_in_ego_fram... | ALGO | 0.998725 | 5.139708 |
d7b52b13-1d6f-4a7d-aa4f-b69fc2626aaa | emo-mruczek/lt | cpp/80_Remove_Duplicates_from_Sorted_Array_II.cpp | #include <vector>
class Solution {
public:
static int removeDuplicates(std::vector<int>& nums) {
int size = nums.size();
int curr_slot { 0 };
int curr_num { nums[0] };
int counter { 1 };
for (int i = 1; i < size; i++) {
if (nums[i] == curr_num) {
+... | ALGO | 0.999692 | 6.291363 |
fedc4b90-b02b-45f8-9f90-b3a5e531e646 | rajatlokesh/Remote_Code_Page_Mamagement | Project 1/SourceCodePublisher/Utilities/StringUtilities/StringUtilities.cpp | ///////////////////////////////////////////////////////////////////////
// StringUtilities.cpp - small, generally useful, helper classes //
// ver 1.0 //
// Language: C++, Visual Studio 2017 //
// Application: Most Projects, C... | TOOL | 0.890914 | 5.972208 |
9e65a021-af0c-4bb1-8523-07bf604b4ef0 | KaTaiHo/RecursionInC | factor.cpp | #include <stdio.h>
void factor(int n, int f, char* p) {
char empty[1] = {'\0'};
if (n % f == 0) {
if (n/f == 1) {
printf(" %d\n",f);
return;
}
else{
printf("%s", p);
printf(" %d x", f);
factor(n/f, f, empty);
}
}
else if (n % f != 0) {
factor(n, f + 1, empty);
}
}
int main(void) {
cha... | ALGO | 0.99992 | 4.062727 |
2182e9d4-9b23-45b6-a64f-79bf4215b9f9 | JBringmann/Computer-Architecture | project4/BranchPred.cpp | #include <iostream>
#include <iomanip>
#include <cstdint>
#include "BranchPred.h"
using namespace std;
BranchPred::BranchPred() {
/* TODO Initialize your private variables and pred[] array here*/
cout << "Branch Predictor Entries: " << BPRED_SIZE << endl;
for(int i = 0; i < BPRED_SIZE; i++){
pred[i] = 0;
... | ALGO | 0.99178 | 5.425533 |
2ef5acd9-f601-437d-a77d-13598719299a | fireae/caffe_latte | 3rdparty/eigen/doc/examples/class_FixedVectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived, 2>
firstTwo(MatrixBase<Derived>& v)
{
return Eigen::VectorBlock<Derived, 2>(v.derived(), 0);
}
template<typename Derived>
const Eigen::VectorBlock<const Derived, 2>
firstTwo(c... | TOOL | 0.955437 | 5.181627 |
25a161e3-b984-410e-ac67-39207f23d54c | Tamimkhan7/University_classcode | 3rd semester/factorial using oop.cpp | #include <iostream>
using namespace std;
class member
{
int n,i, fact=1;
public:
void display()
{
cin>>n;
for (i=1; i<=n; i++)
{
fact = fact*i;
}
cout<<fact<<endl;
}
};
int main ()
{
member p;
p.display();
return 0;
}
| ALGO | 0.999941 | 4.895018 |
8418cd2d-c007-434b-be71-a74341e4d975 | metehkaya/Algo-Archive | Problems/LeetCode/Solutions/0238.Product_of_Array_Except_Self.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& ar) {
int n = ar.size();
vector<int> ans(n,1);
if(n <= 1)
return ans;
for( int i = 1 ; i < n ; i++ )
ans[i] = ans[i-1] * ar[i-1];
int suffix = 1;
for( int i = n-2 ; i >= 0 ; i-... | ALGO | 0.999775 | 5.485826 |
0b5a1d4f-89b8-461c-a342-94a26796cbdc | dgcnz/competitive-programming | codeforces/1516B-agaga-xooorr.cpp | #ifdef DBG_MACRO_NO_WARNING
#include <dbg.h>
#else
#define dbg(...) ((void)0)
#endif
#include <bits/stdc++.h>
#include <cplib/utils/io>
#define all(c) begin(c), end(c)
#define isz(c) (int)(c).size()
using namespace std;
using namespace cplib;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
bo... | ALGO | 0.999894 | 4.469922 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.