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 |
|---|---|---|---|---|---|---|
2988f3ea-5c61-4a25-8a9e-3a2bd9b93143 | ucsb-cs24-s18/cs24-s18-lectures | lec-08/recursion/intlist.cpp | // intlist.cpp
// Implements class IntList
// YOUR NAME(S), AND DATE
#include "intlist.h"
#include <iostream>
using std::cout;
// return sum of values in list
int IntList::sum() const {
return 0; // REPLACE THIS NON-SOLUTION
}
// returns true if value is in the list; false if not
bool IntList::contains(int valu... | ALGO | 0.992124 | 5.0786 |
47a8f153-300e-434e-9d68-cac78e4c9cd6 | Livinfly/AlgorithmPromble_Code | BeginToGreat/03_STL/03HDU1702.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <stack>
#include <queue>
using namespace std;
int n;
string str;
queue<int> q;
stack<int> stk;
void FIFO_calc()
{
while (q.size())
q.pop();
while (n--)
{
string op;
int x;
cin >> op;
if (... | ALGO | 0.999539 | 5.288816 |
c0716048-3c5c-4609-8767-c8ff35584434 | vinhSeo-02/PTIT | C/135 C05016 MA TRAN XOAN OC 1.cpp | #include<stdio.h>
void in(int a[100][100], int n, int m)
{
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
printf("%d ",a[i][j]);
}
printf("\n");
}
}
void xoanoc(int n)
{
int a[100][100] , i, b=0, d=1;
while(b<=n/2)
{
for(i=b;i<n-b;i++) a[b][i] = d++;
for(i=b+1;i<n-b;i++) a[i][n-b-1] = d++;
fo... | ALGO | 0.999881 | 3.195364 |
a26b826e-3b13-4e9e-9bc4-095bae5fa591 | parth896/OOP-lab | Lab-4/Q6_1.cpp | #include <iostream>
#define endl "\n"
using namespace std;
class RealNumber
{
public:
float real;
RealNumber()
{
real = 0;
}
RealNumber(float real)
{
this->real = real;
}
static float multiply(float r1, float r2)
{
return r1 * r2;
}
};
class ImaginaryNumb... | ALGO | 0.966475 | 4.653333 |
958963a7-9566-4ccd-8462-69efd0390571 | FuChaolei/leetcode_ago | 283.移动零.cpp | /*
* @lc app=leetcode.cn id=283 lang=cpp
*
* [283] 移动零
*/
// @lc code=start
class Solution
{
public:
void moveZeroes(vector<int> &nums)
{
int count = nums.size(), n = 0;
for (int i = 0; i < count; i++)
{
for (int j = 0; j < count - 1; j++)
{
i... | ALGO | 0.999804 | 6.451215 |
416f6e56-9053-4a07-b5c6-0882384e94cd | MuhammadSalmanAhmad/Smart_Tool_Rent_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.998859 | 6.785645 |
3bcd1644-8c8f-4290-8170-2f7482e6da1e | TTWNO/tutoring | bo/pointers.cpp | #include <iostream>
class Person
{
// bad practice to make everything punlic.
// Not a probelm for this excersise though.
public:
std::string name;
int age;
};
// declare all functions first
void swap(int*, int*);
void swapn(int&, int&);
void set_name(Person*, std::string);
void set_name(Perso... | ALGO | 0.969707 | 6.164234 |
8c7007d8-aa41-4a85-a388-acfd424ce21e | kovid-sharma/LeetCode | 876-middle-of-the-linked-list/876-middle-of-the-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* middleNode(... | ALGO | 0.999891 | 5.643404 |
d79ff207-c5b3-4cd3-9070-831d6ed59195 | Aurora-73/Data-Structure-Code | 05_Search/二叉查找树的非递归构建与遍历.cpp | #include <iostream>
#include <vector>
using namespace std;
// 二叉树节点的结构体
typedef struct BiTNode {
int data;
struct BiTNode *lchild, *rchild;
}BiTNode, *BiTree;
//二叉查找树插入元素
bool InsertBST(BiTree &T,int x){
BiTNode *q = new BiTNode,*p = T,*pre = T;
cout << x << " : " << q << endl;
q -> data = x;
... | ALGO | 0.999941 | 4.632144 |
38151672-ea41-40ee-89d2-db7da40c0c4b | KarinaGordia/theMovieDB | 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 |
e442401a-d4e8-4cfd-9f68-264cab14c0af | filipeherculano/UVA_trash | 12405.cpp | #include <bits/stdc++.h>
#define X first
#define Y second
#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define all(a) a.begin(),a.end()
#define pb push_back
#define LSOne(S) (S & (-S))
#define dbg(x) cerr << ">>>> " << x << endl;
#define _ << " , " <<
typedef unsigned l... | ALGO | 0.984707 | 3.095013 |
3f0fbc16-2206-4918-a385-fba515868cb9 | hoaha110405/Homework-22028306--inh-Xu-n-H-a | BT02/Bai2.2.cpp | #include <iostream>
using namespace std;
int main()
{
double a;
int b;
cin >> a >> b;
double c=a;
if(b==0)
{
cout << 1;
return 0;
}
for(int i=1;i<b;i++){
c*=a;
}
cout << c;
return 0;
}
| ALGO | 0.999943 | 3.476237 |
5e78b41e-0785-4a27-a967-b4bc6760a890 | renpayero/Cplusplus | TPS HECHOS QT C++/PI TP4/Ej1/main.cpp | #include <iostream>
using namespace std;
int funcion(int m, int n) {
if (n == 0) {
return 0;
}
return m + funcion(m, n-1);
}
int main() {
cout << funcion(20, 3)<<endl; //retorna 60
return 0;
}
| ALGO | 0.999849 | 4.919442 |
a5b7e47d-b5f1-40a9-b1b9-87b0b4230ea1 | notj-code/Junwon-Kim-1.0 | _posts/solved_problem/USACO 2025 February Contest, Silver Problem 3. Transforming Pairs.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long long minOperations(long long a, long long b, long long c, long long d) {
if (a == c && b == d) return 0;
if ((c < a || d < b) || ((c - a) % b != 0 && (d - b) % a != 0)) return -1;
vector<pair<long long, long long>> queue ... | ALGO | 0.999578 | 5.546687 |
56361c02-a613-45de-9b27-c0977c9c29b4 | adityanjr/code-DS-ALGO | Olympiad Solutions/DMOJ/ioi15p4.cpp | // Ivan Carvalho
// Solution to https://dmoj.ca/problem/ioi15p4
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll MAXN = 5*1e5 + 10;
struct node{
double maximum,total;
ll max_product,tot_product;
node operator*(const node& other)const{
//printf("Joining\n");
//p... | ALGO | 0.999887 | 3.758329 |
3d87364d-e56c-4996-b241-9638f08280c8 | egorpugin/benchmarksgame | problem/regexredux/solution/icx/4.cpp | // The Computer Language Benchmarks Game
// https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
//
// Contributed by Jeremy Zerfas
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <pcre.h>
typedef struct {
char * data;
int capacity, size;
} string;
// Function for searching a src_... | ALGO | 0.991733 | 4.948894 |
511d7af5-4b81-4d69-8df8-24a240b3e66e | anshi05/Search-Engine | trie.cpp | #include "Trie.h"
TrieNode::TrieNode() {
for (int i = 0; i < 29; ++i)
children[i] = NULL;
numSen.clear();
numRow.clear();
}
bool TrieNode::isHave( int k ) {
for (int i = 0; i < (int)numSen.size(); ++i)
if (numSen[i] == k) return true;
return false;
}
string Trie::isInSameSentence( string query ) {
vector <... | ALGO | 0.99943 | 4.394257 |
e5cbd987-5124-407a-b37d-41f91298450b | forked-llvm/Polaris-Obfuscator | llvm/lib/CodeGen/CodeGenCommonISel.cpp | #include "llvm/CodeGen/CodeGenCommonISel.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/IR/DebugInfoMetadata.h"
#define DEBUG_TYPE ... | ALGO | 0.889462 | 7.986229 |
1474c488-2de9-4302-91fe-82a021329ff1 | EttoreZero000/AlgoritmosTEC2024SII | Practica/Lista Simple/listadoble.cpp | #include <iostream>
#include "listadoble.h"
void ListaDoble::insertarAlInicio(int _dato){
if (inicio == NULL)
inicio = new NodoDoble(_dato);
else {
NodoDoble * nuevo = new NodoDoble(_dato);
nuevo->siguiente = inicio;
inicio->anterior = nuevo;
inicio = nuevo;
}
}
void ListaDoble::insertarAlFinal(int _dato... | ALGO | 0.928722 | 4.165185 |
f85bf543-501d-4d2f-a1e2-0f51dc8086d7 | NotPunchnox/hexa | software/Firmware/src/animations/sleep/sleep.cpp | #include "../../config/config.h"
#include "../../functions/Algo.h"
#include "../../functions/servo.h"
#include <Arduino.h>
// Matrice de sleep_animation (x, z, y, ms) => hauteur, extension, rotation coxa en cm, temps du mouvement.
float matrice_sleep[][5] = {
{PX, PZ, PY, 0, 1000},
{PX, PZ-(PZ/4), PY, 0, 500},
{... | TOOL | 0.866292 | 3.19479 |
ce5d6240-c0e4-436f-8935-88bf056cfa60 | matsumoto2004/icpc | mitanai/__old_library/math/lagrange_interpolation.cpp | template<class T>
class polynomial : public vector<T> {
public:
using vector<T>::vector;
constexpr T eval(T x) const {
T res = 0;
T now = 1;
rep(i, this->size()) {
res += (*this)[i] * now;
now *= x;
}
return res;
}
// return f'(x)... | ALGO | 0.999514 | 4.517262 |
cfe2fb88-5d21-474f-a3fc-377a2ece4b71 | etherzhhb/Shang | testsuite/SimpleTest/op_stuint8.cpp | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#ifdef __cplusplus
extern "C" {
#endif
void op_stuint8(unsigned char a[], long offest, unsigned char v) __attribute__ ((noinline));
void op_stuint8(unsigned char a[], long offest, unsigned char v) {
a[offest] = v;
}
#ifdef __cplusplus
}
#endif
int main(int ... | TOOL | 0.894667 | 3.65592 |
0281c892-17b1-47a5-9b28-6ccc8b2515b7 | ProjectSulphur/ProjectSulphur | deps/bullet3/src/Bullet3OpenCL/BroadphaseCollision/b3GpuParallelLinearBvhBroadphase.cpp | /*
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it f... | ALGO | 0.966936 | 6.157253 |
f7c9a074-be19-4575-99ef-e0d7ff1cef9e | raincross7/code-similarity | codes/train_code/problem007/problem007_390.cpp | /*
∧_∧ やあ
(´・ω・`) / ようこそ、バーボンハウスへ。
/∇y:::::\ [ ̄] このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
|:⊃:|:::::| |──|
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| うん、「また」なんだ。済まない。
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| ̄ 仏の顔もって言うしね、謝って許してもらおうとも思っていない。
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄/|
∇ ∇ ∇ ∇ /./| でも、この提出を見たとき、君は、きっと言葉では言い表せない
┴ ┴ ┴ ┴ / / | 「ときめき」みたいなものを感じて... | ALGO | 0.999942 | 4.239152 |
e54efc7b-942d-42ae-86af-3a6bdfacb481 | chinmoy-kumar/competitive-programming | codeforces/C_Dora_and_Search.cpp | /*=====================================================
Author: Chinmoy Kumar Tirtho
Platform: Codeforces
Problem: C. Dora and Search
URL: https://codeforces.com/problemset/problem/1793/C
=====================================================*/
/*
Approach:
- Read the number of test cases.
- For each test case, read the... | ALGO | 0.999922 | 6.007984 |
4412f8ae-5c58-4fdf-ba6d-094949276b4b | FelpsSousa/URI-Codes | C++/bee_2416.cpp | #include <iostream>
using namespace std;
int main() {
int C, N;
cin >> C >> N;
int endPoint = C % N;
cout << endPoint << endl;
return 0;
} | ALGO | 0.999778 | 3.285487 |
02aef24f-8f55-48eb-817e-8c17efa23bd3 | hjiang13/LLMs-in-IR | POJ-104/27/1861.cpp | #include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
int j, n;
cin >> "%d\n",&n);
for(j=1; j<=n; j++)
{
float a,b,c;
cin >> "%f%f%f",&a,&b,&c);
double x1,x2,m,p;
if ((b*b-4*a*c)>0)
{
x1=(-b + sqrt(b*b-4*a*c))/(2*a);
x2=(-b - sqrt(b*b-4*a*c))/(2*a) ;
cout << "x1=%.5f; x2=%.5f\n",x1,x2);
}
else if ... | ALGO | 0.999876 | 3.349271 |
18570b0f-bfe4-4cd5-b5ef-dae741114408 | avinashz14/DSA-Problems | Competitive-Programming-Problems-master/KICKSTART - PRACTICE - 2018 - 3.CPP | #include<bits/stdc++.h>
#include<unordered_set>
using namespace std;
#define fio ios_base::sync_with_stdio(false)
#define ll long long int
#define s(x) scanf("%lld",&x)
#define s2(x,y) s(x)+s(y)
#define s3(x,y,z) s(x)+s(y)+s(z)
#define p(x) printf("%lld\n",x)
#define p2(x,y) p(x)+p(y)
#define p3(x,y,z) p(x)+p(y)+p... | ALGO | 0.999834 | 4.259192 |
de6e964c-6def-46bc-a804-18db2cf08516 | Aldyyep16/Pertemuan-11 | Pertemuan 11/quiz2.cpp | #include <iostream>
using namespace std;
void swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
int main() {
int x = 10;
int y = 20;
cout << "Sebelum swap:" << endl;
cout << "x = " << x << ", y = " << y << endl;
swap(&x, &y);
cout << "Setelah swap:" << endl;
cout <<... | ALGO | 0.999458 | 5.091935 |
28b7b1e6-ca67-4c10-aee8-ed29e030a6a0 | yusifaliyevpro/Competitive-Programming | LeetCode/Medium/1594. Maximum Non Negative Product in a Matrix.cpp | // 1594. Maximum Non Negative Product in a Matrix
// https://leetcode.com/problems/maximum-non-negative-product-in-a-matrix/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int maxProductPath(vector<vector<int>>& grid) {
}
}; | ALGO | 0.999918 | 5.66247 |
b54803ac-23c8-4a8a-84b9-2710a53c3660 | NCKUdent/ArdupilotforPixhawkRealLatest | libraries/AP_Math/polygon.cpp | #include "AP_Math.h"
#pragma GCC optimize("O2")
/*
* The point in polygon algorithm is based on:
* https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html
*/
/*
* Polygon_outside(): test for a point in a polygon
* Input: P = a point,
* V[] = vertex points of a polygon V[n+1] with V[n]=... | ALGO | 0.999879 | 7.160966 |
ef52a964-9a9d-463e-995f-1fdd80f2ae52 | shatilsarower/assignment | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
aaf9f8f2-1298-4964-b39e-e5982e626509 | tzcnt/runtime-benchmarks | cpp/cppcoro/skynet.cpp | // The skynet benchmark as described here:
// https://github.com/atemerev/skynet
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
#include <cppcoro/... | TEST | 0.901763 | 5.139223 |
b2e2bd9b-50a4-4db5-8dc3-8bf271681e31 | itamarBachar/Anomaly-Detector-Server | anomaly_detection_util.cpp | /*
* animaly_detection_util.cpp
*
* Authors : Matan Shamir 206960239 , Itamar Bachar 318781630.
*/
#include <math.h>
#include "anomaly_detection_util.h"
//a simple check for an average of size elements stored in an array of floats.
float avg(float *x, int size) {
//check if the size isnt 0 to be able to divid... | ALGO | 0.98414 | 3.217696 |
d8342627-877b-4622-9947-4d6bccbe8085 | sigu1011/atcoder | abc144_a.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
scanf("%d%d", &A, &B);
if (A <= 9 && B <= 9) {
printf("%d", A * B);
} else {
printf("-1");
}
return 0;
}
| ALGO | 0.999263 | 4.411615 |
310c3b01-42ab-45cd-98f0-f4b285e20f69 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_5022_0.cpp | #include <bits/stdc++.h>
const int MN = 100005, MS = 1 << 18 | 7;
namespace Hashing {
const int Mod = 998244353, B = 114514, iB = 137043501;
int _w[MN * 2], *w = _w + MN;
void Init(int N) {
w[0] = 1;
for (int i = 1; i <= N; ++i)
w[i] = (long long)w[i - 1] * B % Mod,
w[-i] = (long long)w[-i + 1] * iB % Mod;
... | ALGO | 0.999981 | 5.029469 |
ec53afc6-42bf-4245-a3f4-e0d0794caf5d | zhanglaplace/practice4Offer | Leetcode/Tree/107. Binary Tree Level Order Traversal II.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
<<<<<<< HEAD
int getDepth(TreeNode* root){
if(root == nullptr)
return 0;
... | ALGO | 0.99997 | 6.090689 |
4b4e55a3-5036-4d16-9651-b6a12bcbcbf1 | Arnold-roy/dsa | rotate_array.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
int k;
cin >> n;
cin >> k;
int arr[n];
int reversedarr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
k = k % n;
for (int i = 0; i < n; i++)
{
int newindex = i - k;
if (newind... | ALGO | 0.999984 | 3.46958 |
9cd18703-0ecd-4b62-9855-97cd0d7e5b81 | weiteli/LoopyBeliefPropagagtion | OpencvLoopBelievePropagation/main.cpp | #include <iostream>
#include <opencv2/opencv.hpp>
#include <vector>
using namespace std;
using namespace cv;
const int LABELS = 24;
const int Iteration = 20;
const int LAMBDA = 10;
const int SMOOTHNESS_TRUC = 2;
enum DIRECTION {LEFT, RIGHT, UP, DOWN, DATA};
double countTime(){
const clock_t begin_time = clock();
... | ALGO | 0.999497 | 4.825203 |
85eeefa0-06b6-4fa8-a668-e2d6c3d79e95 | LuizHenriqueSena/ESBMC-GPU | regression/esbmc-cpp/algorithm/algorithm75/main.cpp | // search_n example
#include <iostream>
#include <algorithm>
#include <vector>
#include <cassert>
using namespace std;
bool mypredicate (int i, int j) {
return (i==j);
}
int main () {
int myints[]={10,20,30,30,20};
vector<int> myvector (myints,myints+5);
vector<int>::iterator it;
// using default comparis... | ALGO | 0.99885 | 4.980482 |
7e5a0899-18a1-4421-8982-acc5d4a9aab1 | lechenyu/Arbalest-Vec | llvm/lib/CodeGen/PostRASchedulerList.cpp | #include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/AntiDepBreaker.h"
#include "llvm/CodeGen/LatencyPriorityQueue.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/Mach... | ALGO | 0.989405 | 7.511847 |
bc1381a5-d3a9-499b-a667-4339830e1570 | astanin/mirror-alvar | src/IntegralImage.cpp | #include "IntegralImage.h"
namespace alvar {
void IntIndex::update_next_step() {
next_step = step;
estep += step_remainder;
if (estep >= steps) {
estep -= steps;
next_step++;
}
}
IntIndex::IntIndex(int _res, int _steps) {
res = _res;
steps = _steps;
operator=(0);
}
int Int... | ALGO | 0.996668 | 4.55288 |
d9ba0fe2-757f-4cba-a785-026986bf1704 | lucasbrenner/competitive-programming | content/math/gauss.cpp | #include "../contest/template.cpp"
const ld eps = 1e-6;
template<typename T>
pair<int, vector<T>> gauss(vector<vector<T>> a, vector<T> b){
int n = sz(a), m = sz(a[0]);
rep(i,0,n) a[i].push_back(b[i]);
vector<int> pivot(m, -1);
int f = 0;
rep(i,0,m){
rep(j,f,n){
if(fabs(a[j][i])... | ALGO | 0.999432 | 3.636041 |
be491fdc-7300-48cb-a13a-aec28a1d00e6 | aahung/UVa | uva-10189.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
int a, b, count = 1;
while (cin >> a >> b) {
if (a * b == 0)
return 0;
if (count > 1) {
cout << endl;
}
vector<vector<int> > mat = vector<vector<int> >(a + 2, vector<int>(b + 2, 0));
... | ALGO | 0.999423 | 3.350986 |
baecee99-67af-4c96-aac3-88ce63e3ada9 | nkane/c-practice | day-001-100/day-085/problem-2/main.cpp | /*
* Define an array with a maximum of 20 integer values and fill
* the array with numbers either input from the keyboard or assigned
* by the program. Then write a function named split() that reads
* the array and places all 0 or positive numbers into an array
* named positive and all negative numbers into an arr... | ALGO | 0.999885 | 4.662851 |
90dc6d6a-c026-4a34-90db-7859fb3a7199 | OnCampus-Community/Daily-DSA-Quest | Intermediate/Day_29/Solution.cpp | #include <bits/stdc++.h>
int goodnessOfString(string &s)
{
// Write your code here.
int count = 0;
int total = 0;
int i = 0;
while(i<s.size()){
if(s[i] == '['){
count++;
i++;
}
else if(s[i] == ']'){
count--;
i++;
}
... | ALGO | 0.999411 | 4.554304 |
72c671fd-694a-4691-bb69-41f40e4da285 | iamarghamallick/GeeksforGeeks-Solutions | Difficulty: Medium/Case-specific Sorting of Strings/casespecific-sorting-of-strings.cpp | class Solution {
public:
bool isLower(char c) {
return 0 <= c - 'a' && c - 'a' < 26;
}
string caseSort(string& s) {
int n = s.size();
string upper = "", lower = "";
for(char c : s) {
if(isLower(c))
lower += c;
else
... | ALGO | 0.999923 | 6.094806 |
f2786ca6-4022-498b-95ed-fbcb1b844a8b | ccw2010/lc | 724. Find Pivot Index.cpp | /*724. Find Pivot Index
Given an array of integers nums, write a method that returns the "pivot" index of this array.
We define the pivot index as the index where the sum of the numbers to the left of the index is equal to the
sum of the numbers to the right of the index.
If no such index exists, we should return -1. ... | ALGO | 0.999988 | 6.067834 |
25b0d1e7-b199-46f1-9d67-bd01e11c1e56 | Bhanuprakash-M04/GFG-DSA | Difficulty: Medium/Tree Boundary Traversal/tree-boundary-traversal.cpp | /*
// Tree Node
class Node {
public:
int data;
Node* left;
Node* right;
// Constructor to initialize a new node
Node(int val) {
data = val;
left = NULL;
right = NULL;
}
};
*/
class Solution {
public:
bool isLeaf(Node* root){
if(root!=NULL && root->l... | ALGO | 0.999987 | 6.116667 |
055a0746-8513-4eb4-9e8b-233be6485458 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12412_17.cpp | #include <bits/stdc++.h>
using namespace std;
int sg[2][2][300005], v[4];
long long a[300005];
int repeat;
int maxx = 32;
int cal(long long x, int j, int k) {
if (x < maxx) {
return sg[j][k][x];
} else {
return sg[j][k][(x - maxx) % repeat + maxx];
}
}
void work() {
int n, x, y, z;
scanf("%d%d%d%d", &... | ALGO | 0.999827 | 4.026371 |
1b4a1802-4527-4035-9da1-5cb1fbe6f1ac | st117173/2023-cpp-autumn | 2023.11.22-homework-6/task4/main.cpp | #include <iostream>
void honoi(int n, int from, int to)
{
if (n <= 0)
{
return;
}
int res = 6 - from - to;
if (n == 1)
{
printf("%d %d %d\n", n, from, to);
}
else
{
honoi(n - 1, from, to);
printf("%d %d %d\n", n, from, res);
honoi(n - 1, to, ... | ALGO | 0.999854 | 4.270668 |
e44cb46e-69f5-4bf2-99e0-cfe92dbd9381 | bosecodes/CP-by-bosecodes | 30 days coding challenge/Day 1: Arrays/colorSort.cpp | // sort an array of 0s, 1s, 2s without using extra space
// and any sorting algo
// Somdev Basu
// The ultimate Devtaaaa
#include <bits/stdc++.h>
using namespace std;
void sortvec(vector<int> &a) {
int low = 0, mid = 0, high = a.size() - 1;
while(mid <= high) {
switch(a[mid]) {
case 0:
... | ALGO | 0.999921 | 4.623884 |
4523fda4-0097-430d-b8af-3531f5c51573 | detu/mcadjoint | Code/OilProblem/regularization.cpp | //
// Created by Stefano Weidmann on 17.05.18.
//
#include "regularization.hpp"
#include "darcyVelocity.hpp"
#include "pressure.hpp"
#include "fixedParameters.hpp"
#include "logging.hpp"
#include "specialCells.hpp"
#include <Eigen/Dense>
#include "sensitivity.hpp"
//#error "Referenzwert (k - kref)^2 pore volume injec... | ALGO | 0.994819 | 5.662513 |
5552085d-e334-42f6-bcd0-f5b22773a0c8 | sarvex/leetcode-emoji-code | solution/0700-0799/0731.My Calendar II/Solution.cpp | class MyCalendarTwo {
public:
map<int, int> m;
MyCalendarTwo() {
}
bool book(int start, int end) {
++m[start];
--m[end];
int s = 0;
for (auto& [_, v] : m) {
s += v;
if (s > 2) {
--m[start];
++m[end];
... | ALGO | 0.999925 | 6.132884 |
d1dc5d9e-a5b1-4094-925e-392e353cb500 | MalayShikharSoni/LeetCodeSolutions | 2395-longest-binary-subsequence-less-than-or-equal-to-k/longest-binary-subsequence-less-than-or-equal-to-k.cpp | class Solution {
public:
int longestSubsequence(string s, int k) {
int n = s.size();
int zeros = 0, ones = 0;
long long value = 0, pow = 1;
for (char c : s) {
if (c == '0')
zeros++;
}
for (int i = n - 1; i >= 0; i--) {
if (s[i... | ALGO | 0.999889 | 6.153469 |
c2d48815-d531-4e1a-a13c-00be2cd5ed38 | mdakram00/hellowWorld | reverseNumber.cpp | #include<iostream>
using namespace std;
int main(){
int n, digit;
int num=0;
cin>> n;
while(n>0){
digit=(n%10);
num=num*10 + digit;
n=(n/10);
}
cout << num << endl;
return 0;
}
| ALGO | 0.999905 | 4.488779 |
90048a59-9949-44be-84be-fc0eed28850b | Prince3009/DSA-Using-CPP | 5BasicMaths/1ExtractionOfDigits.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cout << "Enter the digit: " ;
cin >> n;
while(n > 0){
int lastDigit = n % 10;
cout << lastDigit << endl;
n = n / 10;
}
} | ALGO | 0.999441 | 4.636213 |
35bceb76-1cd9-458c-bc01-a7bedf15d8a0 | mozilla/releases-comm-central | third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp | /**
* \file opt_flip_matrices.cpp
*
* Convert (matrix * vector) operations to (vector * matrixTranspose),
* which can be done using dot products rather than multiplies and adds.
* On some hardware, this is more efficient.
*
* This currently only does the conversion for built-in matrices which
* already have tra... | ALGO | 0.981633 | 7.310534 |
177cb8dc-5050-4a5a-9fcd-5516cf8bea53 | raikarshubham/hacktoberfest2024 | tw2_ip.cpp | #include<STDIO.H>
#include<CONIO.H>
#include<MALLOC.H>
typedef struct tree
{
char data;
struct tree *left;
struct tree *right;
}*pos;
pos stack[30];
int top=-1;
pos newnode(char b)
{
pos temp;
temp=(struct tree*)malloc(sizeof(struct tree));
temp->data=b;
temp->left=NULL;
temp->right=NULL;
return(temp);
}
void push(pos ... | ALGO | 0.999947 | 3.67549 |
1cc89155-51dd-4345-a6f8-4b318657237b | 8prashant/leetcode | 0092-reverse-linked-list-ii/0092-reverse-linked-list-ii.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* reverseBetw... | ALGO | 0.999999 | 5.392945 |
955ccb2e-6de7-4a78-bbe7-9411a258c4cb | lihao814386741/TeamWork | LeetCode/Liang/208ImplementTrie.cpp | class TrieNode {
public:
// Initialize your data structure here.
bool isWord;
unordered_map<char, TrieNode*> hash;
TrieNode() {
isWord = false;
}
~TrieNode() {
}
};
class Trie {
public:
Trie() {
root = new TrieNode();
}
// Inserts a word into the trie.
void ... | ALGO | 0.999765 | 6.439346 |
cfce22f9-f3d5-4324-be53-dca7b86c827b | dishita10/DSA_for_me | daily streaks/ransomNote.cpp | class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
unordered_map<char,int> m;
for(auto it:magazine)
{
m[it]++;
}
for(auto it:ransomNote)
{
m[it]--;
}
for(auto it: m){
if(it.second<0) ret... | ALGO | 0.999543 | 6.215197 |
b77613e1-06f2-4ea3-a2ed-fd044ce17b2c | ishandutta2007/codeforces | p_b_p_b/normal/1355/F.cpp | #include<bits/stdc++.h>
clock_t t=clock();
namespace my_std{
using namespace std;
#define pii pair<int,int>
#define fir first
#define sec second
#define MP make_pair
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define drep(i,x,y) for (int i=(x);i>=(y);i--)
#define go(x) for (int i=head[x];i;i=edge[i].nxt)
#d... | ALGO | 0.999849 | 3.33147 |
af558321-ef84-4f07-9ae2-1b505a226ec0 | chocolatemelt/misc | RPI/LLVM-Compiler-Case-Study/lib/Analysis/InlineCost.cpp | #include "llvm/Analysis/InlineCost.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CodeMetrics.h"
#include "llvm/Analysis/ConstantFold... | ALGO | 0.891362 | 5.762739 |
f79eb75c-8c31-4ddf-aed2-9749b051c870 | nd-0r/CodingPractice | c++/src/BinarySearch.cpp | # include <iostream>
# include <vector>
# include <string>
using namespace std;
bool isPrimeHelper(vector<int> primes, int target, int start, int end)
{
if (abs(end - start) < 1) {
return false;
}
int i = (start + end) / 2;
int current = primes[i];
if (current == target) {
cout << ... | ALGO | 0.999176 | 4.850563 |
bff5fa1f-2bd0-47d0-b3e3-62439871a323 | Anna-Khachatryan-1999/array | matrix/16_symmetricalMainDagonal.cpp | #include <iostream>
bool symmetricalMainDiagonal(int** arr, int n, int m)
{
for (int i = 0; i < n; ++i) {
for (int j = 1; j < m; ++j) {
if (arr[i][j] != arr[j][i]) {
return false;
}
}
}
return true;
}
int main()
{
int n;
std::cout << "column ... | ALGO | 0.999687 | 4.588765 |
4354b4c1-0d26-4c7e-9f55-39c1af65bdd9 | karina-Shv/basic_prog_c | lab12.cpp | #include <iostream>
#include <stdio.h>
#include <windows.h>
#include <math.h>
using namespace std;
int main(){
double x;
double y;
double tax, taxAmount, amountPay, res;
char type;
cout<<"Input type: A, B or C\n"; cin >> type;
cout<<"Input x\n"; cin >> x;
//повна команда розгалудження
... | ALGO | 0.997791 | 3.541379 |
f8e4d052-ad84-4c51-93e5-7d2f2785a9be | CodingPO8/ORE | QuantExt/qle/termstructures/crossccybasismtmresetswaphelper.cpp | #include <ql/cashflows/iborcoupon.hpp>
#include <ql/utilities/null_deleter.hpp>
#include <qle/pricingengines/crossccyswapengine.hpp>
#include <qle/termstructures/crossccybasismtmresetswaphelper.hpp>
#include <boost/make_shared.hpp>
namespace QuantExt {
CrossCcyBasisMtMResetSwapHelper::CrossCcyBasisMtMResetSwapHelpe... | TOOL | 0.857823 | 7.779667 |
8f2a2a48-47cf-4c81-9ce2-e2e6145f351f | ROCm/firdev-llvm-project | libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/is.heap/is_heap.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires LessThanComparable<Iter::value_type>
// constexpr bool // constexpr after C++17
// is_heap(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
TEST_CONSTEX... | TEST | 0.869552 | 5.093495 |
f7ae8764-123d-458d-a551-3f3207131ab4 | FAISAL1414-hub/Discrete-Project | Q6 Module.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm> // For find()
using namespace std;
const int MAX_ENTRIES = 100;
int main() {
ifstream dataFile("D:\\Friends Dataset.csv");
if (!dataFile.is_open()) {
cout << "Error: Unabl... | ALGO | 0.998144 | 5.095768 |
a9316f8b-bc8d-42e3-9e91-25e320338a11 | jaydeep-pro/my_dsa_2024 | Medium/Optimal Strategy For A Game/optimal-strategy-for-a-game.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//Function to find the maximum possible amount of money we can win.
class Solution{
public:
long long maximumAmount(int n, int arr[])
{
vector<vector<long long>> dp(n + 1, vector<long long>(n + 1, -1));
return so... | ALGO | 0.999857 | 6.099925 |
931c62cc-91cd-4e73-8575-bf82b7c873ad | sarvex/leetcode-algol | solution/0000-0099/0059.Spiral Matrix II/Solution.cpp | class Solution {
public:
const int dirs[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
vector<vector<int>> generateMatrix(int n) {
vector<vector<int>> ans(n, vector<int>(n));
int i = 0, j = 0, k = 0;
for (int v = 1; v <= n * n; ++v) {
ans[i][j] = v;
int x = i + dirs... | ALGO | 0.999938 | 5.777387 |
1f56d9d4-8ded-48b6-9fb6-9b75bd955f6b | lyciumlee/learn_leetcode_easy | Merge Sorted Array.cpp | #include <vector>
using namespace std;
class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n)
{
int ida,idb,icur;
ida = m - 1;
idb = n - 1;
icur = m + n - 1;
while(ida >= 0 && idb >= 0)
{
nums1[icur--] = nums1[ida] ... | ALGO | 0.999974 | 5.098775 |
4fae53ea-0ea4-4de5-b2a8-54565ba68489 | WHOLEACS/LeetCode | 1190/code.cpp | class Solution {
public:
// 栈 时间复杂度:O(n) 空间复杂度:O(n)
string reverseParentheses(string s) {
int len = s.size();
stack<string> st;
while (!st.empty()) {
st.pop();
}
for (int i = 0; i < len;) {
if (s[i] == '(') {
st.push(string(1, '('))... | ALGO | 0.99992 | 5.681807 |
7190b699-fffd-4a1f-9b54-22e56711d4cb | itsRishi-prog/CPP | 4. Foundation of Programming 2/L2- Pattern Printing/Q11.cpp | // print the following pattern
// 1
// 2 3
// 4 5 6
// 7 8 9 10
// " VERY EASY " :- by using extra variable
#include<iostream>
using namespace std;
int main(){
int n,a=1;
cout<<"enter number of rows: ";
cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
cout<<a++<<" ";
}
... | ALGO | 0.999698 | 4.562997 |
98299657-988d-4c01-bc65-fd26b1326ac4 | vanphutin/DataStructureAndAlgorithms | src/on_tap_cuoi_ky/de-quy/toHop.cpp | // to hop chap k n
#include <iostream>
using namespace std;
int toHop(int n, int k){
if(k == 0 || k == n) return 1;
return toHop(n-1,k-1) + toHop(n-1,k);
}
main(){
int n ;;
cout<<toHop(6,3);
}
| ALGO | 0.999986 | 3.891419 |
decfb403-7238-4594-a196-186e3e02a597 | shleshitha/leetcode_DSA | 153-find-minimum-in-rotated-sorted-array/find-minimum-in-rotated-sorted-array.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
int n=nums.size();
int lo=0, hi=n-1;
while(lo<=hi){
int mid = (lo+hi)/2;
if(nums[mid]>nums[n-1])
lo=mid+1;
else
hi=mid-1;
}
return nums[lo];
}
}; | ALGO | 0.999988 | 5.806272 |
9d07a6c5-7401-4e32-be4c-928bebd6b75e | rshubham24/coding | course_era/algorithms on graphs/week1/finding_an_exit_from_a_maze.cpp | #include <bits/stdc++.h>
using namespace std;
bool bfs(vector<vector<int>> &a, int x, int y, int n){
vector<bool> vis(n, false);
queue<int> q;
q.push(x);
int p;
vis[x] = true;
while(!q.empty()){
p = q.front();
q.pop();
for(int i = 0; i < a[p].size(); i++){
if(a[p][i] == y){
return true;
}
... | ALGO | 0.999992 | 4.661821 |
49fb0d09-6e11-433c-b9d9-ef0b81c32918 | JLMazing/nCodebooks | SvmCodeMarco/PYTHON_OPT_CLASSIFICATION_SVM/SVM/utils.cpp | /* input: line
output: array of words, function returns amount of words
ALLOCATES MEMORY NEEDS malloc.h
The amount of words in the line should not exceed MAX_WORDS
*/
#include <cstdlib>
#include <math.h>
#include <limits.h>
#include <stdio.h>
#include "utils.h"
#define MAX_WORDS 10000
using namespace std;
... | TOOL | 0.996834 | 3.969098 |
d88c656c-8729-47ed-949f-ddab2aeebf98 | hztttt/Synergistic_Optimization | lammps_DeepSPIN/src/REAXFF/reaxff_multi_body.cpp | // clang-format off
#include "reaxff_api.h"
#include "pair.h"
#include <cmath>
#include <cstring>
namespace ReaxFF {
void Atom_Energy(reax_system *system, control_params *control,
simulation_data *data, storage *workspace, reax_list **lists)
{
int i, j, pj, type_i, type_j;
double Delta_l... | ALGO | 0.955598 | 5.641302 |
99e5d069-aa4b-4fe7-9c59-a1c9f6a1fea6 | morshedalam3/codeforce | Codeforces Round 911 (Div. 2)/b.cpp | /****************Bis'Millah Hir Rah'Manir Rahim ***************
* Author: Morshed Alam *
* SyntaxSorcerer *
***************************************************************
problem link:
*/
#include<bits/stdc++.h>
#define ll long long
#... | ALGO | 0.999732 | 4.676294 |
e77368df-b45c-4be1-9bf3-223a3b4a51af | pytorch/executorch | kernels/portable/cpu/op_softmax.cpp | #include <cmath>
#include <executorch/kernels/portable/cpu/util/activation_ops_util.h>
#include <executorch/kernels/portable/cpu/util/functional_util.h>
#include <executorch/kernels/portable/cpu/util/reduce_util.h>
#include <executorch/runtime/kernel/kernel_includes.h>
namespace torch {
namespace executor {
namespace... | ALGO | 0.977103 | 7.271605 |
ec4e60d2-dfbc-4029-bf3c-a3215ff4367d | ZiadKasem/Vector-Matrix-multiplication-using-MPI | Source.cpp | #pragma warning(disable:4996) // Disables the warning for using unsafe functions in Visual Studio
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <mpi.h>
#include <string.h>
#define MAX_SIZE 100 // Maximum value for size
int main(int argc, char** argv) {
int rank, size, N_SizeOfMatrix;
int d... | ALGO | 0.999787 | 4.285482 |
ab2a3c57-3faf-4c4f-af86-70f3b8e9dba0 | Linuxydable/Godot_STL | core/math/camera_matrix.cpp | /*************************************************************************/
/* camera_matrix.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... | TOOL | 0.982063 | 7.036365 |
b904e9be-8c66-435f-98ef-269706eb3113 | Dafydd8/TDV | TDV - TP1/prueba.cpp | #include <vector>
#include <map>
#include <tuple>
#include <iostream>
using namespace std;
int max(vector<int> v){
int rv = v[0];
for (int i = 0; i < v.size(); i++){
if (v[i] > rv){
rv = v[i];
}
}
return rv;
}
void suma(int & carlos){
carlos += 1;
}
void invertir(vect... | ALGO | 0.995949 | 4.055552 |
fb2fea25-397d-42c9-b1ac-35d3bccab4b2 | zhaohanson1/project_euler_plus | 023 - Non-abundant sums/solution.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <cmath>
#include <cstring>
#include <unordered_set>
#define ll long long
#define MAXP 100000
using namespace std;
vector<ll> prime;
unordered_set<int> abundants;
void generate_primes() {
ll limit = ceil(sqrt(MAXP));
bool mark[limit];
... | ALGO | 0.999789 | 5.479033 |
076dcf4c-253b-4106-a81e-380435f5f389 | Skull-crusher44/gfg_practice | Difficulty: Medium/Minimum number of deletions and insertions/minimum-number-of-deletions-and-insertions.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int minOperations(string &a, string &b) {
// Your code goes here
int n = a.length();
int m = b.length();
vector<vector<int>>dp(n+1,vector<int>(m+1,0));
fo... | ALGO | 0.999931 | 6.540324 |
79fe2ad7-4c6e-4f86-a84a-8677975cfb84 | Hansimov/cs-notes | leetcode/0063.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <string>
#include <cstring>
#include <stack>
#include <vector>
using namespace std;
static const auto _ = []() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
return nullptr;
}();
// class Solution {
// publi... | ALGO | 0.999476 | 3.075985 |
ee04b147-a052-4e20-8556-7d6b0eb73650 | namhn89/algorithm | codeforces/users/N00/contest/805/e/26869418.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iomanip>
using namespace std;
#define RemoveDuplicate(a) sort(a.begin(), a.end()); a.resize(distance(a.begin(), unique(a.begin(), a.end())));
const in... | ALGO | 0.999686 | 4.217587 |
bd1f795c-964d-492d-abd8-e94f43aa91e0 | DeepakReddy1999/leetcode | 201-bitwise-and-of-numbers-range/bitwise-and-of-numbers-range.cpp | class Solution {
public:
int rangeBitwiseAnd(int left, int right) {
int shift=0;
while(left!=right){
left=left>>1;
right=right>>1;
shift++;
}
return left<<shift;
}
}; | ALGO | 0.999948 | 5.999517 |
f448b9b0-8813-4fdd-a838-a78c4a5e2a90 | ranjan0346/leetcode | Unique Numbers - GFG/unique-numbers.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution
{
public:
// vector<int> uniqueNumbers(int L,int R)
// {
// unordered_set<int> set;
// for(int i=L; i<R; i++){
// int tem... | ALGO | 0.999807 | 5.707886 |
ea1edef7-cd6a-4e84-bc7e-ed87c5f3c5e6 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_7157_4.cpp | #include <bits/stdc++.h>
using namespace std;
map<char, int> m;
bool judge(string str) {
int count = 0;
for (int i = 0; i < 3; i++) {
if (str[i] == '.') break;
if (str[i] == 'A' && m['A'] == 0) {
m['A'] = 1;
count++;
} else if (str[i] == 'B' && m['B'] == 0) {
m['B'] = 1;
count++;... | ALGO | 0.999945 | 4.002139 |
ecab5d4d-a094-46be-842c-45323b1056f1 | openkylin/platform_external_llvm-project | libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/hash.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14
// XFAIL: libc++
// <functional>
// boyer_moore_horspool searcher
// template<class RandomAccessIterator1,
// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
// class BinaryPredicate = equal_to<>>
// class boyer_moore_horspool_searc... | TEST | 0.881941 | 6.620381 |
b415461e-3c43-4f38-9b7f-8320dc0eb2e6 | betallcoffee/leetcode | string/Palindrome Partitioning/Palindrome Partitioning/main.cpp | /**
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
Example:
Input: "aab"
Output:
[
["aa","b"],
["a","a","b"]
]
*/
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {... | ALGO | 0.999951 | 6.261952 |
93f3f86b-e639-49eb-9df3-db165ccf2984 | wjshuibing/PCL_Demo | registration/src/correspondence_rejection_sample_consensus.cpp | #include <pcl/registration/correspondence_rejection_sample_consensus.h>
| CONFIG | 0.962028 | 4.150505 |
659fa604-43e6-4530-97c9-18560716106e | Hinski2/school | algorytmikaPraktyczna/lista3/monotonic_queue.cpp | #include <bits/stdc++.h>
using namespace std;
constexpr int mak = 2e5 + 5;
struct struct_querry{
int l;
int r;
int idx;
};
bool cmp(const struct_querry &a, const struct_querry &b){
if(a.r != b.r) return a.r < b.r;
return a.idx < b.idx;
}
int n;
int arr[mak], ans[mak], p[mak];
int find(int v){
... | ALGO | 0.999995 | 4.924702 |
d04b5ce7-db8b-4678-9361-786c8b19e392 | mokshchadha/cses | Introductory-Problems/12PalindromeReorder.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
/*#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt", "w", stdout);
#endif*/
string s, palindrome;
cin >> s;
vector<int> a(26);
for (char c : s) a[c-'A']++;
int odd = 0;
for (int i = 0; i < 26; i++)
odd += a[i] % 2;
i... | ALGO | 0.999996 | 4.247881 |
fef1484b-64d8-4f13-b310-5b2d29fb93c6 | marcovc/casper | bindings/xcsp/parser.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <libxml++/libxml++.h>
#include <bindings/cpp/cpp.h>
#include <bindings/cpp/print.h> // tmp
#include <list>
#include <boost/algorithm/string.hpp>
#include <boost/xpressive/xpressive.hpp> // must be here
#include "exprparser.h"
// Parameterized predic... | TOOL | 0.951614 | 3.689395 |
068911cf-f375-4196-8d7f-c804c0d8a9c9 | Light0Yagami/Competetive-Programming | LeetCode/2390. Removing Stars From a String/solution.cpp | /*You are given a string s, which contains stars *.
In one operation, you can:
Choose a star in s.
Remove the closest non-star character to its left, as well as remove the star itself.
Return the string after all stars have been removed
*/
class Solution {
public:
string removeStars(string s) {
string p =... | ALGO | 0.999961 | 5.839339 |
a6bc7f64-e264-4867-8ecd-756b511ff60c | hrishibawane/cses-problem-set-solutions | Sorting_and_Searching/concert_tickets.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define ull unsigned ll
#define ld long double
#define pll pair<ll, ll>
#define pb push_back
#define F first
#define S second
#define VLL vector<ll>
#define VB vector<bool>
... | ALGO | 0.999991 | 3.999521 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.