uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7b0d26cf-a549-4097-b67b-d8cbf8965caa | SinaShahandeh/MultiPhaseField | CloseLook/2D/Oneset/createcircle.cpp | //create a dome of value 1 in the order paramter number 1.
double* createcircle(double *eta,int mboxsize, int nboxsize, int domeR)
{
int i,j,jn;
int i0=mboxsize/2; //centre of the dome position
int j0=nboxsize/2;
int size2=nboxsize*mboxsize;
//create a circle at (i0,j0)
for (j=0;j<nboxsize;j++)
{
jn... | ALGO | 0.996766 | 3.677756 |
a17a5c05-eced-40ed-87c9-68abe12d0f9e | 907th/code-challenges | Timus/1226/solution.cpp | #include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <array>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <cassert>
using nam... | ALGO | 0.999674 | 4.152674 |
96863611-cbf2-4a85-80fb-549dc4cec186 | Himanshi-Saini-0277/Leetcode_Streak | 2800-minimum-string-length-after-removing-substrings/2800-minimum-string-length-after-removing-substrings.cpp | class Solution {
public:
int minLength(string s) {
stack<char> charStack;
for (char currentChar : s) {
if (!charStack.empty() &&
((charStack.top() == 'A' && currentChar == 'B') ||
(charStack.top() == 'C' && currentChar == 'D'))) {
charSt... | ALGO | 0.999253 | 6.408645 |
9c5023f9-9a64-4957-82bc-e1750829cdae | Mongerr/Algorithm_cpp | 수업/소수의판별.cpp | #include <cstdio>
#include <iostream>
using namespace std;
bool isPrime(int N) //N이 소수인지 판별하는 함수
{
if(N == 1) return false; //1은 소수가 아님
for(int i = 2; i*i <= N; i++) // i = 2부터 루트N까지 반복
{
if(N % i == 0) //N이 i로 나누어 떨어진다면
return false; //N은 소수가 아님
}
return true; //N은 소수
}
... | ALGO | 0.997801 | 5.176286 |
8822b057-4923-4db7-9d33-7ec466e82157 | ishandutta2007/codeforces | maripium/normal/1025/F.cpp | #include <bits/stdc++.h>
using namespace std;
struct point {
int x, y;
point(int x = 0,int y = 0) : x(x), y(y) {}
point operator - (const point &p) {
return point(x - p.x, y - p.y);
}
bool operator < (const point &p) {
return make_pair(y, x) < make_pair(p.y, p.x);
}
};
point pivot = point();
long long cros... | ALGO | 0.999928 | 4.060554 |
503be5b4-655a-418f-ad17-dce79e43ce6d | imawadh/LeetCode | 226-invert-binary-tree/invert-binary-tree.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.999968 | 6.298655 |
2a33476c-fda7-4ff0-9989-ee5ec14edf8e | osama-mohamoud2006/Algorithms-Problem-Solving-Level-2 | ConsoleApplication48/ConsoleApplication48.cpp | #include <iostream>
#include <cmath>
using namespace std;
float input_number() {
cout << "enter number to floor: ";
float n;
cin >> n;
return n;
}
double floor_function (float n ){
// 10.7
/*floor() function takes floating point number as input
and returns the largest integer that is smaller than or
equal to th... | ALGO | 0.998403 | 3.321586 |
4a67bc8b-0e93-4d11-a915-6f02461eba3e | Melonator/STDISCM-Problem-Sets | implementation/threaded/BFSThreaded.cpp | #include "../../headers/threaded/BFSThreaded.h"
#include "../../headers/Graph.h"
#include <iostream>
#include <vector>
#include <string>
#include <future>
#include <mutex>
#include <atomic>
void BFSThreaded::displayPath(const std::string &start, const std::string &end, Graph* graph) {
struct State {
std::s... | ALGO | 0.998571 | 4.201589 |
659519a5-f00a-416f-a77a-010eceb6bca3 | XiaoMaResearch/hybrid_FEM_SBI | src/fem/cal_fe_global_vary_ke.cpp | //
// cal_fe_global_vary_ke.cpp
// hybrid_fem_bie
//
// Created by Max on 2/7/18.
//
//
#include "cal_fe_global_vary_ke.hpp"
//#include <omp.h>
//extern double time_fem; // declaration (not definition)
void cal_fe_global_vary_ke(int n_nodes, int n_el, MatrixXi &index_store, double q, VectorXd &u_n, VectorXd &v_n, i... | ALGO | 0.995681 | 3.243922 |
bd2a805b-018d-4927-bc4d-02f37d128635 | SurafelTm/GrowAnAppleTree | TreeLib/ActualTree.cpp | #include "pch.h"
#include "ActualTree.h"
#include "Fruit.h"
#include "TreePartsDrawable.h"
#include "ActualFruit.h"
#include "Limb.h"
#include "FruitVisitor.h"
using namespace std;
using namespace Gdiplus;
const double GrowthRate = 0.4;
CActualTree::CActualTree()
{
mRoot = make_shared<CLimb>(this, 1);
mLeaf = make... | TOOL | 0.928551 | 5.585937 |
5be0cdf3-e85d-4f16-98cf-82d0ebfa3781 | sankalpg/Essentia_tonicDebug_TEMP | src/algorithms/complex/magnitude.cpp | #include "magnitude.h"
#include "essentiamath.h"
using namespace essentia;
using namespace standard;
const char* Magnitude::name = "Magnitude";
const char* Magnitude::description = DOC("This algorithm computes the absolute value of each element in a vector of complex numbers.\n"
"\n"
"References:\n"
" [1] Complex Mo... | ALGO | 0.994946 | 6.105404 |
6f41a1a6-e6d2-4013-99bb-16ce53e4e3d8 | ishandutta2007/codeforces | natsugiri/normal/1474/E.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>
using ... | ALGO | 0.998887 | 3.751382 |
c6f1df2b-6ead-4b38-937e-a7fb8d68fa7a | PranjalDby/DSA-Cpp | recursion/recursion_cpp.cpp | #include <iostream>
#include<string>
using namespace std;
string B();
string C();
string A()
{
return "A" + B();
}
string B()
{
return "B" + C();
}
string C()
{
return "C";
}
string reversal(string s)
{
if (s.empty())
{
return "";
}
string res = "";
... | ALGO | 0.999838 | 3.573244 |
8a2424e8-9615-4b56-9bd3-c2f8b4423a3f | kal990574/Algorithm | BOJ/BOJ-2075.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N, tmp;
cin >> N;
priority_queue<int, vector<int>, greater<int> > pq;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
cin >> tmp;
... | ALGO | 0.99994 | 3.562227 |
a10becc5-4a5f-4c59-8738-d295a6b0cc9c | MrfksIv/Accelerated_CPP_Notes | Accelerated_CPP_Chapter_05/Accelerated_CPP_Chapter_05/median.cpp | #include "stdafx.h"
#include <vector>
#include <algorithm>
#include <stdexcept>
#include "Student_info.h"
using std::vector;
double median(vector<double> vec) {
vector<double>::size_type vec_size = vec.size();
if (vec_size == 0) {
throw std::domain_error("Median cannot be computed for vectors of length 0");
}
s... | ALGO | 0.987006 | 5.208605 |
f31b72b5-3f83-4eef-b8f5-84f95986c92f | pnagre05/datastructurescpp | queuesTwo.cpp | #include <iostream>
using namespace std;
struct node
{
int data; node* link;
};
class queue
{
private:
node* front; node* rear;
public:
queue()
{
front = rear = NULL;
}
void addq(int item)
{
node* temp;
temp = new node;
if (temp == NULL)
cout << endl << "Queue is f... | ALGO | 0.994967 | 3.509213 |
ed22d08d-25eb-4635-a410-73e64c1430cc | schnehowebking/csefundamentals | semester2/BasicDSA_PS-II/Week06-BST-heap-priority-Queue_and-map/module-24-final-exam/Give_Current_Min.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// Write your code here
int n, q;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i)
{
cin >> a[i];
}
cin >> q;
priority_queue<int, vector<int>, greater<int>> pqmin;
for (int i = 0; i < n; ++i)
{
... | ALGO | 0.999878 | 4.41827 |
c980d302-c6fd-4005-9e1f-bced3a9c604e | YipZLF/OJSurvivalTutorial | Codes/VirusPandora.cpp | #include<iostream>
#include<cstdio>
#include<memory>
#include<string.h>
#include<queue>
using namespace std;
const int pMAXN = 1010,sMAXN = 5101000;
const int LETTER = 26;
char pStr[pMAXN],sStr[sMAXN],rStr[sMAXN];
int nodeCnt = 0;
struct Node{
bool isBadNode,isMatched;
Node *pChild[LETTER];
Node *pPrev;
... | ALGO | 0.999774 | 3.762128 |
d45cb68d-ecda-46d0-9072-74bbd376fe70 | AliOsm/CompetitiveProgramming | CodeForces/514D. R2D2 and Droid Army.cpp | /*
Idea:
- Using Segment tree to calculate the maximum in range.
- Then using Two pointers to calculate the maximum segment.
*/
#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 10;
int n, m, k, a[N][6], sum[N], seg[4 * N][6];
void build(int at, int l, int r) {
if(l == r) {
for(int i = 1; i ... | ALGO | 0.999972 | 3.162286 |
0718e477-8ef8-422a-a666-90ba4565adf4 | SimpleCode28/Leetcode-Exercise | 100.same-tree.cpp | /*
* @lc app=leetcode id=100 lang=cpp
*
* [100] Same Tree
*/
// @lc code=start
/**
* 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), r... | ALGO | 0.999983 | 7.067409 |
b251a9eb-aae7-42f6-9ade-c1ad7e782f8d | Ankur8789/LC-my-solutions | 2130-maximum-twin-sum-of-a-linked-list/2130-maximum-twin-sum-of-a-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
int pairSum(ListNode*... | ALGO | 0.999983 | 5.457462 |
bf7e3cc2-a308-4f14-95a2-863734c238dd | adoptium/aarch32-jdk8u_hg | hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp | #include "precompiled.hpp"
#include "gc_implementation/shared/gcUtil.hpp"
// Catch-all file for utility classes
float AdaptiveWeightedAverage::compute_adaptive_average(float new_sample,
float average) {
// We smooth the samples by not using weight() directly u... | ALGO | 0.950589 | 6.600198 |
64eaf4d5-211e-4168-83a1-49dcf9def5ad | ganghe74/algo | baekjoon/10807_개수 세기.cpp | #include <iostream>
using namespace std;
int main() {
int a[100];
int N, v, cnt = 0;
scanf("%d", &N);
for (int i=0;i<N;++i) scanf("%d", &a[i]);
scanf("%d", &v);
for (int i=0;i<N;++i)
if (a[i] == v) cnt++;
printf("%d", cnt);
} | ALGO | 0.999839 | 3.971111 |
44debffb-d9d1-4452-9186-50866e866048 | faizh27/Assignment-2-Game-Arch | Assignment 2/maze.cpp | ////////////////////////////////////////////////////////////////////////////
//
// Maze - maze object
// Generates and accesses a 2D maze.
// Represents the maze as a 2D array of cells.
// Each cell contains flags to indicate which walls exist.
// The algorithm for the maze construction uses disjoint sets.
//
// (c)... | ALGO | 0.934522 | 5.64587 |
ab8136fd-eb9e-4d16-ad94-978bb43e9ad5 | QinHongZhe/hongzhe-leetcode | solution/2000-2099/2078.Two Furthest Houses With Different Colors/Solution.cpp | class Solution {
public:
int maxDistance(vector<int>& colors) {
int n = colors.size();
if (colors[0] != colors[n - 1]) return n - 1;
int i = 0, j = n;
while (colors[++i] == colors[0]);
while (colors[--j] == colors[0]);
return max(n - i - 1, j);
}
}; | ALGO | 0.999199 | 5.715848 |
b45c32cb-bd29-4d9b-a2e4-b05ed3ab0f7d | kmjp/procon | 2017-2021/2018/yahoo/qual/b.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 ZER... | ALGO | 0.999752 | 3.501713 |
e4a98a89-b1d0-454c-92a3-7b870f08e3e9 | ishandutta2007/codeforces | popovicirobert/normal/1148/D.cpp | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
// 217
// 44
/*const int MOD = 998244353;
inline int lgput(int a, int b) {
int ans = 1;
while(b > 0) {
if(b & 1) ans = (1LL * ans * a) % MOD;
b >>= 1;
a = (1LL * a * a) % MOD;
}
... | ALGO | 0.99998 | 3.911895 |
1aec51f9-1f4c-478a-b5df-448ee40d0fdd | Krishna01kp/LeetCodeProblems | 216-combination-sum-iii/216-combination-sum-iii.cpp | class Solution {
public:
vector<vector<int>>res;
void solve(int idx, int k, int n, vector<int>temp)
{
if(n<0)return;
if(temp.size()==k and n==0)
{
res.push_back(temp);
return;
}
for(int i=idx;i<=9;i++)
{
temp.push_back(i);
... | ALGO | 0.999979 | 6.57391 |
32defed4-d287-41d7-844c-2ca50e59ce4b | aspears1935/opencv-ams | shiftEstSonarOnly/RANSAC.cpp | //#include "precomp.hpp"
#include "RANSAC.hpp"
#include "_modelest.h"
//#include <algorithm>
//#include <iterator>
//#include <limits>
#include "opencv2/opencv.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/highgui/highgui.hpp"
using namespace std;
using namespace cv;
/... | ALGO | 0.997563 | 5.016016 |
bf769835-e104-4b9c-ab62-f9ab5e2d6054 | Raunak-dubey-07/Leet_Code | 1087-longest-arithmetic-subsequence/longest-arithmetic-subsequence.cpp | class Solution {
public:
int longestArithSeqLength(vector<int>& nums) {
int n=nums.size();
if(n<=2){
return n;
}
unordered_map<int,int>dp[n+1];
int ans=0;
for(int i=1;i<n;i++){
for(int j=0;j<i;j++){
int diff=nums[i]-nums[j];
... | ALGO | 0.999935 | 5.477898 |
44e57f08-a772-488d-80c6-83f470629a30 | saiket-das/DSA | algorithms/linear & binary search/binary/max-count-of-positive-and-negative-integer.cpp | /*
Maximum Count of Positive Integer and Negative Integer
Problem Link: https://leetcode.com/problems/maximum-count-of-positive-integer-and-negative-integer/
*/
class Solution {
public:
int maximumCount(vector<int>& nums) {
int neg = 0, pos = 0;
for (int i = 0; i < nums.size(); i++) { // T... | ALGO | 0.999985 | 5.580881 |
517ad7df-8495-4cd4-84df-03a67f4b1fcd | welkin-qing/C | c++/第十三次练习/第十三次课前练习/求平方根函数mySqrt的异常处理.cpp | #include<iostream>
#include<math.h>
using namespace std;
double mySqrt(double x)
{
return sqrt(x);
}
int main()
{
double x;
cin>>x;
try
{
if(x<0)
throw "Error: Can not take sqrt of negative number";
cout<<"The sqrt of "<<x<<" is "<<mySqrt(x)<<endl;
}
catch (const char *s)
{
... | ALGO | 0.99877 | 3.866318 |
bc6d1321-6017-4fef-b81d-367e883c6278 | tianway/DataStructure | Linear_Table/Chain_Storage/Circular_Double_Linked_List/main.cpp | //循环双链表(带头结点)
#include <stdio.h>
#include <stdlib.h>
typedef struct DNode {
int data;
struct DNode *prior, *next;
} DNode, *DLinkList;
bool InitDLinkList(DLinkList &L) {
L = (DNode *) malloc(sizeof(DNode));
if (L == NULL) {
return false;
}
L->next = L;
L->prior = L;
return true... | ALGO | 0.999934 | 3.949595 |
849c29bf-e66b-4c43-b4a6-8b27d709aeb9 | arazi47/university-projects | 1st year/2nd semester/OOP/Final_Exam_Practice/Written/Subject_2/a.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> v{1, 2, 3, 4, 5};
vector<int>::iterator it = find(v.begin(), v.end(), 4);
v.insert(it, 8); // 1 2 3 8 4 5
it = v.begin() + 2; // 1 2 10 8 4 5
*it = 10;
vector<int> x;
copy_if(v.begin... | ALGO | 0.998138 | 4.242916 |
b343f6c2-eb49-4f35-9676-db9839cc7fb7 | jhanssen/libcxx | test/numerics/numeric.ops/inner.product/inner_product_comp.pass.cpp | // <numeric>
// template <InputIterator Iter1, InputIterator Iter2, MoveConstructible T,
// class BinaryOperation1,
// Callable<auto, Iter1::reference, Iter2::reference> BinaryOperation2>
// requires Callable<BinaryOperation1, const T&, BinaryOperation2::result_type>
// && HasAssign<T, Bi... | TEST | 0.889593 | 6.671736 |
068853fe-2d75-47a4-8ac0-d9970bb75690 | liangkyle08/competitive-programming | MyProblems/checkers/ncmp.cpp | #include "testlib.h"
using namespace std;
int main(int argc, char *argv[]) {
setName("compare ordered sequences of signed int%d numbers", 8 * int(sizeof(long long)));
registerTestlibCmd(argc, argv);
int n = 0;
string firstElems;
while (!ans.seekEof() && !ouf.seekEof()) {
n++;
lo... | TEST | 0.924948 | 3.930218 |
9e9495d1-510f-4bd6-bba5-0bb1ad6412c9 | linneszyx/CP-Problems | Easy/Print all nodes that don't have sibling/print-all-nodes-that-dont-have-sibling.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
};
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
return temp;
}
Node* buildTree(string str)
... | ALGO | 0.999771 | 6.255589 |
03fe7bbd-0fe1-4550-8a44-64f09dcc0e6b | Harxnee/E1_DAA | insertion_sort_analysis/Codes/insertion_sort_vector.cpp | #include<iostream>
#include<vector>
#include<ctime>
using namespace std;
int main()
{
vector<int> elements;
int key,i,j,n,ele;
//cout<<"Enter number of elements";
cin>>n;
for(i=0;i<n;i++)
{
cin>>ele;
elements.push_back(ele);
}
clock_t tStart = clock();
for(j=1;j<n;j++)
{
... | ALGO | 0.99989 | 3.872624 |
4b1b91c8-c0a2-4583-a4e3-a1ac87e18b77 | samkenhuang/Algorithm | leetcode/top-interview-questions-easy/string/longestCommonPrefix.cpp | #include "../../util/stl.h"
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
string prefix = "";
if (strs.size() == 0) return prefix;
else if (strs.size() == 1) return strs[0];
bool run = true;
for (int i = 0; i < strs[0].size() && run; i ++) {
... | ALGO | 0.999338 | 5.485153 |
d780f8a4-ec07-406b-9890-cd3f3bb785b7 | CapStoneProject-KW/BoT-SORT | VideoCameraCorrection/VideoCameraCorrection/cmc.cpp | #include "cmc.h"
CGMC::CGMC(int downscale, int nb_features, bool detections_masking)
{
if (0 < downscale && downscale < 8)
m_downscale = downscale;
if (0 < nb_features)
m_numberFeatures = nb_features;
m_detectionsMasking = detections_masking;
m_est = cv::makePtr<cv::videostab::Motion... | ALGO | 0.890671 | 5.67748 |
a2435bd9-17e7-4025-bb55-76d026f33201 | Hrishi75/DSA | numberhashing.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int arr[n];
for(int i= 0 ; i< n;i++){
cin >> arr[i];
}
int hash[13] ={0};
for(int i =0;i<n;i++){
hash[arr[i]] += 1;
}
int q;
cin >> q;
while(q--){
int number;
cin>> numbe... | ALGO | 0.999689 | 4.264389 |
1c818399-4303-4bab-9616-f7e47c2060fa | shreyasjoshi1234/c-codes | C++/57_Exchange_of_obj.cpp | #include<iostream>
using namespace std;
class point
{
int x,y;
public:
point(int a,int b)
{
x=a;
y=b;
}
//Don't expect the function to xch values of ob1 and ob2
//Because the calling object values can be modified
//but the object which is passed as parameter is call by ... | ALGO | 0.972226 | 4.563633 |
e9d0017d-b654-47e0-b373-a0bdd3b25bd5 | ahananupam33/6companies30days | Walmart/Q4_NumberOfUniquePath.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution
{
public:
//Function to find total number of unique paths.
int NumberOfPath(int a, int b)
{
// For 1 column or 1 row only 1 path is possible
if(a==1|| b==1)
return 1;
return NumberOfPath(a-1, b)... | ALGO | 0.99994 | 5.947411 |
ac831e02-66a4-4546-97c5-dcbd023726a9 | PlayerY102/MyCode | code/sencond/w.cpp | #include<stdio.h>
#include<algorithm>
#include<string.h>
#define max_size 1007
char inp[max_size];
int ifis(char* l,char* r){
int flag=0;
int count=0;
int com_count=0;
for(char* i=l;i<=r;i++){
if(*i=='('){
count++;
}
else if(*i==')'){
count--;
}
... | ALGO | 0.99984 | 3.404798 |
1d4f8535-e07e-4636-91ea-8a6abce53626 | anmolkohli13/DSA-practice | leetcode solutions/trapping_rain_water.cpp | class Solution {
public:
int trap(vector<int>& arr) {
int i;
int n = arr.size();
int *left = new int[n];
int *right = new int[n];
left[0] = arr[0];
right[n-1] = arr[n-1];
for(i = 1; i < n; i++)
{
left[i] = max(arr[i],left... | ALGO | 0.999936 | 6.666577 |
a958c485-3c01-4b14-aa0e-b64b6313101e | mariaaktermukti/Leetcode | maximum_candies_allocated_to_K_children.cpp | #include <bits/stdc++.h>
using namespace std;
bool canDistribute(vector<int>& candies, long long k, long long candiesPerChild) {
long long count = 0;
for (int c : candies) {
count += (c / candiesPerChild);
}
return count >= k;
}
int maximumCandies(vector<int>& candies, long long k) {
long ... | ALGO | 0.999977 | 5.970103 |
a19d5b87-3466-4484-a8d8-3381b108e700 | kefeh/card_perspective | 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 |
e7e28b75-8369-4863-8ce1-e2e76efbfe2f | rayz1065/competitive-programming | ois/2016/estintori/main.cpp | #include <cstdio>
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
std::vector<std::vector<char> > mappa;
std::queue<std::pair<int,int> > muri;
std::queue<std::pair<int,int> > stanza;
int mancanti(0);
using namespace std;
void cercaesti(){
int movx[]={0,1,1}, movy[]={1,0,1}, x=stanza.fron... | ALGO | 0.996956 | 4.048368 |
9fa5d1f8-2a59-48ce-83b9-ef3aa555a245 | fe1w0/VulnInfoSearch | DataSet/MethodSet/VulnSet/C++/CWE-190/CVE-2022-23562/Compute.cpp | void Compute(OpKernelContext* context) {
const Tensor& start_in = context->input(0);
const Tensor& limit_in = context->input(1);
const Tensor& delta_in = context->input(2);
// TODO(rmlarsen): Disallow legacy use of length-1 vectors as scalars.
OP_REQUIRES(context,
TensorShapeUtils... | ALGO | 0.98469 | 7.153509 |
02e91e67-350f-4e33-8d2b-6d088aa273ca | CHRISTIANAGUIRRE16/codigoQR | codigo_qr_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.998633 | 6.785645 |
50bd7574-9686-426d-b00c-ff709daaf5a2 | sarvex/leetcode-nativescript | solution/2000-2099/2071.Maximum Number of Tasks You Can Assign/Solution.cpp | class Solution {
public:
int maxTaskAssign(vector<int>& tasks, vector<int>& workers, int pills, int strength) {
sort(tasks.begin(), tasks.end());
sort(workers.begin(), workers.end());
int n = tasks.size(), m = workers.size();
int left = 0, right = min(m, n);
auto check = [&](... | ALGO | 0.999992 | 5.603654 |
c96b7c12-99e5-44b9-abfd-8ebd970082d7 | CMU-SAFARI/DAMOV | simulator/pin/source/tools/SimpleExamples/topopcode.cpp | /* ===================================================================== */
/*
@ORIGINAL_AUTHOR: Robert Muth and Artur Klauser
*/
/* ===================================================================== */
/*! @file
* This file contains a real time opcode mix profiler
*/
#include "pin.H"
#include "portability.... | TOOL | 0.968729 | 6.880118 |
e56d06d2-2551-49b5-8611-09bda36d1e53 | will-zzy/2dgs-non-official | SIBR_viewers/src/core/system/Matrix.cpp | #include "core/system/Transform3.hpp"
namespace sibr
{
Matrix4f perspective( float fovRadian, float ratio, float zn, float zf, const sibr::Vector2f & p)
{
const float yScale = float(1.0)/std::tan(fovRadian/2.0f);
const float xScale = yScale/ratio;
Matrix4f m;
const float dx = 2.0f * p.x() - 1.0f;
const fl... | ALGO | 0.938172 | 5.924917 |
62f768d3-8ea2-490d-9acb-89a5766f53ef | gulf1324/Leet_code | cpp/Solutions/Top 100 Liked/Find the Duplicate Number.cpp | #include <iostream>
#include <typeinfo>
#include <vector>
using namespace std;
////////////////////////////////////////////////////////////////////////////////////////////////////
// Floyd's Tortoise and Hare (Cycle Detection)
// O(n), O(1)
class Solution {
public:
int findDuplicate(vector<int>& nums) {
in... | ALGO | 0.999457 | 5.588445 |
56d814d1-91a1-410d-8b0e-147230c60c4b | sachinDev07/Programming-language | C++ Programs/10_program.cpp |
// Write a program to calculate simple interest
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int p,t;
float r;
cout<<"Enter the principal , rate of interest and time"<<endl;
cin>>p>>r>>t;
float si = (p*r*t)/100;
cout<<"your SI is "<<si;
} | ALGO | 0.991148 | 3.531635 |
c2448f05-3e7e-46dd-b1f2-48eaf2b41826 | Utchash007/Leetcode_Solution | 0062-unique-paths/0062-unique-paths.cpp | class Solution {
public:
int dp[102][102];
int dpf(int i, int j){
if(i==0 && j==0)return 1;
if(i<0|| j<0)return 0;
if(dp[i][j]!=-1)return dp[i][j];
return dp[i][j]=dpf(i-1,j)+dpf(i, j-1);
}
int uniquePaths(int m, int n) {
memset(dp,-1, sizeof(dp));
return dpf(m-1,n-1);
}
}; | ALGO | 0.999944 | 6.339501 |
c698c8c5-f93a-4409-b089-bf8ce2066405 | 1stcooldude/zybooks | testing zylabs/Module 18/18.49/main.cpp | #include <iostream>
using namespace std;
double CalculateMonthElectricCost(double monthKWh, double tier1Cutoff, double tier1Cost,
double tier2Cutoff, double tier2Cost, double tier3Cost) {
double remainingKWh = monthKWh;
double price = 0;
if (remainingKWh > tier2Cutoff){
... | ALGO | 0.999452 | 3.604709 |
b92aa266-d156-4c2d-8e34-a4199e8215ba | syw1114/Coding-Test | 백준/백준5427.cpp | #include <iostream>
#include <cstring>
#include <vector>
#include <queue>
#define MAX 1000
#define INF 999999
using namespace std;
int N,W,H;
char MAP[MAX][MAX]; // .
int Fire_MAP[MAX][MAX]; // .
bool visit[MAX][MAX];
int dx[] = { 1,-1,0,0 }; //
int dy[] = { 0, 0 ,1,-1 };
pair<int, int>start;
queue<pair<int, int>... | ALGO | 0.999965 | 4.285815 |
a8016703-acfe-4a37-841d-c93e37491b66 | ishandutta2007/codeforces | somethingnew/normal/1475/E.cpp | #include "list"
#include <iostream>
#include <vector>
#include <fstream>
#include <map>
#include "algorithm"
#include <iomanip>
#include "cmath"
#include "set"
#include <climits>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
ll mod = 1e9 + 7;
ll pow(ll a, ll b){
ll res = 1;
wh... | ALGO | 0.999934 | 4.322995 |
90adf514-98cb-4a11-80b0-9d5afe29ed06 | Deepakkr2003/MY-CODECHEF-SOLUTION | Even_Sum_Subarray.cpp |
#pragma GCC optimize("O3,unroll-loops")
#include<bits/stdc++.h>
using namespace std;
//#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define nline "\n"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#defi... | ALGO | 0.999757 | 4.4582 |
d5f5402a-7f66-4127-91e9-d43687e72d3c | Krishpatel1314/C-plus-plus-Program | SET-3/KRISH3.cpp | /*WA function called zerosmaller() uses two arguments.
Use return by reference to the function concept and set a smaller value to 0.*/
#include<iostream>
using namespace std;
void zerosmaller(int &, int &);
int main()
{
int j,k;
cout<<"Enter first number:";
cin>>j;
cout<<"Enter second number:";
cin>... | ALGO | 0.998413 | 4.795135 |
bce26f64-6fea-4874-8462-10885ce0f069 | thomasbarrett/voxel | wasm/src/voxel/perlin.cpp | #include <voxel/Perlin.hpp>
#include <libc/math.hpp>
static const int SEED = 1985;
static const unsigned char HASH[] = {
208,34,231,213,32,248,233,56,161,78,24,140,71,48,140,254,245,255,247,247,40,
185,248,251,245,28,124,204,204,76,36,1,107,28,234,163,202,224,245,128,167,204,
9,92,217,54,239,174,173,102... | ALGO | 0.995483 | 6.176956 |
dfc6ea8c-c3a2-4831-9615-abb2617863c2 | MrArthor/CPP | C++/graph-connectivity-with-threshold.cpp | // Time: O((nlogn + q) * α(n)) ~= O(nlogn + q)
// Space: O(n)
class Solution {
public:
vector<bool> areConnected(int n, int threshold, vector<vector<int>>& queries) {
UnionFind union_find(n);
for (int i = threshold + 1; i <= n; ++i) {
// https://stackoverflow.com/questions/25905118/fin... | ALGO | 0.999797 | 6.198779 |
d5699e26-3df1-4375-879d-4531c4fc545e | jaronho/sdk | alone/cxx/packetcrypto/PacketCrypto.cpp | /**********************************************************************
* Author: jaron.ho
* Date: 2014-03-21
* Brief: packet crypto
**********************************************************************/
#include <memory.h>
#include <stdlib.h>
#include <time.h>
//------------------------------------------------------... | ALGO | 0.907913 | 4.446375 |
3f35a176-bac3-485f-9230-871c751c4b4d | Sammyhao/Automated-Debugging-System | Mod_AGC003A_1.cpp | #include <fstream>
#include <bits/stdc++.h>
using namespace std; fstream routeFile("route.txt", fstream::out|fstream::trunc);
int main(){ routeFile << to_string(__LINE__) << " ";
string s; routeFile << to_string(__LINE__) << " ";
cin >> s; routeFile << to_string(__LINE__) << " ";
int Up = 0,Left = 0; r... | ALGO | 0.99998 | 3.826123 |
7aaff141-8d32-40be-b8ee-5e2b9256d248 | maru2213/Competitive-programming | AIZU ONLINE JUDGE/Introduction to Programming I/ITP1_05_C.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
int h, w;
cin >> h >> w;
if (h == 0 && w == 0) {
break;
}
for (int i = 0; i < h; i++) {
for(int j = 0; j < w; j++) {
if (i % 2 == j % 2) {
cout << "#";
} else {
cout << ".";
... | ALGO | 0.999299 | 3.855228 |
f58fda16-1c59-4116-ac53-c45edcb34cce | 183aryan/LeetCode-Solutions | 0077-combinations/0077-combinations.cpp | class Solution {
public:
void f(int idx, int k, int n, vector<int>& temp, vector<vector<int>>& v){
if(temp.size() == k){
v.push_back(temp);
return;
}
for(int i=idx;i<n+1;i++){
temp.push_back(i);
f(i+1, k, n, temp, v);
temp.pop_back(... | ALGO | 0.999984 | 6.02859 |
6c3d37cf-38ed-4142-addd-aa5999a6937a | ChuanqiXu9/clangd-for-modules | libc/src/math/generic/exp2m1f.cpp | #include "src/math/exp2m1f.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PolyEval.h"
#include "src/__support/FPUtil/except_value_utils.h"
#include "src/__support/FPUtil/multiply_add.h"
#include "src/__support/FPUtil/rounding_mode.h"
#include "src/_... | ALGO | 0.908608 | 5.675009 |
3399d336-60a2-4538-a81e-eadd9782d890 | ishandutta2007/codeforces | black_horse2014/normal/830/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VPII;
typedef pair<LL, LL> PLL;
typedef pair<int, LL> PIL;
typedef pair<LL, int> PLI;
typedef double DB;
#define pb push_back
#define mset(a, b) memset(a, b, sizeof a)
#define al... | ALGO | 0.999945 | 3.432069 |
67901fb2-bc39-4dc7-987c-9da0b664d9c5 | ssunggun2/LeetCode | 0130-surrounded-regions/0130-surrounded-regions.cpp | #include <vector>
using namespace std;
class Solution {
public:
int m;
int n;
void DFS(vector<vector<char>>& board, int i, int j) {
// 만약 i 또는 j가 보드의 범위를 벗어나거나 보드[i][j]가 'O'가 아니면 반환
if (i < 0 || i >= m || j < 0 || j >= n || board[i][j] != 'O') {
return;
}
// 보드[... | ALGO | 0.999717 | 6.437687 |
f5400aa1-eed6-44a6-9215-4f121c6d1893 | tiankonguse/ACM | manger/离散化/连连看/HUD_4444.cpp | #include <cstdio>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
using namespace std;
struct B {
int x1, y1, x2, y2;
void init() {
scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
if(x1 > x2) {
swap(x1, x2);
}
if(y1 > y2) {
swap(y1, y2);
}
};
};
struct P {
int x, y, stp, d;
};
int pos[4... | ALGO | 0.999491 | 3.51316 |
9000f5e0-73ed-441a-b82b-8d825beee3a4 | nonoivan1234/112PD | exam/quiz1/2.cpp | #include<bits/stdc++.h>
using namespace std;
#define nono_is_handsome cin.tie(0); ios_base::sync_with_stdio(0);
#define int long long
signed main(){
nono_is_handsome
int n, B;
cin >> n >> B;
int now = 0;
for(int i = 0; i < n; i++){
int x, y, c, p;
cin >> x >> y >> c >> p;
... | ALGO | 0.99976 | 3.750029 |
990db5b2-3c87-4df4-93d6-3d9a60eab511 | raincross7/code-similarity | codes/train_code/problem283/problem283_12.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define file_se_input freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pp long long int
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __bui... | ALGO | 0.999878 | 3.443851 |
2a591580-6db8-42d5-b44f-01d2fbf55607 | iamslash/learntocode | leetcode/StatisticsfromaLargeSample/a.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
// 0 1 2 3 4
// 0 4 3 2 2
// cnt: 11
// sum: 24
// min: 1
// max: 4
// mea: sum/cnt = (1*4 + 2*3 + 3*2 + 4*2)/11 = 24/11 = 2.18182
// mod: 1
// m1: (cnt + 1) / 2 = 12 / 2 = 6
// m2: 6 (same with m1 because cnt is odd)
// med: 2
// 4ms 83.9... | ALGO | 0.999066 | 4.910498 |
77e937f5-75bb-401a-928f-aa092e9dec19 | K1XE/LeetCode | 每日一题/2025-6/6.19/2294.划分数组使最大差为-k.cpp | /*
* @lc app=leetcode.cn id=2294 lang=cpp
*
* [2294] 划分数组使最大差为 K
*/
// @lc code=start
#pragma once
#include <bits/stdc++.h>
#include <ranges>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#define ALL(v) v.begin(), v.end()
#define For(i, _) for (int i = 0, i##end = _; i < i##end... | ALGO | 0.999751 | 6.240825 |
1737282f-202a-4221-b512-dc68af63ab17 | KennethYangle/Graphical_Game_based_Allocation | RealFlight/motion_capture_system/mocap_base/src/KalmanFilter.cpp | #include <ros/ros.h>
#include <Eigen/SVD>
#include <mocap_base/KalmanFilter.h>
using namespace std;
using namespace Eigen;
namespace mocap {
KalmanFilter::KalmanFilter():
attitude (Quaterniond::Identity()),
position (Vector3d::Zero()),
angular_vel (Vector3d::Zero()),
linear_vel (Ve... | ALGO | 0.996045 | 6.624674 |
e16cd4c5-ddc7-4426-8563-52e142172a22 | jonckjunior/UVa | UVa 11634 - Generate random numbers.cpp | #include <bits/stdc++.h>
using namespace std;
int N, v[10000];
int f(int x){
return ((x*x / 100) %10000);
}
int main(){
int caso = 0;
while(cin >> N, N != 0){
memset(v,0,sizeof v);
int c = 0;
while(v[N] == 0){
v[N] = 1;
N = f(N);
c++;
... | ALGO | 0.999561 | 3.892447 |
9e37c20d-b066-4f2c-b267-8b3e4ee15ec2 | MostafaMohamed2001/C-Data-Structure | .history/hello_20240716114258.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n,k, pass = 0;
cin >> n >> k;
for (int i = 0; i < n; i++){
string str;
cin >> str;
bool digit_good[10] = {false};
}
} | ALGO | 0.998692 | 3.276337 |
3ea06a82-7488-43c8-8669-b92684670d26 | P0L3NARUBA/roblox-2016-source-code | Contribs/boost_1_56_0/libs/locale/src/icu/boundary.cpp | #include "cdata.hpp"
#include "all_generator.hpp"
#include "icu_util.hpp"
#include "uconv.hpp"
namespace boost {
namespace locale {
namespace boundary {
namespace impl_icu {
using namespace boost::locale::impl_icu;
index_type map_direct(boundary_type t,icu::BreakIterator *it,int reserve)
{
index_type indx;
i... | TOOL | 0.91445 | 5.203541 |
98a40c71-be16-4bb1-b974-08a058f142be | sanketmalaviya/Assignment | c++/d.cpp | /* Define a class to represent a bank account. Include the following members:
1. Data Member:
-Name of the depositor
-Account Number
-Type of Account
-Balance amount in the account
2. Member Functions
-To assign values
-To deposited an amount
-To withdraw an amount after checking balance
-To display name and ... | TOOL | 0.878785 | 4.860195 |
8e5d4506-8084-4e7f-a710-2fa0e5bbdee6 | HimanshuYadav0/DSA-Questions | 0027-remove-element/0027-remove-element.cpp | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int k = 0;
for (int i = 0; i < nums.size(); i++) {
if (nums[i] != val) {
nums[k] = nums[i];
k++;
}
}
return k;
}
};
| ALGO | 0.998376 | 6.196438 |
8267570c-6b51-4804-b863-a897b52e3074 | aishita04/aishita.cpp | prac6.cpp | #include<iostream>
using namespace std;
int binarySearch(int a[],int l,int h, int n)
{
if(l<=h)
{
int m=(l+h)/2;
if(a[m]==n)
{
return m;
}
else if(a[m] <n)
{
return binarySearch(a,m+1,h,n);
}
else
{
return binarySearch(a,l,m-1,n);
}
}
return -1;
}
int main()
{
int a[]={1,3,5,8,10};
int n=... | ALGO | 0.999845 | 5.009349 |
10b5f115-73e0-4265-8868-85b8c660e0d3 | joydip007x/CompetitiveCodeArchive | HackerRank/tower-breakers-revisited-1/22635558_AC_4563ms_0kB.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll int
#define ret return
#define pp printf("1\n")
#define qq printf("2\n")
#define pb push_back
ll t;
const ll sz=1000000+100;
ll dp[sz];
unordered_set<ll>divlist[sz];
void prec(ll p){
if(divlist[p].size() || p<=1 ) return;
ll ss=sqrt(p);
for(ll... | ALGO | 0.999508 | 3.750969 |
5e3d41dc-2585-4926-9537-cd6dab7492ef | yuvraj1107thapa/Competitive-Programming | Algo++/Maths/Advanced/fibonaccilogn.cpp | #include <iostream>
#define ll long long int
using namespace std;
void multiply(ll A[2][2], ll M[2][2]) {
ll fvalue = A[0][0] * M[0][0] + A[0][1] * M[1][0];
ll svalue = A[0][0] * M[1][0] + A[0][1] * M[1][1];
ll tvalue = A[1][0] * M[0][0] + A[1][1] * M[1][0];
ll lvalue = A[1][0] * M[0][1] + A[1][1] * M[1][1];
A[0... | ALGO | 0.999979 | 3.941216 |
2c68bc17-3a56-4191-8598-a6c700ed0b1b | darkwuta/-CSC417-Assignment | Assignment2/extern/libigl/include/igl/quad_planarity.cpp | template <typename DerivedV, typename DerivedF, typename DerivedP>
IGL_INLINE void igl::quad_planarity(
const Eigen::PlainObjectBase<DerivedV>& V,
const Eigen::PlainObjectBase<DerivedF>& F,
Eigen::PlainObjectBase<DerivedP> & P)
{
int nf = F.rows();
P.setZero(nf,1);
for (int i =0; i<nf; ++i)
{
const Ei... | ALGO | 0.997101 | 6.457924 |
33500520-ae55-4e05-8d61-8444b78e9d8f | MandusBorjesson/gesh | src/setting/src/setting.cpp | #include "setting.h"
#include <iomanip>
#include <iostream>
#include <limits>
std::optional<std::string> toString(const setting_t &setting) {
if (std::holds_alternative<std::string>(setting)) {
return std::get<std::string>(setting);
}
if (std::holds_alternative<int>(setting)) {
return std::... | TOOL | 0.934159 | 7.267898 |
9dfbfc8b-be7a-4ffe-99f4-52c394d7ed9c | fanacio/ncnn-inference | ncnn-master/src/layer/riscv/selu_riscv.cpp | #include "selu_riscv.h"
#if __riscv_vector
#ifdef RVV_SPEC_0_7
#include "riscv_v_071_fix.h"
#else
#include <riscv_vector.h>
#endif
#include "rvv_mathfun.h"
#endif // __riscv_vector
namespace ncnn {
int SELU_riscv::forward_inplace(Mat& bottom_top_blob, const Option& opt) const
{
int w = bottom_top_blob.w;
int... | ALGO | 0.977856 | 6.733792 |
15ba651d-5509-46dd-af5a-425665c66ed5 | keisuke90/AtCoder | practice/abc157-b.cpp | #include <bits/stdc++.h>
#define rep(i, start, end) for(int i = start; i < end; i++)
using namespace std;
vector<vector<int>> A(3, vector<int>(3));
vector<vector<bool>> B(3, vector<bool>(3));
bool bingo() {
rep(i, 0, 3) {
if(B[i][0] && B[i][1] && B[i][2]) {
return true;
}
}
rep(... | ALGO | 0.999894 | 4.108971 |
1218dae0-44be-4207-8292-78a00f62f292 | AmpereComputingAI/oneDNN | src/gpu/ocl/rnn/cell_common.cpp | // Common for RNN and LSTM cell execution
#include "gpu/ocl/rnn/ref_rnn.hpp"
namespace dnnl {
namespace impl {
namespace gpu {
namespace ocl {
using namespace dnnl::impl::utils;
using namespace rnn_utils;
template <prop_kind_t aprop>
cell_execution_sig((_ref_rnn_common_t<aprop>::cell_execution)) {
const conf_t ... | ALGO | 0.99355 | 7.12116 |
cbad84b0-a109-45af-97d8-1b816472d320 | gh0stintheshe11/LeetCode-Solutions | solutions/remove-duplicate-letters/C++.cpp | class Solution {
public:
string removeDuplicateLetters(string s) {
vector<int> lastIndex(26, -1);
vector<bool> inStack(26, false);
for (int i = 0; i < s.size(); ++i) {
lastIndex[s[i] - 'a'] = i;
}
string result;
for (int i = 0; i... | ALGO | 0.999986 | 7.064563 |
0d4069c3-bf28-4931-a9b4-a5d54ea9f67d | DinosL/BenchmarkingAdaptiveIndexes | src/main_nonAdaptiveGrid.cpp | #include "basics.h"
#include "AKD_grid.h"
int getStartOfcell(ELEMTYPE start, ELEMTYPE extent)
{
return (int)(start / extent + EPS);
}
int getCellId(ELEMTYPE x, ELEMTYPE y, int numCellsPerDimension)
{
return (y * numCellsPerDimension + x);
}
void partition2DGrid(int partitionsPerDimension, ELEMTYPE** index, ... | DATA | 0.990452 | 4.088861 |
7a17f9d2-dfb9-4003-9d2c-812b730f4c8a | andreapassini/LearningCpp | ReturnMultiple/ReturnMultiple/ReturnMultiple.cpp | #include <iostream>
using namespace std;
int getMin(int numbers[], int size)
{
int min = numbers[0];
for(int i = 1; i < size; i++)
{
if(numbers[i] < min)
min = numbers[i];
}
return min;
}
int getMax(int numbers[], int size)
{
int max = numbers[0];
for(int i = 1; i < s... | ALGO | 0.999893 | 4.798335 |
23fc9986-2e05-43d3-879e-8f7e2a44b55e | markcda/unitech-bop-1st-gr-2023-cpp | 14/4-4.cpp | #include <iostream>
#include <vector>
using namespace std;
struct date {
int day;
string month; // "mar", "apr", "may", etc.
int year;
};
int main() {
vector<date> dates = {
{27, "apr", 1993},
{26, "apr", 1986},
{25, "jan", 2005}
};
for (auto &d : dates) {
if (d.month == "mar" or d.month ... | TOOL | 0.930282 | 4.749671 |
3ea31008-37bc-45a3-bc49-cbf3ed80dc6a | Dragon-oniv/packages_apps_ColtOTA | jni/boost_1_57_0/libs/spirit/example/x3/calc4b.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A Calculator example demonstrating generation of AST. The AST,
// once created, is traversed, 1) To print its contents and
// 2) To evaluate the result.
//
// [ JDG April 28, 2008 ] For BoostCon 2008
// [ JDG February 18, 20... | TOOL | 0.870062 | 7.846494 |
c4d89871-d976-4605-83fc-19bfce245322 | OsvathKatalin/DSAII | labor11.cpp | //
// Created by Just Ok on 11.05.2023.
//
#include "labor11.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
void penzek() {
ifstream f("penzek.txt");
int n, ossz,ossz1=0;
f>>n;
int t[n], j=n-1,t1[100];
for (int i = 0; i < n; ++i) {
f>>t[i];
}
ren... | ALGO | 0.999448 | 3.863148 |
a08448b1-5b7d-49d6-8773-af8d5372a474 | doocs/leetcode | solution/3200-3299/3247.Number of Subsequences with Odd Sum/Solution.cpp | class Solution {
public:
int subsequenceCount(vector<int>& nums) {
const int mod = 1e9 + 7;
vector<int> f(2);
for (int x : nums) {
vector<int> g(2);
if (x % 2 == 1) {
g[0] = (f[0] + f[1]) % mod;
g[1] = (f[0] + f[1] + 1) % mod;
... | ALGO | 0.999997 | 5.870772 |
7c000c80-54c1-471a-b5d6-96ae6ca34845 | mosuab-bit/Problem-Solving-C- | Problem 32/Problem 32.cpp |
#include <iostream>
#include <string>
using namespace std;
char ReadChar()
{
char char1;
cout << "Please Enter Your Char?\n";
cin >> char1;
return char1;
}
bool IsVowel(char Ch1)
{
Ch1 = tolower(Ch1);
return ((Ch1 == 'a') || (Ch1 == 'e') || (Ch1 == 'i') || (Ch1
== 'o') || (Ch1 == 'u'));
}
int main()
{
char... | ALGO | 0.965148 | 3.802036 |
22795a19-a566-4ef0-b9f0-0602d687f06c | ValentinViz20/sorting-algorithms-demo-poo-usv | MetodeDeSortareDemoVizitiuValentin/QuickSort.cpp | #include "QuickSort.h"
QuickSort::QuickSort(int arraySize) : SorterBase(arraySize)
{
}
void QuickSort::Sort(bool recordSorting)
{
this->recordSorting = recordSorting;
QuickSortStart(array, 0, array.size() - 1);
}
void QuickSort::Swap(int& a, int& b) {
int temp = a;
a = b;
b = temp;
}
int QuickS... | ALGO | 0.999649 | 5.708452 |
629a025f-fd9a-48b9-983f-26769415a05d | ishandutta2007/codeforces | ljc00118/normal/1270/B.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 = a; i >= b; i--)
using namespace std;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef long long ll;
template <typename _T>
inline void read(_T &f) {
f = 0; _T fu = 1; char c = getchar()... | ALGO | 0.999863 | 3.606858 |
261191e1-b39e-43b1-966a-006a874ce01a | suubh/100-Days-of-Code | Day-17/try.cpp | #include<iostream>
using namespace std;
int main(){
int arr[4]={1,2,3,4};
int *ptr=arr;
cout << *ptr <<endl; //1
cout << ptr <<endl; //Address
return 0;
} | ALGO | 0.993796 | 3.409968 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.