uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
31f54cc3-1c94-4d29-abfb-c6ef76472ddf | preetimaurya1992/programming_practise_C-Interview-question- | sum_of_given_range.cpp | #include<bits/stdc++.h>
using namespace std;
//Write a program to find Sum of numbers in a given range
int main(){
int start,end,i,sum=0;
cout<<"enter the two number"<<endl;
cin>>start>>end;
for(i=start;i<=end;i++){
sum=sum+i;
}
cout<<sum<<endl;
return 0;
} | ALGO | 0.998132 | 3.235557 |
d3f68e5c-37f4-4338-836c-e52c6494d865 | itsaril/ADS | labka1/g.cpp | #include <iostream>
#include <cmath>
#include <vector>
using namespace std;
bool p[1000001];
int n, N = 1000000;
vector<int> v, vv;
int prime(int n) {
for(int i = 2; i <= sqrt(n); i++) {
if(n % i == 0) return false;
}
return true;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0)... | ALGO | 0.999688 | 4.461256 |
85811c0e-164a-4a0d-bbbf-56ab93871ff2 | vidhi-kiet/Data-structure | array/longest array optimal.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run a... | ALGO | 0.999738 | 4.341978 |
b6fbe2ac-2a78-49d0-bc13-3c9f3e4a0b4c | forzenheart/Thinking-In-C-resource | C15/Size.cpp | #include <iostream>
using namespace std;
class NoVirtual {
int a;
public:
void x() const { }
int i() const {
return 1;
}
};
class OneVirtual {
int a;
public:
virtual void x() const {}
int i() const {
return 1;
}
};
class TwoVirtual {
int a;
public:
virtual void x() const {}
virtual int i() const ... | TOOL | 0.892561 | 3.878992 |
c7b2f58a-f753-459e-86a4-d5b204284e0d | DuqueIguro/Estudo-Cpp | Atividades/grupo 1/Q4.cpp | // Fazer um programa em C++ que pergunte um valor em graus Fahrenheit e imprime no vídeo o correspondente em graus Celsius usando as fórmulas que seguem.
// A) Usar uma variável double para ler o valor em Fahrenheit e a fórmula C=(f-32.0) * (5.0/9.0).
// B) Usar uma variável int para ler o valor em Fahrenheit e a fórm... | ALGO | 0.989681 | 5.201659 |
6ec4820b-8c5c-4c9e-979d-9a3928016144 | celestialxevermore/BaekjoonOnlineJudge | Baekjoon/Baekjoon/분해합.cpp | //#include<stdio.h>
//#include<iostream>
//#include<math.h>
//#include<algorithm>
//using namespace std;
//
//int pow(int ten, int cnt) {
// for (int i = 0; i < cnt; i++) {
// ten *= ten;
// }
// return ten;
//}
//
//int main() {
// int N;
// int C;
// cin >> N >> C;
//
// /*int cnt = 0;
// while (N > 0) {
// N /= 1... | ALGO | 0.999937 | 3.775033 |
2c8f53b2-7b3e-4488-83c2-255ed2215a55 | JustinBordage/Flocking | Blit3Dv3/Boid.cpp | #include "Boid.h"
#include "Random.h"
//Externs
extern Sprite* BoidSprite;
extern Random* rng;
//Marcos
#define MAXSPEED 200.f
#define BOIDSCALE 0.3f
#define LERPFORCE 7.f
//Method Prototype
glm::vec2 basicLerp(glm::vec2 towards, glm::vec2 from, float speed);
Boid::Boid(float posX, float posY)
{
//Sets the positio... | ALGO | 0.9973 | 5.628717 |
56013029-b4b5-4d35-9cec-428ef880bcf2 | Alex-Beng/ojs | FuckAlgorithmAnalysis/vjudge/poj3414_Pots.cpp | #include <map>
#include <iostream>
using namespace std;
string idx2op[6] = {"FILL(1)","FILL(2)","DROP(1)","DROP(2)","POUR(1,2)","POUR(2,1)"};
struct status
{
int cA;
int cB;
int prev;
int op;
status() {
cA = cB = 0;
prev = op = -1;
}
status(int A, int B, int pv=-1, int o=-... | ALGO | 0.99994 | 4.250137 |
01e69904-f691-457d-8401-77c38e9744d5 | jqp4/prac-CS-MSU | prac-4-C/up05/up05/mz05-2.cpp | #include <iostream>
#include <vector>
class Pred {
public:
bool operator()(const int x) const {
return x % 2 == 0;
}
};
template <typename T, typename P>
T myfilter(T &sc, P pred) {
T newsc;
auto it = sc.begin();
auto nit = newsc.end();
while (it != sc.end()){
if (pred(*it)) {
... | ALGO | 0.998489 | 5.260092 |
013e74c1-2559-4cf2-9183-b7f4e150c5df | ABUTAYYAB/Programming-Fundamentals | Lab-5/task9cp.cpp | #include <iostream>
using namespace std;
void TimeTravel(int hr, int min, int* hour, int* minute); //it will calculate the time in future and return in hour:minute format
int main()
{
int hr; //variable daclaration
int min;
int hour = 0;
int minute = 0;
cout << "Enter Hours: ";
cin... | ALGO | 0.953946 | 4.7753 |
b9a42c80-8479-4fe4-8de0-596c96549b13 | carzy-zala/leet-by-me | LinkedList/382. Linked List Random Node.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 {
ListNode* h;
int cnt=0;
p... | ALGO | 0.999271 | 5.366096 |
a27f1d15-a25e-4bd1-8577-48559768920c | ShivamSisodiya527/CodeHelp-DSA-Busted-Series-main | Lecture013 Binary Search Interview Questions/firstLastPosition.cpp | #include<vector>
using namespace std;
int firstOcc(vector<int>& arr, int n, int key) {
int s = 0, e = n-1;
int mid = s + (e-s)/2;
int ans = -1;
while(s<=e) {
if(arr[mid] == key){
ans = mid;
e = mid - 1;
}
else if(key > arr[mid]) {//Right me jao
... | ALGO | 0.99995 | 5.528801 |
980e6de7-d12a-402e-9171-ff5b0ed8b172 | ashhek/Leetcode_solution | 0075-sort-colors/0075-sort-colors.cpp | class Solution {
public:
void sortColors(vector<int>& nums) {
int n = nums.size();
int start = 0, mid = 0, hi = n-1;
while(mid<=hi){
if(nums[mid]==0){
swap(nums[start],nums[mid]);
start++;
mid++;
}
else if(nu... | ALGO | 0.999931 | 6.086765 |
c9c3f5bb-b801-4cbe-9c69-27151755efa1 | CaiHuicheng/Project | leetcode/leetcode/剑21_调整数组顺序是奇数在前偶数在后.cpp | class Solution {
public:
vector<int> exchange(vector<int>& nums) {
int hight = 0,low = nums.size()-1;
while(hight<low){
if((nums[hight]&1) != 0){
hight++;
continue;
}
if((nums[low]&1) != 1){
low--;
co... | ALGO | 0.999994 | 5.258148 |
59798ed9-fe69-43e0-ad31-ba620ea41ede | SumitVadhava/CSE---Semester-1 | Lab G-305/Lab 17/A/17-A(1).cpp | #include<stdio.h>
int main(){
int x=10;
int *ptr;
ptr=&x;
printf("Value=%d\n Address=%d",*ptr,ptr);
return 0;
}
| TOOL | 0.967311 | 3.671376 |
8c4f6730-f7db-48a6-b771-e6ae37563585 | ishandutta2007/codeforces | xaohu/normal/1462/F.cpp | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, a, b) for (int i = b - 1; a <= i; i--)
#define vi vector<int>
typedef long long ll;
using namespace std;
const int N = 200200;
int T, n, l[N], r[N], a[N], b[N];
int main() {
cin >> T;
while (T--) {
cin >> n;
rep(i, 0, n)... | ALGO | 0.999882 | 4.144583 |
4ff3bcbd-dd74-4e6b-ac3e-298d0c7a1628 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9844_3.cpp | #include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
inline long long read() {
long long re = 0, k = 1;
char ch = getchar();
while (ch > '9' || ch < '0') {
if (ch == '-') k = -1;
ch = getchar();
}
while (ch <= '9' && ch >= '0') {
re = re * 10 + ch - 48;
ch = getchar();
... | ALGO | 0.999799 | 3.731075 |
12076bbc-2acc-41df-bc50-22fa08bc024b | Ritax2003/GeeksForGeeks-POTD | Medium/Array Pair Sum Divisibility Problem/array-pair-sum-divisibility-problem.cpp |
class Solution {
public:
boolcanPair(vector<int>nums,intk){
// Code here.
intn=nums.size();
if(n%2!=0)returnfalse;
unordered_map<int,int>mp;//for storing remainder
intpair=0;
for(inti=0;i<nums.size();i++){
intrem=nums[i]%k;
if(rem==0){
mp[0]++;
if(mp[0]%2==0){
pair++;
mp[0]=mp[0]-2;
}
}
elseif(mp.find(k-rem)!=mp.en... | ALGO | 0.999907 | 5.460525 |
1b0183a3-e982-4bef-ad19-1419b0accb2d | niveditaprity/LeetCode | Graph/200. Number of Islands.cpp | class Solution {
public:
void numsisland(vector<vector<char>>&grid,int x,int y,int rows,int cols)
{
if(x<0||x>=rows||y<0||y>=cols||grid[x][y]!='1')
{
return;
}
else
{
grid[x][y]='2';
}
numsisland(grid,x+1,y,rows,cols);
numsisland... | ALGO | 0.999961 | 6.179731 |
7d802912-b994-47a5-9901-af3c80a56b3c | fireae/caffe_latte | 3rdparty/eigen/unsupported/doc/examples/MatrixPower_optimal.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
Matrix4cd A = Matrix4cd::Random();
MatrixPower<Matrix4cd> Apow(A);
std::cout << "The matrix A is:\n" << A << "\n\n"
"A^3.1 is:\n" << Apow(3.1) << "\n\n"
"A^3.3 is:\n" << Apow(3.3) << "\n\n"
... | ALGO | 0.998557 | 3.400131 |
7b7b9356-b5a6-4056-a0d0-800770ae5b45 | Walter-Pleitez/RepasoCpp | EstructurasDeDatos/Practicas/Ejercicio1Cola.cpp | #include <iostream>
using namespace std;
struct Nodo{
int elemento;
struct Nodo *siguiente;
};
void Push(Nodo *&, Nodo *&, int);
bool Vacia(Nodo *&frente);
void Pop(Nodo *&, Nodo *&, int &);
int main(){
Nodo *frente = nullptr;
Nodo *final = nullptr;
int continuar = 1, eleccion, input;
do{
... | ALGO | 0.991655 | 4.466468 |
dded7b6f-381b-4c6d-b2ba-b768eac76e5e | MohdAliJasim/C---DSA-Practice-Questions | 503-Next-Greater-Element-II.cpp | class Solution {
public:
vector<int> nextGreaterElements(vector<int>& nums) {
vector<int> res;
int n = nums.size();
for(int i = 0 ;i < nums.size();i++){
int j = i+1;
j = j%n;
while(j != i){
if(nums[i] < nums[j]){
res.pu... | ALGO | 0.999827 | 5.378563 |
ef791c85-5a1a-4da3-ae0f-13acebf84faa | mdbal-lunule/lunule | src/boost/libs/compute/perf/perf_set_intersection.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/set_intersection.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);... | ALGO | 0.984834 | 5.555636 |
5ad5d37c-41a6-4d89-aa7c-51ba379ce699 | SVCE-ACM/A-December-of-Algorithms-2022 | December - 11/C++_MugundhanY.cpp | //Question 11:
#include <bits/stdc++.h>
using namespace std;
int count1(char character[]){
for(int i=0; i<100000; i++){
if(character[i]=='1' || character[i]=='2') return i;
}
return 0;
}
int count2(char character[]){
for(int i=0; i<100000; i++){
if(character[i]=='\0') return i;
}
... | ALGO | 0.995908 | 3.462513 |
a039dc53-b34c-4e24-89c0-2481830f3aaa | salo-002/stilsoft_test | test1_1/test8_1.cpp | #include <iostream>
namespace Constants
{
inline constexpr double pi { 3.14159 };
}
using Degrees = double; Псевдоним для типа double, представляющего градусы
using Radians = double; Псевдоним для типа double, представляющего радианы
Radians convertToRadians(Degrees degrees)
{
return degrees * Constants::pi ... | ALGO | 0.853261 | 6.489259 |
54f651af-66fe-4267-a12e-4949fababfae | MaheshSharan/LeetCode_Automation | solutions/1000-1099/1020.Number of Enclaves/Solution2.cpp | class Solution {
public:
int numEnclaves(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
int dirs[5] = {-1, 0, 1, 0, -1};
queue<pair<int, int>> q;
for (int j = 0; j < n; ++j) {
for (int i : {0, m - 1}) {
if (grid[i][j] == 1) {
... | ALGO | 0.999948 | 6.440346 |
6ecbfecb-d28b-4b72-9768-1e5bb22ab30c | ThanGeo/rasterizer-lib | Rasterizer/src/rasterization.cpp | #include "rasterization.h"
#include <iostream>
namespace rasterizerlib
{
static inline bool checkY(double &y1, double &OGy1, double &OGy2, uint32_t &startCellY, uint32_t &endCellY){
if(OGy1 < OGy2){
return (startCellY <= y1 && y1 <= endCellY + 1);
}else{
return (endCellY <... | ALGO | 0.998245 | 6.03368 |
986ecc20-4c67-4296-9291-5373c7861eb0 | Nimesh-Srivastava/DSA | C++/LeetCode/0350.cpp | class Solution {
public:
vector<int> intersect(vector<int>& nums1, vector<int>& nums2) {
unordered_map<int, int> map1;
unordered_map<int, int> :: iterator it;
vector<int> result;
for(auto c : nums1){
it = map1.find(c);
i... | ALGO | 0.999978 | 5.665311 |
03ea4d46-3f41-4db9-b760-875ffa83aa21 | HarshilSiyani/code | Data Structure and Algorithms HSC/week6_dynamic_programming2/1_maximum_amount_of_gold/knapsack.cpp | #include <iostream>
#include <vector>
using std::vector;
int optimal_weight(int W, const vector<int> &w) {
//write your code here
int current_weight = 0;
for (size_t i = 0; i < w.size(); ++i) {
if (current_weight + w[i] <= W) {
current_weight += w[i];
}
}
return current_weight;
}
int main() {... | ALGO | 0.999996 | 5.67807 |
2a0a77da-8c47-4bae-a37a-c43aaa282242 | shazebsayyad1/Shazeb | p8.cpp | //WAP to accept the number from the user ands find its square using a function
#include <iostream>
using namespace std;
int findsqaure(int n)
{
return n * n;
}
int main(int argc, char const *argv[])
{
int square, number;
cout << "enter the number to find its square" << endl;
cin >> number;
//funct... | TOOL | 0.982456 | 4.184528 |
2f45923d-f886-4c88-a63b-8687e2335eba | print-hi/lyra | lib/eigen/bench/eig33.cpp | #include <iostream>
#include <Eigen/Core>
#include <Eigen/Eigenvalues>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Matrix, typename Roots>
inline void computeRoots(const Matrix& m, Roots& roots)
{
typedef typename Matrix::Scalar Scalar;
con... | ALGO | 0.999512 | 5.666831 |
e2f52b42-b9d8-419f-94e4-7c3d9c40ac87 | riyad4567/DSA-1 | 2005053-offline6(L2,T1)/assignment6.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<fstream>
#include<string>
using namespace std;
class Greedy{
int *arr;
int cap;
int count1;
vector<pair<int,int>>vp;
public:
Greedy(int n)
{
cap=n;
//vector<pair<int,int>>vp(cap);
vp.resize(cap);
a... | ALGO | 0.999905 | 3.992207 |
738929ad-81db-4cdc-b2cb-f4f03d7aa7d8 | Ajla115/Full-C-Plus-Plus-Course | Lab13 - Recursion/Task13.cpp | //
// Created by Ajla Korman on 8. 6. 2025..
//
#include <iostream>
using namespace std;
// Recursive function to find GCD using Euclidean algorithm
int gcd(int a, int b) {
if (b == 0)
return a; // Base case: GCD found
return gcd(b, a % b); // Recursive case
}
int main() {
int num1, num2;
cou... | ALGO | 0.999913 | 6.539982 |
11b21c0d-b4f7-47d0-a2e5-2406e30cbc83 | TanishqBhargava/Hackerearth | Data Structures/Advanced Data Structures/Trie (Keyword Tree)/Minimize Trie Nodes.cpp | /*========================*\
| ID: tanishqbhargava2509 |
| LANG: C++ |
\*========================*/
//Tanishq Bhargava
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<pair<int, int>> v;
for(int i = 0; i < n; i++)
{
int s = 0;
for... | ALGO | 0.999718 | 3.5144 |
1693a3b1-34bd-4b7b-b24d-319d93d44457 | minnce/codechef | sub1000/race.cpp | #pragma GCC optimize("O2,no-stack-protector,unroll-loops,fast-math")
#include <iostream>
#include <bits/stdc++.h>
#define ll long long
#define PB push_back
#define F first
#define S second
#define uset unordered_set
#define umap unordered_map
#define MP make_pair;
#define vt vector
#define all(x) begin(x), end(x)
#defi... | ALGO | 0.999872 | 3.996106 |
f658017f-0727-4fb7-b1f7-abf2d8669b6b | NoyaCai1110/CPU-Based-Ray-Tracer | HW4/main.cpp | #include <chrono>
#include <iostream>
#include <opencv2/opencv.hpp>
std::vector<cv::Point2f> control_points;
void mouse_handler(int event, int x, int y, int flags, void *userdata)
{
if (event == cv::EVENT_LBUTTONDOWN && control_points.size() < 4)
{
std::cout << "Left button of the mouse is clicked -... | ALGO | 0.996712 | 5.748984 |
4f9d6447-1331-4f66-9027-d66f6aa3fde3 | DotOS-Extended/android_frameworks_av | media/libstagefright/codecs/amrwb/src/isf_extrapolation.cpp | /*
------------------------------------------------------------------------------
Filename: isf_extrapolation.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-------------------------------------------------------------------... | ALGO | 0.999592 | 5.451385 |
828faed8-dd85-4b30-812b-d30912a04bea | logicallaw/lecture_data_structure | final_labs/Day6_lab/Day6_P2_H.cpp | #include <iostream>
#include <string>
using namespace std;
class Queue{
private:
int* array;
int N;
int f;
int r;
int n;
public:
Queue(int size) : N{ size }, array{ new int[size] } {
f = 0;
r = 0;
n = 0;
for(int i{ 0 }; i < size; i++){
int x;
... | ALGO | 0.999835 | 4.156971 |
f33d9a36-9a0b-4e39-8ae8-e4aaf869f243 | softbalanced/core | src/script/interpreter.cpp | #include "interpreter.h"
#include "primitives/transaction.h"
#include "crypto/ripemd160.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
#include "pubkey.h"
#include "script/script.h"
#include "uint256.h"
typedef std::vector<unsigned char> valtype;
namespace {
inline bool set_success(ScriptError* ret)
{
i... | ALGO | 0.900839 | 5.606839 |
d8082c01-7f1d-4601-b9b9-c72c24efd15d | Manav-hub-coder/LEETCODE-SOLUTION | 167-two-sum-ii-input-array-is-sorted/167-two-sum-ii-input-array-is-sorted.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
//vector<int>ans;
int n=numbers.size();
int start=0;
int end=n-1;
// if(start==end&&numbers[start]==target)
// {
// return [start];
// }
// int n=numbers.size(... | ALGO | 0.999706 | 6.136271 |
81290201-fd8e-4edc-a566-6b61c8a7fb1d | chapuni/llvm-project-legacy | libcxx/test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval_param.pass.cpp | // <random>
// template<class RealType = double>
// class extreme_value_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <cassert>
#include <vector>
#include <numeric>
template <class T>
inline
T
sqr(T x)
{
return x * x;
}
int main()
{
... | TEST | 0.894753 | 5.095325 |
16836096-b279-4c2e-8a22-470a2594ca76 | TF2-Community-Edition-Dev-Team/Team-Fortress-2-Community-Edition | src/game/client/splinepatch.cpp | #include "mathlib/vmatrix.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//-----------------------------------------------------------------------------
// Catmull rom blend weights
//-----------------------------------------------------------------------------
static VMat... | ALGO | 0.920676 | 4.758902 |
429db85c-4daa-4eed-aa25-639859cc924e | moondemon68/cp | ITEBE/1Div3/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main () {
int n,ans=0;
cin >> n;
string s;
cin >> s;
for (int i=0;i<n;i++) {
for (int j=i+1;j<n;j++) {
int u=0,d=0,l=0,r=0;
for (int k=i;k<=j;k++) {
if (s[k]=='U') u++;
if (s[k]=='D') d++;
if (s[k]=='L') l++;
if (s[k]=='R') r++;
}
if... | ALGO | 0.99998 | 4.00004 |
51a47235-da38-4196-8069-20d28dbff958 | ameya28-dev/testcpp | LinkedList/linkedlistproblems.cpp | #include <iostream>
class Node
{
public:
int data;
Node *next;
Node(int val)
{
data = val;
next = nullptr;
}
};
void insertNodeAtTail(Node *&head, int val)
{
Node *newnode = new Node(val);
if (head == nullptr)
{
head = newnode;
return;
}
Node ... | ALGO | 0.999719 | 5.407818 |
735d3d71-9d57-4a17-9e30-896f3b73bb74 | lwlshawn/Algolab-HS24 | returnofthejedi.cpp | #include <iostream>
#include <vector>
#include <tuple>
#include <queue>
#include <algorithm>
#include <boost/pending/disjoint_sets.hpp>
typedef std::tuple<int, int, int, bool> T;
void bfs(int root, std::vector<std::vector<std::pair<int, int>>>& tree_edges, std::vector<std::vector<int>>& dist, int n) {
std::vector<b... | ALGO | 0.999498 | 4.715358 |
e00135d8-0fcd-4369-98ea-c751b57db9aa | shivamkasaudhan/DailyDSA-2024 | Week-1/CountingSort.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
#define RANGE 255
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
//Function to arrange all letters of a string in lexicographical
//order using Counting Sort.
string countS... | ALGO | 0.999958 | 6.035575 |
f8d7e8ed-bf95-47d6-aca3-3536d351a0a6 | mahtvakanksha/dataSt | phase1/basics/complements.cpp | #include <iostream>
#include <math.h>
using namespace std;
void displayBits(int x)
{
int mask;
for (int i = 31; i >= 0; i--)
{
mask = 1 << i;
cout << ((mask & x) ? 1 : 0);
if (i % 4 == 0)
cout << " ";
}
cout << endl;
}
void negComplement(int x)
{
// convert ... | ALGO | 0.99968 | 5.005815 |
302b6a7b-ec70-446b-9bc0-420dbf550eca | matszpk/native-boinc-for-android | src/boinc-6.10.58/lib/unix_util.cpp | #include "unix_util.h"
// Note. This already has an ifdef around it. If it is causing problem
// then HAVE_SETENV should be defined in your configuration files.
#ifndef HAVE_SETENV
#include <vector>
#include <cstring>
#include <cerrno>
#include <cstdlib>
static std::vector<char *> envstrings;
// In theory setenv()... | TOOL | 0.919217 | 5.633065 |
20ac0786-56cb-4700-b6d7-3e9cf0fbe8d4 | preethamd98/My-Solutions | binary-tree-upside-down/binary-tree-upside-down.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999987 | 6.443415 |
ff3542de-658b-492e-a694-fe5decc0c942 | ArmanKurmanaliev/OOP2018 | Desktop/BIBLIATEKA/allLab/5lab/1/aa.cpp | #include <iostream>
using namespace std;
int main()
{
int a[101000],m,n;
cin>>n;
for (int i=0; i<n; i++)
{
cin>>a[i];
}
for (int i=0; i<n; i++)
{
if(i%2==0) cout<<a[i]<<" ";
}
return 0;
} | ALGO | 0.999499 | 3.205215 |
b4da9f90-e33a-4f9a-b9cd-5cd527d7a24b | PabloFuentes97/CPP09 | ex02/PmergeMe.cpp | #include "PmergeMe.hpp"
//-------------------------UTILS-------------------------
const char *invalidArg::what() const throw ()
{
return ("Invalid arg!");
}
int charcmpDict(char c, std::string dict)
{
int dictSize = dict.size();
int same = 0;
for (int i = 0; i < dictSize; i++)
{
if (c == d... | ALGO | 0.999201 | 4.821331 |
58c9c1fb-99bd-49ad-b60c-b80104585c79 | ishandutta2007/codeforces | hitman623/normal/449/D.cpp | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mi map<int,int>
#define mii map<pii,int>
#define all(a) (a).begin(),(a).end()
#define x first
#d... | ALGO | 0.999984 | 3.888029 |
d6f6eda7-8931-46eb-9978-de912f10d701 | WSM-simon/CP-problems | CCC/CCC 16/CCC 16 S2/S2.cpp | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
using namespace std;
int N, M;
vector<int> v1, v2;
void solve2()
{
sort(v1.begin(), v1.end());
sort(v2.begin(), v2.end());
reverse(v1.begin(), v1.end());
int ans = 0;
for (int i = 0; i < M; ++i)
ans += max(v1[i], v2... | ALGO | 0.999997 | 3.533932 |
2a6b2674-c4ec-4595-9344-15baad7c7e5f | Nelson-Wang-02/csi-2372-labs | lab1/myfile3a.cpp | /*myfile3a.cpp : Ex3a a1 CSI2372A*/
#include <iostream>
# include <vector>
using namespace std;
/* Index search selector function that returns the index of the max value of an array
**
*/
int searchIndex(vector<int> T, int imax) {
if (T.size() < imax - 1) {
cout << "Erreur ! Tableau trop petit ! " << endl;
retu... | ALGO | 0.999959 | 4.6201 |
38b00c28-ebc7-488c-bc9b-322d7075dfaa | MUHAMMET-UZUN/DataStructureLearning | ReverseLinkedList/b11-201.cpp | #include <iostream>
#include <stdlib.h>
struct Node
{
int data;
struct Node *next;
} *first = NULL;
void Create(int A[], int n)
{
int i;
struct Node *t, *last;
first = (struct Node *)malloc(sizeof(struct Node));
first->data = A[0];
first->next = NULL;
last = first;
for (i = 1; i <... | ALGO | 0.999802 | 4.191815 |
ae84b534-60c9-48ca-b6ba-8e181e81a0e5 | Fabayu/Leetcode-problems | 2007-find-original-array-from-doubled-array/2007-find-original-array-from-doubled-array.cpp |
class Solution {
public:
vector<int> findOriginalArray(vector<int>& changed) {
int n = changed.size();
if (n % 2 == 1) return {};
sort(changed.begin(), changed.end());
vector<int> ans;
map<int, int> mp;
for (int i = 0; i < n; i++) {
mp[changed[i]]++;... | ALGO | 0.999976 | 5.342001 |
3bcbcac0-5877-4fcd-bbc3-a5fccf7a13dc | SnehaKumari3/codeforces_practice_problems | c_icpc.cpp | #include <bits/stdc++.h>
#include "cmath"
#include <cmath>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef double db;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;... | ALGO | 0.999713 | 4.307178 |
dc96cd16-5603-44ee-b817-208f5bb8a4da | ArrolCardoz/CompetitiveProgramming | Kattis/Weekly Club/fbiuniversal.cpp | #include <bits/stdc++.h>
using namespace std;
int checkChar(string str, unordered_map<char, int> base27) {
// cout << (2 * base27[str[7]]) << "+" << (4 * base27[str[6]]) << "+"
// << (5 * base27[str[5]]) << "+" << (7 * base27[str[4]]) << "+"
// << (8 * base27[str[3]]) << "+" << (10 * base27[str[2... | ALGO | 0.999322 | 4.677825 |
0ec6d279-9243-4939-8dec-d00f26c41397 | a-mishra16/Laboratory-14.2 | Laboratory 14.2.cpp | /*
* Program: Laboratory 14.2
* Author: Aanika Mishra
* Date: 12-12-2024
* Description: This program intakes a string and a chosen specified character
* to count and look for then returns how often the character appears in the
* string. The program then counts and returns the number of repeated characters
* in the str... | ALGO | 0.996245 | 5.416267 |
5cdd68f9-66f9-4dac-ad89-6c316fb67bb3 | wangtongxue-369/xcpc_Code_file | file/codeforces/race2/1021_div2/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define INF 0x3f3f3f3f
#define PII pair<ll, ll>
const ll mod = 1e9 + 7;
const ll MAXN = 500005;
const ll base1 = 131;
const ll base2 = 127;
ll _ = 1, n, m, ans = 0, a[MAXN], f[MAXN];
void solve()
{
cin >> n;
map<ll... | ALGO | 0.999973 | 4.497312 |
8215c6f7-57ea-44a3-9314-76e714e32921 | sourcesync/NYU | NN_Skeleton_Tracking/pse_demo/george_archive/Conv3DToolbox/modules/gwt/cuMisc/cuRand.cpp | #include <stdio.h>
#include <string.h>
#include <stdarg.h>
#ifdef UNIX
#include <stdint.h>
#endif
#include "mex.h"
// CUDA
#include "cuda.h"
#include "cuda_runtime.h"
#include "GPUmat.hh"
#include "GPUkernel.hh"
// RAND
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <fstream>
#include <iostrea... | TOOL | 0.940702 | 4.936061 |
e3b28e31-bede-40cc-a1d0-627fd6e554bf | abhayanigam/Programing_Questions | Questions_In_Cpp/ArraysQuestions/IN_CPP/MinimumPlatforms.cpp | /**
* Minimum Platforms
Given arrival and departure times of all trains that reach a railway station.
Find the minimum number of platforms required for the railway station so that no train is kept waiting.
Consider that all the trains arrive on the same day and leave on the same day.
Arrival and depart... | ALGO | 0.999858 | 5.857242 |
4a6a372d-ba59-4cf3-a4e0-72b51b677c67 | kavya-k243/100-Days-of-Code | Day 94/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
private:
// dfs traversal function
void dfs(int node, vector<int> adjLs[], int vis[]) {
// mark the more as visited
vis[node] = 1;
for(auto it: adjLs[node]) {
if(!vis[it]) {
dfs(it, adjLs, vi... | ALGO | 0.99998 | 5.928202 |
6f46b72b-6226-437e-90de-37b5a0b61066 | BramhaBajannavar/ADA | prims.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
#define MAX 100
int minKey(const vector<int> &key, const vector<bool> &mstSet, int V) {
int min = INT_MAX, min_index;
for (int v = 0; v < V; v++)
if (!mstSet[v] && key[v] < min)
min = key[v], min_index = v;
... | ALGO | 0.99989 | 5.615922 |
4f84dba5-1e7b-4a53-a48f-e031a9f7ef54 | abelkm99/competitive_programming | 2013-detect-squares/2013-detect-squares.cpp | class DetectSquares {
public:
int dp[1001][1001];
DetectSquares() {
memset(dp, 0, sizeof(dp));
}
void add(vector<int> point) {
int x = point[0], y = point[1];
dp[x][y]++;
}
int count(vector<int> point) {
// if he current point was at 0,1
int x = point... | ALGO | 0.999252 | 5.622518 |
1dcbbf50-4c0c-4d1e-a298-719f4aea3a26 | ishandutta2007/codeforces | -armageddon-/normal/1428/A.cpp | //Original Code:
//#include <self/utility>
//#include <self/debug>
//using namespace std;
//
//inline void solve()
//{
// int sx,sy,ex,ey;
// scanf("%d%d%d%d",&sx,&sy,&ex,&ey);
// int x=mabs(sx-ex);
// int y=mabs(sy-ey);
// if(x && y)
// {
// cout<<x+y+2<<endl;
// }
// else if(x || y)
// ... | ALGO | 0.999114 | 4.342185 |
58eb024d-b2a1-4ccd-be4e-0818a6f74872 | hayashi-ryo/atcoder | docker/problems/cpp/ABC/abc366/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, x) for (int i = 0; i < (x); i++)
int main()
{
int N;
cin >> N;
vector<string> S(N);
rep(i, N) cin >> S[i];
int maxLength = 0;
rep(i, N) maxLength = max(maxLength, (int)S[i].size());
vector<string> T(maxLength, string(N, '... | ALGO | 0.999957 | 3.932663 |
b6a5e39a-194c-4bc7-903d-bf6bfe469dbe | geoffgeorgein/CP | 1/edu114B.cpp | #include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define F first
#define S second
#define ll ... | ALGO | 0.999452 | 4.157633 |
7c2e8c8f-4e2d-48d4-afeb-ba71e6b546eb | bert13069598/codetree-TILs | 240607/오목의 승패/concave-victory-and-defeat.cpp | #include <iostream>
using namespace std;
bool win;
void dfs2(int n, int now, int *map,int team,int i,int d){
if(d==5)
win=true;
else
win=false;
int dxy[8]={1,-1,n,-n,n+1,n-1,-n+1,-n-1};
int next=now+dxy[i];
if(next<0||next>=n*n)
return;
if(abs(dxy[i])==1&&now/n!=next/n)
... | ALGO | 0.999736 | 3.763319 |
4bc3f45a-bb8a-4496-9cf8-d5e84021addb | Mehedi-Hasan-Rabbi/Online-Judge-Solution | GeeksForGeeks Practice/Deque Implementations.cpp | #include <bits/stdc++.h>
using namespace std;
void push_back_pb(deque<int> &dq, int x) {
dq.push_back(x);
}
void pop_back_ppb(deque<int> &dq) {
if (!dq.empty())
dq.pop_back();
else return;
}
int front_dq(deque<int> &dq) {
if (!dq.empty())
return dq.front();
else return -1;
}
void... | ALGO | 0.992982 | 4.641479 |
c6c20419-afaa-4e18-bf11-c520ccf1ba6b | StavrosChryselis/hackerrank | Implementation/Append and Delete.cpp | /*
****************************************************************
****************************************************************
-> Coded by Stavros Chryselis
-> Visit my github for more solved problems over multiple sites
-> https://github.com/StavrosChryselis
-> Feel free to email me at <EMAIL>
****... | ALGO | 0.999993 | 3.815671 |
f7c7162e-fae3-419e-a54c-441186bdda1f | ankishb/Algorithm-DS-Problems | dp/path_in_the_grid.cpp |
/*
As we can go from (i,j) to 1. (i+1,j), (i+1,j+1), (i+1,j-1),
we will check for three position in the top row(backword) to update current cell.
Note: backword approach will give us optimal solution(this is dp)
*/
#include <bits/stdc++.h>
using namespace std;
int solve(){
int n;
cin>>n;
vector<vector<in... | ALGO | 0.999961 | 5.213834 |
2c9068f9-8b47-40ea-9709-e0562e8a92b8 | hk-117/UVa_solves | vol 6/p673.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
scanf("%d",&n);
getchar();
while(n--){
string in;
stack<char> S;
getline(cin,in);
for(int i=0;i<in.size();i++){
if(in[i]=='('||in[i]=='[')
S.push(in[i]);
else{
... | ALGO | 0.999889 | 4.324503 |
e9cbd7c8-f443-4ef9-86f9-8560330b3602 | megarage9000/GarageEngine | GarageEngineSolution/GarageMathLibrary/GarageLinearTransformations.cpp |
#include "GarageLinearTransformations.h"
namespace GarageLinearAlgebra {
Mat4 translate(float x, float y, float z) {
Mat4 transform_matrix = Mat4(IDENTITY_4, 16);
transform_matrix[0][3] = x;
transform_matrix[1][3] = y;
transform_matrix[2][3] = z;
return transform_matrix;
... | ALGO | 0.880753 | 6.830003 |
24f476a6-12b4-42f7-aa64-7318fb9e1d31 | Manik-Aggarwal/Leetcode | k-th smallest element in BST - GFG/kth-smallest-element-in-bst.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// 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 ... | ALGO | 0.999955 | 6.467062 |
bfa1ea02-a072-4f6f-92b4-bb86788dd81e | Yush1nk1m/Problem-Solving | BOJ/11050.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> bin_coef;
int N, K, i, j;
int main(int argc, char* argv[]) {
cin >> N >> K;
bin_coef.resize(N + 1);
for (i = 1; i <= N; i++) {
bin_coef[i].resize(i + 1, 0);
bin_coef[i][0] = 1;
}
bin_coef[1][1] = 1;
... | ALGO | 0.999957 | 4.341464 |
c50a43d5-c761-4e05-b061-c44c34e3de70 | Sixzeroo/CodingInterviews | C++/039-1.cpp | class Solution {
public:
// 后序遍历思想
bool IsBalanced(TreeNode* thisNode, int & h)
{
if(thisNode == NULL)
{
h = 0;
return true;
}
int lh, rh;
bool lb = IsBalanced(thisNode->left, lh);
bool rb = IsBalanced(thisNode->right, rh);
h = ... | ALGO | 0.999946 | 5.905442 |
7150c933-4027-4487-b913-e5a45130a7fe | noahjonesx/justForFun | fizzbuzz.cpp | #include <iostream>
#include <limits> //allows 'numeric_limits' in clearCin function
using namespace std;
//clear cin method - call to execute
//clears error flag after invalid user input
// ( such as alphabetic characters or !@#$%^&* )
void clearCin() {
cin.clear();
//sets streamsize to clear MAX amount of in... | TOOL | 0.993448 | 4.168265 |
4f183e9a-5898-448d-95b7-d6229f13efb0 | WingsOSab/android_frameworks_av | media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_1St_2i_D16C31_SAT.cpp | /**********************************************************************************
INCLUDE FILES
***********************************************************************************/
#include "LVC_Mixer_Private.h"
#include "LVM_Macros.h"
#include "ScalarArithmetic.h"
void LVC_Core_MixHard_1St_MC_float_SAT(Mix_Priva... | ALGO | 0.902854 | 5.177013 |
1db36201-0435-4dc2-bb5b-3692eb982194 | Sanober494/cardpage | 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 |
baf447da-3149-4cb9-873f-08a643af7402 | jordirocha/FIB | EXAMENS_DE_P1/CONTROLS_P1/control_c402_d.cpp | #include <iostream>
using namespace std;
string gira(string s) {
string temp;
for (int i = s.length() - 1; i >= 0; i--) temp += s[i];
return temp;
}
int main() {
string s1, s2;
while (cin >> s1 >> s2) {
if (s1 == s2 or gira(s1) == s2) cout << "yes" << endl;
else cout << "no" << end... | ALGO | 0.999949 | 4.777864 |
029b21a9-0589-4ec6-914d-2fbfd0f51532 | PoWeiChiao/Cpp | DynamicProgramming/HouseRobber.cpp | #include <vector>
// You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and it will automatically contact the police if two adjacent hou... | ALGO | 0.999966 | 5.951352 |
dd6eb801-fd3a-441b-aa0e-219b82207e30 | moeenuddin-ahmad/check | min.cPP | #include<bits/stdc++.h>
using namespace std;
int main(){
int test_case, length;
cin >> test_case;
for (int x = 0; x < test_case; x++)
{
cin >> length;
int arr[length];
int min_result = INT_MAX;
for(int i = 0; i < length; i++){
cin >> arr[i];
}
for (int i = 0; i <... | ALGO | 0.999273 | 3.891205 |
e1f713d6-6594-4a60-84c0-9825ba94c45b | tk-yoshimura/TensorShaderAVX | TensorShaderAvxBackend/Indexer/argmin.cpp | #include "../TensorShaderAvxBackend.h"
using namespace System;
void argmin(unsigned int length, unsigned int channels, float* src_ptr, float* dst_ptr) {
for (unsigned int n = 0; n < length; n++) {
unsigned int idx = 0;
float vmin = src_ptr[channels * n];
for (unsigned int i = 1; i... | ALGO | 0.988879 | 5.636719 |
3dd57ea9-87a5-413a-a8a9-de7766037c69 | xiewende/CPlusPlus_Algorithm | string/Offer2-016.cpp | // 剑指 Offer II 016. 不含重复字符的最长子字符串
// 解题思路:双指针+哈希记录
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<unordered_map>
using namespace std;
int lengthOfLongestSubstring(string s) {
int len = s.length();
// vector<int> visited(26, 0);
unordered_map<char, int> visited;
int... | ALGO | 0.999808 | 5.963531 |
2febc638-4407-481c-84be-0043834dd6b2 | donzoru/GN-template-demo | buildtools/third_party/libc++/trunk/test/std/containers/sequences/forwardlist/forwardlist.ops/sort_pred.pass.cpp | // <forward_list>
// template <class Compare> void sort(Compare comp);
#include <forward_list>
#include <iterator>
#include <algorithm>
#include <vector>
#include <functional>
#include <random>
#include <cassert>
#include <iostream>
#include "test_macros.h"
#include "min_allocator.h"
std::mt19937 randomness;
struc... | TEST | 0.959037 | 6.502649 |
06fdb613-fead-47c9-a4d6-5d1919257b13 | NILAVARASAN-M/cpp-Fundamentals-A-Beginner-s-Guide | 12_map_1/initilizing maps/3_initiz.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
pair<string,string>old_arr[] =
{
make_pair("Ground", "Grass"),
make_pair("Floor", "Cement"),
make_pair("Table", "Wood")
};
int n = (sizeof(old_arr) /
sizeof(old_arr[0]));
map<string, string> New_Map(old_arr, old_arr + n);
// if vector, then we pass ... | ALGO | 0.998011 | 4.413272 |
191c8ca5-7cec-4eaa-b3e0-fdbb9fb02883 | bsc-loca/PQC-High-Volume-CRYSTALS | acc_experiments/ML/ML-DSA/verification/src/c++/run.cpp | #include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sign.h"
#include "randombytes.h"
#if defined(TIME) || defined(BENCH)
#include "ktime.hpp"
struct s_time etime, etime2;
#endif
#ifdef U280
#include "kset.hpp"
#endif
#ifdef VERIFY
#include "kverify.hpp"
#endif
unsigned int packn;
... | TOOL | 0.871242 | 5.918849 |
3078a403-dbde-4927-85dc-cfd07cbd6584 | ip99202/Algorithm | 최단 경로 알고리즘/플로이드 와샬/10159_저울.cpp | #include<iostream>
using namespace std;
int arr[200][200];
int n, m;
int main() {
cin >> n;
cin >> m;
for (int i = 0; i < m; i++) {
int x, y;
cin >> x >> y;
arr[x][y] = 1;
}
for (int k = 1; k <= n; k++) {
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
if (arr[i][k] && arr[k][j])
... | ALGO | 0.999975 | 3.036348 |
d669f50c-09a6-4346-add9-799002980d42 | zackluckyf/Project-Euler | problem10/problem10/main.cpp | #include <iostream>
#include <cmath>
int main(int argc, const char * argv[])
{
long long sum(2);
bool prime = true;
for (int i = 3; i < 2000000; i+= 2)
{
prime = true;
for (int j = 1; j <= sqrt(i); j+=2)
{
if (i % j == 0 && j != 1)
{
prime... | ALGO | 0.999664 | 4.806738 |
af9b6f0d-0894-4636-9c43-c92825da5ab7 | sjet47/n2t | projects/07/VMtranslator/src/utility.cpp | #include "utility.h"
void stringSplit(const std::string _String, const char _Char, std::vector<std::string>& _SubStrings)
{
int start = 0, length = 0;
_SubStrings.clear();
for(auto i = _String.begin(); i != _String.end(); ++i)
{
if(*i == _Char)
{
if(length == 0)
... | TOOL | 0.871167 | 4.122522 |
1d8320c2-a4e4-4886-a9fd-82d1c4087ff4 | Michael-Ma/Coding-Practice | LeetCode/MaxPointsOnALine.cpp | #include <sstream>
#include <stdio.h>
#include <string>
#include <cstring>
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <cfloat>
//#include <unordered_map>
using namespace std;
Definition for a point.
struct Point {
int x;... | ALGO | 0.999537 | 5.089829 |
97cfd264-8d01-4493-9439-d34f1142a0cf | abhi-9-kumar/Dsa-for-placements | linkedlist/deletemiddle.cpp | class Solution {
public:
ListNode* deleteMiddle(ListNode* head) {
// if (!head || !head->next) { // Check if the list is empty or has only one node
// delete head;
// return nullptr;
// }
// int n = 0;
// ListNode* temp = head;
// // Count the total... | ALGO | 0.999186 | 6.572416 |
50630eee-0db3-466d-a080-5aba13cfe4d2 | maximrufed/mipt_hw_tp_project | libs/box2d/src/dynamics/b2_edge_circle_contact.cpp | #include "b2_edge_circle_contact.h"
#include "box2d/b2_block_allocator.h"
#include "box2d/b2_fixture.h"
#include <new>
b2Contact* b2EdgeAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->Allocate(sizeof(b2EdgeAndCircleContact));
re... | TOOL | 0.973581 | 6.81621 |
c21036f9-b945-4ed1-9100-0d3cdd93369c | WHUCodingAndOpen/OpenCourseResources | 专业必修课/程序设计D/实验/实验代码/Chapter_3/3-10.cpp | #include<iostream>
using namespace std;
int findGCD(int a, int b);
int findLCM(int a, int b);
int main() {
int num1 = 1024, num2 = 2526;
cout << "请输入第一个整数: 1024" << endl;
//cin >> num1;
cout << "请输入第二个整数: 2526" << endl;
//cin >> num2;
cout << "最大公约数是: " << findGCD(num1, num2) << endl;
co... | ALGO | 0.957389 | 3.511123 |
9d725e39-df5b-47ec-80c3-638b9c4166f4 | CalvinNeo/ACM | SRC/njust2016.A.cpp | //#include <iostream>
//#include <fstream>
//#include <vector>
//#include <queue>
//#include <cstring>
//#include <string>
//#include <algorithm>
//#include <stack>
//#include <functional>
//#include "stdlib.h"
//#include "time.h"
//#include <set>
//#include <map>
//#include <numeric>
//
//#define INF 800
//using nam... | ALGO | 0.99986 | 4.585784 |
b98c3ec6-5b2d-4677-8f10-1e2159d7cf7d | Sandigupta/AlgoZeneth_Premium- | Prefix Sum Concept/sum_of_ele_betweeen_two_index.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> calculatePrefixSum(const vector<int>& arr) {
int n = arr.size();
vector<int> prefixSum(n, 0);
prefixSum[0] = arr[0];
for (int i = 1; i < n; ++i) {
prefixSum[i] = prefixSum[i - 1] + arr[i];
}
return prefixS... | ALGO | 0.999922 | 6.32656 |
d4b07c86-48e9-437e-afdf-af0a628c195d | kamrulashraf/Vjudge-mixed- | CodeForces/205A/10393551_AC_124ms_9136kB.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 1000005
int a[N];
int main()
{
int n;
scanf("%d",&n);
bool flag = 0;
map < int , int > mark;
int save = 0, mmin = 1e9+3;
for(int i = 0 ; i< n ; i++){
int temp;
scanf("%d",&temp);
a[i] = temp;
mark[t... | ALGO | 0.999951 | 3.48792 |
13b6feaa-b890-42e4-a2ec-77aa96024451 | ishandutta2007/codeforces | yancouto/normal/730/E.cpp | #include <bits/stdc++.h>
using namespace std;
int score[110];
int add[110];
int ev(int id1,int p1,int id2,int p2){
if(p1 > p2)
return 1;
if(p1 < p2)
return 0;
if(id1 < id2)
return 1;
return 0;
}
main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d%d",score+i,add+i);
int ans = 0;
... | ALGO | 0.999843 | 3.317419 |
7fd6b072-ae5f-4cc6-8d42-70e40dea5d4e | reyadussalahin/problem-solving | dynamic_programming/lcs/loj/F1033/Solution.cpp | // problem: http://lightoj.com/volume_showproblem.php?problem=1033
// contest:
// problem name: Generating Palindromes
// author: reyad
#include <bits/stdc++.h>
using namespace std;
#define N 128
int main() {;
char s[N], r[N];
int dp[N][N];
int tc;
scanf("%d", &tc);
for(int cc=0; cc<tc; cc++) {
scanf("%s",... | ALGO | 0.999924 | 4.253166 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.