uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d25b7768-65cf-439b-b0ab-bad3828315de | yukikamome316/atcoder-archive | abc344/abc344_d_51078137_AC.cpp | /*
* Author: yukikamome316
* Submission URL: https://atcoder.jp/contests/abc344/submissions/51078137
* Submitted at: 2024-03-09 22:08:26
* Problem URL: https://atcoder.jp/contests/abc344/tasks/abc344_d
* Result: AC
* Execution Time: 2 ms
*/
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n)... | ALGO | 0.999837 | 5.187565 |
a6aff15d-f613-462d-959f-4ba7bf03b95e | 192210154/DATA-STRUCTURES | factorial using recursion.cpp | #include <stdio.h>
#include<conio.h>
int factorial(int);
int main()
{
int n,fact;
printf("Enter a positive integer: ");
scanf("%d", &n);
fact= factorial(n);
printf("Factorial of %d = %d",n, fact) ;
return 0;
}
int factorial(int n)
{
if(n==1)
return 1;
else
return n*factorial(n-1);//recursion function
}
| ALGO | 0.999457 | 3.779279 |
1e508da1-6f16-42b1-a687-5113a5475e98 | morris821028/UVa | volume009/941 - Permutations.cpp | #include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main() {
int t, i, j, k;
long long f[21] = {1, 1}, p;
char str[30];
for(i = 2; i <= 20; i++)
f[i] = f[i-1]*i;
scanf("%d", &t);
while(t--) {
scanf("%s", str);
int n = strlen(str);
... | ALGO | 0.999977 | 3.385487 |
ceeac492-ef2a-4ea6-89a1-114c070fc457 | mateus1028/C | B1/Trabalho de C/Exercicio4.cpp | #include<iostream>
using namespace std;
int main()
{
setlocale(LC_ALL,"Portuguese");
int Idade=0;
cout<<"Digite idade para saber se necessario ir votar:\n";
cin>>Idade;
if(Idade<16)
cout<<("No eleitor, ainda no pode votar");
else{
if(Idade < 18)
cout<<("Eleitor, voc no p... | ALGO | 0.978293 | 4.172936 |
8201a6de-34e2-4ba6-99f0-d31b03d6228b | NeziheSozen/Udacity-CPP-Nanodegree-Build-a-System-Monitor | src/linux_parser.cpp | #include <dirent.h>
#include <unistd.h>
#include <string>
#include <vector>
#include <sstream>
#include <numeric>
#include <fstream>
#include <iostream>
#include "linux_parser.h"
using std::stof;
using std::string;
using std::to_string;
using std::vector;
using std::istringstream;
using std::accumulate;
using std::... | TOOL | 0.927885 | 4.405828 |
9de4ad25-4b1d-4fc6-a63b-fc12d6dfd57b | Anmol-Sri/Competitive-Environment | CSES/32.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int n;
void solve(){
cin>>n;
ll arr[n];
ll sum=0;
ll mx=0;
for(ll &i:arr) cin>>i,sum+=i,mx=max(mx,i);
cout<<max(sum,2*mx)<<"\n";
return ;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(0);
/* #ifnde... | ALGO | 0.999771 | 3.829607 |
84a51cbd-ed42-4514-ad37-aef529338530 | dalerank/caesaria-game | source/core/spline.cpp | #include <algorithm>
#include <vector>
using namespace std;
#include "spline.hpp"
#include "core/math.hpp"
typedef std::vector< double > vd_t;
Spline::Spline(vd_t &x, vd_t &y)
{
myX = x;
myY = y;
if( ! IsInputSane() )
return;
int n = x.size()-1;
vd_t a;
a.insert(a.begin(), y.begin(... | ALGO | 0.998969 | 4.879868 |
23ffc017-03a6-4341-8d0a-854d9bf3accd | Automatic28m/flutter-app-demos | news_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.999004 | 6.76073 |
bc7926a6-8667-446a-a08a-52ba2f27e365 | MCHIHANA/BSC-COM-01-21-COM221 | LAB_TASK_7.0/cppclassesQuestion3/MAIN.cpp | #include <iostream>
#include <cmath>
namespace shapes {
class Square {
private:
float sideLength;
public:
Square() : sideLength(0) {}
Square(float side) : sideLength(side) {}
~Square() {}
void setSideLength(float side) { sideLength = side; }
float getSideLen... | TOOL | 0.995306 | 6.150157 |
9a362b24-6a3b-401e-8b95-0809488a932d | kristiantg/sp_Assignment_21 | sP_kristiantgregersen/src/StochasticSimulator.cpp | #include "StochasticSimulator.h"
#include "SystemStateMonitor.h"
// Spwans k threads to do stochastic simulation.
void StochasticSimulator::doMultithreadedStochaticSimulation(double& T, vector<Reactant> state, vector<ReactionRule>& _rules, int& numberOfThreads)
{
vector<std::thread> threads;
for (auto i = 0; i < num... | ALGO | 0.931697 | 4.018448 |
a962c833-c715-45e3-9c11-b11e95f663b8 | ayushgupta2959/-Competitive-Programmer-s-Core-Skills-Coursera- | MySolutions/4-a-frequent_symbol/frequent_symbol.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <cstring>
#include <algorithm>
#include <climits>
#include <deque>
#include <map>
#include <deque>
#include <iomanip>
#include <cmath>
#include <functional>
#include <set>
#define endl '\n'
#define FOR(i,a,n,c) for(int i=a;i<=n;i+=c)
using namespace std;
#... | ALGO | 0.999918 | 3.77818 |
78610568-c491-4c44-8906-75f8eab87c48 | trivializm/firmware-mod-kit | src/others/squashfs-3.4-nb4/lzma465/CPP/7zip/Compress/ByteSwap.cpp | // ByteSwap.cpp
#include "StdAfx.h"
#include "ByteSwap.h"
STDMETHODIMP CByteSwap2::Init() { return S_OK; }
STDMETHODIMP_(UInt32) CByteSwap2::Filter(Byte *data, UInt32 size)
{
const UInt32 kStep = 2;
UInt32 i;
for (i = 0; i + kStep <= size; i += kStep)
{
Byte b = data[i];
data[i] = data[i + 1];
d... | ALGO | 0.935961 | 5.358013 |
026f77aa-53cf-43c5-a6be-8b2d44135adc | AbhishekGargcoder/Top-interview-problems | 0445-add-two-numbers-ii/0445-add-two-numbers-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* addTwoNumbe... | ALGO | 0.999936 | 5.951766 |
b9f25614-ba3c-49c0-b836-a3280a400de9 | rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning | packages/anasazi/epetra/src-rbgen/RBGen_ISVDSingle.cpp | #include "RBGen_ISVDSingle.h"
#include "Teuchos_ScalarTraits.hpp"
#include "Epetra_Comm.h"
namespace RBGen {
ISVDSingle::ISVDSingle() {}
void ISVDSingle::updateBasis(const Teuchos::RCP< Epetra_MultiVector >& update_ss ) {
// free pointer to original data set
// switch it to new data set, momentarily
... | ALGO | 0.987993 | 5.104047 |
6d230365-9cef-4c89-bab0-ee3d9d6aeb15 | ddamddi/PS | 백준/10992.cpp | #include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
for(int i = 1; i <= N; i++){
for(int j = 0; j < N-i; j++) cout << " ";
if(i > 1 && i < N){
cout << "*";
for(int j = 0; j < 2*i-3; j++) cout << " ";
cout << "*";
}
else if(i == N)
for(int j = 0; j < 2*N-1; j++) cout << "*";... | ALGO | 0.999972 | 3.676723 |
2af818f5-fbf1-44d9-ad2b-4f53aab9ecf4 | MehulGarg22/Algo_Engineering | Program/Graph/Graph_PrimAlgorithm.cpp | #include<iostream>
#include<vector>
#include<bits/stdc++.h>
#include<set>
const int INF=1e9;
using namespace std;
int main()
{
int node, edge;
int cost=0;
cout<<"Enter no of node and edges: ";
cin>>node>>edge;
cout<<"Enter Edges: "<<endl;
vector<vector<pair<int,int>>> adl(node+1); //Vertex, We... | ALGO | 0.999984 | 4.330684 |
a1acee67-fd3c-4c43-a49e-414baa6a001c | ishandutta2007/codeforces | madball/normal/1628/A.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <random>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <tuple>
usin... | ALGO | 0.999967 | 4.041365 |
1de3cb4f-88de-456b-870b-41dc0c156496 | IDA-TUBS/CC_LinkMonitor | thirdparty/boost_1_73_0/libs/graph/example/remove_edge_if_bidir.cpp | #include <boost/config.hpp>
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/graph_utility.hpp>
/*
Sample output:
original graph:
0 --> 3 2 3
1 --> 3
2 --> 0
3 --> 2
1(0,3) 2(0,2) 3(0,3) 4(1,3) 5(2,0) 6(3,2)
removing edges connecting 0 to 3
0 --> 2
1 --> 3
2 -... | ALGO | 0.997568 | 6.498795 |
002dabd2-cdcb-45e2-b499-386148f17ccf | necrocest/programacionC | vectores o arrays/ejercicio7.cpp | #include<iostream>
using namespace std;
int main(){
int a;
int multiplicacion = 0, division = 0, suma = 0;
int total = 0, n, n1;
cout<<"cuantos elementos en el vector 1:"<<endl;
cin>>n;
int vector[n];
cout<<"ingrese los elementos del vector 2(debe ser igual al vector 1): "<<endl;
cin>>n... | ALGO | 0.999414 | 3.214656 |
6127c1c8-9caa-418b-8c49-a009855a9c9c | Jasjot784/Coding | Leetcode_Daily_27-12-24.cpp | // https://leetcode.com/problems/best-sightseeing-pair/description/?envType=daily-question&envId=2024-12-27
class Solution {
public:
int maxScoreSightseeingPair(vector<int>& values) {
int n = values.size();
if (n < 2) return values[0] + values[1] + 0 - 1;
vector<int> suffixMax(n);
s... | ALGO | 0.999982 | 6.369144 |
717cd1bf-b285-4ede-a214-07cca773b8ca | hjiang13/LLMs-in-IR | POJ-104/67/1774.cpp | #include <iostream>
using namespace std;
int main()
{
int n,i,j;
double a[100][2],t;
double b[100];
cin>>n;
t=5.0/100.0;
for(i=0; i<=n-1; i++)
{
for(j=0; j<=1; j++)
{
cin>>a[i][j];
}
b[i]=a[i][1]/a[i][0];
}
for(i=1; i<=n-1; i++)
{
if((b[i]-b[0])>t)
{
cout<<"better"<<'\n';
}
else if(b[0]-b[i]>t)
{
cout<<"worse"<<'\n';
}... | ALGO | 0.999915 | 3.563858 |
e5d880d1-37d0-4b23-a923-c2eec88bbfbe | ananthkumarmv/Coding-problems | CodeChef/BIRYANI.cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int x, y;
cin>>x>>y;
cout<<(x*y)<<"\n";
}
return 0;
}
| ALGO | 0.99975 | 4.994835 |
fd11c00e-2ccc-4b31-b8e2-7b42fb1cbe38 | iboutsikas/g4g18 | Engine/Source/ThirdParty/ICU/icu4c-53_1/source/test/perf/collperf/collperf.cpp | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <limits.h>
#include <string.h>
#include "unicode/uperf.h"
#include "uoptions.h"
#include "unicode/coll.h"
#include <unicode/ucoleitr.h>
#if !U_PLATFORM_HAS_WIN32_API
#define DWORD uint32_t
#define WCHAR wchar_t
#endif
/* To store an array of string<U... | TOOL | 0.996208 | 4.898271 |
8ef48f7e-7209-4502-a378-2f59b765148b | esa/spacecreator | src/libs/promela/Asn1ToPromelaTranslator/visitors/integerrangeconstraintvisitor.cpp | #include "integerrangeconstraintvisitor.h"
#include <algorithm>
using Asn1Acn::IntegerValue;
using Asn1Acn::Range;
namespace promela::translator {
void IntegerRangeConstraintVisitor::visit(const Asn1Acn::Constraints::RangeConstraint<IntegerValue> &constraint)
{
const Range<IntegerValue::Type> &range = constrain... | TOOL | 0.99094 | 7.321088 |
32339d07-6745-46ef-abf1-d14a88770b86 | shoujiaxin/leetcode-solutions-cpp | [65] Valid Number/solution1.cpp | /*
* @lc app=leetcode id=65 lang=cpp
*
* [65] Valid Number
*
* https://leetcode.com/problems/valid-number/description/
*
* algorithms
* Hard (14.80%)
* Likes: 629
* Dislikes: 4347
* Total Accepted: 155.8K
* Total Submissions: 1.1M
* Testcase Example: '"0"'
*
* Validate if a given string can be int... | ALGO | 0.97924 | 6.006178 |
f5876e66-4e4b-4caa-a421-5aa4b829486c | ishandutta2007/codeforces | 18michael/normal/1444/D.cpp | #include<cstdio>
#include<bitset>
#include<vector>
#include<algorithm>
using namespace std;
int h,v,t0,t1,sumh,sumv,nowx,nowy,Test_num;
int H[1002],V[1002];
bitset<1000002> bs[1002];
vector<int> vec[4];
inline void mv(int x,int y)
{
printf("%d %d\n",nowx+=x,nowy+=y);
}
inline void solve()
{
sumh=nowx=0,vec[0].clear()... | ALGO | 0.999969 | 3.022266 |
fc2df84c-845b-44c0-a81e-a20de67ff1f3 | vidalmatheus/codes | Palantir/maintenanceWindows/1.cpp | #include <bits/stdc++.h>
using namespace std;
/*
input:
3
Thu 5 - Thu 6
Tue 4 - Tue 7
Sun 9 - Sun 10
output:
2 // how many reach the largest maintenance window
1 // the largest maintenance window in hours
*/ | ALGO | 0.998986 | 4.022454 |
c004f388-2536-4a5e-8a5a-6b43da4762c8 | prakyathlv/DSA | polynomial1.cpp | #include<iostream>
using namespace std;
class term
{
public:
int coeff;
int exp;
};
class poly
{
int n;
term *s;
public:
poly(int n)
{
this->n=n;
s=new term[n];
}
~poly()
{
delete []s;
}
void read();
void display(int x);
friend void operator+(poly p1,poly p2);
};
void operator+(p... | ALGO | 0.998918 | 3.71479 |
a696849b-b72c-4dc2-bfc1-54afecf48776 | ralpioxxcs/problemsolving | problems/watermelon.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int w;
cin >> w;
if(w==2) std::cout << "NO" << std::endl;
else if(w%2==0) std::cout << "YES" << std::endl;
else std::cout << "NO" << std::endl;
return 0;
}
| ALGO | 0.999608 | 3.706582 |
adadb28d-5f98-45ec-8145-038e317c5348 | phantomcoder11/All-codes | striver sheet/2. Array 2/5. Repeat & missing.cpp | // https://leetcode.com/problems/set-mismatch/
class Solution {
public:
vector<int> findErrorNums(vector<int>& nums) {
int x=0;
for(int i=0;i<nums.size();i++){
x^=nums[i];
}
for(int i=1;i<=nums.size();i++){
x^=i;
}
int set_bit=x&-x;
in... | ALGO | 0.999662 | 5.442218 |
19549a98-4a46-44ee-a4b7-ea2862ad2c17 | varun2430/450_DSA_Sheet | stack_queue/implement_2_stack_in_an_array.cpp | #include<iostream>
using namespace std;
class TwoStack
{
int size;
int* arr;
int top1, top2;
public:
TwoStack(int s)
{
size = s;
arr = new int[s];
top1 = -1;
top2 = s;
}
void push1(int x)
{
if(top1 < top2 - 1)
{
top1++;
... | ALGO | 0.999059 | 4.534542 |
d515979f-5c3e-4d34-b747-297f961ad69f | geekbutton/Cpp-Primer | ch3/ex3_17.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
//#include<algorithm>
//#include<stdio.h>
using namespace std;
int main(){
vector<string>v1;
string s;
while(cin>>s)
v1.push_back(s);
for(auto &c:v1){
for(auto &c2:c)
c2=toupper(c2);
}
for(auto c:v1)
cout<<c<<endl;
return 0;
}
| ALGO | 0.999582 | 3.985724 |
584be43f-f7a9-4830-ac0f-cf5f13aca68e | dharamghevariya/my_OOP345_notes | Fardad's_lecture_code/11-Oct30/c-stack.cpp | #include <stack>
#include <iostream>
using namespace std;
int main() {
std::stack<double> prices; // initially empty
prices.push(10.43); // add 10.43
prices.push(20.54); // add 20.54
prices.push(32.43); // add 32.43
prices.top() = 5.41;
while (!prices.empty()) {
std::cout << prices.top() << " ... | ALGO | 0.995841 | 4.53519 |
dcf5a5ad-63a1-4ff5-a548-7193e9dc45b8 | raviprakash7367/coding-solution | leetcode/Binary-tree-level-order-traversal.cpp |
/*
name= binary tree level order traversal
link-https://leetcode.com/problems/binary-tree-level-order-traversal/
author- Parth garg
time complexity- o(n)
space complexity- o(n) (for saving result)
method 1- preorder traversal;
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
... | ALGO | 0.999992 | 6.635949 |
b243b821-a8fb-487b-834b-9c557661079e | IsadoraPiropop/Programacao_DEV-C- | x1.cpp | #include<iostream>
#include<clocale>
#include<cmath>
#include<iomanip>
#include<cstdlib>
using namespace std;
int main () {
setlocale (LC_ALL,"Portuguese"); // crie um programa que declare um array com nmeros e
// imprima sua mdia artimtica.
int tam=5;
float Array [tam];
Array[0]=2;
Array[1]=3;
Array[2]... | ALGO | 0.995459 | 3.480086 |
2b48e68e-b513-424c-b235-d9f32cc8d459 | MatheusBragaC/Maratona-Programa-o---Kattis | licensetolaunch.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int menor = INT_MAX;
int indiceDoMenor = 0;
for (int k = 0; k < n; k++)
{
int value;
cin >> value;
if (value < menor)
{
menor = value;
indiceDoMenor = k;
... | ALGO | 0.999711 | 4.68393 |
3df184ab-93f3-48d7-b2cd-8da550bb5c4f | Sumit2595/Leetcode-Problems | 0014-longest-common-prefix/0014-longest-common-prefix.cpp | class Solution {
public:
string common(string s,string t){
string str="";
int i=0,j=0;
while(i<s.length() && j<t.length()){
if(s[i] != t[j]){
break;
}
str+=s[i];
i++;j++;
}
return str;
}
string longestCom... | ALGO | 0.999788 | 5.739916 |
73c91ea5-0ad9-49b7-90aa-e76270f6e58c | TzashiNorpu/Algorithm | Clion/zero/1200_1400/gcdOfStrings_1071.cpp | //
// Created by TzashiNorpu on 2023/6/5.
//
#include "../header/header.h"
using namespace zero;
string Solution::gcdOfStrings(string str1, string str2) {
return (str1 + str2 == str2 + str1) ? str1.substr(0, gcd(size(str1), size(str2))) : "";
} | ALGO | 0.997674 | 5.841847 |
ede05e60-b592-4612-8443-7136aac3975f | Magorx/mipt | sem_1/course_algorithms/hw_contest_4/E.cpp | /*
Нужно отвечать на запросы вида
• + x – добавить в мультимножество число x.
• ? x – посчитать сумму чисел не больших x.
*/
#include <cstdlib>
#include <cstdio>
#include <ctime>
long long randlong() {
return (rand() << 16) ^ rand();
}
template <typename T_KEY>
struct DecaTreeNode {
T_KEY key;
long long cn... | ALGO | 0.999818 | 4.690541 |
e62ea8ff-4bbf-4e02-aeec-089af7d58c3a | twicelike/file | file8.cpp | #include <fstream>
#include <iostream>
#include <vector>
using namespace std;
int main() {
fstream danhsach, luusx;
string s;
vector<string> v;
danhsach.open("D:\\code\\C++\\laptrinhcoso\\file\\DSten.txt", ios::in);
luusx.open("D:\\code\\C++\\laptrinhcoso\\file\\SX.txt", ios::out);
while (getline(danhsach,... | ALGO | 0.997695 | 3.633981 |
e70cfeac-2581-4bc9-8589-74aead3906e6 | WenHsuanYu/Leetcode | 421. Maximum XOR of Two Numbers in an Array.cpp | // TC: O(n)
// SC: O(1)
struct Node{
public:
Node* next[2];
Node()
{
next[0] = next[1] = nullptr;
}
};
class Trie{
Node* root;
public:
Trie(){
root = new Node();
}
void insert(int data){
Node* r = root;
for (int i = 30; i >= 0; i--) {
in... | ALGO | 0.999959 | 5.64489 |
be447c9b-3419-4cea-af3f-df1d07208a7c | NestinGrigoriy/Project | 1_course/28.10/4zadacha/4.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int n1, n2, n3;
n1 = n % 10, n2 = (n / 10) % 10, n3 = n / 100;
cout << n1 * n2 * n3;
return 0;
} | ALGO | 0.998369 | 3.151607 |
ca8da288-9f58-4125-a107-54b2c13ce751 | sudhakar0202/repo_repo | main.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
//This is testing
int main()
{
vector<vector<int>> dp;
for (int i = 0; i < 5; i++)
{
vector<int>v(3, -1);
dp.push_back(v);
}
for(auto ve:dp){
for(int val:ve){
cout<<val<<" ";
}
... | ALGO | 0.993416 | 3.154353 |
e2ac4a5f-f9e0-4e84-abc7-794bebdd7b53 | Devil200207/Codeforces | Rating (0 -800)/Vasya the Hipster.cpp | #include<bits/stdc++.h>
#define int long long int
#define mod 1000000007
using namespace std;
void solve()
{
int n,m;
cin>>n>>m;
int ans1 = min(n,m);
int ans2 = max(n,m)-ans1;
ans2/=2;
cout<<ans1<<" "<<ans2;
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// int t;
// cin>>t;
... | ALGO | 0.999967 | 5.018142 |
a964ab31-a58f-472a-b079-8521d085b3d6 | ChernakovEgor/codewars | c++/6kyu/consecutive_strings.cpp | #include <string>
#include <vector>
class LongestConsec {
public:
static std::string longestConsec(const std::vector<std::string> &strarr,
int k);
};
std::string LongestConsec::longestConsec(const std::vector<std::string> &strarr,
int k) {... | ALGO | 0.99977 | 5.624209 |
91f9d6cf-2eac-4ba3-86c9-40e637b7f88d | liweiyap/HackerRank-InterviewPreparationKit | LinkedLists/reverse-a-linked-list.cpp | class SinglyLinkedListNode;
// IN: head of singly linked list
// OUT: head of reversed singly linked list
SinglyLinkedListNode* reverse(SinglyLinkedListNode* head)
{
if (!head) return head;
if (!head->next) return head;
SinglyLinkedListNode* old_head = head;
SinglyLinkedListNode* next;
while (old_... | ALGO | 0.999757 | 5.727018 |
4057f3c5-55c2-49f0-a706-393115414333 | CDharyatra/Code-Analyser | Nebula9.ai Assignment/upload/test_20241217193743_6435c7.cpp | // C++ program to find quotient
// and remainder
#include <iostream>
using namespace std;
// Driver code
int main()
{
int Dividend, Quotient, Divisor, Remainder;
cout << "Enter Dividend & Divisor: ";
cin >> Dividend >> Divisor;
// Check for division by zero
if (Divisor == 0) {
cout << "Er... | ALGO | 0.991711 | 5.422442 |
2b0c2cde-cf5c-408f-a89d-49a88d6e1819 | githubcrce/Cpp-Programs | arrays/selectionsort.cpp | #include<iostream>
#include<math.h>
#include <bits/stdc++.h>
#include <climits>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
for(int i=0; i<n; i++){
cin>>a[i];
}
//find minimum element place it at the begining
for(int i=0; i < n-1; i++){
int min = a[i];
... | ALGO | 0.999975 | 3.639534 |
bc00c1a5-4ad9-4676-aa88-1cc8b2f66ddd | Mahmoud-nfz/Codeforces-Solutions | Solutions B/680B.cpp | #include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <math.h>
typedef long long ll ;
#define pairi pair <int,int>
#define pairll pair <long long,long long>
#define vi vector <int>
#define vll vector <long long>
#define mapi map <int,int>
#define mapill ... | ALGO | 0.999767 | 3.629396 |
3fcad668-191e-4ca2-b7e3-1c86c51fd41f | HemangTheHuman/hacktoberfest-2022 | DSA in CPP/Array Adt/delete.cpp | #include <iostream>
using namespace std;
struct Array
{
/* data */
int A[10];
int size;
int length;
};
int Delete(struct Array *arr, int index){
int x=0, i=0;
if(index>=0 && index < arr->length){
x = arr->A[index];
for(i = index; i < arr->length-1 ; i++){
arr->A[i]= arr->A[i+1];
... | ALGO | 0.996892 | 3.615185 |
75f636aa-e2c8-4421-8e8f-b07057c0aea1 | chabuuuu/UIT_OOP | Thuchanh/dethicuahieu.cpp | #include<iostream>
#include<vector>
#include<math.h>
#include<iomanip>
using namespace std;
class NguonDien{
protected:
float hieuSuat;
float dienTaoRa;
static float tongDien;
static bool coKhaNangTichDien;
static bool mangDienBiRa;
public:
virtual void nhap(){
cin>>hieuSuat;
}
... | TOOL | 0.973632 | 3.810532 |
c19f065a-4635-4532-ad13-e12b3dc5c950 | Mehulcoder/Codeforces | Random_Problems/he1.cpp | /*
Author: Mehul Chaturvedi
Talent is overrated
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<long long, long long> pll;
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
#define vll vector<long long>
#define vvll... | ALGO | 0.999972 | 4.91586 |
96823157-f3e1-4c6f-9444-c438a24d08ef | CI-WATER/TauDEM-LFS-Test | src/DinfConcLimAccum.cpp | /* DinfConcLimAccum function to compute concentration limitted accumulation based on
D-infinity flow model.
David Tarboton, Teklu K Tesfa
Utah State University
May 23, 2010
*/
// This software is distributed from http://hydrology.usu.edu/taudem/
#include <mpi.h>
#include <math.h>
#include <queue>
... | ALGO | 0.999449 | 3.882808 |
070695ff-c1cb-4eed-bd37-ab94f2cff78d | cvtrana/LeetcodeSolutions | 0138-copy-list-with-random-pointer/0138-copy-list-with-random-pointer.cpp |
class Solution {
public:
void InsertAtTail(Node* &head,Node* &tail,int d){
Node* newnode = new Node(d);
if(head==NULL){
head = newnode;
tail = newnode;
return;
}
else{
tail ->next = newnode;
tail = newnode;
}
... | ALGO | 0.999113 | 5.406732 |
e8252ca7-dcd3-4c4a-94bc-794b13b3c0da | Shaxzy/NIXWARE-CSGO | CryptoPP/zdeflate.cpp | // zdeflate.cpp - originally written and placed in the public domain by Wei Dai
// Many of the algorithms and tables used here came from the deflate implementation
// by Jean-loup Gailly, which was included in Crypto++ 4.0 and earlier. I completely
// rewrote it in order to fix a bug that I could not figure out. This ... | ALGO | 0.998856 | 6.523902 |
6e6ab8a6-cd07-40fb-9e38-1eb5fc80b7a1 | Rishi-09/cpp_code_bot | snippets/MaxSubArray_BruteForce.cpp | #include <iostream>
#include <vector>
using namespace std;
int MaxSubarraySum(vector <int> arr)
{
int max_sum = 0;
for(int i=0;i<arr.size();i++)
{ int current_sum=0;
for(int j = 0 ; j<i;j++)
current_sum +=arr[j];
max_sum= max(current_sum,max_sum);
}
return max_su... | ALGO | 0.994067 | 4.752894 |
242bb1f6-119b-4489-b29d-18a72a5bef86 | doktorprozac/Sortowania | Sortowanie/sortowanie.cpp | #include <iostream>
#include <utility>
#include <string>
#include <time.h>
using namespace std;
clock_t start, stop;
double czas;
int rand_number()
{
int number;
number = rand() % 100 + 10;
return number;
}
int own_numbers(int *tab)
{
cout << "Podaj dziesiec liczb calowitych: " << endl;
for (int i = 0; i < 1... | ALGO | 0.997511 | 4.248845 |
9dd1f0d9-76aa-497d-bd8a-b94e36284ea4 | eugeneyuchunlin/external-sroting-in-cpp | main.cpp | #include <algorithm>
#include <iostream>
#include <fstream>
#include <ostream>
#include <string>
#include <cmath>
#include <thread>
#include <type_traits>
#include <vector>
#include <ctime>
#include "mergeTask.h"
#include "output_stream.h"
#include "task.h"
#include "merge_stream.h"
using namespace std;
struct chunkF... | ALGO | 0.998438 | 3.688314 |
82a9cdc6-0ac6-45f6-96fb-1eaa7e36e338 | hyungyu-02/CppStudy_BJ_Army | 2446.cpp | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
for (int i = 0; i < 2 * N - 1; i++) {
if (i < N) {
for (int j = 0; j < i; j++) {
cout << " ";
}
for (int j = 0; j < 2 * N - 1 - 2 * i; j++) {
cout << "*";
}
}
else {
for (int j = 0; j < 2 * N - i - 2; j++) {
co... | ALGO | 0.999911 | 3.685295 |
30feea5f-556d-41a7-8103-b6cbd7725ec8 | ishandutta2007/codeforces | -is-this-fft-/normal/1208/F.cpp | #include <iostream>
using namespace std;
const int MAX_N = 1e6 + 5;
const int MAX_LG = 21; // TODO
ostream& operator<< (ostream& out, pair<int, int> p) {
out << "(" << p.first << " " << p.second << ")";
return out;
}
pair<int, int> mrg (pair<int, int> p, pair<int, int> q) {
if (q > p) {
swap(p, q);
}
... | ALGO | 0.999918 | 3.960777 |
763dc5fa-9445-4ed5-bba2-c51addedf2b3 | nguyenductoandhv/checker | datastructure/static_range_lis_query/gen/almost_sorted.cpp | #include <cstdlib>
#include "../params.h"
#include "base.hpp"
#include "random.h"
int main(int, char *argv[]) {
const int case_index = std::atoll(argv[1]);
Random gen(case_index ^ 13428581043660426568ULL);
const int N = N_MAX;
const int Q = gen.uniform<int>(Q_MIN, Q_MAX);
std::vector<int> P(N);
std::iot... | ALGO | 0.990566 | 4.239209 |
ba586131-57a7-4961-870f-393ee8e6f19b | papachristoumarios/IEEEXtreme11.0 | fibonacci(full score)/fibonacci.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#define X first
#define Y second
#define mp make_pair
#define pb push_back
using namespace std;
typedef pair< int, int > pii;
typedef pair< pii, pii > table;
table product( table A, table B ) {
int num1 = A.X.X * B.X.X + A.X.Y * B.X.Y;
int num2 = A.X.... | ALGO | 0.999929 | 4.099097 |
1d69d47b-ad2e-4494-9cae-f7d4343dd259 | shubhashis-k/Trying-out-Algorithms-and-problems | AllAboutBT.cpp | #include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
};
TreeNode *root;
bool pfound, qfound;
TreeNode* findLCA(struct TreeNode* root, int n1, int n2)
{
// Base case
if (root == NULL) return NULL;
if (root->val ... | ALGO | 0.999991 | 5.146949 |
db85f185-fe4f-45d1-9199-4f98d18505c6 | HeeHeejun/c-_study | 7562.cpp | // (S1) knight movement
// how many movement of knight can go wanted place
// graph travel
#include <iostream>
#include <queue>
using namespace std;
struct coordinate
{
int x, y, cost;
};
bool visit[300][300] = {false};
int dx[8] = {-2, -2, -1, -1, 2, 2, 1, 1};
int dy[8] = {-1, 1, 2, -2, -1, 1, 2, -2};
int main(... | ALGO | 0.999782 | 4.953837 |
91a76014-cf1e-47ad-8115-2a8ea4fc3e1f | jucamohedano/ros_contact_graspnet | contact_graspnet/pointnet2/tf_ops/grouping/tf_grouping.cpp | #include <cstdio>
#include <ctime>
#include <cstring> // memset
#include <cstdlib> // rand, RAND_MAX
#include <cmath> // sqrtf
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/shape_inference.h"
#include "tensorflow/core/framework/common_shap... | ALGO | 0.935092 | 6.587374 |
a72809e3-60c1-4dc3-b122-485bd5230b39 | AkshatAggarwal14/Competitive-Programming | CodeChef/EXPWEI.cpp | #ifdef LOCAL
// https://github.com/AkshatAggarwal14/Competetive-Programming
#include "Akshat.hpp"
#else
#include "bits/stdc++.h"
using namespace std;
#define dbg(...)
#endif
using ll = int64_t;
auto sz = [](const auto &container) -> ll { return container.size(); };
#define all(x) (x).begin(), (x).end()
template <class ... | ALGO | 0.999893 | 5.957738 |
55141a9a-7720-49d3-963c-8e5b04a3f686 | PranavChauhan22/Pranav-s-LeetHub | 48-rotate-image/48-rotate-image.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
for(int k=1;k<=matrix.size()-1;k++){
for(int j=k,i=k;j<matrix[0].size();j++,i++){
int t=matrix[i][k-1];
matrix[i][k-1]=matrix[k-1][j];
matrix[k-1][j]=t;
}
}
... | ALGO | 0.999989 | 6.202816 |
6f9685cc-4ad4-42c3-bc29-cc3ca179a15a | ThreeSR/LeetCode | LC135_Candy_Greedy Algorithm.cpp | class Solution {
public:
int candy(vector<int>& ratings) { // 贪心算法
vector<int> candy(ratings.size(), 1); // 一开始,每个小孩手里都要有糖
for (int i = 1; i < ratings.size(); i++) { // 从左到右,如果右边小孩得分高,右边小孩就要比左边小孩多一个糖
if (ratings[i] > ratings[i - 1]) candy[i] = candy[i - 1] + 1;
}
for (int... | ALGO | 0.999999 | 6.217036 |
ec3f5f0d-d47b-4832-93a8-752d753bee05 | Neela-satya-sai/Assignment-2-arrays | minoftwoMAXIMIZE.cpp |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{ //length is even
vector<int> arr={1,4,3,2,6,8,4,6};
sort(arr.begin(),arr.end());
int n=arr.size();
int sum=0;
int mi=0;
for(int i=0;i<n-1;i+=2){
mi=min(arr[i],arr[i+1]);
sum+=mi;
... | ALGO | 0.999951 | 4.221095 |
30ee5671-f318-4aa6-80ac-877fdaebf636 | MaikeV/GIP | Praktika/Aufgabe6_1/Aufgabe6_1.cpp | #include <iostream>
int main() {
int input = 0;
int inpArr[5];
for (int index = 1; index <= 5; index++) {
do {
std::cout << "Bitte geben Sie die " << index << ". Zahl ein: ? ";
std::cin >> input;
} while (input < 1 || input > 9);
inpArr[index - 1] = input;
}
for (int index = 9; index >= 1; index--)... | ALGO | 0.993703 | 3.55141 |
bb841114-f3d5-4f08-9ace-817b65532aed | 10Maruf/CODEFORCES-Problem | A_Olympiad_Date.cpp | /*maruf_bro*/
#include <bits/stdc++.h>
using namespace std;
#define IO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define ld long double
#define ll long long
#define vec vector<ll>
#define pb push_back
#define fcin(n) \
for ... | ALGO | 0.999716 | 5.515872 |
4c22fb30-2d0b-4fb4-b16f-ef58f9ee9023 | dimgatz98/coding_challenges | code_signal/differentSquares/sol.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#inc... | ALGO | 0.999972 | 3.616032 |
520df9d9-72f6-4a5a-8df6-ef48cc7318da | AV2409/DSA_Codes | Contest/grid.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n=3;
int r=0,c=0;
vector<string> commands={"DOWN","RIGHT","UP"};
for(auto i:commands){
if(i=="RIGHT") c++;
if(i=="DOWN") r++;
if(i=="LEFT") c--;
if(i=="UP") r--;
}
cout<<(r*n)+c;
return 0;
... | ALGO | 0.999898 | 3.276254 |
85d50cce-743e-48b2-8265-e7df42a5aecb | neerajcodes365/LeetCode | 1020-number-of-enclaves/1020-number-of-enclaves.cpp | class Solution {
public:
int n;
int m;
void dfs(int row,int col,vector<vector<int>>&board,vector<vector<int>>&visited ){
visited[row][col]=1;
int rowi[]={0,0,-1,1};
int coli[]={1,-1,0,0};
for(int i=0;i<4;i++){
int nrow=row+rowi[i];
int ncol=col+coli[i]... | ALGO | 0.999972 | 6.213883 |
06900a63-96ea-4cda-9351-f5658d0814eb | Grover-Seerat/CPP | BASICS/VECTORINITIALISATION.CPP | #include <iostream>
#include <vector>
using namespace std;
int main()
{
// initializer list
vector<int> vector1 = {1, 2, 3, 4, 5};
// uniform initialization
vector<int> vector2{6, 7, 8, 9, 10};
// method 3
vector<int> vector3(5, 12);
cout << "vector1 = ";
// ranged loop
for (const int& i : vector1)
... | ALGO | 0.98651 | 4.092609 |
c56d43f1-e406-46f8-8c11-d6ffb3e6978a | MAKIYAMA-ma/AtCoder | ABC314/B.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#if 1
using mint = modint1000000007;
#else
using mint = modint998244353;
#endif
using ll = long long;
using ull = unsigned long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = v... | ALGO | 0.999984 | 3.776952 |
d68181e0-2ff2-4c98-b76a-9a66fd2459e8 | NerdPotatoo/Problem-Solving | Codeforces/443A.cpp | #include<bits/stdc++.h>
using namespace std;
int a[27];
int main(){
int cnt = 0;
string s;
getline(cin, s);
int len = s.size();
for(int i = 1; i<len-1; i++){
if(s[i] >= 97 && s[i] <= 122){
a[s[i]-96]++;
}
}
for(int i = 0; i < 27; ++i){
if(a[i]>0){
... | ALGO | 0.999579 | 3.944302 |
bb31acce-0ee6-4049-a75e-358efee57e6d | ArtNazarov/leetcode-solutions | 26-remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.cpp | #include <algorithm>
#include <vector>
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
nums.erase( std::unique( nums.begin(), nums.end()), nums.end());
return nums.size();
}
}; | ALGO | 0.999373 | 6.26852 |
7004288f-37a8-4ef7-9937-abf47f284941 | evialbert/LeetCode | 0066-plus-one/0066-plus-one.cpp | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int carry = 1;
for(int i=digits.size() - 1; i>=0; i--){
int add = digits[i] + carry;
digits[i] = add%10;
carry = add/10;
}
if(carry > 0){
digits.insert(digits.begin(), ... | ALGO | 0.999852 | 6.691516 |
52c8f85f-09cf-499c-9165-c6f6957cc221 | Denys209818/TelefonContacts | TelefonContacts/Baza.cpp | #include "libs.h"
#include "Baza.h"
void Baza::AddAbonent(Node*& abonent, int nummer, string surname)
{
if (abonent == nullptr)
{
Node* ANew = new Node();
ANew->nummer = nummer;
ANew->surname = surname;
ANew->left = nullptr;
ANew->right = nullptr;
abonent = ANew;
return;
}
else if (nummer > abonent... | TOOL | 0.950679 | 3.220437 |
a8eab04b-f2e3-4f2f-ab7e-a301bab9940f | toshysna/The-Green-Cube | ammo.js-main/ammo.js-main/bullet/src/BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp | #include "btConvexPointCloudShape.h"
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
#include "LinearMath/btQuaternion.h"
void btConvexPointCloudShape::setLocalScaling(const btVector3& scaling)
{
m_localScaling = scaling;
recalcLocalAabb();
}
#ifndef __SPU__
btVector3 btConvexPointCloudShape::localG... | ALGO | 0.887899 | 7.035684 |
1ea7aca0-4909-42e3-9ef1-f672bd662c5e | aryan-0069/CPP_basics | c++/linkedlist/insertingatend.cpp | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int data){
val= data;
next = NULL;
}
};
// time complexity -> 0(n)
void InsertatTailLL(Node* &head,int val){
Node* new_node = new Node(val);
Node* temp = head;
while(temp->next!... | ALGO | 0.999451 | 4.992155 |
be2b6d8a-9f32-4e33-a3ea-7a407fb9501b | shadowmick1/swtor-emu | Swtor_login/cryptopp/include/blowfish.cpp | // blowfish.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "blowfish.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
void Blowfish::Base::UncheckedSetKey(const byte *key_string, unsigned int keylength, const NameValuePairs &)
{
AssertValidKeyLength(keylength);
unsigned i, j=0, k... | ALGO | 0.999338 | 7.377288 |
55674872-057a-43cd-95c7-ef65fcfd4261 | ikjot-2605/Competitive-Programming | leetcode/jump-game-vi.cpp |
/*COMPETITIVE PROGRAMMING C++ TEMPLATE */
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <cmath>
#include <iostream>
#include <stack>
#include <queue>
#include <climits>
#include <iomanip>
#include <iterator>
#define a... | ALGO | 0.999519 | 4.995388 |
f18d097a-03ef-4153-b3ac-e69ba07c0e2f | muriloruz/C-CPP | cpp/Sem Título3.cpp | #include <stdio.h>
#include <stdlib.h>
int main(){
int z = min(2,9);
printf("%d",z);
} | ALGO | 0.999091 | 3.044742 |
b79a151b-7537-4126-a48b-266cdb3c5b63 | ishandutta2007/codeforces | qaqautomaton/normal/1394/B.cpp | /*
Author: QAQAutomaton
Lang: C++
Code: B.cpp
Mail: <EMAIL>
Blog: https://www.qaq-am.com/
*/
#include<bits/stdc++.h>
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define Debug debug("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define all(x... | ALGO | 0.99991 | 3.864747 |
5b211daa-7e4c-4f87-86be-e0dd36c98b38 | Zlin0509/Zlin_ACM | _CF/CONTEST/1500-1999/1717/E.cpp | //
// Created by 27682 on 2025/5/6.
//
#include "bits/stdc++.h"
using namespace std;
typedef double db;
typedef long double ldb;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
constexpr ... | ALGO | 0.999935 | 5.316271 |
f7aba2e1-8068-4b22-9f5d-9ba54e72d5cb | bogdanputintsev/ParusEngine | source/engine/utils/math/Math.cpp | #include "Math.h"
#include <corecrt_math.h>
#include <cmath>
namespace parus::math
{
/*==================================
* Math functions
*==================================*/
bool isNearlyEqual(const float x, const float y, const double epsilon)
{
return fabsf(x - y) < epsilon;
... | TOOL | 0.945527 | 6.312058 |
0f7a4422-b433-4d2b-bf95-c48e49686526 | Srinivas03062005/CP31_800 | Ambitious.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n],b[n];
int ans=INT_MAX;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
b[i]=fabs(a[i]);
}
for(int i=0;i<n;i++)
{
ans=min(ans,b[i]);
}
cout<<ans;
... | ALGO | 0.999966 | 3.97863 |
8250d0b0-6e8d-491b-9645-335c25dd381b | lmh760008522/ProgrammingExercises | 入门80/62_笨小熊.cpp | //
//СܵĴʻСÿӢѡʱͷۡҵһַַ֤ȥѡѡʱѡԵļʷdz
//ַľ£maxnǵгִĸijִminnǵгִٵĸijִmaxn-minnһôСܾΪǸLucky WordĵʺܾܿȷĴ𰸡
//
//
//һN(0<N<100)ʾ
//ÿֻһУһʣֻܳСдĸҳС100
//
//ÿУһһַĵĵLucky WordôLucky WordNo Answer
//ڶһ뵥Lucky Wordmaxn-minnֵ0
#include<stdio.h>
#include<string>
#include<cmath>
#include<iostream>
using namespace std;
int main(){
int n,co... | ALGO | 0.999946 | 3.923298 |
49412231-6bc8-454e-bf2b-0e86cf625be2 | PJain2000/Jetpack-Joyride | common/vboindexer.cpp | #include <vector>
#include <map>
#include <glm/glm.hpp>
#include "vboindexer.hpp"
#include <string.h> // for memcmp
// Returns true iif v1 can be considered equal to v2
bool is_near(float v1, float v2){
return fabs( v1-v2 ) < 0.01f;
}
// Searches through all already-exported vertices
// for a similar one.
// Simi... | ALGO | 0.987262 | 5.927599 |
c0232d1e-64e9-4359-9685-e469d8024d4b | yairlara/ejercicios-en-clase- | trabajo4.cpp | //leer 2 matrices a y b . generar una 3 tercera matriz que contenga la suma de estas, imprimir las 3 mareices
#include<iostream>
using namespace std;
int main(){
int f,f2,f3;
int c,c2,c3;
int suma=0;
cout<<"dime las filas"<<endl;
cin>>f;
cout<<"dime las columnas"<<endl;
cin>>c;
int mat... | ALGO | 0.990812 | 3.35554 |
b18a0f12-1903-4d34-b2b8-9158d4a373b8 | sonapraneeth-a/competitive-programming_submissions | platforms/leetcode/practice/non-premium/easy/171__excel-sheet-column-number/solutions.cpp | // clang-format off
/**
* FILE DESCRIPTION
*
* Filename: 171__excel-sheet-column-number/solutions.cpp
* Created on: 05 September 2021
* Last modified: 05 September 2021
* Author: sonapraneeth_a
* Description: LeetCode submission for 'Excel Sheet Column Number' problem
*/
/**
* CHAN... | ALGO | 0.999845 | 6.629485 |
b0f9e1b8-bf45-417a-999c-9301f6445dad | RedlineResearch/simulator-GC | boost_1_71_0/libs/compute/perf/perf_search.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/search.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int ma... | ALGO | 0.997865 | 5.499373 |
393a3603-c090-4013-8b47-00cdc62f6cfd | VladOS-byte/algo-itmo | term-1-3/I.cpp | #include <iostream>
using namespace std;
long long getCountDominoWithoutPair(bool a[13][13], int n, int m) {
long long dp[n + 1][m + 1][1 << m];
for (int i = 0; i <= n; ++i) {
for (int j = 0; j <= m; ++j) {
for (int p = 0; p < (1 << m); ++p) {
dp[i][j][p] = 0;
}... | ALGO | 0.999903 | 4.701458 |
6c349d0f-a7a0-432d-9bee-56faa21591ae | Bulnabi-SNU/Bulnabi_2024_PX4 | src/modules/commander/lm_fit.cpp | #include "lm_fit.hpp"
struct iteration_result {
float gradient_damping;
float cost;
enum class STATUS {
SUCCESS, FAILURE
} result = STATUS::SUCCESS;
};
void lm_sphere_fit_iteration(const float x[], const float y[], const float z[],
unsigned int samples_collected, sphere_params ¶ms, iteration_result ... | ALGO | 0.999716 | 6.163499 |
6b7aecf9-fec5-4afc-8277-8112b8dde92e | RomarioBasm/Leetcode | 191-number-of-1-bits/191-number-of-1-bits.cpp | #define MASK_FIRST_DIGIT 0x00000001
class Solution {
public:
int hammingWeight(uint32_t n) {
int counter = 0;
for(int i=0;i<32;i++){
if(n & MASK_FIRST_DIGIT == 1){
counter++;
}
n = n>>1;
}
return counter;
}
}; | ALGO | 0.999805 | 6.217113 |
12a69ccd-1426-40f2-8720-c0eb16d2d72d | nka21/atcoder | apg4b/ex9.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int x, a, b;
cin >> x >> a >> b;
x++;
cout << x << endl;
x *= a + b;
cout << x << endl;
x *= x;
cout << x << endl;
x --;
cout << x << endl;
} | ALGO | 0.999596 | 3.368828 |
f25ddc59-f243-483d-a8d9-ac3293cbe0b0 | ishandutta2007/codeforces | hehezhou/normal/1208/D.cpp | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll n;
ll s[200005],p[200005];
ll t[200005];
ll lowbit(ll x) {
return x&(-x);
if (14209>9243) {
if (31558>31075) {
bool ZENBDJUSHQ;ZENBDJUSHQ=28821;
if (21853>13000) {
if (11380>206... | ALGO | 0.999981 | 3.086682 |
e192a724-2f04-495f-92c9-070fc40bc019 | epicdeepak/Practicing-DSA | 1351-count-negative-numbers-in-a-sorted-matrix/1351-count-negative-numbers-in-a-sorted-matrix.cpp | class Solution {
public:
int countNegatives( vector<int> &nums){
int low=0;
int high=nums.size()-1;
while(low<=high){
int mid=(high+low)/2;
if(nums[mid]>=0)
low=mid+1;
else high=mid-1;
}
return nums.size()-h... | ALGO | 0.999989 | 6.181021 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.