uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3e46de6a-4d4b-40ad-87f9-92ae8eb1aecc | abhi061201/GFG-LEETCODE-CODINGNINJA-SOLUTION | 0141-linked-list-cycle/0141-linked-list-cycle.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
ListNode* slow= head, *fast= head;
while(fast && fast->next)
{
s... | ALGO | 0.99979 | 5.204326 |
6e9ca903-f998-4288-a58c-6e2a4560784b | raincross7/code-similarity | codes/train_code/problem347/problem347_54.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
// a >= b ?
bool comp(string a, string b){
if(b == "-") return true;
if(a == "-") return false;
if(a.size() > b.size()) return true;
if(a.size() < b.size()) ... | ALGO | 0.999984 | 4.157218 |
b86e2f05-c9a4-4a40-8afc-810bfd42cdd2 | openharmony/third_party_boost | libs/iterator/example/reverse_iterator.cpp | #include <boost/iterator/reverse_iterator.hpp>
#include <boost/cstdlib.hpp>
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
int x[] = { 1, 2, 3, 4 };
boost::reverse_iterator<int*> first(x + 4), last(x);
std::copy(first, last, std::ostream_iterator<int>(std::cout, " "));
std::cout << s... | TOOL | 0.914046 | 4.15839 |
d6e98d25-cab5-4df2-ab31-56f1636accce | TomoNi1130/cpp | 最小二乗法/main.cpp | #include <iostream>
#include <random>
#include <vector>
#include <cmath>
#include "matplotlibcpp.h"
namespace plt = matplotlibcpp;
const int points_number = 750;
void drow_function(double a, double b) // 傾きと切片から一次関数のグラフを書く
{
std::vector<double> x_gess(points_number), y_gess(points_number);
for (int i = 0; i ... | ALGO | 0.981595 | 3.718391 |
637f92b1-3166-4585-a572-91ca2e548922 | ProtingasBlogasLT/Programavimas-Cpp-11 | 30 - Vienmačio masyvo duomenų atnaujinimas/Source.cpp | #include <iostream>
using namespace std;
int main()
{
int pazymiai[10] = { 7, 4, 3, 8, 9 };
int kiek = 5;
for (int i = 0; i < kiek; i++)
{
cout << pazymiai[i] << " ";
}
cout << endl;
for (int i = 0; i < kiek; i++)
{
if (pazymiai[i] < 5)
{
pazymiai[i] = 0;
}
}
for (int i = 0; i < kiek; i++)
{
... | ALGO | 0.989948 | 3.008825 |
2438329d-2f04-4d23-ab59-08b4df923b2d | Masterqsx/ProgrammingPractice | leetcode/305_Number_of_Islands2/Number_of_Islands2.cpp | class Solution {
public:
class unionfind{
public:
vector<int> array;
vector<int> sz;
int len;
unionfind(int size) : len(size){
array = vector<int>(size, 0);
sz = vector<int>(size, 1);
for (int i=0;i<size;i++) array[i] = i;
}
int... | ALGO | 0.99999 | 6.198273 |
a54c4028-cc66-4fd8-850c-678d15f17980 | Rijul796/Cpp_Programing | C++/Pattern132.cpp |
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
// bool find132pattern(vector<int>& nums) {
// int n = nums.size();
// if (n < 3) {
// return false;
// }
// stack<int> s;
// int third = INT32_MIN;
// for (int i = n - 1; i >= 0; --i) {
// if (nums[... | ALGO | 0.999816 | 4.928083 |
563df331-b2af-44ae-b72f-12a5a00c2746 | alex-roh/Cpp_PS_Study | 70 - 그래프 최단 거리 (BFS)/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <limits>
using namespace std;
int numOfVertices, numOfEdges;
vector<int> list[21];
bool visitedVertices[21];
vector<int> minDistanceFromOne(21);
void BFS(int startVertex){
queue<int> myqueue;
myqueue.push(startVertex);
visitedVertices[startVertex] =... | ALGO | 0.999777 | 4.472832 |
ca894298-893c-4a50-a36d-2ad82d9ec5ce | orestisI/Point_Cloud_Viewer_Cpp_Qt_Widget | eigen-3.4.0/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.978027 | 4.152793 |
e4d067f2-dbe8-4766-8c13-f2e1ef367e63 | harsh3sahu/DSA | 10stack/13nprac.cpp | #include<iostream>
#include<vector>
#include <cstring>
using namespace std;
class Nstack{
public:
int size;
int *arr;
int *next;
int *top;
int freespace=0;
Nstack(int size, int num){
this->size=size;
arr=new int[size];
next=new int[size];
top = new int[num... | ALGO | 0.999214 | 3.721955 |
6b1e780d-ba40-46fb-8d06-c5149524834a | Sonu08-Sto/Data-Structure-Algorithms | power.cpp | #include<iostream>
using namespace std;
int print(int a,int b)
{
if(a==0)
return b;
else if(b==0)
return a;
else
return print(b,a%b);
}
int main()
{
int n,m;
cout<<"Enter the value of N and m = ";
cin>>n>>m;
int a=print(n,m);
cout<<a;
return 0;
} | ALGO | 0.999958 | 3.569627 |
0395d472-b072-4d54-9cee-31346a6b3100 | Ruogu7/DynamicPrograming | 最长升序子序列.cpp | /***
Author: <EMAIL>
Date: March 8th, 2020
Question link: https://zhuanlan.zhihu.com/p/356275443
***/
#include<iostream>
#include<array>
using namespace std;
int longestRisingSequence (int *nums, int size) {
// һҳʼֵΪ1
std::array<int,1000> arr { };
arr.fill(1);
for(int i=0; i < size; i++) {
for (int j = 0; j<i; ... | ALGO | 0.999799 | 4.710309 |
8fbb52fb-8ee8-41f5-9aa0-f6689f3cf8d5 | joye-ramone/xray_xp_dev | xray/xr_3da/xrRender_R2/Light_Render_Direct_ComputeXFS.cpp | #include "stdafx.h"
#include "light_render_direct.h"
void CLight_Compute_XFORM_and_VIS::compute_xf_spot (light* L)
{
// Build EYE-space xform
Fvector L_dir,L_up,L_right,L_pos;
L_dir.set (L->direction); L_dir.normalize ();
if (L->right.square_magnitude()>EPS) {
// use specified 'up' and 'right', j... | TOOL | 0.943251 | 5.257801 |
d2d0d10e-69e6-47c7-b523-2c307d49dccf | dakdevs/Moorpark-Computer-Science | M10B/Homework/Homework-10/StringSearch.cpp | /* ***************************************************************************************
* CS M10B - Object-Oriented C++ - CRN 30110 - Dak Washbrook
* =======================================================================================
* Write a program that asks the user for a file name and a string to search for... | TOOL | 0.901642 | 6.381717 |
d352c70d-e992-48fd-b5e6-c15e9eaaea6a | Deirael/CMSC-21 | Lecture2/Assignment/as1.c.cpp | #include <stdio.h>
int main()
{
int number, answer = 0;
printf("Enter a 2-digit number: ");
scanf("%d",&number);
while(number > 0)
{
int lastnum = number % 10;
answer = answer * 10 + lastnum;
number = number / 10;
}
printf("The reversed number is %d\n", answer);... | ALGO | 0.999391 | 5.343277 |
ec5c3c1d-61eb-4d6d-a577-5c15264e1c4c | AdilHydari/LZRD | cpp/library/compress_floats_lzma.cpp | // compress_floats_lzma.cpp
// Generates circle data, delta-encodes, flattens, and compresses using LZMA.
//
// Requires liblzma-dev: sudo apt-get install liblzma-dev
// Compile with: g++ -std=c++17 -O2 -o compress_floats_lzma compress_floats_lzma.cpp -llzma -Wall -Wextra
#include <iostream>
#include <vector>
#include... | ALGO | 0.99715 | 7.167901 |
8b04e80b-c0f0-4f96-8121-d77eda049c4b | benyapikaso/Laboratory-works | 5_2.cpp | #include <iostream>
using namespace std;
int main()
{
int i, n, a[20];
cout << "Enter the number of array elements ";
cin >> n;
cout << "Enter the array elements as an integer through the space " << endl;
for (i = 0; i < n; i++) cin >> a[i];
for (i = 0; i < n / 2; i++) swap(a[i], a[n-i-1]);
... | ALGO | 0.999357 | 3.687175 |
515f83ed-4b76-4421-8520-df9302fdfe6e | sangyx/algorithm | poj/数字三角形.cpp | #include <iostream>
using namespace std;
int num[110][110];
int dp[110][110];
int N;
int main()
{
cin >> N;
for(int i = 1; i <= N; i++){
for(int j = 1; j <= i; j++){
cin >> num[i][j];
}
}
for(int i = 1; i <= N; i++){
dp[i][1] = num[i][1] + dp[i-1][1];
for... | ALGO | 0.999962 | 3.465913 |
170fc180-48ad-49b3-9aba-e95432b9becf | hemere/my-program | kyopro/arc/arc031/b.cpp | //問題:https://atcoder.jp/contests/arc031/tasks/arc031_2
//提出:https://atcoder.jp/contests/arc031/submissions/11635867
//2020-04-07AC
#include <bits/stdc++.h>
using namespace std;
int plusmap(vector<string> ilmap, vector<vector<bool>> &sude, int i, int j){
sude[i][j] = false;
int ilground = 1;
if(i<9 && ilmap[i... | ALGO | 0.999789 | 5.236628 |
73570308-50c3-4d8c-bf80-851231fd1cd3 | dendisuhubdy/blaze | blazemark/src/eigen/DMatInv.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.999013 | 5.866573 |
b2f4204b-6b61-4d86-952a-e6402450c30e | liulilittle/openppp2-macos-amd64-environment | boost/libs/geometry/doc/src/examples/algorithms/touches_two_geometries.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[touches_two_geometries
//` Checks if two geometries have at least one touching point (tangent - non overlapping)
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/g... | ALGO | 0.990284 | 7.001352 |
2f77758d-9a8e-4a82-ae6c-5214240c65ed | Gourav1695/SDE-Sheet_challenge | cycle_detrect_BFS.cpp | bool checkForCycle(int s, int V, vector<int >adj[], vector<int >&visited)
{
queue<pair<int, int >>q;
visited[s]=true;
q.push({s,-1});
while(!q.empty()){
int node=q.front().first;
int par = q.front().second;
q.pop();
... | ALGO | 0.999972 | 6.059942 |
41021eb2-cd11-4dd6-9dfd-1bc721bb4ac9 | basecode-lang/basecode | share/prototypes/bootstrap-redux/ext/boost-1.70.0/libs/graph/test/mcgregor_subgraphs_test.cpp | #include <cmath>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <boost/lexical_cast.hpp>
#include <boost/random.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/filtered_graph.hpp>
#include <boost/graph/graphviz.hpp>
#include <boost/graph/isomorphism.hpp>
#incl... | TEST | 0.872159 | 6.510208 |
0c81067a-22e8-4310-a1a1-84efa53049b0 | ishit1011/Everyday-LeetCode | 2406-divide-intervals-into-minimum-number-of-groups/2406-divide-intervals-into-minimum-number-of-groups.cpp | class Solution {
public:
int minGroups(vector<vector<int>>& arr) {
// Max overlapping intervals for an index in the "arr" = MIN. no. of separate groups required
// 1. Set start & end values for each event
int n = arr.size();
vector<pair<int,int>> eventStartEnd;
for(int i=0;... | ALGO | 0.999981 | 6.20125 |
18efc164-58e7-4e53-8071-399d993ed1ea | guanqin-123/compareM | Marabou/tools/boost-1.84.0/libs/geometry/index/example/benchmark_experimental.cpp | // Boost.Geometry Index
// Additional tests
#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL
#include <iostream>
#include <boost/chrono.hpp>
#include <boost/foreach.hpp>
#include <boost/random.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/index/rtree.hpp>
#inc... | TEST | 0.976914 | 6.231939 |
2dcfa2dc-0fec-46f4-993a-fb57c02b49df | AssemAbdirashova/Algorithm | week5/courses/3_e1.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <climits>
using namespace std;
void nxtsml(vector<long long int>& nums,vector<long long int>&nsl){
stack<int>s;
for(int i=0;i<nums.size();i++){
while(!s.empty() && nums[s.top()]>=nums[i]){
... | ALGO | 0.999991 | 4.064529 |
d407462d-f9d8-49ad-a76b-8b9463608beb | navneetk2001/CPP_Programs | Topic Wise Coding Questions/5_Stack/7_Max Area Rectangle in binary matrix.cpp | https://leetcode.com/problems/maximal-rectangle/
//Solution Approach :-
class Solution {
public:
int largestRectangleArea(vector<int>& heights) {
int n= heights.size();
vector<int> left,right;
stack<pair<int,int>> s1,s2;
int pseudo_index =-1; //nearest smaller to left... | ALGO | 0.999932 | 6.762243 |
abb05f62-0864-485b-97d6-b6043a7a5151 | vrshchk/pp_cpp | 00Vareshchuk/Main.cpp | #include <iostream>
#include "FunctionsHeaders.h"
using namespace std;
int main() {
cout << "function 1 for n = 2, x = 2: " << func1(2, 2) << "\n";
cout << "function 1 for n = 3, x = 1: " << func1(3, 1) << "\n";;
cout << "function 1 for n = 0, x = 4: " << func1(0, 4) << "\n";
cout << "function 1 for n ... | ALGO | 0.976009 | 4.574933 |
9f8f71e1-2a29-446c-a9c8-46f29d401648 | karandesai24/LeetCode | 797-all-paths-from-source-to-target/797-all-paths-from-source-to-target.cpp | class Solution {
public:
vector<vector<int>> allPathsSourceTarget(vector<vector<int>>& graph) {
vector<vector<int>> ans;
dfs(graph, 0, {0}, ans);
return ans;
}
private:
void dfs(const vector<vector<int>>& graph, int u, vector<int>&& path,
vector<vector<int>>& ans) {
if (u == g... | ALGO | 0.999805 | 6.569692 |
4369e6de-98e0-41b7-b256-5c4a19c595af | yashdubey369/Codef | C_Showering.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define fa(i, a, n) for (int i = a; i < n; i++)
#define f(i, n) fa(i, 0, n)
#define frev(i, n) for (int i = n - 1; i >= 0; i--)
#define fitr(i, m) for (auto i : m)
#define inp(x) \
for (int i = 0; i < n; i++) \
cin >> ... | ALGO | 0.999953 | 3.945087 |
74bec39b-1964-451a-b1d3-6cb6c4e7f7f7 | tnqkr98/Algorithm-Study | BeakjoonOnlineJudge/baek10282(해킹).cpp | #include <iostream>
#include <queue>
#include <climits>
#include <vector>
#include <algorithm>
using namespace std;
int n, dist[10001];
bool visit[10001];
vector<pair<int, int>> graph[10001];
void dijkstra(int start) {
priority_queue<pair<int, int>> pq;
pq.push({ 0,start });
fill(dist, dist + n + 1, INT_MAX);
fill(... | ALGO | 0.999772 | 3.855947 |
66f8f693-d565-41a4-8477-6ce2e67b48e4 | ShantoOBS/Interview_DS_Algorithm | String/Add Binary Strings.cpp | /*
Company Tags : Amazon, Microsoft, Facebook
GfG Link : https://www.geeksforgeeks.org/problems/add-binary-strings3805/1
*/
------------------------------------------------------------- C++ ---------------------------------------------------------
//Approach-1
//T.C :O(n)
//S... | ALGO | 0.99998 | 6.278931 |
81c65ea9-54c7-4860-9727-a7f974f9240c | cagatay-goz/raytracer_lastver | eigen/doc/examples/tut_matrix_resize.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,5);
m.resize(4,3);
std::cout << "The matrix m is of size "
<< m.rows() << "x" << m.cols() << std::endl;
std::cout << "It has " << m.size() << " coefficients" << std::endl;
VectorXd v(2);
v.resize(5);
... | ALGO | 0.970448 | 3.882785 |
240a6c92-2034-4ff2-82a7-caeec30ac27d | ZakharTS/kpo_lab | lab5/task2/main.cpp | #include <iostream>
#include <string>
#include <set>
#include <sstream>
using namespace std;
int main() {
set<string> words;
string input, temp;
getline(cin, input);
stringstream sstr(input);
while (sstr >> temp) {
if (!((temp[0] >= 65 && temp[0] <= 90) || (temp[0] >= 97 && temp[0] <= 122))... | ALGO | 0.999464 | 4.744694 |
d514ff9d-c7ed-4c2f-8544-6ffcc3ab9e91 | Stradex/librecoop-rbdoom3bfg | neo/libs/moc/MaskedOcclusionCulling.cpp | #if MOC_RECORDER_ENABLE
#include "FrameRecorder.h"
#endif
// RB: only check this on Windows and expect any Linux user to have a CPU newer than 2013
#if defined(_MSC_VER) && ( defined(__AVX__) || defined(__AVX2__) )
// For performance reasons, the MaskedOcclusionCullingAVX2/512.cpp files should be compiled with VEX e... | ALGO | 0.933999 | 5.078369 |
91ad9145-10dd-4eae-9f0e-e22be4b66c68 | netxpto/QuantumMiningSMC | lib/binary_source_20180723.cpp | # include "binary_source_20180723.h"
using namespace std;
void BinarySource::initialize(void) {
numberOfOutputSignals = (int) outputSignals.size();
for (unsigned int i = 0; i < numberOfOutputSignals; ++i) {
outputSignals[i]->setSymbolPeriod(bitPeriod);
outputSignals[i]->setSamplingPeriod(outputSignals[i]->get... | TOOL | 0.892503 | 5.379985 |
c7b309cd-a68f-4d34-bb58-c923824fc003 | WYK15/swift-Ollvm12 | llvm/utils/TableGen/OptEmitter.cpp | #include "OptEmitter.h"
#include "llvm/ADT/Twine.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include <cctype>
#include <cstring>
namespace llvm {
// Ordering on Info. The logic should match with the consumer-side function in
// llvm/Option/OptTable.h.
// FIXME: Make this take StringRefs ins... | TOOL | 0.860346 | 7.793422 |
65279a90-7ddd-4842-b9bc-f5901faa73dd | Teabeans/CPP_Learn | CodeSnippets/LongestSubsequence.cpp | //-----------------------------------------------------------------------------|
// Authorship
//-----------------------------------------------------------------------------|
//
// Tim Lum
// <EMAIL>
// Created: 2018.09.03
// Modified: 2018.09.03
//
/*
Longest Subsequence
Given an array of unsorted, non-negative in... | ALGO | 0.999862 | 6.045796 |
879f13a1-62cd-47e9-abc5-a981b75044c7 | ssqstc/Cpp_Primer_Plus | Chapter_05/test03.cpp | #include "iostream"
using namespace std;
/*
知识点总结和注意点:
1. `do-while` 循环:
- `do-while` 循环确保循环体至少执行一次。
- 适用于需要先执行操作再进行条件判断的情况。
2. 输入和输出:
- 使用 `cin` 从用户输入读取数字。
- 使用 `cout` 输出累计和。
注意点:
- 在读取用户输入时,注意检查输入是否为数字,以避免意外输入导致程序错误。
- 循环条件为 `num != 0`,当输入为 0 时循环结束。
*/
int main()
{
double num, sum = 0; // 初始化变量
... | ALGO | 0.98224 | 5.046981 |
51635f2e-d705-4dc0-a3f0-f25f49ebea60 | aizsfgk/leetcode-cn | editor/cn/[剑指 Offer 14- I]剪绳子.cpp | //给你一根长度为 n 的绳子,请把绳子剪成整数长度的 m 段(m、n都是整数,n>1并且m>1),每段绳子的长度记为 k[0],k[1]...k[m-1] 。
//请问 k[0]*k[1]*...*k[m-1] 可能的最大乘积是多少?例如,当绳子的长度是8时,我们把它剪成长度分别为2、3、3的三段,此时得到的最大乘积是18
//。
//
// 示例 1:
//
// 输入: 2
//输出: 1
//解释: 2 = 1 + 1, 1 × 1 = 1
//
// 示例 2:
//
// 输入: 10
//输出: 36
//解释: 10 = 3 + 3 + 4, 3 × 3 × 4 = 36
//
// 提示:
//
// ... | ALGO | 0.999997 | 5.83688 |
73cb098c-510c-451a-9196-bf598544ad49 | ishandutta2007/codeforces | arthur.nascimento/normal/452/A.cpp | #include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <stdio.h>
#include <ctime>
#include <cstdlib>
#include <utility>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#define inf (999999999)
#define pii pair<int,i... | ALGO | 0.999336 | 3.051374 |
9e200a1e-db2d-47f3-96eb-6b0b6c251e9d | Living-Hell/LeetCode | DFS/#386. Lexicographical Numbers.cpp | // M1
// Using maths and dfs
// Faster than 64.96% (9ms)
class Solution
{
public:
vector<int> lexicalOrder(int n)
{
vector<int> ans(n);
int count = 1;
for (int i = 0; i < n; i++)
{
ans[i] = count;
if (count * 10 <= n)
count *= 10;
... | ALGO | 0.999972 | 6.607049 |
1595906c-e7f8-49e7-b371-b4f77e4c06aa | Shreyakamlakar/Complete_C_Programs | LetterPattern1.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
printf("Enter the number of rows: ");
scanf("%d", &n);
for(int i=1; i<=n; i++)
{
int letter=65; //ASCII Value of 'A'
for(int j=1; j<=i; j++)
{
printf("%c", letter);
letter++;
}
... | ALGO | 0.988911 | 3.807356 |
97b66061-875f-44c5-8e9e-5ae74e4011d2 | fztfztfzt/leetcode | easy/169 Majority Element.cpp | /*
Majority Element
Total Accepted: 64584 Total Submissions: 176887 Difficulty: Easy
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
You may assume that the array is non-empty and the majority element always exist in the array.
Credits:
S... | ALGO | 0.999983 | 5.963514 |
6858bf9b-a9ff-4c3e-93f4-29e373d2f329 | Sekakou/OIsrc | data_structure/block/5356poker.cpp | #include <bits/stdc++.h>
using namespace std;
constexpr int N = 1e5 + 5, L = 1300, S = 80;
int n, m;
int len, num, pos[N], st[S], ed[S], tag[S];
int sl, san[L << 1];
struct pii
{
int x, y;
inline bool operator<(const pii &o) const { return x < o.x; }
inline bool operator<(int o) const { return x < o; }
} a... | ALGO | 0.999947 | 4.679085 |
9500dd80-681d-4f12-8d41-2dc3cccef36f | Agony5757/SU2-Quantum | SU2-Quantum/SU2_CFD/src/solvers/CDiscAdjSolver.cpp | #include "../../include/solvers/CDiscAdjSolver.hpp"
CDiscAdjSolver::CDiscAdjSolver(void) : CSolver () {
}
CDiscAdjSolver::CDiscAdjSolver(CGeometry *geometry, CConfig *config) : CSolver() {
}
CDiscAdjSolver::CDiscAdjSolver(CGeometry *geometry, CConfig *config, CSolver *direct_solver, unsigned short Kind_Solver, un... | ALGO | 0.993529 | 6.773795 |
398c6aaa-ff34-465b-b225-1a1bab68fa04 | SOKP-1/frameworks_av | media/libstagefright/codecs/amrwb/src/weight_amrwb_lpc.cpp | /*
------------------------------------------------------------------------------
Filename: weight_amrwb_lpc.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
--------------------------------------------------------------------... | ALGO | 0.999845 | 6.181465 |
7fd60521-931f-4e3d-b63d-cd5e0d0d443d | Tejas-987/DSA | 1460-number-of-substrings-containing-all-three-characters/1460-number-of-substrings-containing-all-three-characters.cpp | class Solution {
public:
int numberOfSubstrings(string s) {
int len = s.length();
int left = 0, right = 0;
// Track frequency of a, b, c
vector<int> freq(3, 0);
int total = 0;
while (right < len) {
// Add character at right pointer to frequency array
... | ALGO | 0.999957 | 6.655269 |
a6ac6a61-a707-44cf-9251-7ec204502cfd | ishandutta2007/codeforces | heno239/normal/477/B.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target ("sse4")
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#inc... | ALGO | 0.999863 | 3.097993 |
6aeca80c-cea9-4050-a928-7a374c3950e5 | zhangchunbao515/leetcode | leetcode-01/cpp/leetcode/378. kth-smallest-element-in-a-sorted-matrix.cpp | #include "public.h"
//80ms, 35.39%
//ָ
class Solution {
public:
int kthSmallest(vector<vector<int>>& matrix, int k) {
multimap<int, pair<int, int>> sorted_value_and_loc;
//init
for (int i = 0; i < matrix.size(); ++i) //ʼÿпͷԪ
sorted_value_and_loc.insert(pair<int, pair<int, int>>{matrix[i][0], pair<int, int>{... | ALGO | 0.999977 | 5.046794 |
0166f0f0-033e-4bd3-adf8-20aa80d51ce1 | EmilMaliev/OS | lab4/Administrator.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include<Windows.h>
#include <conio.h>
int main()
{
HANDLE eX[2];
eX[0] = CreateEvent(NULL, FALSE, FALSE, "writer");
eX[1] = CreateEvent(NULL, TRUE, FALSE, "reader");
int k;
int n, m;
std::cout << "Input number of Writer processes\n";
std... | ALGO | 0.979051 | 3.640502 |
d75c63e9-c8c0-40d0-92b3-6013763f4c00 | feranco/coding-challenges | dynamic_programming/word_composition/word_composition.cpp | //algorithm to check if a target word can be composed by
//other dictionary's words and find these words
#include <vector>
#include <iostream>
#include <string>
#include <unordered_set>
using namespace std;
// Solution 1:
// Backtrack: find (recursively) a dictionary word matching
// the current target prefix until... | ALGO | 0.999387 | 5.965554 |
f78c093c-acdd-4dbf-a1d5-a5e226fe62cc | TudorMihaescu24/egc-labs | EGC_Lab6/EGC_Bresenham/bresenham.cpp | #include <iostream>
#include "bresenham.h"
#include "math.h"
using namespace std;
//Detects in which octant a line is situated
int getOctant(BresenhamLine line)
{
int deltaY = (line.endY - line.startY);
int deltaX = (line.endX - line.startX);
//Slope
float m = abs(deltaY) / (float)abs(deltaX);
if ((m < 1) && (... | ALGO | 0.935716 | 5.070077 |
0e36c959-8442-4f3b-8f29-385f5d8a9110 | Rashed357/CP-stuffs | bfs.cpp | void bfs(int start, vector<vector<int>>& graph) {
vector<bool> visited(graph.size(), false); // Initialize visited array
queue<int> q; // Use a queue for BFS
q.push(start);
visited[start] = true;
while (!q.empty()) {
int node = q.front();
q.pop();
// Process the nod... | ALGO | 0.999946 | 7.048957 |
2b3ee0e2-8ca7-41dc-afb3-5ec4a7a20f5c | hantwofish/my_leetcode | datastruct_learn/class/charP8/二叉搜索树.cpp | #include"../STLCOMMON.h"
using namespace std;
typedef struct Node {
int key;
Node* lchild;
Node* rchild;
} Node;
#define KEY(n) (n ? n->key : -1)
Node *getNewNode(int key)
{
Node *p = (Node*)malloc(sizeof(Node));
p->key = key;
p->lchild = NULL;
p->rchild = NULL;
return p;
}
// 释放所有节点... | ALGO | 0.999975 | 4.218606 |
ef46ebd5-5cc4-4ab8-8a73-4daad3f8fc5f | maoding1/simple-LSM | src/skiplist/SkipList.cpp | #include <skiplist/SkipList.h>
#include <type/KeyComparator.h>
#include <type/Size.h>
// **************** SkipList ****************
SKIPLIST_TEMPLATE_ARGUMENTS
SKIPLIST_TYPE::SkipList(const KeyComparator &comparator, int maxLevel)
: max_level_(maxLevel), level_(0), used_bytes_(0), comp_(std::move(comparator)) {
h... | ALGO | 0.998482 | 5.929726 |
68fb6171-8cb3-4994-9f7b-38fdcf16414c | Adi2209/DSA | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divlinkedin-divdiv-classcompanytagscontainer-tagoccurence18-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba... | /**
* 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:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if... | ALGO | 0.999992 | 6.137302 |
9763d4c9-6190-4544-923a-822093728a98 | nojhan/paradiseo | moeo/test/t-moeoDominanceDepthFitnessAssignment.cpp | //-----------------------------------------------------------------------------
// t-moeoDominanceDepthFitnessAssignment.cpp
//-----------------------------------------------------------------------------
#include <eo>
#include <moeo>
//-----------------------------------------------------------------------------
cl... | ALGO | 0.999614 | 6.303099 |
929484c3-b8d2-4878-bed6-9cbeb9047198 | fry404006308/fry_course_materials | 201008之前/算法疑难(C++实现)/一、数学相关/1、快速幂/2、快速幂.cpp | /*
快速幂:
首先,快速幂的目的就是做到快速求幂,
假设我们要求a^n,那么其实n是可以拆成二进制的,
例如当n==11时
11的二进制是1011,
11 =2º×1+2¹×1+2²×0+2³×1=1+2+8,
所以
a^11=a^1*a^2*a^8
原来算11次,现在只需要算三次
具体怎么算呢:
我们可以用一个变量base来在每次循环的时候记录a^i,
最开始base是a
然后每次循环让base=base*base
那么base的值
a-->a^2-->a^4-->a^8-->a^16-->a^32.......
然后根据11的二进制,1011,
取位为1时候的base值即可,
也就是取a,a^2,a^8
由此可以得到... | ALGO | 0.999914 | 5.287413 |
1f1b4708-eabb-48c7-9924-a633343611d8 | MDATIK-3/CPP-Problem-Solving | 1475_A.cpp | #include <bits/stdc++.h>
#define ll long long int
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define fastio() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
using namespace std;
/*int Vowel(string str)
{
int len = ... | ALGO | 0.997344 | 4.97055 |
b4ca626d-3343-4f4e-b2db-368fa3828fac | etiset/leetcode-solutions | min-stack.cpp | class MinStack {
private:
stack<int> st, min_st;
public:
MinStack() {
}
void push(int val) {
if(min_st.empty() || getMin() >= val){
min_st.push(val);
}
st.push(val);
}
void pop() {
if(st.top() == getMin()){
min_st.pop();
... | ALGO | 0.999665 | 6.702 |
0bc3d217-db23-4afa-be19-ef33f778bf50 | showmanlee/HowCanISolveThisQuestion | BOJ/20000/20540.cpp | // 연길이의 이상형
// https://www.acmicpc.net/problem/20540
#include <iostream>
#include <string>
using namespace std;
int main(void) {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
string s;
cin >> s;
cout << (s[0] == 'I' ? 'E' : 'I') << (s[1] == 'N' ? 'S' : 'N') << (s[2] == 'F' ? 'T' : 'F') << (s[3] == 'P' ? 'J' ... | ALGO | 0.9997 | 3.59622 |
c8e317e4-68ac-4ff0-9c21-f4e9c04f30b7 | EduardoMarciano/PAA-Analise-de-Desempenho-IAs | ChatGPT/Intermediárias/topk_frequent/topk_frequent.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <queue>
#include <functional>
std::vector<int> topKFrequent(std::vector<int>& nums, int k) {
// Mapa para contar a frequência de cada elemento
std::unordered_map<int, int> freq;
for (int num : nums) {
freq[num]++;
}
//... | ALGO | 0.999993 | 6.672267 |
314e037b-306f-4bd0-af6a-1f741e1dde5d | Gon20000/my-cpp-journey | cp/vjudge/acpc_2024/contest/h.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
ll m{}, n{};
cin >> m >> n;
m /= n;
if(m >= 150)
cout << "VERY HAPPY\n";
else if(m >= 100)
cout << "HAPPY\n";
else
cout << "SAD\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t{1}... | ALGO | 0.999289 | 3.471407 |
3d0c7fc9-dc4c-4d7b-9bce-476cbc84eda7 | AnaghaJain/SherlockLovesProgramming | Upper Bound and Lower Bound.cpp | #include <iostream>
#include<algorithm>
using namespace std;
int main() {
int n;
cin>>n;
int arr[n];
for (int i=0;i<n; i++){
cin>>arr[i];
}
int t;
cin>>t;
sort(arr, arr+n);
while(t--){
int no;
cin>>no;
bool present = binary_search(arr, arr+n, no);... | ALGO | 0.999976 | 4.958956 |
176f2c2a-f9f9-4eca-97e0-b1c53115c828 | Popotanu/sandbox_kyopro | typical90/004/main.cpp | #include <bits/stdc++.h>
using namespace std;
/* -------------ACL--------------- */
// #include <atcoder/fenwicktree>
// #include <atcoder/segtree>
// #include <atcoder/lazysegtree>
// #include <atcoder/string>
//
// #include <atcoder/math>
// #include <atcoder/convolution>
// #include <atcoder/modint>
//
// #include... | ALGO | 0.99997 | 4.022893 |
d76092d2-110e-4f07-90a8-74a4a86dc027 | aaryanXcode/Data-structures-and-Algorithms | DSA/Recursion/allBinarystring.cpp | #include<bits/stdc++.h>
using namespace std;
void printAllbinary(string s, int n) {
if (n == 0) {
cout << s << endl;
return;
}
// Add '0' and recurse
printAllbinary(s + "0", n - 1);
// Add '1' and recurse
printAllbinary(s + "1", n - 1);
}
int main(){
int n = 3;
printA... | ALGO | 0.999982 | 5.223087 |
bf7ac829-6e0d-4358-b61d-debbe658fe77 | jimjin73/compro | training/beginner/11.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bitset<10> bts[10];
int p[10];
int main(){
int N,M;
cin >> N >> M;
for(int i=0;i<M;i++){
int k;
cin >> k;
bts[i] = 0;
for(int j=0;j<k;j++){
int b;
cin >> b;
bts[i].set(b... | ALGO | 0.999852 | 3.654799 |
c85797fe-ae8f-4c40-9667-71ed6b360c0e | Kai-0530/NYCU_OverFlowers | codes/Geometric/Rectangle_Union_Area.cpp | const int maxn = 1e5 + 10;
struct rec{
int t, b, l, r;
//t頂,b底,l左,r右邊界點
} r[maxn];
int n, cnt[maxn << 2];
long long st[maxn << 2], ans = 0;
vector<int> x, y;
vector<pair<pair<int, int>, pair<int, int>>> v;
void modify(int t, int l, int r, int ql, int qr, int v) {
if (ql <= l && r <= qr) cnt[t] += v;
els... | ALGO | 0.999512 | 3.898916 |
10b1781d-eed7-412d-9384-2fa32fd2e55a | Harshit22429/DSA-Practice | Lecture 57/Max_Rectangle_In_Binary_Matrix_With_All_1.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
// largest rectangular area in histogram
//nextSmallerIndexses
vector<int> nextSmallerIndx(vector<int> arr){
vector<int> ans(arr.size());
stack<int> stk;
stk.push(-1);
for(int i=arr.size()-1; i>=0;... | ALGO | 0.999932 | 4.856999 |
7a95eff5-d0b9-4fed-a357-2db6d56b7ad9 | rkfrancis/github-upload | boost_1_75_0/libs/sort/example/int64.cpp | // See http://www.boost.org/libs/sort for library home page.
#include <boost/sort/spreadsort/spreadsort.hpp>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
using namespace boost::sort::spreadso... | ALGO | 0.991277 | 4.607142 |
025b9a20-772c-4236-9d37-0cfedfdb4ecc | juhongyee/baekjoon | 74 메르센 합성수/메르센 합성수/메르센 합성수/소스.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>
#define MAX_STACK_SIZE 1000
long long stack[MAX_STACK_SIZE];
int top = -1;
int silsu = 0;
void push(long long data);
long long pop();
long long prime_number(long long a);
int mersenne(int j);
int main()
{
int k;
scanf("%d", &k);
for (int i = 2;... | ALGO | 0.999719 | 3.590664 |
06c9e5c9-6289-4a5a-8410-0fbe3e51274a | gcoronelc/UNI-FIM-20231-MB545-F | Semana09/Split-Caso1.cpp | #include <iostream>
using namespace std;
int main(int argc, char ** argv) {
string datos = "12,54,23,54,67,89,12,34";
string dato;
int numero;
int posicion;
while( datos.size() > 0){
posicion = datos.find(",");
if(posicion > 0){
dato = datos.substr(0, posicion);
datos.erase(0, posicion + 1);
} else ... | TOOL | 0.874561 | 3.294103 |
22118b0f-bb0d-4f5a-a57f-f96ed660f6c9 | obbteam/LeetCodeSolutions | 1798-max-number-of-k-sum-pairs/max-number-of-k-sum-pairs.cpp | class Solution {
public:
int maxOperations(std::vector<int>& nums, int k) {
std::ranges::sort(nums);
int count = 0;
auto start = nums.begin();
auto end = nums.end() - 1;
while (start < end) {
if (*start + *end == k) {
count++;
++st... | ALGO | 0.999923 | 6.390629 |
d4cb4a93-5c99-4d28-b676-cb3b31f89b9e | CoderSwarup/DSA_Mastery | 14_Unique_Arrray_Based_Concepts/4_Longest_SubArray_Sum.cpp | #include<iostream>
using namespace std;
#include <vector>
#include <limits.h>
// Basic Approach
// Time Complexity = > O(n^3)
void LogestSum(vector<int> array){
int n = array.size();
int MaxSum = INT_MIN;
// By we want to loop iterate From the 1 to n-1
for(int size = 1 ;size <= n;size++){
... | ALGO | 0.999907 | 4.80536 |
e97effb6-6d74-405f-8479-ab1da0b2b3eb | R-YimY/MVS-POLYFIT | code/3rd_party/3rd_LAStools/LASzip/src/arithmeticencoder.cpp | #include "arithmeticencoder.hpp"
#include <string.h>
#include <assert.h>
#include <stdio.h>
FILE* file = 0;
#include "arithmeticmodel.hpp"
ArithmeticEncoder::ArithmeticEncoder()
{
outstream = 0;
outbuffer = (U8*)malloc(sizeof(U8)*2*AC_BUFFER_SIZE);
endbuffer = outbuffer + 2 * AC_BUFFER_SIZE;
}
ArithmeticEn... | TOOL | 0.982373 | 5.941662 |
40bc166b-d2c6-466b-ba49-420adbeee2d7 | iamwind-dev/Excpp | .history/Test/Lab3/Lab31_20230522194904.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_SIZE = 100;
struct ST
{
int data;
ST *next;
};
ST *top;
void push(int value)
{
ST *newNode = new ST();
if (!newNode)
{
cout << "Heap overflow" << endl;
exit(1);
}
newNode->data = value;
newNode->next = top;
... | ALGO | 0.999915 | 5.628487 |
a7b3f214-fb89-4927-b17b-e747cfa54e56 | yongwhan/jungol | 513.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
int main() {
cin.tie(0); cout.tie(0); ios_base::sync_with_st... | ALGO | 0.974387 | 4.356575 |
5c4a8d9c-b911-46dc-9fbe-e165b2719cf9 | animay7860/CodeForces-CodeChef | Practice/C_Parity_Shuffle_Sorting.cpp | /*Author :- Animay Prakash*/
#include <bits/stdc++.h>
#include <bits/extc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
/*------ TypeDef Micro's -------*/
using ll = long long;
using li = long int;
using ld = long double;
using lli = long long int;
using vb = st... | ALGO | 0.999889 | 3.521517 |
ac52abd9-1821-4243-8d06-e13d7c51fb89 | alexandraback/datacollection | solutions_2652486_0/C++/sohelH/c.cpp | #include<cstdio>
#include<iostream>
#include<queue>
#include<stack>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<sstream>
#include<cmath>
#include<cctype>
#include<cassert>
#include<cstring>
#include<cstdlib>
using namespace std;
// ------------- PRE-WRITTEN CODES ---------------------... | ALGO | 0.999897 | 3.23882 |
2cc9e248-bee8-440a-a92b-d5c3b2bd37a0 | manu05X/Leetcode | 1955-seat-reservation-manager/1955-seat-reservation-manager.cpp | class SeatManager {
priority_queue<int, vector<int>, greater<int>> availableSeats;
public:
SeatManager(int n) {
for(int seatNum = 1; seatNum <= n; seatNum++){
availableSeats.push(seatNum);
}
}
int reserve() {
int seatNumr = availableSeats.top();
available... | ALGO | 0.998902 | 6.670849 |
ced6274c-d836-49d6-8646-66a0038aede5 | JKSunny/JediKnightGalaxies | codemp/game/g_mover.cpp | #include "g_local.h"
/*
===============================================================================
PUSHMOVE
===============================================================================
*/
void MatchTeam( gentity_t *teamLeader, int moverState, int time );
typedef struct {
gentity_t *ent;
vec3_t origin;
v... | ALGO | 0.941262 | 5.378455 |
f1e9d935-4b25-4287-8373-841ef539e95f | antalszava/cpp_examples | src/LeetCode/phone_numbers.cpp | #include <vector>
#include <iostream>
#include <string>
using namespace std;
vector<string> lookup = {{"abc"},{"def"},{"ghi"},{"jkl"},{"mno"},{"pqrs"},{"tuv"},{"wxyz"}};
vector<string> add_new_combs(const vector<string> & strs, string comb){
int orig_size = strs.size();
int comb_size = comb.size();
std::vector<... | ALGO | 0.996331 | 6.089245 |
2c5aaca9-6548-4cde-a917-76ffd0275897 | aryaman0098/codes | cpp/leetcode/309.best-time-to-buy-and-sell-stock-with-cooldown.cpp | /*
* @lc app=leetcode id=309 lang=cpp
*
* [309] Best Time to Buy and Sell Stock with Cooldown
*/
// @lc code=start
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int maxProfit(vector<int>& prices) {
int n = prices.size();
vector<vector<int>> c(n, vector<int>(2, -1));
... | ALGO | 0.999716 | 6.388792 |
3c613fc5-a4f1-48ac-ac4b-c048bfa4ca53 | Raunaq-singh/SudoPlacement2019 | BitMagic/MaximumXorSubset.cpp | #include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
bool dp[31][1025];
int main(){
ios::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
ll t;
cin>>t;
while(t--){
ll n;
cin>>n;
ll a[n];
for(ll i=0;i<n;i++){
cin>>a[i];
}
memse... | ALGO | 0.999901 | 4.950717 |
5cad1a92-b6fe-4600-b8c8-bfcca97e906b | AshwinGadhvi/C-CPP-Programs | OK8.CPP | #include<iostream.h>
#include<conio.h>
void swap(int *x,int *y);
void main()
{
int x,y;
clrscr();
cout<<"Enter X : ";
cin>>x;
cout<<"Enter Y : ";
cin>>y;
swap(x,y);
cout<<"After swap : "<<endl;
cout<<"X is : "<<x<<endl;
cout<<"Y ia : "<<y;
getch();
}
void swap(int *x,int *y)
{
int temp;
temp = *y;
*y = ... | ALGO | 0.997064 | 3.418675 |
460a6166-5a2b-4903-ae96-b5fd21f7d184 | princekeshriabc/DSA | Heap/Medium_And_Hard_problems/Kth Largest Element in a Stream.cpp | // Kth Largest Element in a Stream
// https://leetcode.com/problems/kth-largest-element-in-a-stream/solutions/5624613/simple-solution-in-c-time-limit-exceed-beat-100/
// Time complexity:O(nlog(k))
// Space complexity : O(k)
class KthLargest
{
public:
int k;
priority_queue<int, vector<int>, greater<int>> pq;
... | ALGO | 0.99987 | 5.710305 |
9f5b0201-3c7b-4570-9866-a4c885a14de8 | ATHARVA-GAWAS/DSA | 518-coin-change-ii/coin-change-ii.cpp | class Solution {
int f(int ind,int amount,vector<int>&coins,vector<vector<int>> &dp){
if(ind==0){
return (amount%coins[ind]==0);
}
if(dp[ind][amount]!=-1){
return dp[ind][amount];
}
int notpick=f(ind-1,amount,coins,dp);
int pick=0;
if(... | ALGO | 0.999949 | 5.805453 |
15528189-3728-454f-825b-23d3bb7bf0ca | Abdelrhmansersawy/Competitive-Programming | CP_Templates/Data Structure/Xor Basis/xor_basis_application.cpp | const int LOG = 30; // log(max(a))
int Basis[LOG] , sz;
void insert(int x){
/*
Insert vector into basis
*/
for(int i = LOG - 1; i >= 0; --i){
if(!(x >> i & 1)) continue;
if(Basis[i] == 0){
Basis[i] = x;
++sz;
return;
}
x ^= Basis[i]... | ALGO | 0.999953 | 4.365935 |
51a79845-0ad2-4ab2-89a7-f60df247af88 | ishandutta2007/codeforces | oipotato/normal/189/A.cpp | #include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<bitset>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<map>
#include<cassert>
#include<string>
using namespace std;
#define pb push_back
#define mp make_pair
#defin... | ALGO | 0.999949 | 3.17563 |
f509cf00-ce9d-4080-a459-3686a37562fe | brinzaalina/Homeworks-and-others | First Year/Semester 2/Object Oriented Programming/Exam/Written/Exercise 12 Math/main.cpp | //
// Created by selen on 19/06/2021.
//
#include <list>
#include <iostream>
#include "classes.h"
void first() {
///-5+(9-3)
Expression* c = new Constant(5);
Expression* n = new Negate(c);
Expression* c1 = new Constant(9);
Expression* c2 = new Constant(3);
Expression* sub = new Subtracter(c1, ... | ALGO | 0.99534 | 4.124802 |
361bf5b8-a511-4040-aaf4-048cfab2aa62 | aiskaushi/Face_Recognition_Code | dlib-19.24/tools/python/src/rectangles.cpp | #include <dlib/python.h>
#include <dlib/geometry.h>
#include <pybind11/stl_bind.h>
#include "indexing.h"
#include "opaque_types.h"
#include <dlib/filtering.h>
using namespace dlib;
using namespace std;
namespace py = pybind11;
// ---------------------------------------------------------------------------------------... | TOOL | 0.93377 | 6.01633 |
9626e4ab-73f0-436d-a969-ffe8d2fb3d4f | VIDA-NYU/Segmentangling | Inviwo/modules/segmentangling/ext/qhull/src/libqhullcpp/Qhull.cpp | #//! Qhull -- invoke qhull from C++
#//! Compile libqhull_r and Qhull together due to use of setjmp/longjmp()
#include "libqhullcpp/Qhull.h"
#include "libqhullcpp/QhullError.h"
#include "libqhullcpp/RboxPoints.h"
#include "libqhullcpp/QhullQh.h"
#include "libqhullcpp/QhullFacet.h"
#include "libqhullcpp/QhullFacetList... | TOOL | 0.970984 | 3.329731 |
e1df149f-8b45-46c0-9463-742a9f52e104 | aytysd/Mikasa_ROS | packages/UnderCarriageEquation/SwerveSteeringEquation.cpp | #include "SwerveSteeringEquation.hpp"
namespace NITNC
{
void SwerveSteeringEquation::Forward( const pure_pursuit::OutputCmd& msg )
{
#if INVERTOUTPUT
double Vx = msg.Speed.data * ( -1 ) * cos( msg.DirectionOfTravel.data - msg.AttitudeAngle.data );//速度のx方向
double Vy = msg.Speed.data * ( -1 ) * sin( msg.Direct... | ALGO | 0.997384 | 4.525776 |
ff7d02c9-7bfb-4306-bc54-3c48139ef22a | Avishkaar007/Sem4 | Algorithms/practise/Knapsack01.cpp | #include <iostream>
#include <vector>
using namespace std;
#define init(i,a,b) for (int i=a;i<b;i++)
vector<int> val,wt, mem;
int Knapsack(int n,int w){
if (w<0||n<0){
return 0;}
if (wt[n]>w)
{return Knapsack(n-1,w);}
return max(Knapsack(n-1,w),Knapsack(n-1,w-wt[n-1])+val[n]);
}
vector<vector<i... | ALGO | 0.999998 | 3.866009 |
0a71b0aa-dc7e-47f7-9aca-d0ef512fbec5 | wsn1226/FEM-Cloth | extern/libigl/python/py_igl/py_forward_kinematics.cpp | //m.def("forward_kinematics", []
//(
// const Eigen::MatrixXd& C,
// const Eigen::MatrixXi& BE,
// const Eigen::MatrixXi& P,
// std::vector<Eigen::Quaterniond, Eigen::aligned_allocator<Eigen::Quaterniond> > & dQ,
// std::vector<Eigen::Vector3d> & dT,
// std::vector<Eigen::Quaterniond, Eigen::aligned_allocator<Eig... | TOOL | 0.983827 | 5.875387 |
fcf58974-02aa-4e13-84ba-84c64b33651a | dzhng/ARView | libs/opencv/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp | /**
* @function cornerSubPix_Demo.cpp
* @brief Demo code for refining corner locations
* @author OpenCV team
*/
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
/// Global variables
Ma... | ALGO | 0.999575 | 6.896334 |
39afce43-62c3-478b-8368-69ecfe22de58 | elzorrofox02/MAPCTienda_FLutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
21909e70-80a3-40f5-ac2b-a80669d66be1 | Ritika-Kumari-16/LeetCode | 1878-check-if-array-is-sorted-and-rotated/1878-check-if-array-is-sorted-and-rotated.cpp | class Solution {
public:
bool check(vector<int>& nums) {
int brkpts=0;
int n= nums.size();
int j=0;
int k=n-1;
while(j<k){
if (nums[j]!=nums[k]){
break;
}
j++;
k--;
}
if(j==k || j>k) return true;... | ALGO | 0.99999 | 5.459367 |
e1ca984e-1a8c-401a-bd91-6c3d7f2703f9 | gh04/c876 | C867/practice/labs/lab3/mathFunc.cpp | #include <iostream>
#include <cmath>
using namespace std;
/*
Given three floating-point numbers x, y, and z, output x to the power of z, x
to the power of (y to the power of z), the absolute value of y, and the square
root of (xy to the power of z).
*/
int main() {
double x;
double y;
double... | ALGO | 0.999093 | 4.047646 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.