uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1a101a7f-75a5-40c7-b3a1-e852efcace0b | ParadoxHole/Iut-Info | travaux-pratique/tp-r1-01-init-au-dev1/tp7/compterValeurNegative/compterValeurNegative.cpp | /*
Programme : compterValeurNegative
But : compter le nombre de valeur negative
Date de dernière modification : 20/10/2022
Auteur : maxou
Remarques : Code conforme aux spécification internes données en cours
*/
#include <iostream>
using namespace std;
int main(void)
{
// VARIABLES
const short int NB_CASE... | ALGO | 0.998603 | 4.715834 |
9e7fb5a6-8548-46b1-8331-ae05c4155f22 | BluesHaru/Practice | BOJ/2935_소음.cpp | /*---------------------------------------------------
2935
: ־ ض.
:
Input) A B 10 ̰, ̴ ִ 100ڸ̴.
Output) A+B Ǵ A*B
----------------------------------------------------*/
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
c... | ALGO | 0.99982 | 4.312785 |
15721e95-a9c5-4997-b3da-98c51b0d16fa | kinetiknz/gecko | gfx/skia/skia/src/core/SkLatticeIter.cpp | #include "SkLatticeIter.h"
#include "SkRect.h"
/**
* Divs must be in increasing order with no duplicates.
*/
static bool valid_divs(const int* divs, int count, int start, int end) {
int prev = start - 1;
for (int i = 0; i < count; i++) {
if (prev >= divs[i] || divs[i] >= end) {
return fa... | TOOL | 0.954986 | 6.925683 |
27930d18-f7b1-42fe-8367-153b0556bc91 | epri-dev/OpenDSS-C | Support/d2c_sysmath.cpp | //#include "stdafx.h"
#include "d2c_sysmath.h"
#include <math.h>
#include <stdlib.h>
namespace System
{
//---------------------------------------------------------------------------
int64_t Round( long double X )
{
return (int64_t) ( X < 0 ? X -.5 : X + .5) ; //floor(X + 0.5);
}
//--------------------------------... | TOOL | 0.920133 | 4.098558 |
5b1e9cc7-9a0e-467a-8859-4b3af061f41b | mzadel/libmapper-sc | external_libraries/boost/libs/regex/src/icu.cpp | /*
* LOCATION: see http://www.boost.org for most recent version.
* FILE icu.cpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Unicode regular expressions on top of the ICU Library.
*/
#define BOOST_REGEX_SOURCE
#include <boost/regex/config.hpp>
#ifdef BOOST_HAS_ICU
#define BOOST_RE... | TOOL | 0.873126 | 6.521331 |
15a93055-b0bc-484e-ba95-425d2d465775 | sinnu2004/DSA | bubblesortAssignment/sortInDecending.cpp | #include<iostream>
using namespace std;
int main(){
int arr[] = {3,5,2,6,4,8,9,1};
int n = 8;
for(int i=0;i<n-1;i++){
for(int j=0;j<n-1-i;j++){
if(arr[j]<arr[j+1]){
swap(arr[j],arr[j+1]);
}
}
}
for(int i=0;i<n;i++){
cout<<arr[i]<<" ";
... | ALGO | 0.999925 | 3.97759 |
0ccc3108-c39f-4772-9baa-2c2c3a2223d4 | Shabopp/DS | array/vector_Function calling example.cpp | #include<iostream>
#include<vector>
using namespace std;
int firstOccurence(vector<int> &arr, int x){
int n = arr.size();
int s=0;
int e= n-1;
int fir =-1;
while(s<=e){
int mid = s+(e-s)/2;
if(arr[mid]==x){
fir = mid;
e=mid-1;
}
else... | ALGO | 0.999673 | 5.792902 |
c0065002-8b83-499c-bdd9-56110e5e2cdb | SebastianMestre/Competitive-Programming | CSES/SortingAndSearching/Towers.cpp | #include <bits/stdc++.h>
using namespace std;
#define forr(i,a,b) for(int i = int(a); i < int(b); ++i)
#define forn(i,n) forr(i,0,n)
#define dforr(i,a,b) for(int i = int(n)-1; i >= int(a); --i)
#define dforn(i,n) dforr(i,0,n)
#define db(v) cerr << #v " = "<<(v)<<'\n'
#define vecp(v) cerr << #v " = "; for(auto ee : v) ... | ALGO | 0.999962 | 4.997401 |
697cfa9c-2859-485d-a26f-854a9e63b7ff | shikha7124v/Data-Structures | Binary-Search(1D, 2D arrays, Search-Space)/BS(on 1D array)/SearchInsertPosition/bruteForce.cpp | #include<bits/stdc++.h>
using namespace std;
int searchInsertPosition(vector<int> &arr, int ele)
{
int n = arr.size();
for(int i=0; i<n; i++){
if(arr[i] >= ele){
return i; //Position where ele must have
}
}
}
int main()
{
vector<int> arr{1,2,4,5,7};
int ele = 3;
co... | ALGO | 0.999831 | 5.580791 |
8e957fb6-8eec-4819-9256-a64d53dc5ec3 | CodeWithChini/Introduction_To_Cpp | Functions/Palindrome.cpp | #include<iostream>
using namespace std;
bool palindrome(int n)
{
int temp = n, revnum = 0;
while(temp != 0)
{
int lastDigit = temp % 10;
temp = temp / 10;
revnum = revnum * 10 + lastDigit;
}
if(revnum == n)
{
return true;
}
else
{
return false... | ALGO | 0.999884 | 4.662104 |
23180893-8ccb-4527-8e20-c630563251fa | istiak7/Problem-Solving | uva/10394.cpp | #include<bits/stdc++.h>
#define ll long long
#define max_size 20000000
using namespace std;
ll ara[max_size+5];
vector<pair<ll,ll>>v;
void sieve()
{
for(ll i=4; i<=max_size; i+=2)ara[i]=1;
for(ll i = 3; i*i<=max_size; i+=2)
{
for(ll j = i*i; j<=max_size; j+=i)
{
ara[j]=1;
... | ALGO | 0.998676 | 4.064811 |
00c4e189-2cc6-4aa7-937f-f30b5993a59f | OddEssA/Ejay-3D_BIQU_B1_-_BX | Marlin-B1-2.0.9.3.x-SKR2-ABL/Marlin/src/gcode/bedlevel/mbl/G29.cpp | /**
* G29.cpp - Mesh Bed Leveling
*/
#include "../../../inc/MarlinConfig.h"
#if ENABLED(MESH_BED_LEVELING)
#include "../../../feature/bedlevel/bedlevel.h"
#include "../../gcode.h"
#include "../../queue.h"
#include "../../../libs/buzzer.h"
#include "../../../lcd/marlinui.h"
#include "../../../module/motion.h"
#in... | TOOL | 0.854561 | 7.837335 |
321dd583-e4bd-4355-8820-d0bea06a0ee0 | priyanka8625/DSA-Daily-Problems-2024 | 04_April_Daily_Problems/05_GFG_Strictly Increasing Array.cpp | class Solution {
public:
int min_operations(vector<int>& nums)
{
int n = nums.size();
vector<int> dp(n,1);
int LIS=1;
for(int i=1;i<n;i++)
{
for(int j=0;j<i;j++)
{
if(nums[i]>nums[j] && (nums[i]-nums[j])>=(i-j))
... | ALGO | 0.999956 | 5.81722 |
193d9ebc-3efc-4db4-9ff5-97bf3a80afb3 | GIBIS-UNIFESP/BIAL | tst/src/SuperPixel-RhombicDodecahedronSeeds.cpp | #include <queue>
#include "Image.hpp"
#include "FileImage.hpp"
using namespace std;
using namespace Bial;
void SuperVoxelDodecahedronInit( Image< int > &supervoxel_seed, double supervoxels ) {
// Volume = 16*sqrt(3)*a^3/9 -> a = edge length. For cube with edge length = 1, a = sqrt(3).
// Distance between dodecahe... | ALGO | 0.92681 | 4.996515 |
00d78823-368d-4006-8bd6-2c5ec5d2037c | KarolineIP/numerical | solver.cpp | #include "solver.h"
inline double Solver::InitalExpression(double x) {
double result = std::asin((std::pow(x, 3) + 2*x + 1)/(3*x + 1)) + std::cos((2*std::pow(x, 3) - 3*x + 3 + 3*std::sqrt(10))/3) - 0.5;
++result_.calculation_count_;
return result;
};
void Solver::Solve(Solver::Method method, double eps, ... | ALGO | 0.999961 | 5.801507 |
fd782851-cde0-4c33-acc2-77ebc031ea34 | Samuu00/EsUni | Fondamenti 2/es1.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cout << "Inserire la dimensione della matrice quadrata: ";
cin >> n;
int mat[n][n], l[n];
int somma = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cin >> mat[i][j];
}
}
for (... | ALGO | 0.992832 | 3.261509 |
f2aa99e8-e27b-4d3b-ad1f-d606f7f03155 | msft-mirror-aosp/toolchain.llvm-project | mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp | #include <climits>
#include <cmath>
#include <cstddef>
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/Dialect/Math/Transforms/Approximation.h"
#include "mlir/Dialect/Math/Transforms/Passes.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Vector/IR/... | TOOL | 0.977412 | 5.228578 |
a88c3275-72b8-4727-8f2d-f52aeabbdaeb | mrdrivingduck/leet-code | 331.VerifyPreorderSerializationOfABinaryTree.cpp | /**
* @author Mr Dk.
* @version 2021/03/12
*/
/*
模拟建树顺序但不真正建树。遇到叶子结点则返回上级。到最后,应当在建立
合法二叉树的前提下,恰好把所有的结点用完。
*/
#include <cassert>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
using std::cout;
using std::endl;
using std::vector;
using std::string;
using std::stringstream;
clas... | ALGO | 0.99982 | 5.916876 |
af2f70a6-1f42-4695-955a-c5408efbd806 | kryag/ct-itmo-algorithms | sem-2/solutions/5D.cpp | #include <iostream>
#include <random>
#include <unordered_set>
std::unordered_set<int> tree_priority;
std::random_device random;
std::mt19937 generation(random());
int random_priority() {
std::uniform_int_distribution<> distribution(INT32_MIN, INT32_MAX);
return distribution(generation);
}
int get_priority()... | ALGO | 0.999977 | 5.234328 |
fc593070-86fa-46bc-aa63-2eec1578e0be | camil0palacios/Competitive-programming | solutions/codeforce/Codeforces Round #762 (Div. 3)/g.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define fori(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define fore(i,a,b) for(int i = a; i <= b; i++)
#define ft first
#define sd second
#define all(v) v.begin(), v.end()
#define sz(v) (int) v.size()
#define mp make... | ALGO | 0.999969 | 4.468475 |
31151e9e-4ecc-4e48-8011-2dcb51ce96fd | bhanupgpt/leetcode-practice | 2494-sum-of-prefix-scores-of-strings/2494-sum-of-prefix-scores-of-strings.cpp | struct TrieNode {
TrieNode* next[26] = {};
int cnt = 0;
};
class Solution {
TrieNode root;
public:
void insert(string word) {
auto node = &root;
for (char c : word) {
if (!node->next[c - 'a']) {
node->next[c - 'a'] = new TrieNode();
}
... | ALGO | 0.999991 | 6.475481 |
0451543b-ade0-4da5-93f5-02fb687e99e7 | AbeerAzmi/Flutter_LoginScreen | 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.998693 | 6.797273 |
d8c60c07-e08d-4248-abd1-75b17c6b767e | dengpingzju/mit6.837 | assignment0/assignment0/ifs.cpp | #include "ifs.h"
#include "matrix.h"
#include <cstdio>
#include <ctime>
#include <cstdlib>
IFS::IFS(const char *file_name) {
good_state=-1;
srand(time(0));
readDescription(file_name);
}
IFS::IFS() {
good_state=-1;
srand(time(0));
}
void IFS::myDecons() {
delete [] prob;
for (int i=0;i<n;i++) {
d... | ALGO | 0.972733 | 3.436926 |
0dc91232-e53b-45ba-89ac-0c5ab7e1b781 | YashMundankar/Leetcode | 349-intersection-of-two-arrays/349-intersection-of-two-arrays.cpp | class Solution {
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
vector<int>ans;
unordered_set<int>s1;
for(auto i: nums1){
s1.insert(i);
}
for(auto i: nums2){
if(s1.find(i)!=s1.end()){
ans.push_back(i);
... | ALGO | 0.999799 | 5.5723 |
dbfeaefc-b7f1-4fa4-8346-f1c94190bfdb | yzzupgo/MFTCG | Data/abc136_b/mr_dreamer/wa/6774938.cpp | #include<bits/stdc++.h>
#define li long long int
#define pb push_back
using namespace std;
int main(){
li n , count1=0 ,t;
cin>>n;
while(n--){
t=n;
li count =0;
while(t){
t=t/10;
count++;
}
if(count%2!=0)
count1++;
}
cout<<count1<<endl;
}
| ALGO | 0.999499 | 3.606363 |
06bbeabb-f45c-492f-911d-f7199ac067e9 | OrigamiMaker-Senior-Project/OrigamiMaker | wxWidgets/samples/treelist/treelist.cpp | // ============================================================================
// Declarations
// ============================================================================
// ----------------------------------------------------------------------------
// Headers
// -------------------------------------------------... | TOOL | 0.931283 | 5.582743 |
2bd104f1-7a17-4bae-aac9-972dd7cfc86d | Mahfuzpust/Compiler-Design- | Compiler Design Sessional Lab/if-else statement check.cpp | #include<bits/stdc++.h>
using namespace std;
char ch, buffer[10],b[30], logical_op[] = "><";
ifstream fin("sample.cpp");// Input file *
string str[100];
int isDatatype(char buffer[])
{
char keywords[9][15] =
{
"int","void","char","float","double","long int",
"long long int","long double","unsi... | ALGO | 0.962016 | 3.211337 |
93991a0d-d255-47e4-ba52-c5fe2e8f1001 | sushantkumar143/Competitive-Programming | CodeForces/A_Boy_or_Girl.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int n = s.length();
int arr[26] = {0};
for(char ch : s){
arr[ch-97]++;
}
int cnt = 0;
for(int i : arr){
if(i > 0) cnt++;
}
if(cnt%2 == 0) cout << "CHAT WITH HER!";
else ... | ALGO | 0.999885 | 4.571239 |
e138dbf2-affe-47b1-bec6-63bfb4c9eb2e | saifrahmania/DataStructurePracticeWithC | PossiblePathsInAMaze.cpp | //count all possible paths in a maze
#include<iostream>
using namespace std;
int countPath(int n, int i, int j){
if(i==n-1 && j==n-1){
return 1;
}
if(i>=n || j>=n){
return 0;
}
return countPath(n, i+1, j) + countPath(n, i, j+1);
}
int main(){
int n;
cin>>n;
cout<<countP... | ALGO | 0.9998 | 4.126519 |
42156f77-3894-466c-a426-0e1058185a72 | n4nimit2000/PlacementPrep | Stack/sort_stack.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vll vector<ll>
void insert_at_right_position(stack<ll> &st, ll tmp)
{
if (st.empty())
{
st.push(tmp);
return;
}
if (tmp > st.top())
{
st.push(tmp);
return;
}
ll x = st.top();
... | ALGO | 0.999975 | 5.459836 |
2fb17861-4934-4a5c-9fd1-12feb66d0beb | benlmaoujoud/CSES_Solutions | Repetitions.cpp | #include<bits/stdc++.h>
using namespace std;
void solve() {
string dna ;
cin >> dna;
int ans = 1;
int count=0;
char l ='A';
for(int i =0; i<dna.length(); ++i){
if(dna[i] == l){
++count;
ans = max(count, ans);
}
else {
l = d... | ALGO | 0.999734 | 3.934484 |
9670269f-a287-4611-a3dd-cd8a4ee915ab | HJWAJ/acm_codes | NJUST OJ/1262.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.991072 | 3.14998 |
f20d6482-17b6-49d3-af18-0c805e5891c2 | 18309220622/learngit | datastruct/RBTreeTest.cpp | #include"RBTree.h"
void test()
{
RBTree<int,int> RB;
int arr[]={16, 3, 7, 11, 9, 26, 18, 14, 15};
size_t sz=sizeof(arr)/sizeof(arr[0]);
for (size_t i=0;i<sz;++i)
{
RB.Insert(arr[i],i);
}
RB.InOrder();
cout<<"Find(15):"<<RB.Find(15)<<endl;
cout<<"IsRBTree?"<<RB.IsRBTree();
}
int main()
{
test();
system("pa... | TEST | 0.935558 | 4.251964 |
5b9589dd-70bc-461b-8f0a-972d4c54aeda | veer11997/DSA | cpp-basic/arr-4.cpp | #include<iostream>
using namespace std;
// Bar Chart
int main()
{
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
int maxi=arr[0];
for(int i=1;i<n;i++)
{
if(arr[i]>maxi)
maxi=arr[i];
}
for(int f=maxi;f>=1;f--)
{
... | ALGO | 0.999901 | 3.885564 |
0a8e8d94-6662-4194-ba2f-c38c0dbde6be | YOUNAVI/AlgoRhythm | week04/YOUNAVI/problem_11478.cpp | // 11478
#include <iostream>
#include <string>
#include <set>
using namespace std;
int main() {
string S;
string tmp;
set<string> A;
cin >> S;
for (int i = 0; i < S.size(); i++) {
for (int j = 0; i + j <= S.size(); j++) {
tmp = S.substr(j, i);
A.insert(tmp);
}
}
cout << A.size();
return 0;
} | ALGO | 0.999555 | 4.702579 |
a8134225-80ee-4e3f-9bb0-9f35c6dd57d7 | BREACH1247/DSA | balanced_paranthesis.cpp | #include<iostream>
#include<stack>
#include<cstring>
using namespace std;
void Paran(char *C,int n){
stack<char>S;
for (int i = 0; i < n; i++)
{
if (C[i] == '{' || C[i] == '[' || C[i] == '(')
{
S.push(C[i]);
}
}
}
int main(){
char C[51];
printf("Ente... | ALGO | 0.998812 | 4.434758 |
4ca4dedb-8670-4daa-a931-659a8ab7212f | krishnactive/cp | some cp problems/Invert_And_Equalize.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define lld long double
#define pb push_back
#define vi vector<int>
#define vc vector<char>
#define vl vector<ll>
#define ump unordered_map
#define uset unordered_set
#define mset mu... | ALGO | 0.999936 | 5.130951 |
2e57ecd0-f813-452f-a1ec-d220ce275bee | d7anSeR/lab3sys_prog | lab.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include<stdio.h>
#include<math.h>
#include<cstdlib>
#include <thread>
#include <chrono>
using namespace std;
using namespace std::chrono;
// Структура для передачи данных в поток
struct ThreadData {
vector<vector<double>>* matrix1;
vector<vector<double... | ALGO | 0.999375 | 4.603362 |
277ab479-ec07-4871-a219-7f596b00ebe1 | Harshjoon/object_in_frame | object_in_fram.cpp | #include <iostream>
#include "math.h"
#include <stdlib.h>
using namespace std;
// TODO
// - change coordinate struct to vector
#define PI 3.1415926
struct coordinate
{
float x;// = 0.0;
float y;// = 0.0;
float z;// = 0.0;
};
struct camera_properties
{
float horizontal_angle;// = 20; // in degrees
... | TOOL | 0.994944 | 4.910555 |
63557162-99eb-4ed0-a4a0-bd8bc524c469 | geographiclib/geographiclib | src/Geocentric.cpp | #include <GeographicLib/Geocentric.hpp>
namespace GeographicLib {
using namespace std;
Geocentric::Geocentric(real a, real f)
: _a(a)
, _f(f)
, _e2(_f * (2 - _f))
, _e2m(Math::sq(1 - _f)) // 1 - _e2
, _e2a(fabs(_e2))
, _e4a(Math::sq(_e2))
, _maxrad(2 * _a / numeric_limits<real>::ep... | ALGO | 0.998388 | 5.883781 |
bfd71f13-296f-4243-bc28-eb065b0d626d | XkdZy/Code-Craft-2023- | source/mAlgorithm.cpp | #include "header.h"
/*
´ָ̨״̬λ4567
*/
void SetBenchGoingState(Robot& r, int num) {
for (int j = 0; j < r._vTask.size(); j++) {
//fprintf(stderr, "------------------4---------------\n");
// ̨״̬λֻ4567̨Ч
if (vBenchInfo[r._vTask[j]._qBench].getBenchType() > 2 &&
vBenchInfo[r._vTask[j]._qBench].getBenchType() <... | TOOL | 0.984371 | 3.883995 |
f78a08da-d948-44c5-a8ed-91c7e756cbda | manimaran02/C-learning | calculator.cpp | #include <iostream>
using namespace std;
const int ZEN_MODE = 1;
const int NORMAL_MODE = 0;
const int EXIT_MODE = -1;
int factorial(int x){
int fact = 1 ;
for(int i =1;i<=x;i++){
fact = fact * i;
}
return fact;
}
int zeros_end(int N){
int val = N;
int zeros;
while(N > 0){
... | ALGO | 0.994328 | 3.264347 |
aa41b542-f2b2-4cb6-887e-629e52103f70 | danielhO9/PS | CODEFORCES/2043A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
void solve() {
cin >> n;
ll ans = 1ll;
while (n > 3) {
ans *= 2ll;
n /= 4;
}
cout << ans << '\n';
}
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int t; cin >> t;
while (t--) solve();
} | ALGO | 0.999782 | 4.914028 |
725a4d7f-7ef3-4cdb-9a7a-e7a6852975d9 | raincross7/code-similarity | codes/train_code/problem207/problem207_295.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007
int dx[]={-1,0,0,1};
int dy[]={0,-1,1,0};
int H,W;
bool check(vector<string>S,int x,int y){
if(S[y][x]=='.') return true;
for(int i=0;i<4;i++){
... | ALGO | 0.999994 | 4.393109 |
8a6f2f52-f104-4a6b-890a-779942dfcd36 | HsiaoWeiChih/LeetCode | cpp/word-pattern.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;
class Solution
{
private:
string findNextWord(string s, int& index)
{
if(index >= s.size())
return " ";
while(index < s.size() && s[index] == ' ')
index++;
int curr... | ALGO | 0.999589 | 5.841631 |
879171ba-92ef-4bf8-9ca7-58e36acef6e2 | Mahdi-Hasan/Introduction-to-Competitve-Programming | Competitive programming lab BY Rafi Sir/Program Files/OJs/Lightoj/curious_robin_hood.cpp | #include <bits/stdc++.h>
using namespace std;
int Bit_arr[1005],arr[10005],t,T,size,q,o,in,unum,indx;
int st,end,qf;
void init(int s,int num,int size)
{
while(s<=size)
{
Bit_arr[s]+=num;
s+=s & (-s);
}
}
void update(int indx,int unum,int size)
{
init(indx,unum,size);
}
int query(int range)
{
int sum=0;
while(... | ALGO | 0.999429 | 3.777512 |
a21deca1-3780-4cc8-bc5a-da7f5bf9bd2e | AbhishekSaxena2244/DSA_Problems_set1 | prac1.4.cpp | #include<iostream>
using namespace std;
int main()
{
int sum;
cout<<"The perfect numbers between 1 and 500 are:"<<endl;
for(int i=1;i<=500;i++)
{
sum=0;
for(int j=1;j<i;j++)
{
if(i%j==0)
sum=sum+j;
}
if(sum==i)
cout<<i<<endl;
}
return 0;
}
| ALGO | 0.999199 | 3.580161 |
12a1b06e-f46c-4ea6-a67d-c51731de8d85 | Anurag-2312/CodeSprint2.0 | Day17/ques1.cpp | #include <bits/stdc++.h>
using namespace std;
string reverse(string s)
{
stack<char> st;
for (char c : s)
{
st.push(c);
}
string reversed = "";
while (!st.empty())
{
reversed += st.top();
st.pop();
}
return reversed;
}
int main()
{
string input;
get... | ALGO | 0.999649 | 5.965903 |
45d987ba-18ce-4730-8a51-09c90d164006 | sonapraneeth-a/competitive-programming_submissions | platforms/leetcode/practice/non-premium/hard/864__shortest-path-to-get-all-keys/solutions.cpp | // clang-format off
/**
* FILE DESCRIPTION
*
* Filename: 864__shortest-path-to-get-all-keys/solutions.cpp
* Created on: 05 September 2021
* Last modified: 05 September 2021
* Author: sonapraneeth_a
* Description: LeetCode submission for 'Shortest Path to Get All Keys' problem
*/
/**... | ALGO | 0.999972 | 6.373882 |
58dd1916-d428-4b63-b187-cca46ce4cfc6 | zhangchunbao515/leetcode | leetcode-02/643. Maximum Average Subarray I/s1.cpp | // OJ: https://leetcode.com/problems/maximum-average-subarray-i/
// Author: github.com/lzl124631x
// Time: O(N)
// Space: O(1)
class Solution {
public:
double findMaxAverage(vector<int>& nums, int k) {
int sum = 0, maxSum = INT_MIN;
for (int i = 0; i < nums.size(); ++i) {
if (i < k) {
... | ALGO | 0.999421 | 6.697156 |
fdc23547-4d94-40c1-99b0-c5e733b73baf | ishandutta2007/codeforces | dragonslayerintraining/normal/947/B.cpp | #include <cstdio>
#include <algorithm>
#include <stdint.h>
const int64_t INF=1e9+7;
struct SegTree{
int64_t cnt;
int64_t sum;
int64_t min;
SegTree():cnt(0),sum(0),min(INF){
}
}st[400000];
int64_t ts[100005];
int64_t vs[100005];
void pull(int64_t w,int64_t L,int64_t R){
st[w].cnt=st[w*2+1].cnt+st[w*2+2].... | ALGO | 0.999967 | 3.551888 |
b62ac949-1912-4ac5-adfe-42b711aab339 | risacker/Leetcode_Solutions | 1675-minimize-deviation-in-array/1675-minimize-deviation-in-array.cpp | class Solution{
public:
int minimumDeviation(vector<int>& nums){
int n = nums.size();
int mx = INT_MIN, mn = INT_MAX;
for(int i = 0; i<n; ++i)
{
if((nums[i]%2) != 0)
nums[i] *= 2;
mx = max(mx,nums[i]);
mn = min(mn,nums[i]);
... | ALGO | 0.999898 | 5.112658 |
63d0a83b-05c8-4f18-9615-f5948d3871bb | pedr0Rossi/UNESP | ATP/Aula4/media.cpp | #include<iostream>
#include<cmath>
using namespace std;
main(){
int inicioFixo, inicio, fim, media, soma, qtde;
inicio = 30;
inicioFixo = inicio;
fim = 60;
while (inicio <= fim){
if(inicio%3==0){ //divisivel por 3
soma += inicio;
qtde += 1;
}
inicio += 1;
}
media = soma/qtde;
cout << "A media entr... | ALGO | 0.999727 | 3.630839 |
239dba15-81e5-4207-8261-7211a2d623cb | blueboxd/libcxx | test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T>
// requires OutputIterator<Iter, RvalueOf<Iter::reference>::type>
// && HasEqualTo<Iter::value_type, T>
// constexpr Iter // constexpr after C++17
// remove(Iter first, Iter last, const T& value);
#include <algorithm>
#include <cassert>
#... | TEST | 0.883561 | 7.258646 |
21977f83-fab6-4f3d-b2c6-d68573c052b4 | ameybh/competitive-programming | codeforces/69/A.cpp | // Author: Amey Bhavsar
// IDE: Geany/Ubuntu
// Platform: Codeforces
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
#define bpc __builtin_popcount
#define bpcl __b... | ALGO | 0.999739 | 3.907814 |
4616d019-0dda-44fb-b204-b145e2578220 | ishandutta2007/codeforces | cerberus97/normal/1569/A.cpp | /* cerberus97 - Hanit Banga */
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
#define pb p... | ALGO | 0.999417 | 3.887644 |
0bc4f701-b199-47e4-9904-79b2d53d70c6 | naviji/CP3-solutions | Introduction/Getting-Started/The-Easy-Problems/easy/11764/11764.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <string>
#include <cmath>
#include <set>
using namespace std;
#define ll long long
#define ld long double
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define pb push_back
c... | ALGO | 0.99956 | 3.461346 |
6802a9af-b6be-4016-af07-8f95d9d0c917 | suyuee/LC | 852.peak-index-in-a-mountain-array.cpp | /*
* @lc app=leetcode id=852 lang=cpp
*
* [852] Peak Index in a Mountain Array
*
* https://leetcode.com/problems/peak-index-in-a-mountain-array/description/
*
* algorithms
* Easy (70.02%)
* Total Accepted: 94.1K
* Total Submissions: 134.4K
* Testcase Example: '[0,1,0]'
*
* Let's call an array A a mount... | ALGO | 0.999975 | 5.774439 |
f26880cf-d0b1-49d5-b44c-4f6a38c57648 | arm/arm-toolchain | lld/ELF/MarkLive.cpp | #include "MarkLive.h"
#include "InputFiles.h"
#include "InputSection.h"
#include "LinkerScript.h"
#include "SymbolTable.h"
#include "Symbols.h"
#include "SyntheticSections.h"
#include "Target.h"
#include "lld/Common/Strings.h"
#include "llvm/ADT/DenseMapInfoVariant.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Supp... | TOOL | 0.87736 | 7.518008 |
d228fe52-eacd-4edd-b10d-65d2ae9de214 | halstonblim/sma-crossover-analyzer | CrossDetector.cpp | #include "CrossDetector.h"
CrossDetector::CrossResult CrossDetector::detectCross(const vector<string>& dates,const int shortPeriod,const int longPeriod,const unordered_map<int, vector<double>>& sma_values) {
CrossResult result;
for (size_t i = 1; i < dates.size(); ++i) {
double shortSma = sma_values.a... | ALGO | 0.990706 | 4.91135 |
c43d2f10-407d-48a8-beac-b1dd4e722760 | desyang-hub/CoderRecords | LeetCode/Solution_0899.cpp | #include "bits/stdc++.h"
using namespace std;
class Solution {
public:
string orderlyQueue(string s, int k) {
if(k == 1) {
string res = s;
for(int i = 0; i < s.size(); i++) {
string t = s.substr(i) + s.substr(0, i);
res = min(t, res);
... | ALGO | 0.999988 | 5.517046 |
b9a9d4cb-e988-4f1a-9e97-0381d2e674b1 | utkarshmaken/cp | inter iit 2020/113.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define f(i,a,b) for(int i = a;i<b;i++)
#define rep(i,a,b) for(int i = a;i<=b;i++)
#define fd(i,a,b) for(int i = a;i>b;i--)
#define repd(i,a,b) for(int i = a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define ... | ALGO | 0.999804 | 3.648185 |
aa90cfd0-17ea-4cab-8a9f-48bdbfb2708f | raincross7/code-similarity | codes/train_code/problem078/problem078_136.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 10000000... | ALGO | 0.999997 | 4.399638 |
b660891c-820e-463a-9ef2-c7852066e078 | PernnyDev/Cpp | EX05.cpp | #include<stdio.h>
#include<stdlib.h>
void inserirLista (int elem);
void exibirLista (void);
void qtdLista (void);
struct No {
int info;
struct No *prox;
};
struct No *cabeca= NULL;
struct No *ult = NULL;
int qtd = 0;
int nMenu;
void inserirLista (int elem){
struct No *novo = (struct No*) malloc(sizeof(struct No )... | ALGO | 0.952739 | 3.70024 |
2ecad539-66b8-48ca-98d6-4096d0688561 | TanishqBhargava/Hackerearth | Algorithms/Dynamic Programming/Dynamic Programming and Bit Masking/Prefix GCD Maximization.cpp | /*========================*\
| ID: tanishqbhargava2509 |
| LANG: C++ |
\*========================*/
//Tanishq Bhargava
#include <bits/stdc++.h>
using namespace std;
long long solve(int mask, vector<long long>&ar, vector<long long>&dp)
{
int n = ar.size();
if(mask == (1<<n) - 1)
return... | ALGO | 0.999983 | 4.412167 |
d54187fc-d354-4915-bb75-61c7d45198b1 | vipinrao009/DSA_WITH_CPP | 2D_Array/Col_wisePrint.cpp | //Print 2D array in colum wise
#include<iostream>
using namespace std;
void printArray(int arr[][4],int row,int col)
{
for(int i=0; i<col; i++)
{
for(int j=0; j<row; j++)
{
cout<<arr[j][i];
}
cout<<endl;
}
}
int main()
{
int arr[][4]=
{
{1,2,3,4... | ALGO | 0.980978 | 4.909654 |
2d53f7f0-c0c7-4771-95f0-8eb5c063c042 | zhao-zh10/CarND-Unscented-Kalman-Filter-Project | src/tools.cpp | #include "tools.h"
using Eigen::VectorXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/**
* TODO: Calculate the RMSE here.
*/
} | TOOL | 0.936791 | 5.145421 |
eab17f0c-ade2-477c-95d9-13011d2d216b | JunBinLiang/Road-To-1900 | Codeforce/2200/2039E.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
/*
[0 1]
[0 0 1]
[0 1 0]
[0 0 0 1] 0
[0 0 1 0] 1
[0 1 0 1] 1
[0 1 1 0] 2
[1 0 1 0] 3
*/
const int MOD = 998244353;
const int N = 1e6 + 10;
void solve() {
int n;
cin >> n;
if(n == 2) {
... | ALGO | 0.999909 | 4.968165 |
7e1c11ca-0a9a-4c87-a0ec-80523338007c | BCAPATHSHALA/DSA-SUPREME-2-0-NOTES | DSA SUPREME 2.0 CODES/ALL ASSIGNMENT CODE/STRING ASSIGNMENT CODE/PROBLEM9.CPP | // 9. Isomorphic Strings (Leetcode-205) (IMP)
class Solution {
public:
bool isIsomorphic(string s, string t) {
int hash[256] = {0};
bool isTMapped[256] = {0};
if(s.size() != t.size()){
return false;
}
for(int i=0; i<s.size(); i++){
if(hash[s[i]] == 0... | ALGO | 0.999981 | 6.514147 |
aaf822ca-cc78-4228-89ab-cc632c06730f | Arlyz159/alkdmas | siu/invertir .cpp | #include <iostream>
using namespace std;
void imprimir(const int arr[], int tam, int i = 0) {
if(tam == 0)
return;
cout << arr[i] << " ";
imprimir(arr, tam-1, ++i);
}
void invertir(int arr[], int tam) {
for(int i = 0; i < tam/2; i++) {
int temp = arr[i];
arr[i] = arr[tam-1];
... | ALGO | 0.999911 | 5.222585 |
7e14a178-5990-4b07-96ea-ff68f57d9986 | emon4075/CSECU-CP-Camp | Marathon-01-Combinatorics/I_Good_Predictions.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define P 1000000007
using namespace std;
void FASTIO()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
}
ll Fact[10000000];
ll Power(ll A, ll B)
{
ll Result = 1;
while (B)
{
if (B % 2)
{
Result = (Result * A)... | ALGO | 0.999959 | 5.454158 |
16758006-0086-4a56-baec-5a93a63e68d3 | UCLeuvenLimburg/pvm | course-material/coding-exercises/arrays/c-style-strings/solution/string-operations.cpp | #include "string.h"
unsigned length(char* string)
{
unsigned count = 0;
auto current = string;
while (*current != 0)
{
++current;
++count;
}
return count;
}
void overwrite(char* destination, char* source)
{
while (*source != 0)
{
*destination = *source;
... | TOOL | 0.864202 | 4.774941 |
e50f21e7-7065-4c41-8241-3203ec10bbe7 | yoniavn/VSCODE | CPP_11_14_17/GK8_EX/cpp11.cpp | // C++ Home assignment
/*
1. Implement function that gets integer numbers as parameter and return the sum
** the function can be called with any number of parameters (not inside container, but as parameter) **
std::cout << sum(2,5,10); //17
std::cout << sum(2,5,10,2,5,102,5,102,5,10); ... | ALGO | 0.998829 | 5.578864 |
f36043e8-2598-4288-bcf5-a93c6e997bba | Nerei/pcl_old_repo | surface/src/vtk_smoothing/vtk_mesh_smoothing_laplacian.cpp | #include <pcl/surface/vtk_smoothing/vtk_mesh_smoothing_laplacian.h>
#include <pcl/surface/vtk_smoothing/vtk_utils.h>
#include <vtkSmoothPolyDataFilter.h>
//////////////////////////////////////////////////////////////////////////////////////////////
void
pcl::MeshSmoothingLaplacianVTK::performProcessing (pcl::PolygonM... | ALGO | 0.919351 | 6.967147 |
5e271b17-50d5-462b-ad7d-0a97c217f0f4 | Sa2003hil/DSA | Love Babbar DSA series/Lecture061 Queue Interview Questions/nonRepeating.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
string FirstNonRepeating(string A){
map<char, int> m;
string ans = "";
queue<char> q;
for(int i=0; i<A.length(); i++) {
char ch = A[i];
q... | ALGO | 0.999847 | 5.428108 |
2b6e45fb-6e48-4b0c-952d-07f41b7930cb | bhaveshgarg2000/LeetCode-GFG-DailyChallenge | April 2024/2073.cpp | class Solution
{
public:
int timeRequiredToBuy(vector<int> &v, int k)
{
int n = v.size();
int value = v[k];
int t = 0;
for (int i = 0; i < n; i++)
{
if (i < k)
{
t = t + min(v[i], value);
}
else if (i == k)
... | ALGO | 0.999919 | 5.683995 |
82f11661-9275-4be6-8ab2-0b1d91ac4d89 | LTLQ/STPTTD | 1008/sample.cpp | #include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
int gcd(int a, int b) {
b == 0 ? a : gcd(b, a % b);
}
int main() {
freopen("in.in", "r", stdin);
freopen("out.out", "w", stdout);
string str1, str2;
while(cin >> str1 >> str2) {
puts(gcd(str1.size(), str2.size())... | ALGO | 0.999724 | 4.163088 |
4ecb9479-25c8-43df-a8f3-59289223704e | shaggy40/leetcode | 0994-rotting-oranges/0994-rotting-oranges.cpp | class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
vector<pair<int,int>> dir = {{1,0},{-1,0},{0,-1},{0,1}};
int vis[m][n];
queue<pair<int,int>> q;
int fresh=0,cnt=0;
... | ALGO | 0.999975 | 6.212764 |
7bfb2bf0-9382-4794-ae73-8b9c384f9287 | Abhish-akp/POD-Leetcode- | 1187-print-foobar-alternately/print-foobar-alternately.cpp | class FooBar {
private:
int n;
mutex m;
condition_variable cv;
bool turn;
public:
FooBar(int n) {
this->n = n;
turn = 0;
}
void foo(function<void()> printFoo) {
for (int i = 0; i < n; i++) {
unique_lock<mutex>lock(m);
while(turn == 1... | ALGO | 0.966488 | 5.73261 |
d733b1e4-e3b3-4d89-b036-51312f92d780 | ruxanda12/Ray-tracer | src/interpolate.cpp | #include "interpolate.h"
#include <glm/geometric.hpp>
// TODO Standard feature
// Given three triangle vertices and a point on the triangle, compute the corresponding barycentric coordinates of the point.
// and return a vec3 with the barycentric coordinates (alpha, beta, gamma).
// - v0; Triangle vertex 0
// - v1... | ALGO | 0.998337 | 6.803339 |
f63e650c-4c34-42d7-96b9-c728254245ba | ydtHCMUT/30CPP | 30days/Day2/A_Drazil_and_Date.cpp | #include <iostream>
#include <string>
#include <math.h>
using namespace std;
void solution(int a, int b, int s){
a = abs(a);
b = abs(b);
bool answer;
while ( a+b < s){
s = s-2;
}
if (s == a + b){
cout << "Yes";
}else{
cout << "No";
}
}
int main()
{
int a, b... | ALGO | 0.999662 | 3.560533 |
7717d980-aeef-4908-b522-f2459866e8ad | lonelam/SolveSet | cf820D.cpp | /*
* hihocoder 1388 Periodic Signal
*
* 把式子变形一下就是求Ai*Bi+k求和的最大值,想到用FFT来求
* 会因为精度问题不能过,这是找出最小的那个k,然后重新算即可。
*/
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000000+10;
const double PI = acos(-1.0);
struct Complex
{
double r,i;
Complex(double _r=0,double _i=0):r(_r),i(_i){}
Complex op... | ALGO | 0.999922 | 3.626382 |
45f2a62c-ee28-492f-977e-ff1a1e2198ce | zzz136454872/leetcode | merge.cpp | /**
* @author f4prime
* @email <EMAIL>
* @aim a plain model for leetcode
*/
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<stack>
#include<queue>
using namespace std;
//#define testMod
#ifdef testMod
void test()
{
}
#endif
#ifndef testMod
class Solution {
... | ALGO | 0.99993 | 3.913253 |
754cdda6-087d-49a3-b4e7-7df7e3525fe7 | shwangdev/kadpeer | src/kademlia/kadroutingtable.cpp | /**
* @file kadroutingtable.cpp
* @author Devil Wang <<EMAIL>>
* @date Mon Dec 6 14:29:23 2010
*
* @brief
* @brief Kademlia Algorithm RoutingTable Construction
*
*
*/
#include "kadroutingtable.h"
#include "kadid.h"
#include "kbucket.h"
#include "contact.h"
#include <utility>
#include <string>
#include <... | ALGO | 0.998256 | 5.378863 |
680ce11b-1a86-4217-9d44-efd9dc614b1e | zeroslope/BZOJ-code | BZOJ/3170 [Tjoi 2013]松鼠聚会.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
const int MAXN = 100010;
template<class T>inline void Read(T& x){
x=0; bool flag=0; char ch=getchar();
while(ch> '9' || ch< '0'){ if(ch=='-'){ flag=1; ch=getchar(); break; } ch=getchar();}
while(ch>='0' && ch<='9'){ ... | ALGO | 0.999931 | 3.463692 |
8b09455f-2328-43b4-9560-1407bc73476f | Itsrohit819/Competitive-Programming | Rank_List.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
int a[n],b[n];
for(int i=0;i<n;i++){
cin >> a[i] >> b[i];
}
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(a[i]<a[j]){
int temp=a[j];
a[j]=a[i];
a[i]=temp;
int temp1=b[j];
b[j]=b[i];
b[i]=temp1;
}
... | ALGO | 0.999989 | 3.341542 |
5018be2e-7970-4f06-aaa4-70c7a6af8701 | zyhang8/data_structure_408 | basis/single_link_list.cpp | //
// Created by Yu Zhong. on 2020-04-15.
// 单链表
//
#include <stdio.h>
#include <stdlib.h>
using namespace std;
typedef int ElemType;
typedef struct LNode {
ElemType data;
struct LNode *next;
} LNode, *LinkList;
//初始化(带头结点)
bool InitList(LinkList &L) {
L = (LNode *) malloc(sizeof(LNode));
if (L == NU... | ALGO | 0.999923 | 4.106073 |
f5e4d0f0-8c39-4df6-b4a3-e86490c8b25c | qbolec/c | bignumy.cpp | #include<iostream>
#include<iomanip>
#include<cstdlib>
#include<string>
#include<vector>
using namespace std;
template<class T>
bool operator ==(const T & a,const T & b){
return !memcmp(&a,&b,sizeof(T));
}
template<int F>
struct bignum{
typedef bignum<F-1> S;
typedef bignum<F> B;
typedef bignum<F+1> L;
stati... | ALGO | 0.998944 | 3.429239 |
b3a3d7af-96ac-4b3a-a4ee-6aba4d7ce9ba | ahmedfathy0-0/my-solved-problems | c++/Leetcode/Striver's SDE sheet/removeNthFromEnd.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* removeNthFr... | ALGO | 0.999977 | 5.967328 |
509dd859-5d99-4d57-8a00-d583312b6edb | AnkurSheel/RoutePlanner | Engine/Source/AI/src/BTBaseSelectorNode.cpp | #include "stdafx.h"
#include "BTBaseSelectorNode.h"
using namespace AI;
using namespace Base;
// *******************************************************************************************************************
cBTBaseSelectorNode::cBTBaseSelectorNode()
: m_CurrentChildIndex(-1)
{
}
// ************************... | ALGO | 0.921235 | 5.269326 |
04c2b129-9814-4e83-b144-5a4f42295210 | MistrySourav/COMPILER-DESIGN- | Assignment/Assignment.cpp | #include <iostream>
#include <fstream>
using namespace std;
bool isValid(string input) {
int S = 32; // SPACE
int SL = 47; // Slash
int C = 58; // colon
int SN = 64; // at sign
int xS = 91;
int yS = 94;
int h = 96;
int sf = 123;
int ss = 126;
int input1 = input.length();
... | ALGO | 0.988449 | 4.263674 |
9d1c9e21-da60-4ef6-9a08-871da791b1ef | codeaholic-shub/ALGO-ADDICT | LEETCODE/C++/count-and-say.cpp | // Time: O(n * 2^n)
// Space: O(2^n)
class Solution {
public:
string countAndSay(int n) {
string seq{"1"};
for (int i = 0; i < n - 1; ++i) {
seq = getNext(seq);
}
return seq;
}
private:
string getNext(const string& seq) {
string next_seq;
for(au... | ALGO | 0.999989 | 7.453256 |
74a5d9a4-57d3-419e-bd2c-f4da4a47b386 | Gaurav232003/Codeforces-Solutions | 894A.cpp | #include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
int q = 0, qa = 0 ,qaq =0;
for(int i = 0;i < s.size();i++){
if(s[i] == 'Q'){
q++;
qaq += qa;
}else if(s[i] == 'A'){
qa += q;
}
}
cout << qaq <<endl;
}
| ALGO | 0.995831 | 3.402345 |
f5b4cba4-6018-4f5f-a482-61263af95431 | akhilofindia/Codeforces-solution | 1821B.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int tc; cin>>tc;
while(tc--){
int n; cin>>n;
int arr[n],arr2[n];
int j,k;
for (int i = 0; i < n; i++)
{
cin>>arr[i];
}
for (int i = 0; i < n; i++)
{
cin>>arr2[i];
}
for (int i = 0; i < n; i++)
{
if (arr[i]!=arr2[i]){
j=i;
... | ALGO | 0.999851 | 3.757689 |
3fe91d83-910c-4143-bbd5-d0f106438251 | archit-dev/LeetCode-Solutions | Detect cycle in a directed graph - GFG/detect-cycle-in-a-directed-graph.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool dfsCycle(int node, vector<bool> & visitedSoFar,
vector<bool> & visitedOnThisPath,
vector<int> graph[]){
visitedSoFar[node] = true;
visitedOn... | ALGO | 0.999888 | 6.415464 |
70770d08-e706-4479-9cdd-cc5e10016479 | mfooo/ScriptDev2 | scripts/outland/nagrand.cpp | /* ScriptData
SDName: Nagrand
SD%Complete: 90
SDComment: Quest support: 9849, 9868, 9874, 9918, 9991, 10044, 10085, 10107, 10108, 10172, 10646. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
SDCategory: Nagrand
EndScriptData */
/* ContentData
mob_shattered_rumbler
mob_lump
mob_sunspring_vil... | TOOL | 0.962 | 5.346225 |
9b864f95-0970-4ea2-86c5-94b5737b47a5 | SachchitBalamurugan/SoulSyncDepression-OCDapp | 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.998784 | 6.761023 |
7a388b4e-2d5c-4a8a-b49e-551df48e4f44 | mukulgpt17/CP | CodeForces/769B.cpp | #include "bits/stdc++.h"
using namespace std;
#define max(a, b) (a < b? b : a)
#define min(a, b) ((a>b)?b:a)
#define mod 1e9+7
#define FOR(a,c) for ( int (a)=0; (a)<(c); (a)++)
#define FORL(a,b,c) for ( int (a)=(b); (a)<=(c); (a)++)
#define FORR(a,b,c) for ( int (a)=(b); (a)>=(c); (a)--)
#define INF 10000000000000... | ALGO | 0.999899 | 3.466771 |
1cc2f437-af32-4332-8434-c2c3f3056f41 | vgfree/supex | lib/graphlabapi/experimental/dist_pagerank/dist_pagerank.cpp | #include <string>
#include <distributed_graphlab.hpp>
#include "data_structures.hpp"
#include <graphlab/macros_def.hpp>
// Constants for the algorithm. Better way would be to
// pass them in the shared_data to the update function, but for
// the simplicity of this example, we simply define them here.
double termin... | ALGO | 0.999855 | 5.720709 |
18af8145-1586-47e4-bd9b-810555eb72fa | L1nkus/cpptemplates | segment_tree_it_findif.cpp | #include <bits/stdc++.h> //Stack size ~2'000'000(x4) use "int *arr = new int[n]" above that
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define all(a) (a.begin()),(a.end())
#define FOR(x,val,to) for(int x=(val);x<int((to));++x)
#define FORE(x,val,to) for(auto x=(val);x<... | ALGO | 0.999535 | 4.423893 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.