uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
fb55c4f4-9a61-4ec3-b6dc-053704223c5b | rong-rubaiya/CPP | Triangle.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b, c;
cout << "Enter a: ";
cin >> a;
cout << "Enter b: ";
cin >> b;
cout << "Enter c: ";
cin >> c;
if ((a + b > c) && (a + c > b) && (b + c > a))
{
cout << "triangle";
}
else
cout << "not Triangle";
} | ALGO | 0.943857 | 3.899609 |
82e132ad-27a4-49ff-ba19-4f7aa911afa0 | tonttu/Shaderkit | ext/assimp/code/ProcessHelper.cpp | /// @file ProcessHelper.cpp
/** Implement shared utility functions for postprocessing steps */
#include "AssimpPCH.h"
#include "ProcessHelper.h"
#include <limits>
namespace Assimp {
// -------------------------------------------------------------------------------
void ConvertListToStrings(const std::string& in, st... | TOOL | 0.93938 | 7.476624 |
f2ac91a6-a83c-4aef-9646-5ad7025f4c07 | iam-abbas/cs-algorithms | C++/recursion/Tower of Hanoi.cpp | #include<iostream>
using namespace std;
void towerofHanoi(int n,char src,char dest,char helper)
{
// Base case
if(n==0)
{
return;
}
//Rec case
// First step N-1 disks move from src to helper
towerofHanoi(n-1,src,helper,dest);
// Shift Nth disk from src to dest
cout<<"Move ... | ALGO | 0.999975 | 5.173421 |
e2186f69-870f-41e3-a583-3dd87971a055 | anarazel/llvm-monorepo | lldb/source/Host/common/HostInfoBase.cpp | #include "lldb/Host/Config.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostInfoBase.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/... | TOOL | 0.901689 | 7.258871 |
6dbcc114-67cf-48d2-b012-9a3247e14613 | firiexp/contest_log | atcoder/ABC/113A.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;
template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
int main() {
int x, y;
... | ALGO | 0.999606 | 3.899518 |
c66d5607-5d29-4745-84d7-2e425d6f068a | pth-demo-orga/platform-external-libcxx | test/std/containers/associative/multiset/erase_iter.pass.cpp | // <set>
// class multiset
// iterator erase(const_iterator position);
#include <set>
#include <cassert>
#include "min_allocator.h"
struct TemplateConstructor
{
template<typename T>
TemplateConstructor (const T&) {}
};
bool operator<(const TemplateConstructor&, const TemplateConstructor&) { return false; ... | TEST | 0.877267 | 5.124216 |
d7a69da7-984b-455e-b2d4-b9d84defbdfd | adeebabdulsalam/ParallelP | merge_sort.cpp | #include <mpi.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
void process_nodes(int n,int pid);
int main(int argc, char *argv[])
{
int n,pid; //Number of processes or nodes
MPI_Init(&argc, &argv); //Initialize MPI
MPI_Comm_size(MPI_COMM_WORLD, &n); //Get number of Process
MPI_Comm_rank(MPI_... | ALGO | 0.99999 | 4.108831 |
04976aec-5865-4cee-bea1-925d39761e49 | mobileliker/mobileliker-OJ | OpenJudge/OpenJudge2786/OpenJudge2786.cpp | #include <iostream>
#include <cstdio>
#define MAX 1000000
#define MODE_NUM 32767
using namespace std;
int arr_pell[MAX];
int main()
{
//freopen("C://input.txt","r",stdin);
int i;
arr_pell[0] = 1;
arr_pell[1] = 2;
for(i = 2; i < MAX; ++i) arr_pell[i] = (2 * arr_pell[i - 1] + arr_pell[i - 2]) % MODE_NUM;
int... | ALGO | 0.999754 | 3.493896 |
9ccfcf8b-72c5-420a-a29f-b968337ad74c | Raghav1209/Leetcode_practice_questions | 581-shortest-unsorted-continuous-subarray/581-shortest-unsorted-continuous-subarray.cpp | class Solution {
public:
int findUnsortedSubarray(vector<int>& nums) {
int end = -1;
int max=nums[0];
for(int i=1;i<nums.size();i++){
if(max>nums[i]){
end = i;
}else{
max = nums[i];
}
}
int s... | ALGO | 0.999978 | 5.821076 |
baa3152e-4bc5-421f-9c1c-77f2bf314191 | choudharyNetram/DSA | Heaps/heap.cpp | // heap is Complete binary tree
// left se fill krte h
// Max heap -> parent is greater than the childrens
// Min heap -> parent is smaller than the childrens
// we put a heap in array whose 0th index is nothing
// we put first elements in first index and
// suppose i is the index (0 based indexing) // but we... | ALGO | 0.999974 | 4.21495 |
cfabf597-ac66-4341-b7be-f7ff54941fcf | Avinash-706/DSA-Practice | Stack/stackWithGetMin_OPTIMIZED02.cpp | #include <bits/stdc++.h>
using namespace std;
// FULLY OPTIMIZED -- Works for both positive & negative integers
struct Stack {
int top, cap, min;
int* arr;
Stack(int x) {
min = 0;
cap = x;
top = -1;
arr = new int[cap];
}
void push(int x) {
if (top >= cap -... | ALGO | 0.999744 | 4.758967 |
eba44ab6-a1f7-4d8f-9375-9201f344a095 | bbchen98/leetcode | 剑指offer/13.cpp | /**
* 13 机器人的运动范围
* https://leetcode.cn/problems/ji-qi-ren-de-yun-dong-fan-wei-lcof/
*/
class Solution {
public:
int getSum(int n) {
int n_sum = 0;
while (n > 0) {
n_sum += n % 10;
n /= 10;
}
return n_sum;
}
void movingCountAux(int m, int n, int i... | ALGO | 0.999895 | 6.000319 |
51b9b1e2-1142-436b-a6ab-e4fb69e375bc | svsannidhay/competitive-programming | DATA STRUCTURES/LINKED LISTS/insertion_at_nth_position.cpp | #include<iostream>
#include<vector>
#include<stack>
#include<list>
#include<map>
#include<algorithm>
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll long long int
using namespace std;
struct Node{
ll data;
struct Node *next;
};
struct Node *head;
void insert(ll x,ll n){
struct Node *te... | ALGO | 0.999216 | 4.167194 |
cfd0dbd2-67f3-4d2a-96ae-dd89c068077b | stefanos1316/Rosetta-Code-Research | Scripts/Task/monte-carlo-methods/c++/monte-carlo-methods.cpp | #include<iostream>
#include<math.h>
#include<stdlib.h>
#include<time.h>
using namespace std;
int main(){
int jmax=1000; // maximum value of HIT number. (Length of output file)
int imax=1000; // maximum value of random numbers for producing HITs.
double x,y; // Coordinates
int hit; // storage v... | ALGO | 0.999553 | 3.307935 |
96669e0f-e86b-41ab-ae58-4e66c9b88f3f | HimanshuSingour/DSA---Full-Dynamic-Programming- | DP on String matching/Recursive/Edit_distance.cpp | #include<bits/stdc++.h>
using namespace std;
int solve(string s1 , string s2 , int i , int j){
// base case
if(i < 0) return j + 1;
if(j < 0) return i + 1;
// Movement
// if they match
if(s1[i] == s2[j]){
return solve(s1 , s2 , i - 1 , j - 1);
}
// not match insert , delet , repl... | ALGO | 0.999956 | 4.918428 |
400ec8fe-4aa2-475a-aff7-701265faaac0 | Abdullah-Asif/Codeforces | CodeForces/CF-1007A.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
typedef long long ll;
int main() {
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
int n;
cin >> n;
int A[n];
for (int &it : A)
cin >> it;
sort(A, A + n)... | ALGO | 0.999971 | 3.9744 |
a6d2b4f5-482c-4d45-a860-cdae65604161 | GilbertImmanuel/Struktur-Data | Pertemuan_12/directedGraph.cpp | #include<bits/stdc++.h>
#include <list>
using namespace std;
class Graph
{
//jml vertex
int V;
vector <list<int>> adj;
public:
Graph(int V);
// tambahin edge ke graph. V = Node, W = Weight
void addEdge(int v, int w);
// prints BFS traversal
void BFS(int s);
};
Graph::Graph(int V)
{... | ALGO | 0.999797 | 4.884197 |
22c3a82a-bc78-42cf-a337-cde6edf07731 | paul2705/OI | OJ/lougu/P2024.cpp | #include <cstdio>
#define MaxNode 100001
#define f(i , a , b) for(int i=a ; i <= b ; i++)
int Input()
{
char c=getchar();
int n=0;
while(c < '0' || c > '9') c=getchar();
while(c >= '0' && c <= '9') n=(n << 1)+(n << 3)+(c-48) , c=getchar();
return n;
}
int v[MaxNode*3];
int Find(int n)
{
return... | ALGO | 0.999928 | 3.927006 |
bccc41ea-9b0c-416a-9f27-ac8e97cda1b9 | Stanotron/vsCode | c++/extras/cps.cpp | #include <bits/stdc++.h>
#define fr(i,a,b) for(int i = a; i < b; i++)
#define pb push_back
#define ll long long
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
using namespace std;
int main()
{
fast_io;
ll t;
t = 1;
// cin>>t;
while(t--){
string in;
cin>>in;
... | ALGO | 0.999266 | 3.11693 |
486fecbf-1100-45a6-98f0-21d0095d73ce | Deepak-032/Data-Structure | modifiedBUBBLEsort.cpp | #include<iostream>
using namespace std;
void bubbleSORT(int A[], int n)
{
int t,flag;
for(int round=1;round<=n-1;round++)
{
flag=0;
for(int j=0;j<=n-1-round;j++)
if(A[j]>A[j+1])
{
flag=1;
t=A[j];
A[j]=A[j+1];
... | ALGO | 0.999964 | 3.307371 |
269662fe-bd1f-4f2b-b8a4-1c90f65918c9 | mathletedev/cp | USACO/761.cpp | #include <cstdio>
#include <iostream>
#include <vector>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(NULL);
freopen("measurement.in", "r", stdin);
freopen("measurement.out", "w", stdout);
int n;
std::cin >> n;
std::vector<int> bessie(100, 7), elsie(100, 7), mildred(100, 7);
while (n--) {
i... | ALGO | 0.999495 | 4.034557 |
0b9e4cc6-9332-4340-a6f5-5b5034fe53c4 | jyotirmoy1997/Data-Structures-Files | Matrix/RowWithMaximumNumberOf1's.cpp | #include<bits/stdc++.h>
using namespace std;
int lowerBound(vector<vector<int>> &mat, int i, int m){
if(mat[i][0] == 1)
return 0;
if(mat[i][m-1] == 0)
return m;
int low = 0, high = m-1;
while(low <= high){
int mid = (low+high)/2;
if(mat[i][mid] == 1 && mat[i][mid-1] ... | ALGO | 0.999959 | 4.853745 |
596c4f95-183b-4990-ac70-36f37e240b32 | pushpend3r/dsa-questions | 39. String Compression.cpp | // https://leetcode.com/problems/string-compression/
#include <bits/stdc++.h>
using namespace std;
void appendCount(vector<char> &c, int &index, int &count) {
int i = index;
while (count) {
c.at(++index) = count % 10 + '0';
count /= 10;
}
reverse(c.begin() + i + 1, c.begin() + index + 1);
}
// My Ap... | ALGO | 0.999982 | 6.062754 |
4538618f-b0b6-451b-a3ef-54f4bf0f8cf9 | sheeluofficial/practice | OthersCode/LeetCode-Solutions-master/LeetCode-Solutions-master/C++/split-bst.cpp | // Time: O(n)
// Space: O(h)
/**
* 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:
vector<TreeNode*> splitBST(TreeNode* root, int V) {
if (... | ALGO | 0.999995 | 6.287971 |
4b58fa78-3c26-402d-b80e-2b648c9dbeb3 | M4rtanc/Neural-network-MNIST | src/normalization.cpp | #include "normalization.h"
#include <vector>
using namespace std;
pair<vector<double>, vector<double>> findMinMax(const vector<vector<double>> &data) {
vector<double> minValues = data[0];
vector<double> maxValues = data[0];
for (long unsigned int i = 1; i < data.size(); ++i) {
for (long unsigned i... | ALGO | 0.993034 | 5.152401 |
296fc9e1-586e-45c5-9aa2-cf15aba8cad4 | rainliu/leetcode | src/100SameTree/100SameTree.cpp | #include <sstream>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <unordered_map>
#include <algorithm>
#include <limits>
using namespace std;
/*
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurall... | ALGO | 0.999737 | 7.118125 |
1d3b29f5-4b4b-4565-adfb-993c0254c910 | PetterS/monolith | third-party/Eigen/doc/examples/tut_arithmetic_matrix_mul.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d mat;
mat << 1, 2,
3, 4;
Vector2d u(-1,1), v(2,0);
std::cout << "Here is mat*mat:\n" << mat*mat << std::endl;
std::cout << "Here is mat*u:\n" << mat*u << std::endl;
std::cout << "Here is u^T*mat:\n" << u.transpo... | ALGO | 0.999059 | 3.818773 |
3486f543-b197-4cd7-829a-bf388f68eb14 | snewptl/stationaryTraveller | old-memory/Codeforces Round 862 (Div. 2)/B.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
typedef double db;
typedef long double ldb;
const ll mod=998244353;
const int maxn=2e5+5;
const double eps=1e-10;
string s;
int main(){
ios::sync_with_stdio(false);
ci... | ALGO | 0.999943 | 4.915134 |
b45a3ca9-431c-4859-b8e1-87ca336fe341 | mirzavvip/cp | codeforces/771a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,k,a,b,edd,sii,ed[1010101],si[1010101],arr[1010101];
ll cariset(ll i){
if(arr[i] == i)return i;
else{arr[i] = cariset(arr[i]);}
return arr[i];
}
void konek(ll aa, ll bb){
ll aroot = cariset(aa);
ll broot = cariset(bb);
if(aroot!=broot)... | ALGO | 0.999993 | 4.568078 |
540d4550-edae-4d68-b4c6-a7ed91a63610 | rafiqul0004/Data_structure | Module_3/binary_search.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,x;
cin>>n;
int a[n];
for (int i = 0; i < n; i++)
{
cin>>a[i];
}
cin>>x;
bool flag=false;
int l,r;
l=0;
r=n-1;
while (l<=r)
{
int mid=(l+r)/2;
if (a[mid]==x)
{
f... | ALGO | 0.999987 | 3.990022 |
d5affac6-2f85-431a-b323-29f74c4a77df | Rivko/android-firmware-qti-sdm670 | adsp_proc/avs/main/afe/services/static/src/AFEUtils.cpp | /*==========================================================================
Include files
========================================================================== */
#include "audio_basic_op.h"
#include "audio_basic_op_ext.h"
#include "Interleaver.h"
#include "AFEPortManagement.h"
#include "AFETdmDriver.h"
#incl... | ALGO | 0.975197 | 4.793262 |
0ce8b57a-54ad-4069-8ce5-5281f961f917 | SoAttila/ChessProject | engine/stockfish_15.1_win_x64_popcnt/src/endgame.cpp | #include <cassert>
#include "bitboard.h"
#include "endgame.h"
#include "movegen.h"
namespace Stockfish {
namespace {
// Used to drive the king towards the edge of the board
// in KX vs K and KQ vs KR endgames.
// Values range from 27 (center squares) to 90 (in the corners)
inline int push_to_edge(Square s) ... | ALGO | 0.996818 | 6.891259 |
2d1e9007-4e29-4501-b408-4229725988f8 | Jamar-Brown/imp | modules/photo/src/calibrate.cpp | #include "precomp.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/imgproc.hpp"
#include "hdr_common.hpp"
namespace cv
{
class CalibrateDebevecImpl CV_FINAL : public CalibrateDebevec
{
public:
CalibrateDebevecImpl(int _samples, float _lambda, bool _random) :
name("CalibrateDebevec"),
samples(_s... | ALGO | 0.997997 | 6.254205 |
3530b0c9-8c1c-4696-bc27-50a5aabd0a6e | Sanchay117/codeforces-solutions | drinks.cpp | //
// Created by sanchay-singh on 4/10/24.
//
#include <bits/stdc++.h>
#define ITERATE_I(X) int i = 0; i<X; i++
#define ITERATE_J(X) int j = 0; j<X; j++
#define ITERATE_K(X) int k = 0; k<X; k++
using namespace std;
int main(){
// 200B
int n;
cin >> n;
double drinks[n];
for(ITERATE_I(n)){
c... | ALGO | 0.998981 | 4.200974 |
400f2cd9-2846-4168-add6-0d289dfbfaf1 | gloriousmind/Coursera | algorithm toolbox/week3_greedy_algorithms/2_maximum_value_of_the_loot/Project1/Project1/Source.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <functional> //greater, change the order
#include <map>
#include <iomanip>
#define min(a, b) (a < b ? a : b)
using namespace std;
using std::vector;
double get_optimal_value(int capacity, vector<int> weights, vector<int> values) {
double value = 0.0... | ALGO | 0.999873 | 4.638432 |
19123429-de6a-4581-a0de-9f5aead06cea | PeterChen712/LeetCode | 2816-double-a-number-represented-as-a-linked-list/2816-double-a-number-represented-as-a-linked-list.cpp | class Solution {
public:
// time/space: O(n)/O(1)
ListNode* doubleIt(ListNode* head) {
ListNode* dummy = new ListNode(0, head);
ListNode* prev = dummy;
ListNode* curr = head;
while (curr != NULL) {
int doubled_value = (curr->val << 1);
if (doubled... | ALGO | 0.999988 | 6.487064 |
5e02af19-a251-43b0-aeae-1f6a1e3a4e56 | wavydavy7/Competitive-Programming-Solutions | CompProgramming/codeforces/dp/multarray.cpp | #include <bits/stdc++.h>
// #include "debug.h"
#define ll long long
using namespace std;
constexpr int MD = 998244353;
// -------------------- mint Class -------------------- //
template <int MOD, int RT>
struct mint {
static const int mod = MOD;
static constexpr mint rt() { return RT; } // primitive root for... | ALGO | 0.999879 | 4.117121 |
3480d535-b225-4862-bd58-0db6af72ec6a | Saidmirzo/assets_generator | 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 |
339400ef-c509-491c-b420-62e7ffd2400d | de-cryptor/LeetCode | Dynamic Programming/min_cost_climbing_stairs.cpp | /*
@Author - Jatin Goel
@Institute - IIIT Allahabad
Hardwork definitely pays off.
There is no substitute of hardwork.
There is no shortcut to success.
*/
class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
int size = cost.size();
int ans[size];
ans[0] = cost[0];
... | ALGO | 0.999967 | 6.015328 |
d4e66f04-6b90-4349-849b-7a94c81456c0 | darrylteo/cp4-solutions | 9 Rare Topics/29. Linear Programming/maximumrent.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define sz(a) int((a).size())
typedef vector<int> vi;
typedef double T; // long double, Rational, double + mod<P>...
typedef vector<T> vd;
typedef vector<vd> vvd;
const T eps = 1e-8, inf = 1 / .0;
#define MP make_pair
... | ALGO | 0.999951 | 4.986024 |
ce519ea6-87d6-41b5-900e-797b267d4898 | martinbudden/SuperSlicer | src/libigl/igl/is_boundary_edge.cpp | template <
typename DerivedF,
typename DerivedE,
typename DerivedB>
void igl::is_boundary_edge(
const Eigen::PlainObjectBase<DerivedE> & E,
const Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedB> & B)
{
using namespace Eigen;
using namespace std;
// Should be triangles
assert(F.... | ALGO | 0.989568 | 7.293667 |
84f24098-2b47-45bb-ab05-391ccbf929c7 | Horson19/algorithem_practice | sort_basic/counting_sort/main.cpp | #include <iostream>
using std::cout;
using std::endl;
void counting_sort(int *scoreArr, int count);
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
int scoreArr[] = {0,5,4,8,8,2,3,9,6,6,7,1};
counting_sort(scoreArr, 12);
cout << scoreArr <<endl;
... | ALGO | 0.999766 | 4.630949 |
60459af1-d3d8-4c37-8240-8eb4f3fabf3f | MathieuGuillout/TheNatureOfCodeCinder | TheEvolutionOfCode/SmartRocketsFaster/src/Rocket.cpp | #include "Rocket.h"
#include "cinder/gl/gl.h"
#include "cinder/app/AppBasic.h"
using namespace ci;
using namespace ci::app;
using namespace std;
Rocket::Rocket(int nbVectors, Vec2f t, DNA * d) {
hitTarget = false;
stopped = false;
geneCounter = 0;
target = t;
dna = d;
finishTime = 1;
recordDist = 100000... | ALGO | 0.986918 | 5.471365 |
86d12417-1669-44bd-a8d9-dbdab2f2b943 | vladvlad23/UBBComputerScienceBachelor | DataStructuresAndAlgorithms/DSATeamWork/P11.cpp | //
// Created by Vlad on 12-May-19.
//
#include "P11.h"
#include <stdexcept>
void removeMin(std::list<TElem> &list, int k)
{
if(k<=0)
throw std::invalid_argument("No good k\n");
if(k>=list.size())
{
list.clear();
}
Heap h;
std::list<TElem> newList;
std::list<TElem>::iterator... | ALGO | 0.998941 | 3.139543 |
6a8cc285-a0c0-443f-8459-8439b29d9f90 | supermarkion/LintCode | Reverse Integer.cpp | /*
Reverse digits of an integer. Returns 0 when the reversed integer overflows (signed 32-bit integer).
Link: http://www.lintcode.com/en/problem/reverse-integer/
Example:
Given x = 123, return 321
Given x = -123, return -321
Solution: Remember to compare with INT_MAX and INT_MIN
Sour... | ALGO | 0.999928 | 6.274734 |
c6c7d246-c071-4f98-b2c7-c1764ea0a2a8 | desirven/algorithm | 프로그래머스/0/181943. 문자열 겹쳐쓰기/문자열 겹쳐쓰기.cpp | #include <string>
#include <vector>
using namespace std;
string solution(string my_string, string overwrite_string, int s) {
for (int i=0; i<overwrite_string.size(); i++){
my_string[i+s] = overwrite_string[i];
}
return my_string;
} | ALGO | 0.987059 | 4.08587 |
dc36fff5-cebe-4bd1-9aa6-65c26529aa3c | VA-run23/Data-Structures-And-Algorithms | Before Linked List-Done/kickStart1.cpp | //Done
//TC : O(n)
//longest subarray with same common difference
#include<iostream>
using namespace std;
#include<iostream>
using namespace std;
int main(){
int n;
cin >> n; // Input the size of the array
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i]; // Input the elements of the array
... | ALGO | 0.999987 | 4.727281 |
1043b2dd-3865-4804-86a3-83c0c5dfeca3 | UOS841/ProblemSolving | zeze1004/2577.CPP | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
vector<int> v;
int arr[10] = {0};
for (int i =0; i<3; i++) {
cin >> n;
v.push_back(n);
}
int all = v[0] * v[1] * v[2];
while(all != 0) {
arr[all%10] += 1; //0, 0, 3,... | ALGO | 0.99985 | 3.506806 |
fbc4661d-8224-4a00-9600-191a47488c74 | Ars-eniy-Cheis/ProgramLanguages | Dynamical_Programming/Dynamical_Programming.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
void menu();
long long int fib(long long int n, long long int cache[]);
void fib_dynamic(long long int n, long long int Fib[]);
void output(long long int a[], int n);
int trajectories(int n, int K[]);
int... | ALGO | 0.998885 | 3.90679 |
5129dfc6-90a1-4272-b353-a27a2ee0b303 | jocagos/competitive | CodeSignal/fb-2.cpp | #include <bits/stdc++.h>
// as n is up to 10e9, its divisors can be up to sqrt(10e9)
// but there is no need to compute them all or similar!
// since there are at most 9 digits, and there are
// only len(n) - k + 1 values to test
// still, we need a small hash_set
using namespace std;
int divisorSubstrings(long long n... | ALGO | 0.999411 | 4.905218 |
4314cd88-4df2-4634-9573-3cc57accbdfa | mvancompernolle/ai_project | data/OptionParser.cpp | // OptionParser
// Author: Nick Porcino
// Purpose: Sample code that implements a simple to use
// Command Line parsing class, based loosely on Python's OptionParser.
// Also included are simple versions of Join and Split
//#include "IlmBaseConfig.h" /* [i_a] rude MSVC2005 hack */
#include "OptionParser.h"
#if defined... | TOOL | 0.941305 | 5.737291 |
7798ac23-8674-4a83-842f-44fea5bf0d5e | AryanRaj315/CompetitiveProgrammingSolutions | C-social-distance/main.cpp | #include<bits/stdc++.h>
using namespace std;
#define loop(i, start, end) for(int i = start; i <= end; i++)
#define ll long long int
#define arrayInput(arr, n) loop(i, 0, n-1){ cin >> arr[i];}
#define arrayDisplay(arr, n) loop(i, 0, n-1){ cout << arr[i] << " ";}
#define GODSPEED ios_base::sync_with_stdio(false);cin.tie... | ALGO | 0.999243 | 3.503049 |
557704f2-1e9e-40e6-a28f-01326c4abfec | fbaru-dev/code-optimization | nbody/ver3_2/GSimulation.cpp | #include "GSimulation.hpp"
#include "cpu_time.hpp"
GSimulation :: GSimulation()
{
std::cout << "===============================" << std::endl;
std::cout << " Initialize Gravity Simulation" << std::endl;
set_npart(2000);
set_nsteps(500);
set_tstep(0.1);
set_sfreq(50);
}
void GSimulation :: set_number_of_... | ALGO | 0.998832 | 3.855305 |
899eac29-ccd8-4689-9bbe-190f45756118 | Ajaya1000/codeforces | 2090/A_Treasure_Hunt.cpp | // @itsAj
#include <bits/stdc++.h>
// #include<boost/multiprecision/cpp_int.hpp>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define test int t; cin >> t; while (t--)
#define pb push_back
#define endl '\n'
#define rep(i, x, y) for (auto i = x; i <= y; i++)
#define repi(i, x, y) for (auto i = x;... | ALGO | 0.999905 | 3.348032 |
dc60c2f3-ef82-4a36-a663-cbc2ca6a584d | OhSeonMu/BFM | lib/ramulator-pim/zsim-ramulator/pin/source/tools/Utils/attachLauncher_unix.cpp | #include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
using std::cout;
using std::cerr;
using std::endl;
using std::vector;
using std::string;
using std::str... | TOOL | 0.863165 | 6.95368 |
6c4a5e3d-f8df-472f-8b0b-5a110ebce5e5 | ZeroEngineProject/ZeroEngine | Code/Libraries/Systems/Physics/Joints/ManipulatorJoint.cpp | /*
Let i correspond to the x,y,z axes
Ci : dot(p2 - p1,i) = 0
Ci : dot(c2 + r2 - c1 - r1,i) = 0
cDoti: dot(v2,i) + dot(cross(w2,r2),i) - dot(v1,i) - dot(cross(w1,r1),i) = 0
cDoti: dot(v2,i) + dot(w2,cross(r2,i)) - dot(v1,i) - dot(w1,cross(r1,i)) = 0
Ji : [-i, -cross(r1,i), i, cross(r2,i)]
*/
namespac... | TOOL | 0.934353 | 7.004323 |
0de1cda0-0a3f-4803-a672-d46c120ff40b | Bojorge/Proyecto_de_diseno_CE | FPGA/SW_o/softmax/softmax_xrt.cpp | #include <iostream>
#include <cstdint>
#include <cstring>
// XRT includes
#include "experimental/xrt_bo.h"
#include "experimental/xrt_device.h"
#include "experimental/xrt_kernel.h"
// Profiler
#include "../timer.hpp"
// HLS Types
#include "ap_fixed.h"
// Function to find the next power of two greater than or equal ... | ALGO | 0.941464 | 5.586675 |
dd8eab2a-678f-4ad3-b6a0-f59676c5c722 | Anshullakhera/DSA-CPP | Tree/Symmetric Tree.cpp | /*
class Node {
public:
int data;
Node *left, *right;
Node(int val) {
data = val;
left = right = nullptr;
}
};
*/
class Solution {
public:
bool issym(Node *left, Node* right){
if(left==NULL || right== NULL)
return left==right;
if(left->data !=right... | ALGO | 0.999985 | 6.581193 |
e08edda1-453c-439e-b488-2c47086ea3b2 | JoseCarlosMunoz12/QuetzalGE | Quetzal/CoatlPhysicsEngine/CoatlPhysicsEngine/src/Shapes/AABB_Obj.cpp | #include "AABB_Obj.h"
using namespace CoatlPhysicsEngine;
float AABB_Obj::GetPoint(float P, float Max, float Min)
{
if (P < Min)
P = Min;
if (P > Max)
P = Max;
return P;
}
float AABB_Obj::LocPoint(float P, float Max, float Min)
{
if (P < Min)
return -1;
if (P > Max)
... | TOOL | 0.94731 | 6.301771 |
568633db-07b9-4a6d-b863-81035a858f1e | MeisterEule/gpuWorld | test/coo_matrix.cpp | #include <stdio.h>
#include <math.h>
#include <limits.h>
#include "types.h"
#include "memoryManager.hpp"
#include "spmv.hpp"
#include "random.h"
#include "count.h"
#define NONZERO_RATIO 0.5
int checkCPU (float *M, float *v, float *v_ref, LDIM Nrows) {
float *v_res = (float*)malloc(Nrows * sizeof(float));
int n_wro... | ALGO | 0.996986 | 3.978667 |
4aa3c167-f9e0-4ddd-b2e0-727bde522265 | maurotrigo/openanpr | platedetection/anpr.cpp | #include "anpr.h"
/*!
* \brief returns a list of all filenames within a directory
* \param dir directory
* \param filenames list of filenames
*/
void anpr::GetFilesInDirectory(std::string dir, std::vector<std::string> &filenames)
{
filenames.clear();
DIR *dp;
struct dirent *dirp;
if ((dp = opendir(di... | TOOL | 0.904945 | 3.896501 |
a8ba050b-7cb4-489e-b2d7-dd71ab5b34f7 | ablackcat04/Polarity-Glitch | Source/PluginProcessor.cpp | #include <random>
#include "PluginProcessor.h"
#include "PluginEditor.h"
#define PI 3.141592653589793238L
//==============================================================================
AudioPluginAudioProcessor::AudioPluginAudioProcessor()
: AudioProcessor (BusesProperties()
#if ! JucePlugi... | ALGO | 0.933172 | 6.20416 |
8a3be388-d87a-4612-bff9-c7c35c0c2824 | yaswanth230755/neetcode-150-solutions | Number of Islands.cpp | // class DSU {
// vector<int> Parent, Size;
// public:
// DSU(int n) {
// Parent.resize(n + 1);
// Size.resize(n + 1);
// for (int i = 0; i <= n; i++) {
// Parent[i] = i;
// Size[i] = 1;
// }
// }
// int find(int node) {
// if (node != Par... | ALGO | 0.999951 | 6.257562 |
317720fb-5277-4caa-8e1a-6e126afacd72 | SLIIT-FacultyOfComputing/tutorial-02b-IT21054518 | tute03.cpp | /*Exercise 3 - Repeatition
Convert the C program given below which calculates the Factorial of a number that you input from the keyboard to a C++ program.
Please Note that the input command in C++ is std::cin. This is a representation of the Keyboard.*/
/*#include <stdio.h>
int main()
{
int no;
long fac;
... | ALGO | 0.999517 | 3.822789 |
e7a5c6e4-5434-43ba-9b72-fa53c2d76466 | GeeKY03/cppcodesolutions | ghjgdfdfdfd.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long int> vlli;
#define pb push_back
#define endl '\n'
#define FastIO ios_base::sync_with_stdio(0);cin.tie(0);
int main() {
FastIO
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
... | ALGO | 0.999787 | 4.177976 |
2c6e6785-f16b-4383-89fa-48efa798b1d9 | WhiteCells/code | algo/daily/23/11/28.cpp | #include "../../head_file.h"
/*
problme:
url: https://leetcode.cn/problems/design-front-middle-back-queue/description
*/
class FrontMiddleBackQueue {
public:
FrontMiddleBackQueue() : head(nullptr), tail(nullptr), midd(nullptr), size(0) {}
void pushFront(int val) {
Node *node = new Node(val);
... | ALGO | 0.999654 | 5.565991 |
6648f325-0512-4bc5-8d51-a2b8dc8fb755 | ishandutta2007/codeforces | kratrissa/normal/1656/A.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int T,n,a[N],mx,mn,cx,cn;
int main(){
scanf("%d",&T);
while(T--){
scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
printf("%d %d\n",min_element(a+1,a+n+1)-a,max_element(a+1,a+n+1)-a);
}
return 0;
} | ALGO | 0.999284 | 3.919936 |
44e5bd61-edfb-4697-8f50-233e07a8978a | Binsal/Leetcode | 0052-n-queens-ii/0052-n-queens-ii.cpp | class Solution {
public:
int rec(vector<bool>col,vector<bool>diag,vector<bool>anti_diag,int row){
int n=col.size();
if(row==n)return 1;
int count=0;
for(int column=0;column<n;column++){
if(!col[column] && !diag[row+column] && !anti_diag[row... | ALGO | 0.99993 | 6.136048 |
a47c1e40-10fa-4de7-83f6-897ec1ea4698 | jin-complex-system/n5xx_tfl | n5xx_tfl_project/eiq/tensorflow-lite/tensorflow/lite/micro/kernels/log_softmax.cpp | #include "tensorflow/lite/kernels/internal/reference/log_softmax.h"
#include <cstddef>
#include <cstdint>
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/quantization_util.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/internal/types.h... | ALGO | 0.91925 | 7.543784 |
37db7a1e-a79f-4d5b-aaee-f69b9ad48190 | minji-o-j/C | sw_academy/sw1936.cpp | #include <stdio.h>
int main(void) {
int a, b;
scanf("%d %d", &a, &b);
if ((a == 1 && b == 3) || (a == 2 && b == 1) || (a == 3 && b == 2))
printf("A");
if ((b == 1 && a == 3) || (b == 2 && a == 1) || (b == 3 && a == 2))
printf("B");
return 0;
} | ALGO | 0.999975 | 3.262862 |
ac8f6d2e-c844-4a08-a3df-b4fa1750f074 | LoadGhost810/cpp | CPP_testings/Ascii.cpp | #include <iostream>
using namespace std;
int main(){
char N;
// Corrected the loop to use single quotes for characters and fixed the loop condition
for (char w = 'A'; w <= 'Z'; w++){
cout << w << endl;
}
cout << "Enter a character: ";
cin >> N;
cout << endl;
cout << "ASCII o... | TOOL | 0.965866 | 4.677355 |
b43aa9c8-1f39-448c-bfd1-d391d7c26670 | Koyingtw/CP | CF practice/1843A.cpp | #include <bits/stdc++.h>
#define Weakoying ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define int long long
#define ll long long
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pair<int, int>>
#define pqueue priority_queue
#define pb push_back
#define F first
#define S second
#define max(a, ... | ALGO | 0.999931 | 4.615288 |
8091b2ce-8020-426b-b1cf-34a861811e35 | harshshivam01/leetcode_sol | 3610-find-x-sum-of-all-k-long-subarrays-i/3610-find-x-sum-of-all-k-long-subarrays-i.cpp | class Solution {
public:
vector<int> findXSum(vector<int>& nums, int k, int x) {
int n = nums.size();
std::vector<int> answer(n - k + 1);
for (int i = 0; i <= n - k; ++i) {
answer[i] = calculateXSum(std::vector<int>(nums.begin() + i, nums.begin() + i + k), x);
... | ALGO | 0.999932 | 6.001125 |
632c511d-f50e-4951-83e3-ad1092870780 | Fanfik235/laboratory_work_01.09-31.10 | Лаб №2/№8.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
setlocale(0,"");
double x, y, c;
cout <<"Введите координаты попадания по х = ";
cin >> x;
cout <<"по у = ";
cin >> y;
c = sqrt(x*x+y*y);
if(c <= 4){
if (c <= 4 and c > 2){
cout << "5 очков";
... | TOOL | 0.99746 | 3.563564 |
c10cb19b-06bc-4d09-adcb-5542c65ccbd1 | mudar-hussain/DSA_Leetcode_Practice | 8-string-to-integer-atoi/8-string-to-integer-atoi.cpp | class Solution {
public:
//2nd Approach
int myAtoi(string s) {
if(s.length()==0) return 0;
int i=0;
while(i<s.size() && s[i]== ' ') {
i++;
}
s = s.substr(i); //i ---> last of string
int sign = +1;
long ans = 0;
... | ALGO | 0.999312 | 5.362843 |
bb36ca1a-0e63-4d45-81d4-7553db30b305 | yusifaliyevpro/Competitive-Programming | LeetCode/Easy/1582. Special Positions in a Binary Matrix.cpp | // 1582. Special Positions in a Binary Matrix
// https://leetcode.com/problems/special-positions-in-a-binary-matrix/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int numSpecial(vector<vector<int>>& mat) {
}
}; | ALGO | 0.994816 | 5.702052 |
996ddf0f-7313-4683-a031-3d6b32a1f235 | wassimalharaki/Codeforces | 900/HQ9+.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
#define all(v) v.begin(), v.end()
#define nl << '\n'
#define v vector
#define vi vector<int>
#define pii pair<int, int>
#define mp make_pair
#define pb push_back
#define INF LONG_LONG... | ALGO | 0.998065 | 3.609597 |
c675551f-f36b-4711-80bc-bb249f8c1d20 | nitinkaplas123/DSA-Daily | POD_GFG/1)min_opeartion.cpp | ERROR: type should be string, got "https://practice.geeksforgeeks.org/problems/find-optimum-operation4504/1\n\nSolution 1-:\nSteps-:\n1)here we have 2 options either 1st choose or 2nd choose.\n2)This give us idea that we can use dp here.\n\nCode-: Using recusrion\n\n int minOperation(int n)\n {\n if(n==0)\n return 0;\n \n else if(n%2==0)\n return 1+minOperation(n/2);\n else\n return 1+minOperation(n-1);\n }\n\nSolution 2-;\nSteps-:\nusing memoization\n\nCode-:\nint helper(int memo[1000001],int n)\n{\n int res;\n if(n==0)\n return 0;\n else if(memo[n]!=-1)\n return memo[n];\n else if(n%2==0)\n res=1+helper(memo,n/2);\n else\n res=1+helper(memo,n-1);\n \n return memo[n]=res;\n}\n\nint minOperation(int n)\n{\n int memo[1000001];\n memset(memo,-1,sizeof(memo));\n return helper(memo,n);\n}\n\nSolution 3-:\nSteps-:\n1)simple doing while loop for both 2 opeartions.\n\nCode-:\nint minOperation(int n)\n{\n int count=0;\n while(n!=0)\n {\n if(n%2==0)\n n=n/2;\n else\n n--;\n count++;\n }\n return count;\n}" | ALGO | 0.999971 | 5.71118 |
33385f31-f8b6-46af-8c23-544501c7590c | SayyedAdil/Codeforces-Questions | Entertainment in MAC.cpp | //------ADIL SAYYED--------
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define all(v) v.begin(),v.end()
#define vin(v,n) for(ll i=0;i<n;i++) cin>>v[i]
#define rep(i, n) for (ll i = 0; i < n; i++)
#define forf(i, a, b) for (ll i = a; i < b; i++)
#define forb(i, s, e) for (... | ALGO | 0.99994 | 4.21934 |
49a38263-a7af-4adb-88e6-275e7ede2ff5 | WebCrawlers-exe/DataStructure-Archives | LeetCode Answers/75-sort-colors/75-sort-colors.cpp | class Solution {
public:
void sortColors(vector<int>& nums) {
int zeros = 0;
int ones = 0;
int twos = 0;
int itr = 0;
for(int i=0; i<nums.size(); i++)
{
if(nums[i] == 0) zeros++;
if(nums[i] == 1) ones++;
if(nums[i]... | ALGO | 0.999951 | 5.872465 |
bc08ebf7-9294-46a5-bdb5-b16f6b707aab | naxocist/naxocist-cp | beta-prog/0025.cpp | #include <bits/stdc++.h>
using namespace std;
#define ln '\n'
#define ll long long
#define pii pair<int, int>
#define pil pair<int, ll>
#define pli pair<int, ll>
#define pll pair<ll, ll>
#define all(x) x.begin(), x.end()
#define pb emplace_back
#define p(x) cout << #x << " = " << x << '\n';
#define p2(x) cout << #x <<... | ALGO | 0.999916 | 4.119465 |
6bc05480-fb20-47d6-88e9-e6c9f63605c3 | ishandutta2007/codeforces | bohun/normal/1656/C.cpp | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= int(b); i++)
#define per(i, a, b) for (int i = b; i >= int(a); i--)
#define cat(x) cerr << #x << ": " << x << "\n";
#define sz(x) int(x.size())
using namespace std;
using ll = long long;
int n, a[200200];
void solve() {
cin >> n;
int cnt = 0;
rep(i... | ALGO | 0.999928 | 4.28337 |
a00c63b9-2c48-4738-9082-bf2ef5fc34d2 | habib09/problem-solution | uva/1112 Mice and Maze.cpp | #include <string.h>
#include <cstdio>
#include <climits>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <sstrea... | ALGO | 0.999924 | 4.664135 |
8fee2709-c2a7-4fba-ace9-32acf06781e4 | ishandutta2007/codeforces | nuip/normal/1601/C.cpp | #include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<cstring>... | ALGO | 0.999972 | 3.183913 |
180a3b34-0a14-4316-9be9-8f9926924ed2 | BUAAHPL/OpenHurricane | thirdParty/eigen/include/unsupported/doc/examples/MatrixSquareRoot.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(2,2);
A << cos(pi/3), -sin(pi/3),
sin(pi/3), cos(pi/3);
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix square root of A is:... | ALGO | 0.999612 | 3.930508 |
9f985038-a8be-42bf-8835-4b67c522f106 | WilliamHGray/AdventOfCode2024 | AOC24_14/Source.cpp | #include "Elves.h"
using namespace std;
int xSize = 101;
int ySize = 103;
int numIter = 100;
string line = "";
void printTree(vector<vector<int>> positions)
{
vector<string>grid;
grid.resize(ySize, line);
for (auto pos : positions)
{
int x = pos[0];
int y = pos[1];
grid[y][x] = 'o';
}
print(grid);
}
void... | ALGO | 0.999669 | 4.00422 |
415505d8-e94d-4b5d-8855-ef3ebfd8bce4 | XERTOV/AthElite | 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 |
206100b6-a7f4-4241-ae6b-95d80d7a3057 | DevM4rk/algorithm-Baekjoon-OJ | 2020_11/1992.cpp | #include <iostream>
using namespace std;
int N;
char arr[65][65]={0,};
void division(int xs, int ys, int xe, int ye){
int cnt_zero = 0;
int cnt_one = 0;
for(int i=xs; i<xe; i++){
for(int j=ys; j<ye; j++){
if(arr[i][j] == '0') cnt_zero++;
else if(arr[i][j] == '1') cnt_... | ALGO | 0.999871 | 3.652574 |
fdfbe33c-e09d-4e25-9d22-970c5bed1516 | guohuiGH/codes | leetcode/46_permutations.cpp | /*************************************************************************
> File Name: 46_permutations.cpp
> Author: guohui
> Mail: <EMAIL>
> Created Time: 2016年02月20日 星期六 15时52分33秒
************************************************************************/
#include<iostream>
#include<vector>
#include... | ALGO | 0.999966 | 4.701597 |
f7e07db5-e3ef-4c93-a65d-b66ad4c9f09c | qinyafee/P9-MPC-Project | src/Eigen-3.3/lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.998061 | 5.816968 |
105121fd-7a37-4743-bcc3-edefcbdde558 | peterkaczorowski/kicad | 3d-viewer/3d_rendering/raytracing/shapes2D/ring_2d.cpp | /**
* @file ring_2d.cpp
*/
#include "ring_2d.h"
#include "../../../3d_fastmath.h"
#include "../ray.h"
#include <wx/debug.h>
RING_2D::RING_2D( const SFVEC2F& aCenter, float aInnerRadius, float aOuterRadius,
const BOARD_ITEM& aBoardItem ) :
OBJECT_2D( OBJECT_2D_TYPE::RING, aBoardItem )
{
... | ALGO | 0.882843 | 7.435181 |
4153365e-e52a-4d0c-be91-5aef9b19b8a0 | MonstarCoder/MyCppPrimer | ch17/ex17_17_18.cpp | #include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <string>
using std::string;
#include <regex>
using std::regex;
using std::sregex_iterator;
int main()
{
string s;
cout << "Please input a sequence of words:" << endl;
getline(cin, s);
cout << endl;
cout << "Word(s) that violiate the ... | ALGO | 0.919613 | 3.783016 |
05ff019e-110a-472f-96dc-0e22a9f68a38 | sajin1040/DataStructures | Shortest Path Algorithms using Dijkstra’s Algorithm.cpp | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define V 6
int minDistance(int dist[], int sptSet[])
{
int min = INT_MAX, min_index;
for (int v = 0; v < V; v++)
{
if (!sptSet[v] && dist[v] < min)
{
min = dist[v];
min_index = v;
}
}
return mi... | ALGO | 0.999976 | 4.026919 |
9684cf5a-389e-47b4-b31e-1fefe5844d9a | UmerSoftwares/Spark-E1 | firmware/Marlin-2.1.x/Marlin/src/feature/backlash.cpp | #include "../inc/MarlinConfigPre.h"
#if ENABLED(BACKLASH_COMPENSATION)
#include "backlash.h"
#include "../module/motion.h"
#include "../module/planner.h"
axis_bits_t Backlash::last_direction_bits;
xyz_long_t Backlash::residual_error{0};
#ifdef BACKLASH_DISTANCE_MM
#if ENABLED(BACKLASH_GCODE)
xyz_float_t Back... | TOOL | 0.92991 | 6.706438 |
842e183d-7671-4825-a1f4-c489a85d2996 | kmjp/procon | codeforce/321-340/cf335/c.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(... | ALGO | 0.999869 | 3.963476 |
e9854101-4205-4c44-b5c3-3790918e77e5 | lauranagamine1/assembly-code | factorial.cpp | //
// Created by laura on 16/06/2025.
//
#include <iostream>
using namespace std;
int factorial(int a){
if(a <= 1){
return 1;
}
else{
return a * factorial(a-1);
}
}
int main(){
cout<<factorial(4);
} | ALGO | 0.999677 | 4.827104 |
795608ee-1309-459e-a237-6dc57a3b1139 | Boikki/haizei1906 | oj/1.cpp | /*************************************************************************
> File Name: 1.cpp
> Author: rEn Chong
> Mail: <EMAIL>
> Created Time: 六 7/30 12:13:36 2022
************************************************************************/
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <vect... | ALGO | 0.999137 | 4.262665 |
c396c839-44d0-4adc-aecf-40ccb34f5d3d | openjdk/jfx13 | modules/javafx.web/src/main/native/Source/JavaScriptCore/b3/B3FoldPathConstants.cpp | #include "config.h"
#include "B3FoldPathConstants.h"
#if ENABLE(B3_JIT)
#include "B3BasicBlockInlines.h"
#include "B3CaseCollectionInlines.h"
#include "B3Dominators.h"
#include "B3InsertionSetInlines.h"
#include "B3PhaseScope.h"
#include "B3ProcedureInlines.h"
#include "B3SwitchValue.h"
#include "B3ValueInlines.h"
n... | TOOL | 0.933601 | 7.900971 |
20d9dc0d-eb93-4db5-b81c-33ccc8e32701 | aman-sharma-as/gfg-questions | Hard/Maximum Rectangular Area in a Histogram/maximum-rectangular-area-in-a-histogram.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
private:
vector<long long> nextSmallerElement(long long arr[], int n){
stack<long long> s;
s.push(-1);
vector<long long> ans(n);
for(int i = n - 1; i >= 0; i--){
... | ALGO | 0.999952 | 6.579934 |
82d50079-7843-4e4c-99ca-957ed697b226 | Tamimkhan7/Hackerrank | Random/Migratory Birds.cpp | #include <bits/stdc++.h>
using namespace std;
#define MTK \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define mem(a, b) memset(a, b, sizeof(a))
#define trace(x) cout << #x << ' ' << x << endl
#define all(x) (x).begin(), (x).end()
#define ll int long l... | ALGO | 0.999977 | 4.463943 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.