uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4b9980aa-ceb4-473c-ae6d-166ea84d168e | vitoria-isabela/estruturas-de-dados | DuplaEncad-pilha-Fila/Q1Prova - DuplaEncad/ListaDupla.cpp | #include <iostream>
#include <cstdlib>
#include "ListaDupla.h"
using namespace std;
ListaDupla::ListaDupla()
{
cout << "Criando uma ListaDupla" << endl;
primeiro = NULL;
ultimo = NULL;
n = 0;
}
ListaDupla::~ListaDupla()
{
cout << "Destruindo ListaDupla" << endl;
NoDuplo* p = primeiro;
while (p != NULL)
{
N... | ALGO | 0.954856 | 4.010821 |
bf72a67f-ccb1-4b78-aba0-e7126e2304cc | Hoang-Lam104/Lap-trinh-nang-cao | week7/bai6.cpp | int* merge(int* firstArr, int lenArr1, int* secondArr, int lenArr2){
int *mergeArr = new int [lenArr1+lenArr2];
int firstIndex = 0, secondIndex = 0, mergeIndex = 0;
if(firstArr[0]<firstArr[lenArr1-1]){
while (firstIndex < lenArr1 && secondIndex < lenArr2){
if(firstArr[firstIndex] <= se... | ALGO | 0.999812 | 3.886989 |
7fbadebc-dcff-4c81-9c57-05b63aabe193 | Anganba/CP | C++/Paranthesis valid check.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <math.h>
#include <ctype.h>
#include <climits>
#include <stack>
#define REP(i, n) for (int i = 1; i <= n; i++)
#define REP0(i, n) for (int i = 0; i < n; i++)
#define pi 2 * acos(0.0)
... | ALGO | 0.99933 | 4.667051 |
92c4b349-63ef-44b2-a6c1-23118993f9a7 | PriyanshuGupta1/Leetcode | 456-132-pattern/456-132-pattern.cpp | class Solution {
public:
int dp[200011];
bool find132pattern(vector<int>& nums) {
int n = nums.size();
if(n<3) return false;
dp[0] = nums[0];
for(int i=1;i<n;i++){
dp[i] = min(dp[i-1], nums[i]);
}
set<int>myset;
myset.insert(... | ALGO | 0.999957 | 5.988435 |
f9f72f74-594e-4328-a3e0-8bf0d5993c8a | Martisum/Algorithm | 高精度乘法/高精度乘法.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int maxm=2019;
char ta[maxm],tb[maxm];
int a[maxm],b[maxm],c[maxm],e[maxm][maxm];
int lena,lenb,lenc,flag;
int main(){
freopen("gin.txt","r",stdin);
std::ios::sync_with_stdio(false);
cin>>ta>>tb;
lena=strlen(ta);lenb=strlen(tb);
l... | ALGO | 0.999972 | 3.349309 |
c86e713f-fa46-48a4-8c43-b9215f58733e | leonardoAnjos16/Competitive-Programming | Lib/Graph/2SAT.cpp | struct TwoSAT {
private:
int n;
vector<vector<int>> g, gt;
vector<int> component;
vector<bool> vis;
stack<int> order;
public:
TwoSAT(int n) {
this->n = n;
clear();
}
void clear() {
g.assign(2 * n, vector<int>());
gt.assign(2 * n, vector<int>());
... | ALGO | 0.999979 | 5.568295 |
87a76e33-3117-40ea-8cee-04a53a6b31e1 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_12447_1.cpp | #include <bits/stdc++.h>
using namespace std;
long long b[1100000];
vector<long long> g[600000];
long long c;
void check(long long l, long long r) {
long long x = g[l].size();
long long y = g[r].size();
long long i;
for (i = 0; i < min(x, y); i++) {
if (g[l][i] != g[r][i]) break;
}
if (i == min(x, y)) {... | ALGO | 0.999952 | 3.667629 |
15a36aa3-0e08-4fb8-9dfe-c93f3c551efa | SaurabhMaurya9695/6Companies30days | Goldman Sachs/03 Count the subarrays having product less than k .cpp | class Solution{
public:
int countSubArrayProductLessThanK(const vector<int>& nums, int n, long long k) {
if (k <= 1) return 0;
long long prod = 1, ans = 0, left = 0;
for (int right = 0; right < nums.size(); right++) {
prod *= nums[right];
while (prod >= k) prod /= ... | ALGO | 0.999979 | 5.729714 |
a03dc17f-e7df-4a9f-a319-5689f021997d | Nyatl/acm-archive | school 2016/plushki/k.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cassert>
using namespace std;
#define sz(x) (int)(x.size())
#define fi(a,b) for(int i=a;i<b;++i)
#define fj(a,b) for(int j=a;j<b;++j)
#define fo(a,b) for(int o=a;o<b;++o)
#define fdi(a,b) for(int i=a-1;i>=b;--i)
#define fdj(a,b) for(int... | ALGO | 0.999902 | 4.145162 |
fa4cf7d9-a48a-4089-818b-c6d07692afe5 | Keldo44/Daw2_M08 | cpp/script.cpp | #include <iostream>
/**
* @brief Clase para representar un punto en el plano cartesiano.
*/
class Punto {
public:
/**
* @brief Constructor por defecto.
*/
Punto() : x(0), y(0) {}
/**
* @brief Constructor con parámetros.
*
* @param x La coordenada x del punto.
* @param y La coordenada y del ... | TOOL | 0.957897 | 5.542675 |
b2734517-2f11-44fe-9caf-9f8a3587c216 | Hybrid-Rom/external_skia | experimental/Intersection/CubicBezierClip.cpp | #include "CurveIntersection.h"
#include "CurveUtilities.h"
#include "LineParameters.h"
// return false if unable to clip (e.g., unable to create implicit line)
// caller should subdivide, or create degenerate if the values are too small
bool bezier_clip(const Cubic& cubic1, const Cubic& cubic2, double& minT, double& m... | ALGO | 0.997963 | 6.040329 |
afae465e-2fd8-461b-ae91-415f46ed5384 | theproudswan/yandex-coursera | white-belt/2-week/Кол-во.уникальных.строк.cpp | #include <iostream>
#include <set>
using namespace std;
int main(){
set <string> words;
string word;
int N;
cin>>N;
for(N;N>0;N--){
cin>>word;
words.insert(word);
}
cout<<words.size()<<endl;
return 0;
}
| ALGO | 0.998002 | 4.139557 |
82a5b5c6-7e34-45a6-9c5c-e227b5f20e6c | doublethinkco/boost | libs/iterator/example/transform_iterator_example.cpp | #include <functional>
#include <algorithm>
#include <iostream>
#include <boost/iterator/transform_iterator.hpp>
// What a bummer. We can't use std::binder1st with transform iterator
// because it does not have a default constructor. Here's a version
// that does.
namespace boost {
template <class Operation>
cla... | ALGO | 0.993909 | 6.615358 |
bcbda207-0acf-4dff-a205-a0bc99615cd4 | guan404ming/leetcode | 190.reverse-bits.cpp | /*
* @lc app=leetcode id=190 lang=cpp
* @lcpr version=30204
*
* [190] Reverse Bits
*/
// @lcpr-template-start
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <stack>... | ALGO | 0.999953 | 5.874386 |
2346e63c-8b97-40b9-9b26-85dfc52bee82 | abdurrezzakekidi/Algorithms-Problem-Solving-Level-2 | Problem22-NumberFrequencyInArray/Problem22-NumberFrequencyInArray.cpp | #include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
int ReadPositiveNumber(string Message)
{
int Number = 0;
do
{
cout << Message;
cin >> Number;
} while (Number <= 0);
return Number;
}
void ReadArryay(int arr[100], int&... | ALGO | 0.927467 | 4.248827 |
690372e5-7249-4f04-afcb-eb4f4c0ef315 | javagovindsharma/leetscode | solution/0200-0299/0240.Search a 2D Matrix II/Solution.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
for (auto& row : matrix) {
int j = lower_bound(row.begin(), row.end(), target) - row.begin();
if (j < matrix[0].size() && row[j] == target) {
return true;
}
}
... | ALGO | 0.999976 | 6.468609 |
95a9bde1-9c9a-4525-8dd4-b40be16507a2 | mjsyam/3d-workspace | MathLibrary/Coordiantes/GCDeformation.cpp | #include "GCDeformation.h"
// Only needed for one task (when points outside cage case)
#include <Eigen/Geometry>
using namespace Eigen;
GCDeformation::GCDeformation( QSurfaceMesh * forShape, QSurfaceMesh * usingCage )
{
this->shape = forShape;
this->cage = usingCage;
orginalCagePos = cage->clonePoints();
orgina... | ALGO | 0.981801 | 5.692122 |
87f37a07-11a9-485c-898b-d7bf074018d3 | Rasec09/COJ-Solutions | 1010 - ACM contest and Blackout.cpp | #include <stdio.h>
#include <algorithm>
#include <utility>
#include <vector>
using namespace std;
#define INF 1000000000
typedef pair<int, int> ii;
typedef pair<int, ii> arista;
vector <arista> aristas, MST, aux;
bool operator < (const arista a, const arista b){
if(a.first < b.first)
return true;
retu... | ALGO | 0.999935 | 4.15534 |
aa72411e-ab31-4990-8339-8c3aee396650 | PavanPongle/PracticeCode | Leetcode/Easy/Binary tree inorder traversal.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.999996 | 6.652676 |
b9b6fb3a-a46a-4113-a89b-275f6b69680d | BhaskarBVV/PenCode | LC/24 Game.cpp | // You are given an integer array cards of length 4. You have four cards, each containing a number in the range [1, 9].
// You should arrange the numbers on these cards in a mathematical expression using the operators ['+', '-', '*', '/'] and the parentheses '(' and ')' to get the value 24.
// You are restricted with... | ALGO | 0.999696 | 6.351245 |
3fd610c0-86af-4f1e-843c-ed1bb97ab199 | ChitrakshiChhabra/Leetcode-Daily-Problems | minimumTimeToCompleteTrips.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
long long minimumTime(vector<int> &time, int totalTrips)
{
ll start = 1;
ll end = 1e14;
while (start <= end)
{
ll trip = 0;
ll mid = start + (end - start) / 2;
for (int i = 0; i < time.size(); i++)
tr... | ALGO | 0.999943 | 5.178138 |
3b2f2f0a-0fae-471d-8049-f5ea7318ec51 | ishandutta2007/codeforces | betaveros/normal/295/A.cpp | #include <cassert>
#include <iostream>
using namespace std;
#define fori(i,s,e) for(int i = s; i < ((int)e); i++)
#define allof(s) (s).begin(), (s).end()
template <class T> void minify(T & a, const T & b) { if (a > b) a = b; }
template <class T> void maxify(T & a, const T & b) { if (a < b) a = b; }
int n, nOps, nMet... | ALGO | 0.999904 | 4.264596 |
daa9c08b-ba6b-4fb5-998a-e3827b179188 | Rich-ar-Dev/Cpp | Improved_Stack_Code.cpp | // Improved_Stack_Code.cpp : This file contains the 'main' function. Program execution begins and ends there.
// Improved Stack.cpp : This file contains the 'main' function. Program execution begins and ends there.
#include <iostream>
#include <string>
#include <limits> // For std::numeric_limits
using namespace std;
... | TOOL | 0.890089 | 5.261484 |
1f2c5c8d-bf38-4cec-881b-7010a5f2c96b | antusaha970/My-source-code-DSA | DSA/Codes/DFS.cpp | #include <iostream>
using namespace std;
int matrix[4][4] = {
// 0 1 2 3
{0, 0, 0, 1},
{0, 0, 1, 0},
{0, 1, 0, 1},
{1, 0, 1, 0},
};
int visited[4] = {0, 0, 0, 0};
void DFS(int vertex)
{
cout<<vertex<<" ";
visited[vertex] = 1;
for (int i = 0; i < 4; i++)
{
if(matrix[vertex]... | ALGO | 0.99986 | 3.449934 |
98f9bb52-b288-4b43-9241-6c7c3c8d2e1b | bensapp/Stretchable-Models-for-Motion-Parsing | cps/thirdparty/OpenCV-2.0.0/src/cxcore/cxarithm.cpp | /* ////////////////////////////////////////////////////////////////////
//
// Matrix arithmetic and logical operations: +, -, *, /, &, |, ^, ~, abs ...
//
// */
#include "_cxcore.h"
namespace cv
{
#if CV_SSE2
template<class Op8> struct VBinOp8
{
int operator()(const uchar* src1, const uchar* src2, uchar* dst, ... | TOOL | 0.984302 | 6.982065 |
8f2123e1-0c8c-41cb-8517-bcb2a5965212 | nxplatform/nx-mobile | thirdparty-cpp/boost_1_62_0/libs/hana/example/tuple/foldable.cpp | #include <boost/hana/assert.hpp>
#include <boost/hana/config.hpp>
#include <boost/hana/equal.hpp>
#include <boost/hana/fold_right.hpp>
#include <boost/hana/if.hpp>
#include <boost/hana/less.hpp>
#include <boost/hana/prepend.hpp>
#include <boost/hana/tuple.hpp>
namespace hana = boost::hana;
using namespace hana::literal... | ALGO | 0.918872 | 5.677901 |
ac08a3c0-d203-4820-b15c-7a6cc0f58c26 | devastating/misc | coding_exercise/word_seach2.cpp | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <list>
using namespace std;
// Word search
// Trie used
class TrieNode {
public:
// Initialize your data structure here.
TrieNode() {
m_word = false;
}
void add_edge(char new_char, TrieNode *node)
{
if (m_ed... | ALGO | 0.9999 | 5.709229 |
bec970db-4ed4-4d7b-b64f-7d0786e4511c | abhinav0223/Leetcode | 0646-maximum-length-of-pair-chain/0646-maximum-length-of-pair-chain.cpp | class Solution {
public:
int findLongestChain(vector<vector<int>>& pairs) {
sort(pairs.begin(), pairs.end(), [](const vector<int>& a, const vector<int>& b) {
return a[1] < b[1];
});
int current_end = INT_MIN;
int chain_length = 0;
for (const auto& pair : ... | ALGO | 0.999983 | 6.102803 |
d19c9758-156b-4653-8b5f-4fc953a9a0fa | StefanFarcasanu/University | Graph Algorithms and Theory/AG-7-Final/pb1.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <unordered_map>
#include <string>
//g++ -std=c++11 -Wall -g -o pb1.exe pb1.cpp
using namespace std;
vector<unordered_map<int,int> > citeste_fisier(ifstream& f, vector<unordered_map<int, int> > v, int numar_muchii) {
for (int i = 0; i < numar_muchii... | ALGO | 0.999694 | 4.454006 |
dce1497e-bc38-4887-b9aa-cfcf43057731 | SnowySparks/Algorithm_Solve | BackJoon_solved/다이나믹프로그래밍/18353_병사배치하기.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int arr[2001];
int dp[2001];
int main(void) {
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int N; cin >> N;
for (int i = 1 ; i <= N ; i++) {
cin >> arr[i];
}
for (int i = 1 ; i <= N ; i++)... | ALGO | 0.999918 | 4.078717 |
b24e0681-7cb1-49ab-9c20-4a023b4e9183 | yumcyaWiz/Skydome-Rendering | main.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <omp.h>
#include "vec3.hpp"
#include "ray.hpp"
#include "camera.hpp"
#include "rgb.hpp"
#include "image.hpp"
const int W = 800;
const int H = 800;
const Vec3 sunDir = Vec3(0, 1, -1).normalize();
inline double rayleigh_phase(const Vec3& rayDir, const Vec... | ALGO | 0.998071 | 4.656196 |
26bb9cd2-de89-47c5-82da-df9397d53cc0 | sadramanouch/leetcode | 2678-number-of-senior-citizens/2678-number-of-senior-citizens.cpp | class Solution {
public:
int countSeniors(vector<string>& details) {
int n = details.size();
int res = 0;
for (int i = 0; i < n; ++i) {
string info = details[i];
string ageStr = info.substr(11, 2);
int age = stoi(ageStr);
if (age > 60) {
... | ALGO | 0.994417 | 6.318793 |
0a2e32fc-8cbe-46f6-ac74-f0e28b8cbc3a | kmjp/procon | yuki/1001-2000/1201-1300/1254.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#def... | ALGO | 0.99985 | 3.741049 |
94a566cb-7b24-44b0-9e33-ec6f16549b06 | shreejitverma/SDE-Interview-Prep | LeetCode/C++/count-collisions-of-monkeys-on-a-polygon.cpp | // Time: O(logn)
// Space: O(1)
// combinatorics, fast exponentiation
class Solution {
public:
int monkeyMove(int n) {
static const int MOD = 1e9 + 7;
const auto& powmod = [&](int a, int b) {
a %= MOD;
int64_t result = 1;
while (b) {
if (b & 1) {... | ALGO | 0.999975 | 5.881213 |
812fca5e-a481-456f-b02a-87f1d3f2124a | joy-adhikary/Codeforces-Solutions- | B_Odd_Swap_Sort.cpp | /*
ॐ नमः शिवाय
_Karn_2.0_
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long u... | ALGO | 0.999969 | 4.147065 |
002be6bd-ccfb-4e18-9e47-22856c0fdcc4 | qijiarui2310/oceanbase-vldbss-2024 | src/sql/engine/expr/ob_expr_minus.cpp | #define USING_LOG_PREFIX SQL_ENG
#include "sql/engine/expr/ob_expr_minus.h"
#include "lib/oblog/ob_log.h"
#include "lib/utility/ob_macro_utils.h"
#include "sql/engine/expr/ob_expr_result_type_util.h"
#include "sql/ob_sql_utils.h"
#include "sql/session/ob_sql_session_info.h"
#include "sql/engine/ob_exec_context.h"
#inc... | ALGO | 0.890014 | 7.517399 |
edce67e2-bfe7-4460-b6a6-5dda2b377999 | Shristk/Leetcode | 17.cpp | class Solution {
public:
void myLetterComb(string digits, vector<string> &res, string nums[], int i,string s){
if(i==digits.size()){
res.push_back(s);
return;
}
string val = nums[digits[i]-'0'];
for(int j=0;j<val.size();j++){
myLetterComb(digits,re... | ALGO | 0.999918 | 6.674018 |
3f8fb327-0913-4231-9569-7e3616c0d9ef | srinivasulu-2654/DSA-Prep | Daily_DSA/DEC-2024/03->2109. Adding Spaces to a String.cpp | https://leetcode.com/problems/adding-spaces-to-a-string/description/?envType=daily-question&envId=2024-12-03
// So stringstream is a buffer which is used to append the string without using that much extra space
Stringstream approach :
class Solution {
public:
string addSpaces(string s, vector<int>& spaces) {
... | ALGO | 0.999835 | 6.734668 |
29f96deb-4ac6-42da-928e-7c502ce664f9 | magyarakoos/contest-prog | njudge/nemes/2-3/NT22/tablajatek/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define speed cin.tie(0); ios::sync_with_stdio(0)
#include <bitset>
struct BinaryBigInt {
private:
bitset<500> a;
public:
// add exactly one to the number
void add() {
if (!a[0]) {
a[0] = 1;
} else {
int i = 0;
... | ALGO | 0.999955 | 4.418982 |
4f993a0d-ec51-43bf-8cb0-8234b059f62d | A-Spiral-Forge/Strivers-SDE-Sheet-Challenge | Arrays/Unique-Paths.cpp | #include <bits/stdc++.h>
using namespace std;
int uniquePaths(int m, int n) {
// Create a 2D array to store the count of paths to reach
vector<vector<int>> dp(n, vector<int>(m, 0));
// There is only one way to reach any cell in the first row
for(int i=0; i<n; i++) {
dp[i][0] = 1;
}
// There is ... | ALGO | 0.999737 | 5.9706 |
e0ac5633-4171-4cc4-bb1c-5341c4a11320 | ishandutta2007/codeforces | zemen/normal/755/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
#define forn(i,n) for (int i = 0; i < int(n); ++i)
typedef long long ll;
typedef long long i64;
typedef long double ld;
const int inf = int(1e9) + int(1e5);
const ll infl = ll(2e18) + ll(1e10);
char s[505];
int main() {
#ifdef LOCAL
... | ALGO | 0.999993 | 4.362679 |
6910b685-e219-4b00-b158-9dde179242d6 | rakeshp-123/Model_Predictive_Control_Pr5 | src/Eigen-3.3/doc/examples/tut_arithmetic_matrix_mul.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d mat;
mat << 1, 2,
3, 4;
Vector2d u(-1,1), v(2,0);
std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
std::cout << "Here is mat*u:\n" << mat*u << std::endl;
std::cout << "Here is u^T*mat:\n" << u.transpo... | ALGO | 0.998531 | 3.818773 |
bb35214e-0666-4590-8fb1-ca6c8eca8e94 | zfa07/Killyouss | Engine/Source/ThirdParty/CryptoPP/5.6.2/include/gf256.cpp | // gf256.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "gf256.h"
NAMESPACE_BEGIN(CryptoPP)
GF256::Element GF256::Multiply(Element a, Element b) const
{
word result = 0, t = b;
for (unsigned int i=0; i<8; i++)
{
result <<= 1;
if (result & 0x100)
result ^= m_modulus;
... | ALGO | 0.999431 | 5.152894 |
4e193e50-e855-4407-8be3-d92a00db286d | SunJ2000/algorithms_four | redblackBST/redblackBST.cpp | // redblackBST.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include <vector>
constexpr auto red = false;
constexpr auto black = true;
using namespace std;
struct node
{
int key;
int value;
int n;
shared_ptr<node> left, right;
bool color;
node(int a, int b, int c,bool color) :ke... | ALGO | 0.999273 | 5.184386 |
bd5c2be8-88ec-4dfa-9b72-bc37ecde994f | linux4life798/llvm-project-ci-test | clang-tools-extra/clang-tidy/utils/OptionsUtils.cpp | #include "OptionsUtils.h"
#include "llvm/ADT/StringExtras.h"
namespace clang::tidy::utils::options {
static const char StringsDelimiter[] = ";";
std::vector<StringRef> parseStringList(StringRef Option) {
Option = Option.trim().trim(StringsDelimiter);
if (Option.empty())
return {};
std::vector<StringRef> Re... | TOOL | 0.96348 | 7.382348 |
752a5238-6d38-47fa-80ca-99e5841dfbb2 | bytebeaver/leetcode-solutions | 2448-count-number-of-bad-pairs/2448-count-number-of-bad-pairs.cpp | //code story with MIK
// class Solution {
// public:
// long long countBadPairs(vector<int>& nums) {
// int n = nums.size();
// long long result = 0;
// for(int i=0; i<n ; i++)
// {
// nums[i]= nums[i]-i;
// }
// unordered_map<int, int> mp;
// ... | ALGO | 0.999948 | 5.780624 |
31683268-a591-464b-8d8c-e4197558f51c | manohar2000/DSA_450 | Trees/mirrorTree.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node* left;
node* right;
node(int d)
{
data = d;
left = NULL;
right = NULL;
}
};
node* buildTree()
{
int d;
cin>>d;
if(d==-1) return NULL;
... | ALGO | 0.999989 | 4.928026 |
60ac3bfd-e598-4785-b36b-7623c57a62ae | AbhJ/some-cp-files-2 | codechefCHEFPSA.cpp | #include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define ibs ios_base::sync_with_stdio(false)
#define cti cin.tie(0)
#define bp __builtin_popcount
using namespace std;//coded by abhijay mitra
const int N=2e5+3;
const long M = 1000000007; // modulo
// int m[2][N];//the grid
ll x[N],fac[N],ifac[N],n... | ALGO | 0.999865 | 3.914012 |
5b680fb6-ade2-4a43-94f5-57c05ad528da | Vinayak-Bhardwaj/DSA-Problem-Solving | CodeChef/AliceBob.cpp | #include<bits/stdc++.h>
using namespace std;
#define lli long long int
int main() {
lli test;
cin >> test;
while(test--) {
lli alice, bob, num;
cin >> alice >> bob >> num;
lli mul = bob * alice;
if(alice == bob) {
cout << "-1" << endl;
}
else if... | ALGO | 0.999989 | 3.567535 |
3a2b0844-dc0a-4447-bf8e-2fb259cadd25 | raincross7/code-similarity | codes/train_code/problem382/problem382_297.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
struct UnionFind {
vector<int> d;
UnionFind (int n): d(n,-1) {}
int find(int x) {
if(d[x] < 0) return x;
return d[x] = find(d[x]);
}
bool unite(int x, int y) {
x = find(x); y = find(... | ALGO | 0.999759 | 4.730265 |
842b49ce-a62e-4bdd-8db1-00c02acba3ad | alexfrederiksen/RplidarRansac | core.cpp | #include "core.h"
bool in_device_bounds(float value) {
return value >= -1 && value <= 1;
}
bool in_device_bounds(vec2_t & vec) {
return in_device_bounds(vec.x) &&
in_device_bounds(vec.y);
}
void Core::update() {
// perform a scan
if (!testing_enabled) {
lidar.scan();
//prin... | ALGO | 0.880049 | 4.986718 |
e14a2234-4ca6-4361-b438-8a1e9cf5cc22 | sinian666/code_86_6 | cpp_副本15/chapter_array_and_linkedlist/list.cpp | /**
* File: list.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Driver Code */
int main() {
/* 初始化列表 */
vector<int> list = {1, 3, 2, 5, 4};
cout << "列表 list = ";
printVector(list);
/* 访问元素 */
int num = list[1];
cout << "访问索引 1 处的元素,得到 n... | ALGO | 0.97705 | 5.024094 |
7fbb8a10-fb71-4897-ba14-909b6b181652 | flameshimmer/leet2015 | Leet2015/Leet2015/FractionToRecurringDecimal.cpp | #include "stdafx.h"
//Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.
//
//If the fractional part is repeating, enclose the repeating part in parentheses.
//
//For example,
//
//Given numerator = 1, denominator = 2, return "0.5".
//Given numerator = 2,... | ALGO | 0.992918 | 6.114153 |
c8bd6028-d32e-41a9-b540-795af1fa437d | Fraunhofer-AISEC/cryptsan-llvm-project | libc/src/math/lroundl.cpp | #include "src/math/lroundl.h"
#include "src/__support/common.h"
#include "utils/FPUtil/NearestIntegerOperations.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(long, lroundl, (long double x)) {
return fputil::roundToSignedInteger<long double, long>(x);
}
} // namespace __llvm_libc
| TOOL | 0.97316 | 5.607308 |
bd507be5-63d7-456d-a80c-812481f462b5 | DawidB95/stroustrup_ppp_pl | ex_11.cpp | #include "../../std_lib_facilities.h"
bool jest_pierwsza(int n);
vector<int> pierwsza;
int main() {
int min = 3;
int max = 100;
pierwsza.push_back(2);
for (int i = min; i <= max; i++) {
if(jest_pierwsza(i))
pierwsza.push_back(i);
}
cout << "Pierwsze\n";
for (int i = 0; i < pierwsza.size(); i++) {
cout <<... | ALGO | 0.998217 | 4.562527 |
5c37ea62-9513-4445-a687-8410120b7e78 | Janhavibabber/DSA | Youtube lectures/Cllg wallah/1a. Array/2dVectorPascal.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<vector<int>> pascalTriangle(int n){
vector<vector<int>> pascal(n);
for(int i=0; i<n; i++){
//resizing ith vector of pascal vector as we are taking 0 based indexing but 0th row of pascal triangle will contain 1 element
pascal[i].re... | ALGO | 0.999976 | 5.184669 |
9f189e7b-9134-4643-a4ca-4f106f6748de | tomas/inkscape | src/2geom/conicsec.cpp | #include <2geom/conicsec.h>
#include <2geom/conic_section_clipper.h>
#include <2geom/numeric/fitting-tool.h>
#include <2geom/numeric/fitting-model.h>
// File: convert.h
#include <utility>
#include <sstream>
#include <stdexcept>
namespace Geom
{
LineSegment intersection(Line l, Rect r) {
boost::optional<LineSegme... | ALGO | 0.998836 | 5.94809 |
8a60862b-ce92-4542-97ae-765e3a5c5900 | Warawreh/CP-Library | Contests/NEERC 16/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
bool good(string s){
s.pop_back(... | ALGO | 0.99938 | 4.743947 |
a6993b2a-8092-436d-b74b-3ac7e07a7930 | wky1009904664/Algorithm | CSP/CSP_4/2014_09_4.cpp | #include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<sstream>
#include<map>
#include<vector>
#include<queue>
#include<math.h>
using namespace std;
int dis[1001][1001];
bool visited[1001][1001];
int n, m, k, d;
struct node {
int x, y;
int val;
node(int _x, int _y) :x(_x), y(_y) {}
node... | ALGO | 0.999797 | 4.639869 |
d8819ce6-454b-46fc-a57a-e5a02d5341c0 | vshishov/otus-algo | 01_lucky_tickets/src/ticket_solver.cpp | #include "ticket_solver.hpp"
#include <algorithm>
namespace solver {
std::string TicketSolver::Solve(const std::string& input) {
return std::to_string(FindLuckyTickets(std::stoi(input)));
}
Array TicketSolver::FillNextArray(const Array& array) {
auto new_size = array.size() + 9;
Array new_array(new_size... | ALGO | 0.999639 | 6.774586 |
49e680f2-8313-48d4-8b60-5985ba0e58d3 | Crimson-MITK-ThirdParty/boost | libs/spirit/classic/phoenix/example/fundamental/sample6.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <boost/spirit/include/phoenix1_operators.hpp>
#include <boost/spirit/include/phoenix1_primitives.hpp>
#include <boost/spirit/include/phoenix1_composite.hpp>
#include <boost/spirit/include/phoenix1_special_ops.hpp>
using namespace std;
using namespace ... | TOOL | 0.862818 | 5.272353 |
8627a10d-e930-4e25-b0b2-89bc54647ecc | ucf-cs/tlds | src/rstm/rstm-dev/libstm/algs/orecala.cpp | /**
* OrecALA Implementation
*
* This is similar to the Detlefs algorithm for privatization-safe STM,
* TL2-IP, and [Marathe et al. ICPP 2008]. We use commit time ordering to
* ensure that there are no delayed cleanup problems, and we poll the
* timestamp variable to address doomed transactions. By... | TOOL | 0.900755 | 6.522388 |
3979399c-9b00-42f5-a282-ff40b96ab49e | Reynald-V1/algoritmos-cpp | sarabada/L7/Q1/aus.cpp | #include <iostream>
using namespace std;
float mediaProv=0, mediaTrab=0;
float comparador();
float media();
int main(){
float medR;
cout << "insira as notas da prova \n";
mediaProv = comparador();
cout << "insira as notas dos trabalhos: \n";
mediaTrab = comparador();
cout << "media do trabalhos: ... | ALGO | 0.971932 | 3.431905 |
3ce98777-ec91-4e01-a915-a2481f9c7df3 | SMiles02/CompetitiveProgramming | AtCoder/ABC144-C.cpp | #include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
ll n,a,b,k;
cin>>n;
a=1;b=n;
k=sqrt(n);
for (int i=2;i<=k;++i)
{
if (n%i==0)
{
a=i;
b=n/i;
... | ALGO | 0.999916 | 3.781076 |
98a11470-d528-4ec0-ac37-11b03b555ad3 | jybill01/optimization | venv/Lib/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/libs/hana/example/tuple/foldable.cpp | #include <boost/hana/assert.hpp>
#include <boost/hana/config.hpp>
#include <boost/hana/equal.hpp>
#include <boost/hana/fold_right.hpp>
#include <boost/hana/if.hpp>
#include <boost/hana/less.hpp>
#include <boost/hana/prepend.hpp>
#include <boost/hana/tuple.hpp>
namespace hana = boost::hana;
using namespace hana::literal... | ALGO | 0.965487 | 5.677901 |
4d90f30d-de8b-4ae1-bc3b-1ae345f542de | aadil124/Data-Structure-and-Algorithm-Assignments | show_odd_even_num.cpp | #include <iostream>
using namespace std;
int main()
{
int value;
cout << "Show Odd and Even Number" << endl;
cout << "Enter Value Here : ";
cin >> value;
if (value % 2 == 0)
{
cout << "Entered Value is Even Number";
}
else
{
cout << "Entered Value is Odd Number";
... | ALGO | 0.968929 | 3.825669 |
184cc7c8-9a84-4a29-87cd-1bd7370459f5 | partho-das/CompetitiveProgrmming | CP_CODE/zahin-vaiLibrary/Karatsuba.cpp | #include <bits/stdtr1c++.h>
#define MAX 131072 /// Must be a power of 2
#define MOD 1000000007
#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)
#define dbg(x) cout << #x << " = " << x << endl
#define ran(a, b) ((((rand() << 15) ^ rand()) % ((b) - (a) + 1)) + (a))
using namespac... | ALGO | 0.997539 | 3.330631 |
afddcf41-ed0e-4b19-8e15-692956dd1c94 | codewithajaypaswan/Preparation | 0084-largest-rectangle-in-histogram/0084-largest-rectangle-in-histogram.cpp | class Solution {
public:
int largestRectangleArea(vector<int>& heights) {
int n = heights.size();
vector<int>prev_smaller(n), next_smaller(n);
stack<int>st;
for(int i=0; i<n; i++) {
while(!st.empty() && heights[st.top()] >= heights[i]) st.pop();
if(!st.empty()... | ALGO | 0.999981 | 6.547203 |
4a769d86-b53d-40df-b2ca-8c8debad4bde | Sudhir769/CPP | Day50.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int val){
this->data = val;
this->next = NULL;
}
};
// using linked List
class QueueLL{
Node* head;
Node *tail;
int size;
public:
QueueLL(){
this->head = NULL;
... | ALGO | 0.999829 | 4.345857 |
55fb65b5-1f39-4828-8865-981b55925e00 | conankun/Dovelet | house_boat/483454_WA.cpp | #include<stdio.h>
#include<math.h>
double max(double aa,double bb) {
if(aa<bb) return bb;
return aa;
}
double x,y;
int main() {
scanf("%lf%lf",&x,&y);
int i;
double xx=0;
for(i=1;;i++) {
double r = sqrt((2*(50+xx))/(6*asin(.5)));
if(r>=max(x,y)) {
printf("Property: This property will begin eroding in year ... | ALGO | 0.999653 | 3.213905 |
b681300e-b861-4aaa-88a7-657d1276a53d | abirrsahaa/DSA | trees/bst/bst2/bst class 2 codes/BSTCode.cpp | #include <iostream>
#include <queue>
using namespace std;
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int data)
{
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
Node *insertIntoBST(Node *root, int data)
{
if (root == NULL)
{
// this is the first node we have to creat... | ALGO | 0.999971 | 4.987727 |
e20a42e1-ddf9-4ac2-974b-0b9ae7f3605a | Nawazish835/DSA | Programming/DecimalToBinary.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int n,ans=0;
cout<<"enter number";
cin>>n;
int i=0;
while(n!=0){
int bits=n&1;
ans=(bits*pow(10,i))+ans;
n=n>>1;
i++;
}
cout<<ans;
} | ALGO | 0.999893 | 4.245277 |
e17d9f5c-96a5-4577-a4ab-b5100e7ec816 | RiteshKr001/DSA | stack_queue/postToPre.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string exp;
cin>>exp;
stack <string> st;
int i = 0;
int n = exp.size();
while (i<n)
{
char c = exp[i];
if(isalnum(c)){
string t = "";
t += c;
st.push(t);
}
else{
... | ALGO | 0.999882 | 4.314996 |
1b5f0c77-cef4-40be-b88e-0391a3895288 | mubasshirahin/Competitive-Programming | Codeforces/1043A(D3).cpp | #include <bits/stdc++.h>
using namespace std;
/*-----------------------------------------------------------------------------------------------------------*/
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),... | ALGO | 0.999861 | 4.244129 |
329834d6-a319-4fd2-8bf9-96c870b850b4 | Jay7221/competitve-programming | codeforces/normal_rounds/Round907/D_other.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long ;
const ll P=1e9+7;
ll calc(ll r,ll a){
ll ans=0,t=a;
while(t<=r){
ans+=(r-t+1)%P;
ans%=P;
if(t<=r/a)t=t*a;
else break;
}
return ans;
}
ll solve(ll x){
ll res=0;
for(ll i=2;i<=62;++i){
ll l=1ll<<i,r=(1ll<<(i+1))-1;
if(l>x)break;
r=mi... | ALGO | 0.999157 | 4.104294 |
f6b959e0-6217-4bd0-8242-377260052838 | Rajesh-Gundu/GeeksForGeeks-DSA | Difficulty: Medium/Coin Change (Minimum Coins)/coin-change-minimum-coins.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int solve(vector<int>& coins, int sum,int i,vector<vector<int>>& dp) {
if(sum == 0)
return 0;
if(i < 0)
return 1e7;
if(dp[i][sum] != -1... | ALGO | 0.996812 | 5.320626 |
d6eb1f66-8e90-4a74-81cf-e023e57285c2 | Olil-byte/coc_unofficial_patch | src/xrGame/ai/monsters/basemonster/base_monster_path.cpp | ////////////////////////////////////////////////////////////////////////////
// Module : base_monster_path.cpp
// Created : 26.05.2003
// Modified : 26.05.2003
// Author : Serge Zhem
// Description : Path finding, curve building, position prediction
////////////////////////////////////////////////////////////////... | TOOL | 0.878517 | 4.561449 |
7bd12936-6733-4166-8e09-5051fcd6188c | Cation-Coder6/DSA-Topicwise-Practise | Dynamic Programming/14.Longest-Common-Subsequence.cpp | int lcs(int x, int y, string s1, string s2)
{
int t[x + 1][y + 1];
for (int i = 0; i <= x; i++)
{
for (int j = 0; j <= y; j++)
{
if (i == 0 || j == 0)
t[i][j] = 0; // if length of any one of the substrings is 0 then there are no common elements between them thus i... | ALGO | 0.999664 | 5.410486 |
5fed839b-91ba-48bf-9d54-4872e34304ca | Terrifying-Mercenary-Coding-Team/litCode | others/LRU_cache.cpp | #include <bits/stdc++.h>
using namespace std;
class LRUCache {
public:
vector<int> clock;
unordered_map<int,int> hash;
int size;
LRUCache(int capacity) : size(capacity) {}
int get(int key) {
auto it = find(clock.begin(),clock.end(),key);
if(it==clock.end()) return -1;
... | ALGO | 0.997226 | 5.886971 |
a43fcabd-1670-4684-aa71-c342e75269e2 | Katsudon10/Competitive-programming | Atcoder/ARC/ARC032/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define ALL(a) (a).begin(),(a).end()
const int inf = INT_MAX;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
vector<int>dxs={1,0,-1,0};
vector<int>dys={0,1,0,-1};
//fixed << setprecision(10)
int ma... | ALGO | 0.999928 | 3.529541 |
58922f0d-b104-4d45-a303-8ac245c347fb | MohamedShelkamy/dune | src/Control/Path/Height/Task.cpp | //***************************************************************************
// Sliding Mode Controler
//***************************************************************************
// ISO C++ 98 headers.
#include <cmath>
// DUNE headers.
#include <DUNE/DUNE.hpp>
namespace Control
{
namespace Path
{
namespac... | TOOL | 0.914071 | 5.038052 |
dc3c8741-524d-4746-bc73-0c9846742dff | Azure/azure-osconfig | src/modules/complianceengine/src/lib/procedures/EnsureDefaultUserUmaskIsConfigured.cpp | #include <CommonUtils.h>
#include <Evaluator.h>
#include <PasswordEntriesIterator.h>
#include <Regex.h>
#include <ScopeGuard.h>
#include <StringTools.h>
#include <algorithm>
#include <array>
#include <dirent.h>
#include <fstream>
#include <pwd.h>
#include <shadow.h>
#include <sys/stat.h>
#include <vector>
using std::i... | TOOL | 0.955682 | 7.241781 |
f3b9d684-841a-4d8d-8a20-81c673bebbb0 | raincross7/code-similarity | codes/train_code/problem182/problem182_310.cpp | #include <bits/stdc++.h>
#define fastio (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using namespace std;
int main() {
fastio;
int a, b, c, d;
cin >> a >> b >> c >> d;
int left = a + b;
int right ... | ALGO | 0.999966 | 3.568689 |
10a0bb18-364c-423a-9029-7a1b8161ee55 | pavel-ryzhov/global_vars | runs/006543.cpp | #include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <string.h>
#define MAX(a,b) a>=b? a : b
#define MIN(a,b) a<=b? a : b
#define MINMA 256
#define MAX_INDEX 40000;
template <class T> class Array
{
private:
T* elements_;
int limit_;
int count_;
bool memoryCopy_;
void push_part();
public:
Array... | ALGO | 0.99157 | 3.512987 |
ec0f23d4-179a-4945-a9bb-5da48994b6ff | SonarSystems/Cocos2d-JS-v3-Tutorial-2---Setting-Up-For-iOS | TutorialCCJSYouTube/frameworks/js-bindings/cocos2d-x/cocos/base/CCNS.cpp | #include "base/CCNS.h"
#include <string>
#include <vector>
#include <string.h>
#include <stdlib.h>
#include "base/ccUtils.h"
using namespace std;
NS_CC_BEGIN
typedef std::vector<std::string> strArray;
// string toolkit
static inline void split(const std::string& src, const std::string& token, strArray& vect)
{
... | TOOL | 0.895536 | 5.423472 |
f90393ea-76ef-447a-87c6-d2dd970df45d | mohammadsoheluddin/CPP-FOR-DSA | cppm-3.5-Practice Day/H_Sorting.cpp | #include <iostream>
using namespace std;
void bubbleSort(int arr[], int n)
{
for (int i = 0; i < n - 1; ++i)
{
for (int j = 0; j < n - i - 1; ++j)
{
if (arr[j] > arr[j + 1])
{
// Swap arr[j] and arr[j + 1]
int temp = arr[j];
... | ALGO | 0.999822 | 5.37285 |
a3b8267a-b9d9-4f74-acb7-6a3611a728fa | daliangowert/SmartUFMS | tasmota-ufms/lib/libesp32_ml/tf_lite_esp32/src/tensorflow/lite/kernels/internal/reference/portable_tensor_utils.cpp | #include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <limits>
#include <utility>
#include "third_party/gemmlowp/fixedpoint/fixedpoint.h"
#include "tensorflow/lite/kernels/internal/common.h"
#include "tensorflow/lite/kernels/internal/compatibility.h"
#include "tensorflow/lite/kernels/int... | ALGO | 0.99769 | 7.055518 |
b2040977-ca3f-414d-b67a-5ab8e906e16e | GianFederico/BD-Algoritmi_e_Strutture_Dati | realizzazioni/alberi/treelink/testLink.cpp | #include "TreeLink.h"
using namespace std;
int main(){
TreeLink<char> tree;
tree.insRoot('a');
tree.insFirst(tree.root(), 'b');
tree.insFirst(tree.root(), 'c');
tree.ins(tree.firstChild(tree.root()),'d');
tree.insFirst(tree.firstChild(tree.root()), 'e');
tree.insFirst(tree.firstChild(tree.root()), 'f');
... | ALGO | 0.992458 | 4.168079 |
36e067bb-1965-46fc-a468-5752df709352 | On-Arap/neosilver_meteo | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
6b241221-143d-4bba-9e2b-d70f4e63ab50 | Nih1tGupta/Leetcode-GFG | 2137-final-value-of-variable-after-performing-operations/2137-final-value-of-variable-after-performing-operations.cpp | class Solution {
public:
int finalValueAfterOperations(vector<string>& operations) {
int a=0;
int n=operations.size();
for(int i=0;i<n;i++){
if(operations[i]=="--X") a--;
else if(operations[i]=="X--")a--;
else if(operations[i]=="X++")a++;
... | ALGO | 0.999917 | 5.830459 |
e0592add-68fd-423e-90cd-cdab0a85db41 | taiga-forestry/multithreaded-search | query.cpp | #include "query.hpp"
/**
* Constructor for Query
*/
Query::Query() {
index.process_xml();
}
/**
* Tokenizes input query and produces tokens for scoring
* @param input: string to process
* @return vector of tokens
*/
vector<string> Query::tokenize_input(string input) {
vector<string> tokens;
for (stri... | ALGO | 0.967171 | 4.296038 |
a0b214f4-fb1c-4eea-9b40-8855ad89b626 | areebakhalid3/PDAY7 | task6.cpp | #include <iostream>
using namespace std;
bool isPrime(int num);
int primorial(int n);
int main()
{
int n;
cout << "Enter number: ";
cin >> n;
int result = primorial(n);
cout << "Primorial: " << result<<endl;
return 0;
}
bool isPrime(int num)
{
for (int i = 2; i<num; i++)
{
if (n... | ALGO | 0.999866 | 4.963951 |
501a9703-285f-4bcc-8e74-73c48ffdf95b | Sookmyung-Algos/2021algos | algos_assignment/team_pratice/ACM ICPC/CheeseMara/10월 2주차/2758.cpp | #include <iostream>
#include <vector>
#define _CRT_SECURE_NO_WARNINGS
#define endl '\n'
#define vll vector<long long>
using namespace std;
int main() {
ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
int t, n, m;
cin >> t;
while (t--) {
cin >> n >> m;
vector<vll>dp(n + 1, vll(m + 1));
... | ALGO | 0.999921 | 4.410909 |
c8902091-6f2c-4b2a-8215-e309a723bc8e | RapDoodle/LeetCode-Solutions | cpp/0001-0099/12. Integer to Roman/solution.cpp | class Solution {
public:
void nextRomanNum(const int&& val, const string&& sym, int& num, string& s) {
int n = num / val;
for (int i = 0; i < n; i++)
s.append(sym);
num = num % val;
}
string intToRoman(int num) {
// The string in reverse
string s = ""... | ALGO | 0.999737 | 6.555323 |
cf7e3136-9d67-4dc9-870e-c5454153e816 | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 summer/二中集训/bzoj3168/std.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
const long long Mod=1e9+7;
int n,cnt,link[610],vis[610],tot;
long long v[310][310],rec[310];
bool ext[310][310];
struct element{
long long p[310];
int id;
}A[310],B[310],Inv[310];
long long powww(long long a,int t){
... | ALGO | 0.999948 | 3.464467 |
712d8928-a793-404a-9d1d-34e3ed686adc | drone911/GatorLibrary | gatorLibrary.cpp | #include <iostream>
#include <string>
#include <chrono>
#include "gatorLibrary.h"
#include "reservations.h"
#define BOOK_NOT_FOUND(x) ("Book " + to_string(x) + " not found in the Library")
using namespace std;
BookData::BookData(string bookName, string authorName, bool available) : bookName(bookName), authorName(au... | ALGO | 0.998205 | 5.643071 |
27bc6a6f-5f52-4203-ab95-6cb43d53ff09 | cygnus-next/frameworks_av | media/libstagefright/codecs/mp3dec/src/pvmp3_dct_16.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_dct_16.cpp
Functions:
dct_16
pv_merge_in_place_N32
pv_split
Date: 09/21/2007
-------------------------------------------------------------------------... | ALGO | 0.9985 | 4.861203 |
0cf7d36a-51bf-42ea-adff-0411218a12e7 | jjeunv/Data-Structure | W3_Stack/2023_P/2023_W3_P3.cpp | #include <iostream>
#include <string>
using namespace std;
class Node {
private:
int value;
Node* next;
public:
Node() {
this->value = 0;
this->next = nullptr;
}
~Node() {
this->value = 0;
this->next = nullptr;
}
friend class LinkedList;
friend class Stack;
};
class LinkedList {
private:
Node* head;
... | ALGO | 0.997951 | 4.452887 |
2702eab3-eb9e-409a-ab21-e3d35c61a0a2 | CBNU-NestNet-Study/2025_1_study | leejuho/week3/boj_18258.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main(){
ios ::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
queue<int> q;
while(n--){
string cmd;
cin >> cmd;
if(cmd == "push"){
int ... | ALGO | 0.995236 | 4.517686 |
af25ac9f-d0ba-4b6e-8ddc-473b6a614e28 | Muhmmad-Mahmoud/PS | PS-Sh2/sh2-E.cpp | // E. Interval Sweep
#include <iostream>
using namespace std;
int main()
{
int num1, num2, even = 0, odd = 0;
cin >> num1 >> num2;
if (num1 == 0 && num2 == 0)
cout << "NO" << endl;
else if (abs(num1 - num2) == 1 || abs(num1 - num2) == 0)
cout << "YES" << endl;
else
cout << "NO" << endl;
return ... | ALGO | 0.999979 | 3.685133 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.