uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
39071d21-5ff9-4100-a917-4b2b0de5ac72 | shanemcdermott/Genesis | Source/Genesis/Private/PointGenerators/PoissonPointGenerator.cpp | #include "PoissonPointGenerator.h"
// Random Point Selector
TArray<FVector2D> UPoissonPointGenerator::GeneratePoints_Implementation(int32 numberOfPoints)
{
Initialize(numberOfPoints);
float randomX = RandomGenerator.FRandRange(Border, MaxPoint());
float randomY = RandomGenerator.FRandRange(Border, MaxPoint());
... | ALGO | 0.964182 | 4.197101 |
e18276e4-43a9-454e-8ac3-64bf680a3115 | ragibshahrier/cp | Contests/Meta Hacker Cup Round1/B_Prime_Subtractorization.cpp | #include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// using namespace __gnu_pbds;
typedef long long ll;
#define vi vector<int>
#define v... | ALGO | 0.999761 | 4.430251 |
f8c61505-dfed-4865-8f7f-bb72694a42cc | DanceManiac/Advanced-X-Ray-Public | SDK/sources/MagicSoftware/FreeMagic/Source/Intersection2D/MgcIntr2DTriTri.cpp | #include "MgcIntervalIntersection.h"
#include "MgcIntr2DTriTri.h"
using namespace Mgc;
//----------------------------------------------------------------------------
// stationary triangles
//----------------------------------------------------------------------------
static int WhichSide (const Vector2 akV[3], const ... | ALGO | 0.998681 | 6.951456 |
d9b70261-0f0f-4ffb-a796-80d1d18ad588 | Mondiegus/Cpp_Learning | My_Tasks/6/T6_7.cpp | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
void processSentence();
int main()
{
processSentence();
return 1;
}
void processSentence()
{
string sentence, word;
int consonants = 0, vowels = 0, others = 0;
cout << "Put words. Single q ends." << endl;
while(... | ALGO | 0.994864 | 4.206009 |
4afa8690-05d3-4536-808c-d47e0695e6f2 | devclub-iitd/SDE-Prep | problem-of-the-day/day05/Merge K Sorted List.cpp |
class Solution {
public:
ListNode* mergetwo(ListNode* h1, ListNode* h2)
{
ListNode* dummy = new ListNode(-1);
ListNode* ptr = dummy;
while(h1 && h2)
{
if(h1->val < h2->val)
{
ptr->next = h1;
h1 = h1->next;
}
... | ALGO | 0.999923 | 5.798464 |
6a3dbc05-d893-49bc-b162-2fb9baee49b3 | yitianhao/gpu_sched_new | gpu-sched-centralcontrol/minor/boost_1_61_0/libs/compute/example/price_cross.cpp | #include <iostream>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/copy.hpp>
#include <boost/compute/algorithm/copy_n.hpp>
#include <boost/compute/algorithm/find_if.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/iterator/zip_iterator.hpp>
namespace compute = boost::c... | ALGO | 0.999088 | 5.593448 |
ea57008d-8037-46b8-8045-89e26d45458b | ishandutta2007/codeforces | aidos/normal/31/C.cpp | #pragma optimize("", on)
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
const int maxn = (int)1e6 + 10;
const int mod = (int) 998244353;
const int inf = (1<<30) - 1;
int n, m;
int a[maxn], b[maxn];
vector<int> c;
int cnt[maxn];
void solve() {
... | ALGO | 0.999994 | 3.695718 |
0b889c43-6ecc-44e8-8ca0-987e1678b795 | rdalejandro22/Algebra-Abstracta | RSA.cpp | #include "RSA.h"
#include "PRNG.h"
#include <iostream>
#include <NTL/ZZ.h>
#include "Funciones Matematicas.h"
using namespace NTL;
using namespace std;
void RSA::generar_claves()
{
ZZ p = ga(500,1024,7,3);
ZZ q = ga(500,1024,9,4);
while(ProbPrime(p,10)!=1)
{
p = ga(500,1024,7,3);
}
while... | ALGO | 0.998927 | 4.502773 |
68c36d01-80b1-47a8-b25f-bde0c3001eca | enkilee/leetcode | .history/no300_20200314094312.cpp | /*
* @Author: your name
* @Date: 2020-03-14 09:32:24
* @LastEditTime: 2020-03-14 09:43:12
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \leecode\no300.cpp
*/
#include <iostream>
#include <cmath>
#include <vector>
#include <stack>
#include <map>
using namespace std;
in... | ALGO | 0.999919 | 4.606807 |
791e472e-aa15-4664-af98-4c77a6fe805d | Ashar134/Object-Oriented-Programming | TimeTypeClass_OperatorOverloadingImplementation.cpp | #include <iostream>
using namespace std;
class timeType
{
private:
int hour;
int min;
int sec;
public:
timeType() : hour(0), min(0), sec(0) {} // Default constructor
timeType(int hour, int min, int sec) // Parameterize constructor
{
this->hour = hour;
this->min = min;
... | TOOL | 0.970627 | 4.986396 |
1c05a11b-c3ad-4637-a2f7-136cc73f5c1a | nitintayal008/new-leetcode-question | 0134-gas-station/0134-gas-station.cpp | class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int previous_gas=0,curr_gas=0,start=0;
for(int i=0; i<gas.size(); i++){
curr_gas=curr_gas+(gas[i]-cost[i]);
if(curr_gas<0)
{
start=i+1;
... | ALGO | 0.999998 | 5.995903 |
763901c2-225e-48a4-8e69-bca850fe228f | osama-afifi/Online-Judges-Solutions | UVA Problems/UVA/UVA/String to Palindrome.cpp | //#include <iostream>
//#include <cstring>
//#include <string>
//
//
//using namespace std;
//
//int min(int a , int b , int c)
//{
// if(c<b && c<a)return c;
// if(b<a && b<c)return b;
// return a;
//}
//
//string text;
//int const oo = 1<<25;
//int dp[1000][1000];
//
//
//int solve(int i , int j)
//{
// if(dp[i][j]!... | ALGO | 0.999784 | 4.165883 |
fcc8c400-53c4-4ad1-a4b0-4ae7a25b6433 | pi34/The-Y-Project | Insertion Sort/insertionSort.cpp | /*
The following implementation of the Insertion Sort Algorithm is used to sort an array in ascending order and has a time compelxity of O(n^2).
*/
#include <iostream>
using namespace std;
// Define the function
int insertionSort (int n, int[] A)
{
// Start iterating from the second element onwards
f... | ALGO | 0.999999 | 5.754593 |
7b20134c-9667-4caa-a880-7aee42629a4e | Joao-vpf/Algoritmos | segtree/Classe Persistent Segment Tree(nlongn).cpp |
struct Node
{
int sum;
Node* left;
Node* right;
Node(int val) : sum(val), left(nullptr), right(nullptr) {}
};
class PersistentSegmentTree
{
private:
vector<Node*> versions;
Node* build(int left, int right, const vector<int>& arr)
{
if (left == right)
{
ret... | ALGO | 0.999967 | 5.831855 |
8fd05e16-212f-471d-9473-cb7613902d0c | atharva-yadav/leetcode-problem-solving | 203-remove-linked-list-elements/203-remove-linked-list-elements.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* removeEleme... | ALGO | 0.99989 | 5.582551 |
7cd06fe9-2f9a-4fd5-b465-591945a62857 | Jef808/geometry | src/examples/Laplacian.cpp | /// -*- c++ -*-
///
// We first compute the Laplacian assuming an ideal setting:
// There is no boundary and the surface is orientable.
//
// Q: In this setting, if moreover the change in lenght of edges
// is very slow, is there a big difference between using the cotangent
// weights and simply using
//
// $\Delta... | ALGO | 0.999592 | 6.194944 |
37dd9d74-24bf-4050-90cb-adf7377790da | faizaafif/Leetcode | 101.cpp | //https://leetcode.com/problems/symmetric-tree/description/
class Solution {
public:
bool isSymmetric(TreeNode* root) {
if(root == nullptr) return true;
return symmetric(root->left, root->right);
}
bool symmetric(TreeNode* x, TreeNode* y){
if(x == nullptr and y == nullptr)return tr... | ALGO | 0.999922 | 6.715142 |
b3588626-72e4-467a-b7e4-51d961084a96 | anm336/LeetCode-Questions | Longest Common Subsequence - GFG/longest-common-subsequence.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
const int mod=1e9+7;
using namespace std;
// } Driver Code Ends
// function to find longest common subsequence
class Solution
{
public:
//Function to find the length of longest common subsequence in two strings.
int lcs(int n, int m, string s1, string s2)
... | ALGO | 0.999972 | 6.450078 |
92fbac54-a631-4eba-a310-23cc6f17e55e | ecfish/RainRemoval | lib/spalgorithm.cpp | /*
* This file contains SuperPixel Algorithms used in Rain Removal
* Created by HanZhang, 2019.10.10
*/
#include <vector>
#include <iostream>
#include <opencv4/opencv2/opencv.hpp>
#include <opencv4/opencv2/ximgproc.hpp>
#include <spalgorithm.h>
#include <spprocess.h>
std::vector<SuperPixel> SuperPixelSLIC(const cv... | ALGO | 0.929866 | 3.34395 |
d18f91d4-fee4-4a69-a926-be71697529b1 | alpet83/Xray-NLC7 | Xray/xr_3da/xrRender/occRasterizer_core.cpp | #include "stdafx.h"
#include "occRasterizer.h"
static occTri* currentTri = 0;
static u32 dwPixels = 0;
static float currentA[3],currentB[3],currentC[3];
const int BOTTOM = 0, TOP = 1;
void i_order (float* A, float* B, float* C)
{
float *min, *max, *mid;
if (A[1] <= B[1])
{
if (B[1] <= C[1])
{
min... | ALGO | 0.95598 | 4.072662 |
8949a40d-87ff-45a3-a51f-2fa8e09766db | i-like-algorithm/programmers | season1/괄호변환/괄호변환_hoylee.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void routine(string &answer, string u, string v, int cnt, string p)
{
int i;
if (p == "")
return ;
for(i = 0; i < p.size(); i++)
{
u += p[i];
if((p[i] == '(' && ++cnt) || (p[i] == '... | ALGO | 0.999845 | 4.794718 |
69d2754f-8712-4822-aed9-5e887022ace4 | xSminJx/baekjoon | Silver/S3 15452 : N과 M (4).cpp | #include <iostream>
#include <string>
using namespace std;
void fun(int n, int m, int k, string str) {
if (m == 0) cout << str << '\n';
else for (int i = k; i <= n; i++) {
fun(n, m - 1, i, str + to_string(i) + " ");
}
}
int main() {
int n, m;
cin >> n >> m;
fun(n, m, 1, "");
return 0;
}
| ALGO | 0.99954 | 4.676831 |
80f1e3ac-6c22-4fa2-9ab6-44a022e358f5 | NuggetNuclear/Archivo-Codigos | Codigos Semestre 1/Evaluacion ecuacion.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int x, v, ca = 0, cb = 0, cc = 0, cd = 0;
/*
Construya una aplicación que evalúe la función -x^2 + 100x entre el intervalo entero [0, 100], e indique cuántos valores son:
a. Menores a 100
b. >100 y < 200
c. >= 200 y < 300
d. > 400
*/
for (x =... | ALGO | 0.995222 | 3.326005 |
70d52e24-2e36-4474-a03c-56a4f2119e6c | swastikpratik-bit/Codeforces_practice | May2k24/May18_2k24/C_1_Dual_Easy_Version.cpp | // Problem Link -> https://codeforces.com/contest/1855/problem/C1
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ppb pop_back
#define ff first
#define ss second
#define PI 3.141592653589793238462
#define set_bits __builtin_popcountll
#define leadingzero __builtin_clzll
#define trailingzer... | ALGO | 0.999804 | 4.437012 |
c3fc7b42-b214-4a8e-8a44-edf1174521b1 | codetatvaacademy/GU-Technical-Training-2026 | isha/SlidingWindow/leetcode239.cpp | class Solution {
public:
int equalSubstring(string s, string t, int maxCost) {
int start=0;
int end=0;
int maxL=0;
while(end<s.size()){
maxCost-=abs(s[end]-t[end]);
while(maxCost<0){
maxC... | ALGO | 0.999939 | 5.941327 |
777fe0eb-a039-4012-addc-496dfe71ae76 | champmaniac/LeetCode | 278-first-bad-version/278-first-bad-version.cpp | // The API isBadVersion is defined for you.
// bool isBadVersion(int version);
class Solution {
public:
int firstBadVersion(int n) {
int l=1,r=n;
while(l<r){
int mid = l+(r-l)/2;
if(!isBadVersion(mid))
l=mid+1;
else
r=mid;
... | ALGO | 0.999879 | 6.448707 |
5e29df68-e978-40a2-a5b9-5301c107b4af | adarshpatil/gem5gpu-hashcache | gpgpu-sim/intersim/arbiter.cpp | #include "booksim.hpp"
#include <assert.h>
#include "arbiter.hpp"
Arbiter_gpgpu::Arbiter_gpgpu( const Configuration &,
Module *parent, const string& name,
int inputs )
: Module( parent, name ), _inputs( inputs )
{
}
Arbiter_gpgpu::~Arbiter_gpgpu( )
{
}
void Arbiter_gpgpu::Clear( ... | ALGO | 0.981521 | 5.324371 |
bade9e0e-9e3f-42de-b2fa-dea7d3734f63 | ornellaolivastri/AED | Poligonos_vertices_enlazados/Poligonos_vertices_enlazados.cpp | #include <iostream>
#include <string>
#include <math.h>
#include "Poligonos_vertices_enlazados.h"
#include <fstream>
#include <sstream>
// Color --------------------------------------------------------------------------------------
Color mixture(Color color1, Color color2) {
Color color_nuevo;
color_nuevo.red... | TOOL | 0.901617 | 3.917432 |
4818c251-4297-475c-a043-236b553a9f55 | ishandutta2007/codeforces | _h_/normal/700/B.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
#include <random>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <complex>
#include <functional>
using namespace std;
#define ... | ALGO | 0.999924 | 3.903204 |
39110a67-9df7-4ed8-a06d-34f6cc6e70ca | MishkatIT/codeforces-atcoder-submissions | codeforces/1494/1494A ABC String.cpp | /*
author : MishkatIT
created : Monday 2023-04-03-00.27.56
*/
#include<bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define debug(_) cout << #_ << " is " << _ << '\n';
using namespace std;
void LesGo (void)
{
string str;
cin >> str;
string temp;
map<char, ... | ALGO | 0.999968 | 4.995263 |
4fc1944e-7c7b-4b12-b266-59af95b62efe | Dup4/competitive-programming | nowcoder/903/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 100010
int n, a[N], b[N], c[N];
struct BIT {
int a[N];
void init() {
memset(a, 0, sizeof a);
}
void update(int x, int val) {
for (; x < N; x += x & -x) {
a[x] += val;
}
}
int query(int x) {
int ... | ALGO | 0.999924 | 3.352873 |
768c3191-e53c-4086-a45f-b413938e9f04 | ishandutta2007/codeforces | oipotato/normal/651/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define data dataa
#define rep(i,n) for(int i=1;i<=n;i++)
typedef long long LL;
int main()
{
int a,b;scanf("%d%d",&a,&b);
int ans=0;
for(;a>0&&b>0;)
{
if(a<b)swap(a,b);
a-=2;b+=1;
if(a<0)break;... | ALGO | 0.999925 | 3.237326 |
629e9ca7-b2cb-4e04-873a-b81847014222 | ishandutta2007/codeforces | egor.lifar/normal/1091/A.cpp | /*
*/
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bi... | ALGO | 0.997756 | 3.657258 |
18b6cb3b-a9bd-46fe-9474-7d60e0006589 | arangodb/arangodb | 3rdParty/boost/1.78.0/libs/math/example/neg_binom_confidence_limits.cpp | // neg_binomial_confidence_limits.cpp
// Caution: this file contains quickbook markup as well as code
// and comments, don't change any of the special comment markups!
//[neg_binomial_confidence_limits
/*`
First we need some includes to access the negative binomial distribution
(and some basic std output of course)... | ALGO | 0.999204 | 7.201398 |
dfe16d66-6bab-4283-a10a-16b957d928f1 | LLNL/SAFIRE | llvm-3.9.0/lib/CodeGen/MachineDominators.cpp | #include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
// Always verify dominfo if expensive checking is enabled.
#ifdef EXPENSIVE_CHECKS
static bool VerifyMachineDomInfo = true;
#else
static bool Ve... | ALGO | 0.995415 | 7.721196 |
f31e4220-4ae1-4870-b5aa-112af9804086 | moohamed154/basketball_points_counter | 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 |
dc0d1c6f-d0cc-43d1-a09b-f0e904953968 | batuyanga/RoCore | src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp | /* ScriptData
SDName: Boss_High_King_Maulgar
SD%Complete: 90
SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing
SDCategory: Gruul's Lair
EndScriptData */
#include "ScriptPCH.h"
#include "gruuls_lair.h"
#define SAY_AGGRO -1565000
#define SAY_ENRAGE -1565001
#defin... | ALGO | 0.955877 | 4.217587 |
ddc09009-9eb6-4611-95d2-ca8f728da063 | drayside/kodkod | lib/cryptominisat-2.9.5/cmsat/ClauseAllocator.cpp | #include "cmsat/ClauseAllocator.h"
#include <string.h>
#include <limits>
#include "assert.h"
#include "cmsat/SolverTypes.h"
#include "cmsat/Clause.h"
#include "cmsat/Solver.h"
#include "cmsat/time_mem.h"
#include "cmsat/Subsumer.h"
#include "cmsat/XorSubsumer.h"
#include "cmsat/Gaussian.h"
#ifndef _MSC_VER
#include <... | ALGO | 0.945637 | 6.070965 |
b1a3296d-6808-4da7-bad1-4758a7e7014f | SparshJain2000/Leetcode-solutions | String/decoded-string-at-index.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<string, int> pi;
typedef vector<pi> vii;
class Solution
{
public:
string repeat(string s, int n)
{
string ans = "";
while (n--)
ans += s;
return ans;
}
string decodeAtIndex(string S, int K)
{
long ... | ALGO | 0.999422 | 4.4897 |
0e36c3ce-eeda-4ede-bd52-161af5d11bea | rajat917/DSA | DSA/linearSearch.cpp | // Linear Search
#include <iostream>
using namespace std;
bool linearSearch(int a[], int n, int key)
{
for(int i=0; i<n; i++)
{
if(key == a[i])
return 1;
}
return 0;
}
int main()
{
int a[5] = {34,56,78,-23,-45};
int key;
cout<<"Enter the key- ";
cin>>key;
bool go... | ALGO | 0.999786 | 4.55367 |
c970431d-45f4-4803-bcc4-bcd42f2fe7c1 | garrettspringer/ec-to-go | blackify/error-checking/equal.cpp | #include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main()
{
ifstream all("all.txt");
ifstream sorted("sorted-ec.txt");
vector<string> smolList;
string s;
while (sorted >> s)
smolList.push_back(s);
while (all >> s) {
bool found = false;
for (auto i : smolLi... | ALGO | 0.950361 | 3.262826 |
8c773829-1d45-4639-9f41-5ad573bb102a | intlabSeJun/c-plus-coding-test | 11. 정렬/단어정렬 (1181).cpp | #include<iostream>
#include<queue>
using namespace std;
int N;
// 켱 ť 带 ü
struct verb {
string s;
int len;
// ε
bool operator<(const verb& a) const {
if (a.len != len) return a.len < len; // Ʈ
return a.s < s; // Ʈ
}
};
priority_queue<verb> PQ;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
... | ALGO | 0.99981 | 4.016091 |
f27a61f1-c61c-4a6d-9b1f-a57817dfafe0 | Valeria-Bravo/lp2 | EXAMEN PARCIAL/TEMPLATE/ejericicos hari/ejercicio 4 - pag 642 TEMPLATE.cpp | #include <iostream>
using namespace std;
/*Escriba un programa para definir la plantilla y muestre el valor
absoluto de int, flotante y tipo de datos largo de variable.*/
template <typename TIPOD>
void mostrarAbsoluto(TIPOD numero){
if (numero<0){
numero=numero*-1;
}
cout<<"Valor absoluto: "<<numero<<endl;
}
in... | TOOL | 0.978308 | 3.411701 |
709429e7-35a9-4a53-a4c3-cd50d7bb1ca6 | Simu96/study_CodeUp | 기초100제/1094.cpp | #include <stdio.h>
int main(){
int n, k;
scanf("%d", &n);
int a[n] = {};
for(int i = 0; i < n; i++){
scanf("%d", &k);
a[i] = k;
}
for(int i = n-1; i >= 0; i--){
printf("%d ", a[i]);
}
}
| ALGO | 0.999807 | 3.274954 |
801ba132-83f0-4c6c-acde-0432682e242a | ThettOo/greenhouse_forecast | fastapiserver/Lib/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/libs/graph/example/bron_kerbosch_print_cliques.cpp | //[code_bron_kerbosch_print_cliques
#include <iostream>
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/bron_kerbosch_all_cliques.hpp>
#include "helper.hpp"
using namespace std;
using namespace boost;
// The clique_printer is a visitor that will print the vertices that comprise
// a clique. Note t... | ALGO | 0.999699 | 6.690554 |
33906c69-9339-49a4-a828-96715f2ba814 | Wajdi-Tech/Cross-Platform-Mobile-App-Development-Tutorial- | notes_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.998534 | 6.76775 |
384776cc-32bc-4e71-acdc-7700f303187b | UM1985/100-days-challenge | Day-51 Counting number of days in a given month of a year/code.cpp | #include <bits/stdc++.h>
using namespace std;
int checkDays(int month, int year){
switch (month) {
// Cases for 31 Days
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
cout<<"Number of days is 31 Days.";
break;
... | ALGO | 0.998873 | 5.279238 |
2e28fdc3-c3d3-41c1-8ea1-55f6c63ccbf6 | prprprpony/oj | cf/716E.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 87;
typedef long long ll;
typedef pair<int,int> pii;
#define F first
#define S second
int M,ti;
vector<pii> g[N];
int sz[N];
pii ct;
map<int,int> mp, cm[N];
void exgcd(ll a,ll&x,ll b,ll&y,ll&g)
{
if (b) {
exgcd(b,y,a%b,x,g);
y -= a/b*x;
} else {
x... | ALGO | 0.999993 | 4.280313 |
b0c85468-04c7-42c2-96b4-e2cf898a9b21 | garasuda/acwing | race/610.cpp | #include<stdio.h>
int main()
{
double b,c;
gets(char a);
scanf("%lf\n%lf",&b,&c);
printf("TOTAL = R$ %lf",b+0.15*c);
return 0;
}
| TOOL | 0.972053 | 3.973223 |
3e2bb787-6114-4b5e-8726-ae0b111594b5 | githubtanush/DSASUPREME2.0 | Linkedlist/linkedlistlecture2/dll.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* prev;
Node* next;
Node(int data){
this->data = data;
this->prev = NULL;
this->next = NULL;
}
};
void printll(Node*& head){
Node* temp = head;
while(temp != NULL){
... | ALGO | 0.999834 | 4.035632 |
10425f0b-7bc3-4d9e-b24e-50818cef6b46 | slightperturbation/locomotor | src/neat/neat.cpp | #include "neat.h"
#include "genetics.h"
#include "experiments.h"
#include "neatmain.h"
//Network pointer display
//ostream& operator<<(ostream &os,Network *thenet) {
// thenet->show_activation();
//}
double NEAT::trait_param_mut_prob=0; /* Prob. of mutating a single trait param */
double NEAT::trait_mutation_power=0... | ALGO | 0.996919 | 4.61656 |
5d57a98f-2aae-4a63-9b77-adde68d5a97b | ishandutta2007/codeforces | a_g/normal/1726/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5+5;
vector<int> G[N];
int par[N], tin[N], tout[N];
int timer = 0;
class dsu {
public:
vector<int> parents;
vector<int> sizes;
dsu (int n) {
parents.resize(n);
iota(parents.begin(), parents.end(), 0);
sizes.resize(n, 1);
... | ALGO | 0.999992 | 4.710269 |
1e54a5d5-3494-4210-b417-c8a38bea9b07 | AVVKavvk/DSA | gfg/BST/inorderSuccessor.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// Tree Node
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
// Function to Build Tree
Node* buildTree(string str)
{
// Corner Case
if(str.length() ... | ALGO | 0.99988 | 5.650637 |
157b86bf-3058-4f55-bdf1-501d427082a1 | renegeizu/UGR-FP | Codigos/Sesion 6/Ejercicio 32 (Sin String).cpp | /*
*
* Un nmero entero de n dgitos se dice que es narcisista si se puede obtener como
* la suma de las potencias n-simas de cada uno de sus dgitos.
*
*/
#include <iostream>
#include <cmath>
using namespace std;
int main() {
const long long var_control = 10;
long long numero_introducido = 0, aux_calculo ... | ALGO | 0.993001 | 4.456383 |
5ad96192-21a5-4585-b3c3-e1309e65badc | robingarbo/qt | src/3rdparty/clucene/src/CLucene/search/RangeFilter.cpp | #include "CLucene/StdHeader.h"
#include "RangeFilter.h"
CL_NS_DEF(search)
CL_NS_USE(index)
CL_NS_USE(util)
CL_NS_USE(document)
RangeFilter::RangeFilter( const TCHAR* fieldName, const TCHAR* lowerTerm, const TCHAR* upperTerm, bool includeLower, bool includeUpper )
{
this->field = STRDUP_TtoT(fieldName);
if ( lowerTe... | TOOL | 0.855637 | 6.277343 |
41245347-3705-4d10-913e-8d2041f485de | 2SSK/leetcode | Leetcode/hash_map/diameter_of_binary_tree/main.cpp | #include <bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};
class Tree {
private:
TreeNode *root = nullptr;
int height(TreeNode *node, int &diameter) {
if (!node)
return 0;
int lh = h... | ALGO | 0.998242 | 5.356341 |
005b5627-a920-4b3b-89c3-c6512c77fb4f | Damdoshi/LibLapin | src/collide/sub/equation_triangle.cpp | // Jason Brillante "Damdoshi"
// Hanged Bunny Studio 2014-2018
//
// Bibliothèque Lapin
#include "lapin_private.h"
bool bunny_collision_equation_triangle(const t_bunny_collision *a,
const t_bunny_collision *b)
{
const t_bunny_triangle_collision *triangle = &b->triangle;
t_bunny_dot_collision dot;
dot.... | ALGO | 0.999268 | 4.079302 |
bac806af-05d4-46d1-b626-c74d104b653e | Dunkkkk/algorithm | Simulation/17822-원판돌리기.cpp | #include <iostream>
#include <vector>
#include <utility>
using namespace std;
int arr[55][55];
int n,m,t;
int sum,c;
void spin(int x, int d, int k){
if(d == 1){
//left
int origin = arr[x][0];
int idx = 0;
for(int i=0;i<m;i++){
if(i == m-1) {
arr[x][idx] ... | ALGO | 0.999797 | 3.605201 |
ac9c2c03-9a6c-4e16-b686-5c15f652cdfb | Mitanshu-Singhal/Placement-Preparation-Module | W4_Day_20/Program_1.cpp | class Solution {
private:
int BASE = 1000000;
public:
int repeatedStringMatch(string A, string B) {
if(A == B) return 1;
int count = 1;
string source = A;
while(source.size() < B.size()){
count++;
source+=A;
}
if(source == B) return count;
... | ALGO | 0.999976 | 5.730441 |
1e707397-1c17-40ad-a2fa-a9563d35aaf6 | intfloat/AlgoSolutions | leetcode/RansomNote.cpp | class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
map<char, int> cnt;
for (int i = 0; i < magazine.size(); ++i) {
++cnt[magazine[i]];
}
for (int i = 0; i < ransomNote.size(); ++i) {
if (cnt[ransomNote[i]] <= 0) {
... | ALGO | 0.999718 | 6.46332 |
4efc674b-6d5b-4e00-be76-6d871dc7917d | stenniswood/bk_code | bkview/line_segmenter_misc.cpp | void init_Segments(int mImageWidth)
{
int i;
int start = 0;
int seg_size = ((float)mImageWidth / 64.);
//printf("seg_size=%d\n", seg_size);
num_segs = 64;
for (i=0; i<num_segs; i++)
{
segs[i].col_start = start;
segs[i].col_end = start + seg_size;
start += (seg_size+1);
}
}
void delete_segment(int ... | ALGO | 0.997033 | 4.08288 |
9bdaa3c4-d1cd-4255-9ab0-0873d08af284 | NUS-HcRL/cloth_opt | deps/alembic/lib/Alembic/Util/Murmur3.cpp | #include <Alembic/Util/Murmur3.h>
#include <Alembic/Util/PlainOldDataType.h>
namespace Alembic {
namespace Util {
namespace ALEMBIC_VERSION_NS {
//-*****************************************************************************
void MurmurHash3_x64_128 ( const void * key, const size_t len,
co... | ALGO | 0.965711 | 6.710493 |
ae030ca0-b39e-4d3b-9db7-5d003881e577 | IntelLabs/t2sp | t2s/src/Math.cpp | #include "Math.h"
#include "Error.h"
namespace Matrix {
void get_cofactor(const matrix_t &in,
size_t r, size_t c,
matrix_t &out) {
size_t n = in.size();
size_t pos_x = 0, pos_y = 0;
for (size_t i = 0; i < n; ++i)
for (size_t j = 0; j < n; ++j) {
if ... | ALGO | 0.998708 | 6.219221 |
e30601c6-5f52-4ba1-a8d8-14ed5851ac7e | Supreme3Bye5423/DSA_TH | Sorting/Ex2/main.cpp | #ifndef SORTING_H
#define SORTING_H
#include <sstream>
#include <iostream>
#include <type_traits>
using namespace std;
template <class T>
class Sorting {
private:
static void printArray(T* start, T* end)
{
int size = end - start;
for (int i = 0; i < size - 1; i++)
cout << start[i] <... | ALGO | 0.999723 | 5.684209 |
3dd19ae3-2aef-4277-8094-a22406bb32d0 | software-mansion-labs/executorch | kernels/portable/cpu/op_round.cpp | #include <cmath>
#include <executorch/kernels/portable/cpu/util/functional_util.h>
#include <executorch/runtime/kernel/kernel_includes.h>
#include <executorch/runtime/platform/assert.h>
namespace torch {
namespace executor {
namespace native {
using executorch::aten::Tensor;
namespace {
// Rounds a floating point ... | ALGO | 0.900552 | 7.424055 |
6e4c9103-cda8-4b0c-be25-2fc02ed03df4 | SidSan97/exercicios-em-C-e-CPP | Exercicio 30/main.cpp | #include <iostream>
using namespace std;
int main()
{
int cont = 0, p1, p2, M, N;
cin >> N >> M;
int matriz[N][N];
for(int i=0; i<N; i++)
for(int j=0; j<N; j++)
cin >> matriz[i][j];
for(int i=0; i<M; i++)
{
cin >> p1;
cin >> p2;
for(int j=p1; j>=0; j--... | ALGO | 0.999903 | 3.617844 |
be4d5160-0040-4cc6-b48a-d3fa7c96c951 | Danziger/CarND-T2-Model-Predictive-Control-MPC-Quizzes | 002-Polyfit/src/Eigen-3.3/doc/examples/tut_arithmetic_scalar_mul_div.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d a;
a << 1, 2,
3, 4;
Vector3d v(1,2,3);
std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl;
std::cout << "0.1 * v =\n" << 0.1 * v << std::endl;
std::cout << "Doing v *= 2;" << std::endl;
v *= 2;
std::cout << ... | ALGO | 0.976134 | 3.669638 |
b84c1dd8-5c7b-4162-af67-83283732f0bb | TheBoolean-Boy/DSA | 3219-make-lexicographically-smallest-array-by-swapping-elements/make-lexicographically-smallest-array-by-swapping-elements.cpp | class Solution {
public:
vector<int> lexicographicallySmallestArray(vector<int>& arr, int threshold) {
vector<pair<int, int>> valueIndexPairs;
int size = arr.size();
for (int i = 0; i < size; ++i) {
valueIndexPairs.push_back({arr[i], i});
}
sort(valueIndexPairs.... | ALGO | 0.999997 | 6.447486 |
e8430c68-7574-4912-89b0-2f42e045a195 | anik-ewu/C-O-N-T-E-S-T | 1.Codeforces/OLD/Codeforces Round #716 (Div. 2)/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e9;
const int mod=1e9+7;
#define all(x) (x).begin(), (x).end()
#define read(x) freopen("in.txt","r",stdin);
#define write(x) freopen("out.txt","w",stdout);
#define what_is(x) ce... | ALGO | 0.99997 | 3.699907 |
a14b69de-7131-497c-ae51-955f308326fd | kluophysics/roptlite | Others/MinPNormConHull.cpp |
#include "Others/MinPNormConHull.h"
/*Define the namespace*/
namespace ROPTLITE{
realdp MinPNormConHull(const Manifold *Mani, Variable x, Vector *Ys, integer LYs, Vector &outSoln)
{
return MinPNormConHull(Mani, x, Ys, LYs, nullptr, nullptr, outSoln);
};
/*Compute min_{y in convex hull of gfs, and gfs are tang... | ALGO | 0.999627 | 4.45064 |
b1b85c00-2cba-4374-bb4b-354ae99dad2a | JJungs-lee/problem-solving | BOJ/2522_별찍기 - 12.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n - i - 1; ++j) {
cout << " ";
}
for (int j = n - i - 1; j < n; ++j) {
cout << "*";
}
cout << endl;
}
for (int i = 1; i < n; ++i) {
for (int j = 0; j < i; ++j) {
cout << ... | ALGO | 0.999946 | 3.830366 |
d2324525-6a92-491c-ae82-46e91ebe9e30 | EmonSpeedy/codeforces | 800-900/arranging_cats.cpp | /*
In the name of Allah
author : md sh emon
*/
#include "bits/stdc++.h"
using namespace std;
#define rep(x, y) for(int i=x; i<y; i++)
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(),x.end()
#define sortall(x) sort(al... | ALGO | 0.999915 | 4.638421 |
7faf558a-3476-46ec-8d34-5230cd1880f8 | ishandutta2007/codeforces | shoemakerjo/normal/846/C.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
int n;
cin >> n;
ll nums[n];
for (int i = 0; i < n; i++) {
cin >> nums[i];
}
ll p[n+1];
p[0] = 0LL;
for (int i = 1; i <= n; i++) {
p[i] = p[i-1] + nums[i-1];
}
ll ans = -p[n];
int i1 = 0, i2 = 0, i3 = 0;
ll best[n+1];
int ... | ALGO | 0.999977 | 3.324741 |
f4c903d9-8239-4d3d-bdf8-8b6ae1e72b8f | voldermort/UVa-2 | 686/686.cpp | /* Alex Velazquez
* Start: Sat Dec 3 18:17:46 EST 2011
* End : Sat Dec 3 18:21:05 EST 2011
*/
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <deque>
#include <string>
using namespace std;
bool isPrime( int n ... | ALGO | 0.999339 | 4.245991 |
a810cf21-34ef-4e99-8d54-aa4ed23bc9ea | DeependraParmar/DSA | My Programs/06 Functions in C++/02_evenOrOdd.cpp | #include <iostream>
using namespace std;
void evenOrOdd(int n){
if(n%2 == 0){
cout << n << " is even" << endl;
}
else{
cout << n << " is odd" << endl;
}
}
int main(){
int n;
cout << "Enter the number for even-odd check: ";
cin >> n;
evenOrOdd(n);
return 0;
} | ALGO | 0.997351 | 4.665982 |
31bf0c54-3e31-4185-9371-4d63951af360 | AzertP/VNOI_SPOJ | NKCITY.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1100;
int n, m, res;
int dsu[N];
vector <pair<int, pair<int, int>>> edge;
int find(int i) {
return (dsu[i] == i)? i : dsu[i] = dsu[find(dsu[i])];
}
void merge(int i, int j) {
dsu[find(i)] = find(j);
}
void kruskal() {
int done = 0, cur = 0;
... | ALGO | 0.999957 | 4.572067 |
6a974f2e-404a-4af1-a4de-d9912a502a51 | Sesh93/My-progs | 0078-subsets/0078-subsets.cpp | class Solution {
public:
void solve(int i,int n,vector<vector<int>> &ans,vector<int> &nums,vector<int> op)
{
if(i==n)
{
ans.emplace_back(op);
return;
}
vector<int> op1;
vector<int> op2;
op1=op;
op2=op;
op2.emplace_back(nums[... | ALGO | 0.999962 | 6.074001 |
920155b6-f7b1-4cdc-ba5d-98ea34dcfe14 | parthtyagii/DSA-Codes | DSUCycleDetectionOptimisation.cpp | #include <iostream>
#include <list>
using namespace std;
// DSU with Optimisaiton: reducing complexity to O(1) approximately by applying two optimisations...
// --> Path Compression Optimisation: changes in Find fn {logN avg. complexity by this}
// --> Union by Rank: changes in Union fn
class Graph
{
int V;
l... | ALGO | 0.999806 | 5.725518 |
92e77861-c27b-4d72-a8c8-10ff4a646c23 | mahinuralam/CP_Problem_Solutions | A_Wonderful_Permutation.cpp | #include <bits/stdc++.h>
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(0), cout.tie(0);
#define ll long long
//#define endl '\n'
using namespace std;
int main()
{
FAST;
ll t;
cin >> t;
while (t--)
{
ll n, m;
cin >> n >> m;
vecto... | ALGO | 0.999906 | 4.643441 |
267f209c-9f29-4d38-a98b-fe4aba250ac9 | itsme3030/leetcode | 0152-maximum-product-subarray/0152-maximum-product-subarray.cpp | class Solution {
public:
int maxProduct(vector<int>& nums) {
int n = nums.size();
vector<pair<int,int>> ind;
int pref[n + 1]; pref[0] = 1;
int suff[n + 1]; suff[n] = 1;
for(int i= 1; i <= n; i++) {
if(pref[i-1] == 0) pref[i] = nums[i-1];
... | ALGO | 0.999967 | 5.947698 |
fe361198-123b-41c2-b62c-31cb8fe7555a | albee/rattle-iros-2022 | rattle_rrt/bullet3/examples/ExtendedTutorials/NewtonsRopeCradle.cpp | #include "NewtonsRopeCradle.h"
#include <cmath>
#include <iterator>
#include <vector> // TODO: Should I use another data structure?
#include "btBulletDynamicsCommon.h"
#include "LinearMath/btVector3.h"
#include "LinearMath/btAlignedObjectArray.h"
#include "../CommonInterfaces/CommonRigidBodyBase.h"
#include "Bullet... | ALGO | 0.991399 | 5.548873 |
9540fae0-84b8-4a6d-80b9-94f2028980cf | YeKYLI/leetcode | 待整理/leetcode-0.2.0/solution/0700-0799/0702.Search in a Sorted Array of Unknown Size/Solution.cpp | /**
* // This is the ArrayReader's API interface.
* // You should not implement it, or speculate about its implementation
* class ArrayReader {
* public:
* int get(int index);
* };
*/
class Solution {
public:
int search(const ArrayReader& reader, int target) {
int r = 1;
while (reader.... | ALGO | 0.999405 | 6.323176 |
2fed9648-6a93-44e9-b315-4ec65971aa5d | PanshulKantan/CPP_command_practice | arrayrowcolumn.cpp | #include <iostream>
#include <string>
int main(){
using std::cout;
// first [] represent rows and second one represent column
std::string cars[][3]= {{"bmw", "audi", "swift"},
{"tata nano", "honda", "toyota"},
{"gtr", "chevrolet", "mg"}};
int row... | TOOL | 0.950238 | 4.415819 |
ba60690d-8fb8-4084-9d3e-562559194b75 | flexsloth/LeetCode_solutions | 0541-reverse-string-ii/0541-reverse-string-ii.cpp | class Solution {
public:
string reverseStr(string s, int k) {
if(s.size() <= k){
reverse(begin(s) , end(s));
return s;
}
int n = s.size();
for(int i = 0 ; i < n ; i+=2*k){
if(n-i <= k){
reverse(s.begin()+i , s.end());
}
... | ALGO | 0.9999 | 6.038941 |
cbfa108d-b397-495d-a844-e0594517d0e3 | alexanderommel/Competitive-Programming | Codeforces/The Morning Star/main.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 3 + (1e6);
const int Ke= 2+ (1e6);
ll prepp[N];
const int LM=36;
int main(){
int t;
cin >> t;
while(t--){
int n;
cin >> n ;
map<ll,ll> a,b,c,d;
ll ans=0;
for(int i=0; i<n;i++){
... | ALGO | 0.997989 | 4.03283 |
fb76caef-35d0-45b5-9ade-8632e23f411c | ravi956/pepcoding-level1-in-cpp | Dynamic Programming/11_dynamic_programming_and_greedy/13_count_binary_strings.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
// int dp0[n + 1];
// int dp1[n + 1];
// dp0[1] = 1;
// dp1[1] = 1;
// for (int i = 2; i <= n; i++)
// {
// dp0[i] = dp1[i - 1];
// dp1[i] = dp0[i - 1] + dp1[i - 1];
// }
// cout << dp... | ALGO | 0.999962 | 3.324953 |
76882e9a-33ae-43dd-bdab-7a230dc7fac7 | egekabas/Competitive-Programming-Solutions | codeforces/egekabas/normal/348/C.cpp | #include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typede... | ALGO | 0.999729 | 3.818059 |
e95d1104-e556-43c0-8167-dace7f01d060 | TengFeiyang01/Algorithm | ACODE/atc/abc_332/e.cpp | #include <bits/stdc++.h>
const double inf = 1e27;
using i64 = long long;
void solve() {
int n, d;
std::cin >> n >> d;
std::vector<int> a(n);
double avg = 0;
for (int i = 0; i < n; ++i) {
std::cin >> a[i];
avg += a[i];
}
avg /= d;
std::vector<double> cost(1 << n);
for (int... | ALGO | 0.999775 | 4.463529 |
14bc56e1-c6a9-42be-a172-70e5f95ce1c8 | Sandeep-003/Leetcode | 1325-path-with-maximum-probability/1325-path-with-maximum-probability.cpp | class Solution {
private:
typedef pair<int,double> pid;
typedef pair<double,int> pdi;
public:
double maxProbability(int n, vector<vector<int>>& edges, vector<double>& succProb, int start_node, int end_node) {
vector<pid> adj[n];
int m = edges.size();
for(int i=0;i<m;i++){
adj... | ALGO | 0.99998 | 5.773635 |
569db343-1059-44d6-8ac8-75c22fb8bcb9 | Chentao2000/O_-Educoder- | M_数据结构/ch2/单链表/单链表的选择排序算法.cpp | #include <stdlib.h>
#include <stdio.h>
#include <iostream>
using namespace std;
/* 定义ElemType为int类型 */
typedef int ElemType;
void input(ElemType &s);
void output(ElemType s);
void swap(ElemType &a,ElemType &b);
/* 单链表类型定义 */
typedef struct LNnode
{
ElemType data;
struct LNnode *next;
}LNnode,*LinkList;
void InitLi... | ALGO | 0.999985 | 3.996714 |
c5dbb69a-1481-46f2-aaae-36b8dc076bb9 | yours-yu-zhu/fight_for_work | leetcode/Hash/242_isAnagram.cpp | #include <iostream>
#include <string>
using namespace std;
class Solution {
public:
bool isAnagram(string s, string t) {
int hash[26] = {0};
for(int i = 0; i < s.size(); i++){
++hash[s[i] - 'a'];
}
for(int i = 0; i < t.size(); i++){
--hash[t[i] - 'a'];
... | ALGO | 0.999984 | 5.672058 |
3b960fc4-c23a-4eee-af97-86498b98af32 | ishandutta2007/codeforces | al13n/normal/1368/A.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#define _CRT_SECURE_NO_DEPRECATE
#define _USE_MATH_DEFINES
#include <array>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <ctime>
#inclu... | ALGO | 0.99987 | 3.85664 |
e7ab6b0d-0743-449e-a3d6-b7d04f44475f | SprueKit/TexGraph | Source/SprueEngine/Libs/igl/exterior_edges.cpp | #include <cassert>
#include <unordered_map>
#include <utility>
#include <iostream>
//template <typename T> inline int sgn(T val) {
// return (T(0) < val) - (val < T(0));
//}
//static void mod2(std::pair<const std::pair<const int, const int>, int>& p)
//{
// using namespace std;
// // Be sure that sign of mod m... | ALGO | 0.993234 | 4.972131 |
cffbe5fd-a4a8-4cd1-ac21-5ce01464d34e | Gota7/Juno-Retired | src/gravity/parallel.cpp | #include "parallel.h"
#include <tracy/Tracy.hpp>
RGravityParallel::RGravityParallel(glm::vec3 pos, glm::vec3 direction, float baseDistance) : rangeType(PARALLEL_RANGE_SPHERE), pos(pos), direction(direction), baseDistance(baseDistance)
{
ZoneScopedN("RGravityParallel::RGravityParallel");
UpdateMtxIdentity();
}... | ALGO | 0.9741 | 7.419968 |
e1f840c3-2f99-4c6d-a8e6-0d38dc62363e | RhomnaV/psme | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
e7f03066-b2dd-41cd-b1ed-9a1b1ee8fe4f | Abhisek-Ray99/Ds-Algo-code | String/Remove-all-adjacent-duplicates-from-the-string-usingStack.cpp | //remove all adjacent duplicates from the string using stack
#include<iostream>
#include<stack>
#include<algorithm>
using namespace std;
string removeDuplicates(string A){
stack<char> s;
for(int i=0; i<A.size(); i++){
if(s.empty() || A[i] != s.top()){
s.push(A[i]);
}else{
... | ALGO | 0.99984 | 5.511249 |
ec55a6eb-8e9d-4db7-8ac7-b4d8dddada02 | anoopshetty03/DSA | Linked List/mergeSort.cpp | /********************************************************************
Following is the representation of the Singly Linked List Node:
class node{
public:
int data;
node * next;
node(int data){
this->data=data;
this->next=NULL;
... | ALGO | 0.999994 | 5.29571 |
b0e530c7-9c27-4a8d-b982-0224618be86a | h3136514/Algorithm | baekjoon/랜덤 마라톤/32371.cpp | // 구현, 부루트포스
#include <iostream>
#include <unordered_map>
using namespace std;
int x, y, lowX = 11, lowY = 11;
char c, keyboard[4][10];
unordered_map<char, pair<int, int>> m;
// 샷건
int main(){
for(int i = 0; i < 4; i++){
for(int j = 0; j < 10; j++){
cin >> c;
keyboard[i][j] = c;
... | ALGO | 0.999235 | 3.504423 |
4a95a635-d615-4d8d-aa3c-4b9c0a83748c | thegamer1907/Code_Analysis | DP/2076.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 100000005
#define FOR(i, a, b) for(int i=int(a); i<int(b); i++)
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define pb push_back
#define endl '\n'
#define PI 3.14159265358979323846
#define all(v) (v).begin(), (v).end()
#define mem(arr,v... | ALGO | 0.999982 | 4.068317 |
55db4954-50f9-4087-8b2f-8dc9c101a8f6 | namangarg2002/gfg | Difficulty: Easy/Minimum Cost of ropes/minimum-cost-of-ropes.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int minCost(vector<int>& arr) {
if(arr.size() < 2){
return 0;
}
priority_queue<int, vector<int>, greater<int>> pq(arr.begin(), arr.end());
int ... | ALGO | 0.999437 | 6.32932 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.