uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
46bdf249-b4ad-419d-bcd2-49221273d2d9 | HPUedCSLearner/hobbies | parallel-BilibiliSite/04/5_loops/12_loop_invariant_failed/main.cpp | void func(float *__restrict a, float *__restrict b, float dt) {
for (int i = 0; i < 1024; i++) {
a[i] = a[i] + b[i] * dt * dt;
}
}
| ALGO | 0.996585 | 3.866194 |
0c4ec363-d258-4984-bad6-233e7f8ea80b | DaddyRaegen/FFBE-JP-Patcher | 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 |
2433518b-ae85-401e-b738-9dc04cbd9987 | hanyucrocks/DSA | 263-ugly-number/ugly-number.cpp | class Solution {
public:
bool isUgly(int n) {
// primes 2 3 5
if (n <= 0) return 0;
if(n == 1) return true;
while(n > 1){
if(n % 2 == 0) n = n /2;
else if(n % 3 == 0) n = n / 3;
else if(n % 5 == 0) n = n / 5;
else break;
}
... | ALGO | 0.99995 | 6.009274 |
1410bdc1-db77-432d-8bec-adef0b62a383 | GAURAVMALODE95/CLG_PROGRAMS | dsal/pratical_10.cpp | #include<iostream>
#include<string>
#include<queue>
using namespace std;
void print(priority_queue<pair<int, string>>& pq) {
while (!pq.empty()) {
pair<int, string> patient = pq.top();
pq.pop();
cout << "Patient's Name: " << patient.second << ", Priority: ";
switch (patient.first... | ALGO | 0.998353 | 5.446743 |
2d7932f4-e759-4b68-b3f7-81d254d03a2b | tblut/Tank-Wars | ThirdParty/bullet3/src/Bullet3OpenCL/NarrowphaseCollision/b3OptimizedBvh.cpp | #include "b3OptimizedBvh.h"
#include "b3StridingMeshInterface.h"
#include "Bullet3Geometry/b3AabbUtil.h"
b3OptimizedBvh::b3OptimizedBvh()
{
}
b3OptimizedBvh::~b3OptimizedBvh()
{
}
void b3OptimizedBvh::build(b3StridingMeshInterface* triangles, bool useQuantizedAabbCompression, const b3Vector3& bvhAabbMin, const b3Ve... | ALGO | 0.971248 | 6.645302 |
edbef93b-e9ff-4b96-9c88-978d66297caa | AreHumphrey/FEFU_1st-course | 2_semester/OAiP/Cats/01D.cpp | #include <fstream>
#include <vector>
#include <algorithm>
struct run {
int team, problem, time, attempt[20];
};
struct result {
int team, problem, time, condition;
};
int main() {
std::ifstream input("input.txt");
std::ofstream output("output.txt");
int c, n;
input >> c >> n;
std::vector<... | ALGO | 0.999895 | 3.915685 |
88096f78-47f8-4f23-85cc-3a90d82668e8 | myunbin/PS | BOJ/11861.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
#define fileio() freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define fio() ios_base::sync_with_std... | ALGO | 0.999697 | 4.026432 |
62196536-dbce-4545-8999-853eb5842fc6 | Mahendran-Murugan/All-CPP-Files | Competitive Programming/SetMatrixZero.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
void setZeroes(vector<vector<int>> &matrix)
{
int n = matrix.size();
int m = matrix[0].size();
unordered_set<int> zeroRows;
unordered_set<int> zeroCols;
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999134 | 6.079245 |
ac94a75b-219f-4cdc-8884-6d97c1facd45 | wiktal123/AiP-ItA | KNAPSACK.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'unboundedKnapsack' function below.
*
* The function is expected to return an INTEGER.
* The function accepts following parameters:
* 1. INTEGER k
*... | ALGO | 0.99995 | 4.468539 |
2a38ebe2-5f70-4e57-92f9-67206c2a7db6 | 239yash/Data-Structures-And-Algos | Math/Pow(x, n).cpp | class Solution {
public:
double myPow(double x, int N) {
long long n = (long long) N;
if (n == 0) return 1;
if (n < 0) {
x = 1.0 / x;
n = -n;
}
return fastPow(x, n);
}
double fastPow(double x, long long n) {
if (n == 0) return 1;
... | ALGO | 0.999855 | 6.574388 |
b2b783c4-ae90-43d1-91f6-11391f047a52 | gcsmith/attack-framework | src/reference/dpacontest_v2/attack_last_round.cpp | /*
* @file attack_last_round.cpp
* @note Side-Channel Attack on the AES-128 algorithm,
* exploiting the absence of MixColumns in the last round.
* @author Sylvain GUILLEY, <<EMAIL>>
*/
#include "attack_last_round.h"
#include <string.h>
#include <algorithm>
#include <stdexcept>
#include <math.h>
using n... | ALGO | 0.999919 | 4.147293 |
66de974b-8d16-4b26-9cb0-f4be2268e3ad | Speedy29bg/FMI-UP-2022-2023 | Tests - 2022_2023/TEST_1/week_1/task1.cpp | #include <iostream>
int main()
{
int n;
std::cin >> n;
int distance = 0;
for (int i = 1; i <= n; i++)
{
distance += (3 * i - 1);
}
std::cout << distance << " sm\n";
return 0;
} | ALGO | 0.999362 | 3.334287 |
a60bc4f9-daf2-4a4e-80be-b86a93cd0147 | fulliu/lc | lib/pnp/cxx/ceres.cpp |
#include <cmath>
#include <cstdio>
#include <iostream>
#include <ceres/ceres.h>
#include <ceres/rotation.h>
#include <omp.h>
// Templated pinhole camera model for used with Ceres. The camera is
// parameterized using 9 parameters: 3 for rotation, 3 for translation, 1 for
// focal length and 2 for radial distortion.... | ALGO | 0.99792 | 6.977555 |
ef6911ba-dae2-432d-abd5-93fe22f5ddfb | BaluDeshamoni/DSA-Programs | lists stack queue/CQueue_Array.cpp | //To implement Circular Queue using Array.
//If there is single element while removing then front and rear set to initial values
#include<iostream>
using namespace std;
class CQueue
{
int *Q,front,rear,N;
public:
CQueue()
{
cout<<"enter maximum number of elements in CQueue";
cin>>N;
Q=new int[N];
front=0;
... | ALGO | 0.991308 | 3.984729 |
2b336c35-e9e3-4591-ac09-8a734614364b | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-gpt4/Codenet/p01134/450385444/response_6.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
#define EPS 1e-10
#define F first
#define S second
#define COUNTER_CLOCKWISE 1
#define CLOCKWISE -1
#define ONLINE_BACK 2
#define ONLINE_FRONT -2
#define ON_SEGMENT 0
using namespace std;
struct P {
double x, y;
P(double x... | ALGO | 0.999287 | 4.236774 |
0920f9cd-5387-48c1-a7b6-637da96ab6b6 | parsa/blaze | blazemark/src/blitz/Mat3Mat3Mult.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.999682 | 4.5199 |
911b0ded-a8ae-4d63-b6df-5ec0cfea320a | hjk9984/Algorithm_study | src/week5/kim_hyun_jun/징검다리.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
int solution(int distance, vector<int> rocks, int n) {
sort(rocks.begin(), rocks.end());
rocks.push_back(distance);
int l = 1;
int r = distance;
int m = (r-l)/2;
while(r - l > 1){
int re... | ALGO | 0.999936 | 5.138527 |
8d8f1c0d-8785-4cea-9b6d-e64e11b7d697 | squaresLab/BatFix | results/transcoder/java/syntax/PROGRAMMING_PUZZLE_ASSIGN_VALUE_WITHOUT_CONTROL_STATEMENT.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <queue>
#include <fstream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <numeric>
#include <algorithm>
using namespace std;
int f_gold (... | ALGO | 0.994106 | 4.748774 |
a4e9078f-aaed-437b-92df-88e2ba710fb2 | LiskArchive/lisk-node | deps/v8_inspector/third_party/v8_inspector/platform/v8_inspector/V8StringUtil.cpp | #include "platform/v8_inspector/V8StringUtil.h"
#include "platform/v8_inspector/V8InspectorImpl.h"
#include "platform/v8_inspector/V8InspectorSessionImpl.h"
#include "platform/v8_inspector/V8Regex.h"
namespace v8_inspector {
namespace {
String16 findMagicComment(const String16& content, const String16& name, bool m... | TOOL | 0.988828 | 6.830724 |
de835c4b-c4d6-4b7a-b4c4-c1c16116a6c8 | vipulbeniwal01/DSA-cpp- | Array Data Structures/secondLargestElement.cpp | #include<iostream>
using namespace std;
int secondLargestElement(int arr[], int n){
int x=arr[0], y=-1;
for(int i=0; i<n; i++){
if(arr[i]>x){
y=x;
x=arr[i];
}
else if(arr[i]!=x){
if(arr[i]>y)
y=arr[i];
}
}
return y;
}
int ... | ALGO | 0.999207 | 3.766214 |
039d9c64-346c-49b5-9540-38ebbcd8bb8d | AdarshSharadPandey/100DaysOfCodeChallenge | Day 22/PerfectSquares(lcMed).cpp | int numSquares(int n)
{
vector<int> dp(n+1);
if(n <= 3) return n;
int i = 0;
while(i <= n)
{
dp[i] = i;
for(int j=1; j*j <= i; j++)
dp[i] = min(dp[i], 1 + dp[i - j*j]);
i++;
}
return dp[n];
} | ALGO | 0.999933 | 5.095795 |
79ee037b-89da-4df8-a1a9-4d09b2fd1099 | sastava007/Tech-Interview-Preparation | Hackerrank + Geeks for Geeks + DS Courseware/Untitled4.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
main()
{
vector<int> v{1,2,3,4};
vector<int>::iterator it=v.begin(),it1=v.end();
do
{
cout<<v[0]<<" "<<v[1]<<" "<<v[2]<<" "<<v[3]<<endl;
}while(next_permutation(it,it1));
}
| ALGO | 0.999718 | 3.092456 |
e7ce5503-fab8-4192-9ebe-64b90fb6f3f1 | manishya1669/MyLeetcodeJourney | 84-largest-rectangle-in-histogram/84-largest-rectangle-in-histogram.cpp | class Solution {
public:
int largestRectangleArea(vector<int>& height) {
int n = height.size(), ans = 0, p;
vector<int> left(n,0), right(n,n);
for (int i = 1;i < n;++i) {
p = i-1;
while (p >= 0 && height[i] <= height[p])
p = left[p] - 1;
left[i] = p + 1... | ALGO | 0.999958 | 6.576534 |
b3574caf-5716-4e6d-9540-4ccd030cebda | AV2409/DSA_NEW | 3-longest-substring-without-repeating-characters/longest-substring-without-repeating-characters.cpp | class Solution {
public:
int lengthOfLongestSubstring(string s) {
int maxlen = 0;
int n = s.length();
int l = 0;
int r = 0;
int len = 0;
int hash[255] = {0};
while (r < n) {
while (hash[s[r]] == 1) {
hash[s[l]]--;
... | ALGO | 0.999957 | 6.292327 |
eb3ebe99-0443-4e76-b704-e09f978b611a | ThinhAE22/Cpp-study | Learn C++/L29_Array.cpp | //Array varible type form: a[i] i is an integer
#include<iostream>
using namespace std;
int main() {
int a[10];
// this syntax is array varible assign
// This mean this array include 10 different a varible
int sum = 0;
// a varible to store all element in the array
for (int i = 0; i < 10; i++... | ALGO | 0.995747 | 3.260013 |
c768cbf4-dced-428c-801c-0d2255c440c6 | Chirag-Mathur/hello-world | date.cpp | #include <bits/stdc++.h>
using namespace std;
static string a[]={"Jan","February","March","April","May","June","July","August","September","October","November","December"};
// int monthsInArray[]={31,28,31,30,31,30,31,30,31,30,31,30};
class Date1{
private:
int date;
int month;
int year;
public:
Date1(int d,int m,in... | ALGO | 0.998009 | 4.014674 |
788db9d4-c51c-4c06-9661-ba6c88167ff1 | Mateo-Guti1/PRACTICA_03 | Ejericicio_03_01.cpp | // Materia: Programación I, Paralelo 1
// Autor: Mateo Enrique Gutierrez Catari
// Fecha creación: 05/09/2024
// Número de ejercicio: 1
// Problema planteado: Calcula la suma de los primeros n numeros de la secuencia
#include <iostream>
using namespace std;
// Función para calcular el n-ésimo término de la serie
int... | ALGO | 0.999953 | 5.468171 |
81c137e0-5d6f-4031-b723-7c50980cc14d | Ragu162004/Leetcode-Challenges | 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:
// Function to return the minimum cost of connecting the ropes.
int minCost(vector<int>& arr) {
priority_queue<int,vector<int>,greater<int>> q(arr.begin(),arr.end());
int sum = ... | ALGO | 0.998857 | 6.298183 |
da773b53-3745-4f7c-84f5-69736e382ea3 | Bungmint/competitiveprogramming | contest/codeforces/1790/D.cpp | using namespace std;
#pragma region TEMPLATE
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vpi = vector<pii>;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vpl = vector<pll>;
using ld = long double;
template <typename T, size_t SZ>
using ar = array<T, SZ>;
template <typename... | ALGO | 0.999559 | 5.239696 |
c5a1d001-cb68-4a75-b8b0-c46f2cff4ea1 | epmcoin/EPMCoin | src/stakeinput.cpp | #include "zepm/accumulators.h"
#include "chain.h"
#include "zepm/deterministicmint.h"
#include "main.h"
#include "stakeinput.h"
#include "wallet/wallet.h"
CZEpmStake::CZEpmStake(const libzerocoin::CoinSpend& spend)
{
this->nChecksum = spend.getAccumulatorChecksum();
this->denom = spend.getDenomination();
u... | ALGO | 0.892049 | 5.74953 |
d04c8671-a043-4447-944f-518a6ad3b3d6 | Vonewman/algorithm_toolbox | week1/max_pairwise_product/max_pairwise_product_cpp/stress_test/stress_test.cpp | #include <cstdlib>
#include <iostream>
#include <vector>
/*Find the maximum product of two distinct numbers in a sequence of non-negative integers*/
long long MaxPairwiseProduct(const std::vector<int>& numbers);
long long MaxPairwiseProductFast(const std::vector<int>& numbers);
int main()
{
// Stress Test!
... | ALGO | 0.999466 | 4.343483 |
317bb887-9a7a-49e6-9adc-40c3968bf1f1 | ishandutta2007/codeforces | antontrygubo_o/normal/889/C.cpp | #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
/*#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")*/
using namespace __gnu_pbds;
using namespace std;
#d... | ALGO | 0.999968 | 4.011026 |
b7f5c794-abd7-47f6-8070-71c88d28ca8f | shoby63/Placement-Preparation-Module | 0155-min-stack/0155-min-stack.cpp | class MinStack {
stack<pair<int, int>>st;
public:
MinStack() {
}
void push(int val) {
int mini;
if(st.empty())
{
mini = val;
st.push({val, mini});
}
else {
mini = min(val, st.top().second);
... | ALGO | 0.999924 | 6.574619 |
cec425c9-782d-4248-b10f-0d49e213b102 | wjl-666/lvgl_2048 | lvgl/src/libs/thorvg/tvgSwImage.cpp | #include "../../lv_conf_internal.h"
#if LV_USE_THORVG_INTERNAL
#include "tvgMath.h"
#include "tvgSwCommon.h"
/************************************************************************/
/* Internal Class Implementation */
/**********************************************************... | ALGO | 0.940533 | 6.741437 |
ff00dc98-1da4-4a97-8a34-59299dfebb0a | An3step/OS3 | OS3.cpp | #pragma once
#include <iostream>
#include "functions.h"
CRITICAL_SECTION array_sect;
HANDLE* releaseEvent;
HANDLE* stopEvent;
HANDLE* handle_threads;
ArrayStruct arrayStruct;
int thread_count;
bool* isStop;
Thread_Info* threads;
Parameters* paramts;
int main()
{
setlocale(LC_ALL, "RUSSIAN");
Initialize... | ALGO | 0.993506 | 3.204923 |
212acf16-9026-419f-944d-5cc271ca088e | shu8Cream/atcoder-archive | atcoder.jp/panasonic2020/panasonic2020_a/Main.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i,n) for (int i=0; i<(n); i++)
using namespace std;
using namespace atcoder;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
const vi a = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15... | ALGO | 0.999945 | 3.886887 |
56e17278-61bc-4116-b8ec-dadfa79d3e40 | NVIDIA-Omniverse/PhysX | physx/source/physxextensions/src/ExtBroadPhase.cpp | #include "foundation/PxBounds3.h"
#include "foundation/PxErrorCallback.h"
#include "foundation/PxFoundation.h"
#include "extensions/PxBroadPhaseExt.h"
using namespace physx;
PxU32 PxBroadPhaseExt::createRegionsFromWorldBounds(PxBounds3* regions, const PxBounds3& globalBounds, PxU32 nbSubdiv, PxU32 upAxis)
{
PX_CHECK... | ALGO | 0.861117 | 6.760014 |
60e4565c-7614-43f1-a83b-4342db4d7740 | PedroH2003/Programacao-Cplusplus | Contests/ICPC_Subregional2024/EnigmaOfTheJewelryCase.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int>> m;
vector<vector<int>> aux;
bool linha(){
for(int i=0; i<n; i++){
int temp = m[i][0];
for(int j=0; j<n; j++){
if(temp <= m[i][j]){
temp = m[i][j];
}
else{
r... | ALGO | 0.999618 | 3.697444 |
1ff2bc50-8fdc-4e67-98b5-7a5233fd13cb | momentarylapse/edward | src/lib/kaba/dynamic/sorting.cpp | #include "dynamic.h"
#include "../kaba.h"
#include "exception.h"
#include "call.h"
#include "../../any/any.h"
#include "../../base/callable.h"
#include "../../base/sort.h"
#include "../../os/msg.h"
namespace kaba {
extern const Class *TypeIntList;
extern const Class *TypeFloatList;
extern const Class *TypeBoolList;
... | ALGO | 0.997517 | 4.920987 |
15a1c728-1abf-414e-8a2f-35e0c8cb34c1 | JBalakrishnaReddy/practise_leetcode | C++ codes/714_Best_Time_to_Buy_and_Sell_Stock_with_Transaction_Fee.cpp |
#include <iostream>
#include <vector>
#include <queue>
#include <map>
using namespace std;
class Solution {
public:
int maxProfit(vector<int>& prices, int fee) {
/* We buy and sell iff we see profit. The algorithm maintains prices s.t
at any point of time the indexes of minPrice and maxPrice... | ALGO | 0.999911 | 5.379002 |
7393c5a6-8deb-4fdb-937f-8243948d6b07 | rahul-pandare/LFDEM-install | lf_dem/LF_DEM/LeesEdwards.cpp | #include <iostream>
#include "LeesEdwards.h"
namespace BC {
void LeesEdwardsBC::periodize(vec3d &pos) const
{
/* Lees-Edwards boundary condition
*
*/
while (pos.z >= container.lz) {
pos.z -= container.lz;
pos -= shear_disp;
}
while (pos.z < 0) {
pos.z += container.lz;
pos += shear_disp;
}
while (po... | ALGO | 0.98247 | 5.526951 |
8720016f-366d-4044-af68-091df7a7d590 | yuanyf23/quantum_computation | FindPrimaryNumber/源.cpp | #include <stdio.h>
#include <stdlib.h>
//int Find_min_subsequence(int a[], int left, int right);
int Max3(int a, int b, int c);
int find_the_primary_element(int *a, int length);
int main()
{
int a[10] = { -1,2,3,5,6,-5,3,-11,-8,7 };
//Ск
//printf("%d",Find_min_subsequence(a, 0, 9));
//ҪԪ
int b[10] = { 2,3,4,2,2,... | ALGO | 0.999923 | 3.141039 |
bb70ef87-4beb-4806-b268-53a81432de8d | ManishVerma16/Data_Structures_Learning | cpp/recursion/tower_of_hanoi.cpp | //Tower of Hanoi Problem using recursion
#include<iostream>
using namespace std;
void TOH(int n, int A, int B, int C){
if (n>0)
{
TOH(n-1, A, C, B);
cout << "disk moved from " << A << " to " << B<<endl;
cout << "(" << A <<", "<< B << ")" <<endl;
TOH(n-1, B,A,C);
}
}
int ma... | ALGO | 0.999969 | 5.476129 |
3f905f58-793d-460b-ac8e-d6049389ccfc | abdul-code22/CPP_Prepinsta | Stacks/StackQuestions/previousElementNaive.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[] = {19, 27, 36, 54, 45, 36, 7};
for (int i = 0; i < 7; i++)
{
bool flag = false;
for (int j = i - 1; j >= 0; j--)
{
if (arr[j] > arr[i])
{
cout << arr[j] << " ";
f... | ALGO | 0.999882 | 3.243678 |
bfcfdf6f-a911-4e4e-8148-832a1f810891 | Anne081031/ParkCode | VC6cryptopp/dsa.cpp | // dsa.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#ifndef CRYPTOPP_IMPORTS
#include "dsa.h"
#include "nbtheory.h"
NAMESPACE_BEGIN(CryptoPP)
size_t DSAConvertSignatureFormat(byte *buffer, size_t bufferSize, DSASignatureFormat toFormat, const byte *signature, size_t signatureLen, DSASi... | TOOL | 0.918559 | 7.707673 |
8071bcd4-d98f-4c7a-a9f5-bed546dd649a | sahilwep/DSA-Workspace | Leetcode/Easy/14.Longest_Common_Prefix.cpp | /*
// 14. Longest Common Prefix
// Observations:
* Write a function to find largest common prefix string amongst all the the string.
* If there is no common prefix string, return "" empty string.
// Example:
Input: strs = ["flower","flow","flight"]
Output: "fl"
Input: strs = ["dog","racecar"... | ALGO | 0.99985 | 5.231031 |
5e46f1a6-5bfd-4aab-ae3a-c44f60fb2e93 | AvijitChowdhury/C-Cplusplus-DSA | 4_DataStructure/Basic-Data-Structures-main/Module 19/left_view_of_a_binary_tree.cpp | #include <bits/stdc++.h>
/************************************************************
Following is the TreeNode class structure
template <typename T>
class TreeNode {
public:
T data;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T data) {
this->data =... | ALGO | 0.999971 | 5.351027 |
48e37429-c1c1-4613-ab04-a1ff4d3825ba | pavitrakumar78/Android-Optical-Text-Recognition-Tool | libraries/jni/com_googlecode_tesseract_android/src/classify/adaptmatch.cpp | /*-----------------------------------------------------------------------------
Include Files and Type Defines
-----------------------------------------------------------------------------*/
#ifdef HAVE_CONFIG_H
#include "config_auto.h"
#endif
#include <ctype.h>
#include "shapeclassifier.h"
#include "ambigs.... | ALGO | 0.916731 | 6.138213 |
c54726b7-ec97-4ac3-ae06-73fa5cef53d7 | Fireflymywife/Athena | src/pgen/rad_linearwave.cpp | //======================================================================================
// C headers
// C++ headers
#include <algorithm> // min
#include <cmath> // sqrt
#include <fstream>
#include <iostream> // endl
#include <sstream> // stringstream
#include <stdexcept> // runtime_error
#include <string... | ALGO | 0.969673 | 4.736311 |
34ee0212-8855-48bd-9142-ce65a62aafba | b10902025kenchen/CA_final_project | analytical/BinGrid.cpp | #include "BinGrid.h"
double ovlp_area(Star &star, Bin &bin) {
double x1 = max(star.x(), double(bin.l_x));
double y1 = max(star.y(), double(bin.l_y));
double x2 = min(star.x() + star.width(), double(bin.u_x));
double y2 = min(star.y() + star.height(), double(bin.u_y));
return max(0.0, x2 - x1) * max... | ALGO | 0.998937 | 4.650756 |
5437e299-21b4-4ea6-b7a6-de09207a226d | ishandutta2007/codeforces | oopsimbad/normal/1196/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i ... | ALGO | 0.999955 | 4.673051 |
573300d0-b3f5-458b-955b-2f491f689478 | rakib1904107/Algorithm-Data-Structure | MO's Algorithm/Square root decomposition(find sum,max,min,etc in any range query).cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define FIO() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define MX 500005
#define MOD 1000000007
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
ll INF=(1ll<<32);
typedef tree<ll,nul... | ALGO | 0.999929 | 4.414301 |
906f1901-8403-4993-bf51-d2e7b7ba95ac | meherajmithun/problem-solving | codeforces/B_Magic_Forest.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
int cnt = 0;
for(int i=1; i<=n; i++){
for(int j=i; j<n+1; j++){
int tmp = i^j;
if(tmp >= j and i+j > tmp and tmp <= n) cnt++;
}
}
cout<<cnt<<endl;
} | ALGO | 0.999635 | 3.618648 |
edf3fdc7-3c06-4135-8d45-90ce31db8128 | colinz2/play | leetcode/link_list/0092_Reverse_Linked_List_II/main.cpp | //
// Created by colin on 2018-12-11.
//
//反转从位置 m 到 n 的链表。请使用一趟扫描完成反转。
//
//说明:
//1 ≤ m ≤ n ≤ 链表长度。
//
//示例:
//
//输入: 1->9->2->3->4->5->NULL, m = 2, n = 5
//输出: 1->4->3->2->9->5->NULL
#include "../listnode.h"
#include <iostream>
class Solution {
public:
//不容易
ListNode* reverseBetween(ListNode* head, int m, ... | ALGO | 0.999714 | 5.32882 |
d29f2ead-d338-4ff1-8a83-b579921e96ef | aayush751/Geeksforgeeks | Medium/Trapping Rain Water/trapping-rain-water.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
// Function to find the trapped water between the blocks.
public:
long long trappingWater(int arr[], int n){
// code here
vector< long long > left(n);
vector< long long > righ... | ALGO | 0.999961 | 6.797848 |
08d0db07-cd5f-4747-8679-3e96bc8e0faf | amineleghouil/LeetCode | 2593-find-score-of-an-array-after-marking-all-elements/2593-find-score-of-an-array-after-marking-all-elements.cpp | class Solution {
public:
long long findScore(vector<int>& nums) {
long long res = 0;
int n = nums.size();
for (int i = 0; i < n - 1; i++) {
if (nums[i] <= nums[i + 1]) {
res += nums[i];
nums[i + 1] = INT_MAX;
nums[i] = INT_MAX;
... | ALGO | 0.999978 | 5.474543 |
101f3ca1-2edb-4613-9a75-db6dab519bcb | jingtaozhang18/algorithm-exercises | leetcode/300-399/313. 超级丑数.cpp | // https://leetcode-cn.com/problems/super-ugly-number/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int nthSuperUglyNumber(int n, vector<int>& primes) {
unordered_set<unsigned long > st;
priority_queue<unsigned long , vector<unsigned long>, greater<unsigned long>> que;
... | ALGO | 0.999966 | 5.524486 |
cfc1a4c9-12c5-4fa4-a441-cf951454c366 | zed1025/coding-programs | topic-wise-practise/trees_heaps/tree_from_inorder_preorder.cpp | /**
Problem Link: https://practice.geeksforgeeks.org/problems/construct-tree-1/1
Date: 11/02/2023 18:20:14
Level: Medium
Notes:
- Algorithm
- take first elemetn of preorder as index
- take index as root
- find root element's position in inorder, call it pos
... | ALGO | 0.999999 | 6.246521 |
0ebc1d5b-7d71-4edb-87ce-d096e941faea | Beisenbek/kbtu-2018-fall-lecture-samples | pp1/Wednesday/week13/77613_2.cpp | #include<iostream>
#include<set>
using namespace std;
int main(){
int x;
set<int> s;
set<int> :: iterator it;
while(cin >> x){
if(x == 0) break;
s.insert(-x);
}
int res = *(s.begin());
cout << -res << endl;
return 0;
} | ALGO | 0.999895 | 3.840368 |
68402bfe-9fa3-45db-a2c9-880d00341ae8 | supeshsinha/CodeISM | number theory long challenge/bash_big_day.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
int32_t main(){
int n,temp;
int ans =1;
cin>>n;
vector<int> freq(1e5+1,0);
vector<bool> seive(1e5+1,1);
for(int i = 0; i<n ; i++){
cin>>temp;
freq[temp]++;
}
for(int i =2;i<=1e5;i++){
int count =... | ALGO | 0.999941 | 3.583894 |
c5ca3029-d6d3-4670-8992-947cd70735e9 | Sofia-Guo-Fu/Financial-Computing-6883-Sofia-Guo-Personal-Repo | HW2/BinomialTreeModel.cpp | #include "BinomialTreeModel.h"
#include <iostream>
#include <cmath>
using namespace std;
namespace fre {
//compute risk-neutral probability
double RiskNeutProb(double U, double D, double R)
{
return (R - D) / (U - D);
}
//compute the asset price at node n,i
double CalculateAssetPrice(d... | ALGO | 0.999142 | 5.698886 |
3fd03cac-c238-4eea-bfcc-cf20c10f8c8c | super19coder/DSA-CPP | ALGO/SORTINGS/AD_BUBBLE_SORT.CPP | #include <bits/stdc++.h>
using namespace std;
//ADAPTIVE BUBBLE SORT
void bubble_sort(int arr[])
{
bool isswapped = 1;
for (int i = 0; i < 8 - 1; i++)
{
isswapped = 0;
for (int j = 0; j < 8 - i - 1; j++)
{
if (arr[j] > arr[j + 1])
{
swap(arr... | ALGO | 0.998835 | 4.365795 |
b90d6ca7-9d4b-4b65-af9d-7fe6beb4946e | wyllmein2000/AssignLP | main_cg.cpp | #include <iostream>
#include <stdlib.h>
#include <time.h>
#include "inout.h"
#include "wyarray.h"
#include "readpara.h"
#include "pdmatrix.h"
#include "cglv.h"
using namespace std;
int main (int argc, char **argv) {
double start = time(NULL);
int maxLine = 6;
string scoreFileName("data/aaa.txt");
s... | ALGO | 0.999215 | 3.655496 |
a95ea368-902e-46d3-a1d1-9ad6856a2ccc | Mrtriste/Learning-Algorithms | POJ/POJ/2192.cpp | #include <iostream>
using namespace std;
bool dp[205][205];
char a[205], b[205], c[510];
int main(){
int T,t=1; cin >> T;
while (T--){
scanf("%s%s%s", a, b, c);
int lena = strlen(a), lenb = strlen(b), lenc = strlen(c);
memset(dp, 0, sizeof(dp));
dp[0][0] = 1;
for (int i = 0; i <= lena; ++i){
for (int j... | ALGO | 0.99986 | 4.179419 |
a7cf11c4-3cf7-40e9-9f5b-18735e54cdab | onglu1/acm | codelist/other/2022-天梯赛训练赛三/6.cpp | //
// Created by onglu on 2022/3/12.
//
#include <bits/stdc++.h>
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define endl '\n'
#define lson (rt << 1)
#define rson (rt << 1 | 1)
#define Mid ((l + r) / 2)
//#define int long long
using namespace std;
//const int N = 2e6 + 1009;
//const int N = ... | ALGO | 0.99956 | 3.209924 |
56ee14cb-b4ef-4d85-9956-ae89d4026dd2 | riskiilyas/Lelangkuy | 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 |
0fae09de-a9fe-42d3-9e58-fda30d68b68c | AniGhodake/ProblemSolving | rotateArrayby90d.cpp | #include<iostream>
using namespace std;
void transposeOfArray(int arr[3][3], int row, int col){
for(int i = 0; i < row; i++){
for(int j = i; j < col; j++){
swap(arr[i][j],arr[j][i]);
}
}
}
int reverseArrayBest(int arr[3][3], int row, int col){
for (int i = 0; i < row; +... | ALGO | 0.999679 | 4.905543 |
f431b016-97a5-4875-8d0c-63f853333776 | jloehr/AdventOfCode | 2017/Day19/Day19.cpp | // Day19.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int main()
{
const StringVector Map = GetFileLines("Input.txt");
std::pair<size_t, size_t> Position{ 0, Map[0].find('|') };
std::pair<int, int> Movement{ 1,0 };
std::string Letters;
size_t StepCount = 0;
bool ReachedEnd ... | ALGO | 0.997744 | 4.521501 |
f612a83c-3c79-4072-a661-ba2f734eefa5 | ishandutta2007/codeforces | rns_cus/normal/643/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
#define N 5100
int a[N], deg[N];
pi ans;
int Ans[N];
short int gas[N][N];
int main() {
int n;
scanf("%d", &n);
for(int i = 1; i <= n; i ++) scanf("%d", &a[i]);
for(int i = 1; i <= n; i ++) {
for(int j = 1; j <= n; j ++) {
... | ALGO | 0.99994 | 3.044999 |
b15bddb3-0c89-40ae-bcf0-d1bbe45cc877 | AhmedTarrad/CppSolutionForCodilityLessons | Lesson_3_TimeComplexity/3_TapeEquilibriumSol1.cpp | #include <numeric>
using namespace std;
int solution(vector<int> &A) {
// Implement your solution here
// we need two for loops to get the full solution
// First one to get the full sum
long long int totalSum{accumulate(A.begin(), A.end(), 0LL)};
long long int leftSum{A[0]};
long long int minDiff{abs(totalSum ... | ALGO | 0.999587 | 5.381017 |
c9445085-29a0-44c1-a696-41f15907ad80 | 0xm4yo/compro | atcoder/adt/adt_medium_20231102_2/F.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
#define rep(i, a, b) for(ll i=a; i<b; i++)
#define rrep(i, a, b) for(ll i=a; i>=b; i--)
#define all(a) (a).begin(), (a).end()
#define YesNo(bool) if(bool){cout<<"Yes"<<en... | ALGO | 0.999929 | 4.123482 |
64e8c78e-d27f-4c1a-98e7-98eaaa89aef0 | haohaoalt/slam_nav | src/thirdparty/navigation_experimental/sbpl_recovery/src/sbpl_recovery.cpp | #include <sbpl_recovery/sbpl_recovery.h>
#include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(sbpl_recovery::SBPLRecovery, nav_core::RecoveryBehavior)
namespace sbpl_recovery
{
SBPLRecovery::SBPLRecovery():
global_costmap_(NULL),
local_costmap_(NULL),
tf_(NULL),
initialized_(false)
{
... | TOOL | 0.906559 | 4.366844 |
04273137-64a7-4568-86ef-bfd3a4dc832c | nachiketa3299/RPS | src/past/BOJ_10984_02.cpp | #include <iostream>;
#include <vector>
class Semester {
private:
struct Subject {
int c; double g;
double getProduct(void) const { return this->c * this->g; }
Subject(void) {
std::cin >> *this;
return;
}
friend std::istream& operator>>(std::istream &i... | ALGO | 0.91294 | 5.243397 |
9e884324-28ba-4bde-a398-80baf347c299 | ksjois/myproject | cplusplus/checkbook.cpp | #include <iostream>
using namespace std;
class checkbook {
int amount;
int total;
int sum;
public:
//initalize checkbook
checkbook();
//add amount to the existing amount
void add_item(const int amount);
//calculate the total amount for the checkbook
int total_sum();
~checkbook();
};
inline... | TOOL | 0.967753 | 4.810904 |
6f41af49-1b7d-4688-9c5f-9ba9638fd036 | connieya/cpp_algorithm | solved/gold4/1062_1.cpp | #include "bits/stdc++.h"
using namespace std;
bool alpha[26];
int words[51];
int n;
int ans = -1;
void dfs(int L , int len , int start , int need) {
if (L == len){
int cnt = 0;
for (int i = 0; i < n; ++i) {
if ((words[i] & ((1<< 26)-1 -need )) == 0){
cnt++;
... | ALGO | 0.999903 | 4.191783 |
f35ae0ce-4cb6-47f2-9469-01e73aa6d700 | Pang-GJ/Nowcoder_solution | Basic/homework/stringSort.cpp | #include <cctype>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <string>
#include <vector>
#define MAXLENGTH 1000
void letterQuickSort(std::string &str, int L, int R);
void swap(char &strA, char &strB);
std::vector<int> partition(std::string &str, int L, int R, char key);
void mergeSort(std::string... | ALGO | 0.998782 | 5.250236 |
49dc60d4-4601-4d69-bd78-c848f4ef10ba | BenLand100/ScratchCode | kd-tree/main.cpp | #include <cstdlib>
#include <iostream>
#include "kdtree.h"
struct point {
double x, y, z;
};
double dim(point *pt, int d) {
switch (d) {
case 0:
return pt->x;
case 1:
return pt->y;
case 2:
return pt->z;
}
}
int main(int argc, char **argv) {
... | ALGO | 0.998703 | 5.872303 |
40f11c91-d408-41e4-bc5c-91a4b0071d77 | Denys1209/language-of-programming | Parser.cpp | #include "Parser.h"
Token Parser::get(int relativePosition)
{
int position = this->pos + relativePosition;
if (position >= this->size) return End;
return tokens[position];
}
bool Parser::match(Token_type type)
{
Token current = this->get(0);
if (type != current.getType()) return false;
pos++;
return true;
}
To... | TOOL | 0.895053 | 4.12799 |
471212bb-2cee-4d1c-924f-4159400b5e3a | GuacheSuede/MSSubmission1234567890 | submission/ema/boost_1_69_0/libs/mpi/src/computation_tree.cpp | // Compute parents, children, levels, etc. to effect a parallel
// computation tree.
#include <boost/mpi/detail/computation_tree.hpp>
namespace boost { namespace mpi { namespace detail {
int computation_tree::default_branching_factor = 3;
computation_tree
::computation_tree(int rank, int size, int root, int branchi... | ALGO | 0.999935 | 6.548349 |
0a490fa8-6e1f-4c68-90d4-e8ae85998b79 | rabelhmd/LeetCode | 2050-parallel-courses-iii/2050-parallel-courses-iii.cpp | class Solution {
public:
int minimumTime(int n, vector<vector<int>>& relations, vector<int>& time) {
vector<vector<int>> adjList(n);
vector<int> inDegree(n), cTime(n, 0);
for(auto &r: relations) {
adjList[r[0]-1].push_back(r[1]-1);
inDegree[r[1]-1]++;
}
... | ALGO | 0.999981 | 6.390913 |
55aeef37-a4be-42bb-afa6-2e6ffa9c870c | trinhminhtriet/leetcode | solutions/2300-2399/2337.move-pieces-to-obtain-a-string/Solution2.cpp | class Solution {
public:
bool canChange(string start, string target) {
int n = start.size();
int i = 0, j = 0;
while (true) {
while (i < n && start[i] == '_') ++i;
while (j < n && target[j] == '_') ++j;
if (i == n && j == n) return true;
if (i ... | ALGO | 0.999779 | 5.882754 |
0efce4f0-3128-48f5-b336-848480c40ed9 | SatAlgo/OpenGL | Please/DoublyLinkedList.cpp | #include <iostream>
using namespace std;
class node {
public:
int prn;
char name[50];
char branch[30];
float cgpa;
node* next;
node* prev; // New pointer to keep track of the previous node
};
class doublyLinkedList {
private:
node* head;
public:
doublyLinkedList() {
head = NUL... | ALGO | 0.999479 | 5.929362 |
1393c52d-25bb-4763-ae1d-3fc129d6f8b8 | Readiz/ProblemSolving | boj_unrated/old/1100[B2].cpp | #include <stdio.h>
int main() {
char c;
int i = 0;
int ans = 0;
for (; scanf("%c", &c), i < 8 * 8; i++) {
if (c == ' ' || c == '\n' || c == '\t') {
i--;
continue;
}
if (i % 2 == (i / 8) % 2 && c == 'F') {
ans++;
}
}
printf("%d\... | ALGO | 0.998942 | 3.563093 |
a94f9747-975b-42d1-a4ac-c12078fdb6cd | z1908144712/ExamCode | LeetCode/190/main.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
vector<bool> bits(32);
for (int i = 0; i < 32; i++) {
bits[31 - i] = n & 1;
n >>= 1;
}
uint32_t r = 0;
for (int i = 0; i < 32; i++) ... | ALGO | 0.999886 | 5.807376 |
79609a48-4298-44a6-87b5-dcd7aafc447b | demon-i386/Simple-Blockchain | include/crypto/sha256.cpp | /*
* @file sha256.cpp
* @author VitorMob
* @brief
* @version 0.1
* @date 2021-05-31
*
* @copyright Copyright (c) 2021
*
* Description:
* here is the function where the crypt of the block will be made
*/
#include "sha256.hpp"
string calc_hash_block(const string str)
{
uschar hash[SHA256_DI... | ALGO | 0.998407 | 5.207485 |
0d9c14f1-0881-4170-8e5e-31dcd732d139 | saumya1singh/DSAImportantQuestionScratch | Bit_Masking/findExponential.cpp | #include <iostream>
using namespace std;
//Given a and n, find a^n
//example a=3, n=5 find 3^5
int findExponent(int a, int n){
int ans=1;
while(n>0){
int last_bit= (n&1);
if(last_bit){
ans=ans*a;
}
n=n>>1;
a=a*a;
}
return ans;
}
int main() {
i... | ALGO | 0.999982 | 5.138448 |
832836ac-88cc-4330-996f-f7f3bebc26ff | miteshkumar77/LC | regular-expression-matching/Accepted/8-19-2021, 1:08:06 PM/Solution.cpp | // https://leetcode.com/problems/regular-expression-matching
class Solution {
public:
bool isMatch(string s, string p) {
int n = s.length(); int m = p.length();
vector<vector<bool>> dp(n+1, vector<bool>(m+1, 0));
dp[0][0] = true;
for (int i = 1; i <= m; ++i) {
dp[0][i] =... | ALGO | 0.999782 | 6.697736 |
4d7bab2d-d4cc-4b33-81cf-d8be3cc94176 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10238_61.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int n, len, tot, cnt, x, y, cur;
bool a[N][N], g[N][N];
pair<int, int> st[N * N];
bool vis[N][N];
double lee[N * N];
queue<pair<int, int> > q;
bool dfs(int s, int t) {
q.push(pair<int, int>(s, t));
vis[s][t] = 1;
while (!q.empty()) {
int x = q.... | ALGO | 0.999752 | 3.037177 |
bbc18d28-0bed-431e-9e7e-dd1e1c447a7f | shnovaj30101/ShnoDataStructure | BTree_with_disk/command.cpp |
#include<iostream>
#include <filesystem>
#include <regex>
#include "basic.hpp"
#include "mytree.hpp"
#include <map>
#include "command.hpp"
#include "nlohmann/json.hpp"
#include "fmt/format.h"
namespace fs = std::filesystem;
using namespace std;
using namespace fmt;
using json = nlohmann::json;
map<string, regex> cmd... | TOOL | 0.915553 | 3.892451 |
c6f07902-8ffe-4e9a-901c-09dbc5fd5eb1 | Elvis2000717/Cpp | 组队竞赛.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
long long val = 0;
vector<int> arr;
arr.resize(3 * n);
for (int i = 0; i < 3*n; i++)
{
cin >> arr[i];
}
sort(arr.begin(), arr.end());
for (int i = 0; i < n; i++)
{
val = val... | ALGO | 0.999641 | 3.66256 |
49b1b1a4-beaa-4966-b201-238601c1054e | liruicrecky/leetcodec-- | 318.最大单词长度乘积.cpp | // @before-stub-for-debug-begin
#include <bits/stdc++.h>
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=318 lang=cpp
*
* [318] 最大单词长度乘积
*/
// @lc code=start
class Solution {
public:
int maxProduct(vector<string> &words) {
int n = words.size();
int maxLen = 0;... | ALGO | 0.999725 | 5.902996 |
11cc1034-bb12-4b94-8640-953da5d82946 | DavidePiccinini/thesis_Kimera_Gazebo | gtsam/examples/Pose2SLAMExample_graphviz.cpp | /**
* @file Pose2SLAMExample_graphviz.cpp
* @brief Save factor graph as graphviz dot file
* @date Sept 6, 2013
* @author Frank Dellaert
*/
// For an explanation of headers below, please see Pose2SLAMExample.cpp
#include <gtsam/slam/BetweenFactor.h>
#include <gtsam/geometry/Pose2.h>
#include <gtsam/nonlinear/Leven... | ALGO | 0.948472 | 6.230124 |
d0297433-0af7-4033-8210-89a518b0f173 | parmarshashank/Assignment_BTech2026_2201921520138 | DSA/5Feb25/LC-1790. Check if One String Swap Can Make Strings Equal.cpp | class Solution {
public:
bool areAlmostEqual(string s1, string s2) {
vector<int> uneqPos;
int n= s1.size();
if(n != s2.length())
return false;
for(int i=0; i<n; i++){
if(s1[i]!=s2[i])
uneqPos.push_back(i);
}
if(uneqPos.size()==0... | ALGO | 0.999979 | 6.272199 |
e1fe5bd7-b087-49c2-9c03-4739a13a16f6 | NafizZ/hackerrank-statistics | hackerrank_stat_day-0-2/main.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#include <iomanip>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int N;
cin >> N;
int X[N], W[N], w=0;
double sum = 0;
for(int i=0; i<N; i+... | ALGO | 0.999884 | 3.718864 |
25878f83-1799-46ea-b9b3-03b2e2928193 | abdallamaher/competitive_programming | Math/Algebra/B. Maximums.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#endif
int n, b, mx = 0, a;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &b);
a = mx + b;
mx = max(a, mx);
printf("%d ", a);
}
return 0;
} | ALGO | 0.999875 | 3.934835 |
ad6c3c53-3957-4a98-9ec9-331fcbd13b7c | yash3001/Competitve-Programming | Random Contests/Facebook Hackercup 2021/Round A/A2/a2.cpp | /* @author -> gamma30 */
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2,sse,sse2,sse3,sse4,popcnt,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define ff first
#define s... | ALGO | 0.998957 | 4.737243 |
ab770fb2-d40a-4265-b10c-77c692656be5 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4128_2.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
long long int n, i, j, k = 0, x;
cin >> n;
for (long long int i = 1; i < n + 1; i++) {
for (long long int j = 1; j < i; j++) {
x = i ^ j;
if (x <= n && i + x > j && i + j > x && j + x > i) k++;
}
}
cout << k;
}... | ALGO | 0.999918 | 4.259353 |
43046be4-c4d6-40b3-8773-c10a0b1965f6 | abhiram002/DSA-Codes | Check if array is sorted or not.cpp |
#include<bits/stdc++.h>
using namespace std;
bool isSorted(int arr[], int n) {
for (int i = 1; i < n; i++) {
if (arr[i] < arr[i - 1])
return false;
}
return true;
}
int main() {
int arr[] = {1, 2, 3, 4, 5}, n = 5;
printf("%s", isSorted(arr, n) ? "True" : "False");
}
| ALGO | 0.999889 | 4.718211 |
93739656-2bfd-4662-a537-d4a40dd17e27 | jacobtpl/pokerbots | preflop.cpp |
#include "omp/HandEvaluator.h"
#include "omp/EquityCalculator.h"
#include "omp/Random.h"
#include "ttest/ttest.h"
#include <iostream>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <list>
#include <numeric>
#include <cmath>
#include <algorithm>
#include <random>
using namespace std;
usin... | ALGO | 0.999116 | 3.680545 |
c0757b9f-fb12-4a85-a854-c4b0f162d2ec | Winaway/Path_planning | src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.969002 | 3.6853 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.