uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e987e9dc-cf7c-46ae-9cad-8191c2303ebc | Vertexwahn/rules_embree | third_party/embree-3.13.0-with-tbb/kernels/subdiv/catmullclark_coefficients.cpp | #include "catmullclark_coefficients.h"
namespace embree
{
CatmullClarkPrecomputedCoefficients CatmullClarkPrecomputedCoefficients::table;
CatmullClarkPrecomputedCoefficients::CatmullClarkPrecomputedCoefficients()
{
/* precompute cosf(2.0f*M_PI/n) */
for (size_t n=0; n<=MAX_RING_FACE_VALENCE; n++)
... | TOOL | 0.945796 | 5.781526 |
1413d63e-f484-4d80-9488-d3238cbb76fb | yyhaos/Data-Structures-and-Algorithms | Algorithms_class/实验13/test13.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll N[100005];
ll sum[100005];
ll select[100005];
ll maxn = 100;//[1,maxn]
void init(ll n)
{
for(int i=1;i<=n;i++)
{
N[i]=maxn/10+(rand()%(maxn-1)/10)+1;//
//cout<<N[i]<<" ";
}
sort(N+1,N+1+n);
sum[n+1]=0;
for(int i... | ALGO | 0.998943 | 3.040409 |
40a8460a-7389-48cf-9e14-d6bd9dae4f39 | Aman-Dubey/InterviewBitSolutions | Backtracking/Combinations.cpp | set<vector<int>> s;
void solve(int A,int B,vector<int> v,int start)
{
if(v.size()==B) s.insert(v);
if(v.size()>B) return ;
for(int i=start;i<=A;i++)
{
v.push_back(i);
solve(A,B,v,i+1);
v.pop_back();
}
}
vector<vector<int> > Solution::combine(int A, int B) {
s.clear();
... | ALGO | 0.999844 | 4.353295 |
90707d14-1ba6-4557-bea4-6fe7d5952a15 | GautamKeshari/DSA_Code | Graph_Striver/8b.cpp | // //{ Driver Code Starts
// #include <bits/stdc++.h>
// using namespace std;
// // } Driver Code Ends
// class Solution {
// private:
// void dfs(int row,int col,vector<vector<char>> &grid,vector<vector<bool>> &vis,int n,int m)
// {
// for(int delrow=-1;delrow<=1;delrow++){
// for(int de... | ALGO | 0.999944 | 6.955122 |
7fccd7e1-4f5c-49f7-9b0f-c4c09d1dbb71 | hjiang13/LLMs-in-IR | POJ-104/10/449.cpp | #include <iostream>
using namespace std;
int main()
{
int height[27];
int result[27];
int k;
int i , j;
int nmax;
cin>>k;
for(i = 1; i <= k; i++){
cin>>height[i];
}
height[k+1] = 0;
result[k+1] = 0;
for(i = k; i > 0; i--){
nmax = 0;
for(j = i+1; j <= k+1; j++){
if(height[i] >= height[j]){
if(result[j] > nmax){
nm... | ALGO | 0.999983 | 3.622016 |
708a250e-6a62-4cb3-a911-2fdb02d888ec | ishandutta2007/codeforces | clovers/normal/1338/B.cpp | /*
the vast starry sky,
bright for those who chase the light.
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define mk make_pair
const int inf=(int)1e9;
const ll INF=(ll)5e18;
const int MOD=998244353;
int add(int x,int y){x+=y; return x>=MOD ? x-MOD : x;}
int sub(int x... | ALGO | 0.999839 | 4.367241 |
0c3a895a-0775-472e-b417-99ee33aa454e | Chaste/Chaste | mesh/src/utilities/DistributedBoxCollection.cpp | #include "DistributedBoxCollection.hpp"
#include "Exception.hpp"
#include "MathsCustomFunctions.hpp"
#include "Warnings.hpp"
// Static member for "fudge factor" is instantiated here
template<unsigned DIM>
const double DistributedBoxCollection<DIM>::msFudge = 5e-14;
template<unsigned DIM>
DistributedBoxCollection<DIM>... | TOOL | 0.987784 | 6.853386 |
9d4ce537-6bd1-4309-a640-98715a2438c7 | HPC-Fortran2CPP/Fortran2Cpp | data/readable_format/cpp/file1050.cpp | // Filename: slar2v.cpp
#include <vector>
#include <iostream>
void SLAR2V(int N, std::vector<float>& X, std::vector<float>& Y, std::vector<float>& Z, int INCX, const std::vector<float>& C, const std::vector<float>& S, int INCC) {
int IX = 0;
int IC = 0;
for (int I = 0; I < N; ++I) {
float XI = X[I... | ALGO | 0.999783 | 3.787162 |
1f9b7efa-2773-4a1e-b3c7-f357c6d255dc | TomaSajt/prog-solutions | CSES/1693 - Teleporters Path.cpp | #include <bits/stdc++.h>
#define speed ios::sync_with_stdio(0);cin.tie(0)
using namespace std;
vector<set<int>> graf;
vector<int> ut;
void keres(int akt) {
vector<int> indit;
while (!graf[akt].empty()) {
int x = *graf[akt].begin();
graf[akt].erase(x);
keres(x);
}
ut.push_back(a... | ALGO | 0.999974 | 4.413753 |
2655265e-c219-4c6c-9d23-233be6bc11e2 | free3nvy/CodePractice | leetcode_c++/34.在排序数组中查找元素的第一个和最后一个位置.cpp | /*
* @lc app=leetcode.cn id=34 lang=cpp
*
* [34] 在排序数组中查找元素的第一个和最后一个位置
*/
// @lc code=start
class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
// 利用二分查找??
}
};
// @lc code=end
| ALGO | 0.99986 | 6.408359 |
b5e9209e-a728-41bb-9878-f053c10cbb2b | Prateek307/Leetcode-Solutions | 95_Unique_Binary_Search_Trees.cpp | // link to the problem ---> https://leetcode.com/problems/unique-binary-search-trees-ii/description/
class Solution
{
public:
// Function to generate all possible binary search trees (BSTs) from values ranging from 'st' to 'e'
vector<TreeNode *> allPossibleBSTs(int st, int e)
{
// Base cases: if th... | ALGO | 0.999972 | 7.014378 |
b8ec8b49-9249-4797-8d1a-8642825b6a96 | MindIssawara/lab18 | lab18_1.cpp | #include<iostream>
using namespace std;
int main(){
int nA,nB;
cout << "Length of A: ";
cin >> nA;
int *A = new int[nA];
cout << "Input Array A: ";
for(int i=0; i < nA; i++) cin >> A[i];
cout << "Length of B: ";
cin >> nB;
int *B = new int[nB];
cout << "Input Array B: ";
for(int i=0; i < nB; i++) ci... | ALGO | 0.998476 | 3.372633 |
fcbd762b-295f-4086-becd-74a99de5a9f0 | duongtt1/FaceMesh | src/FaceMeshService.cpp | #include "../inc/FaceMeshService.h"
#include <string.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <ncnn/cpu.h>
#include "../../Logger/inc/logger.h"
#include <iostream>
#include <mutex>
FaceMeshService *FaceMeshService::m_instance = nullptr... | ALGO | 0.946948 | 5.895771 |
aa1727fc-0be8-4dff-8fd0-977112ec9d16 | DenizIsikli/Codeforces | Problemsets/Rating900/DigitGame1419A.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
// Macros and optimizations
#pragma GCC optimize ("O3")
#define FAST_IO std::ios::sync_with_stdio(0); std::cin.... | ALGO | 0.999656 | 5.092026 |
f76e2d8b-c46c-4cbf-baf9-67c68a30c7fd | Klara1423/GPLT | GPL1/20/L1-011.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string str1, str2;
getline(cin, str1);
getline(cin, str2);
for (int i = 0; i < str2.size(); i++)
{
int pos = str1.find(str2[i]);
while (pos != -1)
{
str1.erase(pos, 1);
pos = str... | ALGO | 0.998939 | 4.11301 |
05d23541-8240-4377-8c6a-de7ec26385b4 | tgxworld/CS1020E | tutorials/5/ListNode.cpp | #include <iostream>
#include <sstream>
using namespace std;
class ListNode{
private:
int item;
ListNode *next;
public:
ListNode();
ListNode(int v, ListNode* n) { item = v; next = n; }
void setNext(ListNode* n) { next = n; }
ListNode* getNext() { return next; }
int getItem() { return item; }
void set... | TOOL | 0.958395 | 3.444161 |
c8d7d877-02aa-47cb-b379-43234a2b540d | HG-IMMORTALS/GFG-POTD | Difficulty: Medium/Rat in a Maze Problem - I/rat-in-a-maze-problem-i.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
string t = "";
vector<string> ans;
vector<string> findPath(vector<vector<int>> &mat) {
int n = mat.size();
... | ALGO | 0.999845 | 6.325954 |
ab1d18a0-9e65-4efa-8c52-b76d5e7ce24e | mikhaeljonathan/online-judges | E-olymp/427.cpp | #include <cstdio>
#include <cmath>
using namespace std;
int main (){
int t;
scanf("%d",&t);
while (t--){
long long n;
scanf("%lld",&n);
long long hasil=0;
for (long long k=0; k<=n-1; k++){
hasil = hasil+pow(k,2)*pow(2,k);
}
printf("%lld\n",hasil);
}
return 0;
}
| ALGO | 0.999639 | 4.114981 |
21f605f1-9a6a-400b-ab8c-bf97d0e39a80 | jesuswr/cp-codes-and-problems | CF1920/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int das;
#define FOR(i,n,m) for(int i = n; i < (int)m; i++)
#define ROF(i,n,m) for(int i = n; i > (int)m; i--)
#define ms(obj,val) memset(obj,val,sizeof(obj))
#define ri(a) das... | ALGO | 0.9999 | 3.98905 |
ed8381ae-051c-4870-9d84-c0ca34b039de | taotesea/EclipseDeeplearning4j | libnd4j/include/ops/declarable/generic/reduce/reduceStDev.cpp | //
// @author Yurii Shyrma (<EMAIL>), created on 04.06.2018
//
#include <ops/declarable/CustomOperations.h>
#include <ops/declarable/helpers/axis.h>
namespace sd {
namespace ops {
//////////////////////////////////////////////////////////////////////////
CUSTOM_OP_IMPL(reduce_stdev, 1, 1, false, 0, 0) {
a... | ALGO | 0.978376 | 7.208746 |
5296b981-225f-4ef6-90cb-ef1b069a1807 | falcaoanderson/CompetitiveProgramming | juizes/p-124.cpp | #include <iostream>
using namespace std;
#define MAXN 1005
int x[8]={-1,-1,-1,0,1,1, 1, 0};
int y[8]={-1, 0, 1,1,1,0,-1,-1};
int m, n;
char matriz[MAXN][MAXN];
bool borda(int a, int b){
if(a>=0 and a<m and b>=0 and b<n){
return true;
}
return false;
}
int bombas(int i, int j){
int bomba = 0;
... | ALGO | 0.998831 | 3.506135 |
7fb1502b-7a09-4063-87f9-1de9aafc412a | zuriniw/DataResonate | Library/PackageCache/com.unity.ide.visualstudio@2.0.8/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.959292 | 6.947423 |
9ab54e67-4fd5-4890-a686-7c9c76e26860 | naser-github/LeetCode | Solve/108.cpp | class Solution {
public:
TreeNode* sortedArrayToBST(vector<int>& nums) {
return setBST(nums, 0, nums.size()-1);
}
TreeNode* setBST(vector<int>& nums, int start, int end) {
if (start>end){
return NULL;
}
int mid = (start+end)/2;
TreeNode* node = new Tree... | ALGO | 0.999997 | 6.901093 |
66d71d48-3fbc-4e2c-8e1c-4c0f29eb318d | Rudadadadada/NeetCode-All | Stack/22. Generate Parentheses.cpp | #include <iostream>
#include <vector>
void generator(int left, int right, std::string brackets, int n, std::vector<std::string> &arr) {
if (left + right == 2 * n) {
arr.push_back(brackets);
return;
}
if (left < n)
generator(left + 1, right, brackets + '(', n, arr);
if (right < l... | ALGO | 0.999762 | 6.19313 |
f0b4da94-98b1-4eba-ad87-49a501bbe20b | colin-de/vslam_sfm | thirdparty/eigen/doc/examples/TutorialInplaceLU.cpp | #include <iostream>
struct init {
init() { std::cout << "[" << "init" << "]" << std::endl; }
};
init init_obj;
// [init]
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd A(2,2);
A << 2, -1, 1, 3;
cout << "Here is the input matrix A before decompositi... | ALGO | 0.999644 | 3.757983 |
25246d66-33df-4931-a0b4-840fd79fdd04 | megablazikenabhishek/CPP-DSA | Queues_DS/diQueue.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
deque<int> dq;
dq.push_back(1);
dq.push_back(2);
dq.push_front(3);
dq.push_front(4);
for (auto i : dq)
{
cout << i << " ";
}
cout <... | ALGO | 0.994445 | 4.060773 |
73c1f794-8ef7-4b3d-afca-2fe3eb553d1e | MeerabNawaz/lab-task- | lab13.cpp | #include <iostream>
using namespace std;
int main() { //declaring variables
int number, reversedNumber = 0, sumOfDigits = 0;
cout << "Enter a number = "; //input a number
cin >> number;
int originalNumber = number;
while (number>0) { ... | ALGO | 0.999043 | 4.594474 |
f0aa5dcf-a984-4cc2-9664-01caf76d78e3 | shakirhms12/DSA | DS&ALGORITHM/selectionSort.cpp | #include<bits\stdc++.h>
using namespace std;
int main(){
int arr[5]={23,12,34,10,14};
for(int i=0;i<5-1;i++){
for(int j=i+1;j<5;j++){
if(arr[j]<arr[i]){
int temp=arr[j];
arr[j]=arr[i];
arr[i]=temp;
}
}
}
f... | ALGO | 0.999782 | 3.418729 |
1de1d7c3-2e2f-4c18-a266-dc9ad85f93e0 | FXTD-ODYSSEY/cppreference | cppreference/container/map/try_emplace.cpp | // cppreference link https://en.cppreference.com/w/cpp/container/map/try_emplace
#include <iostream>
#include <string>
#include <utility>
#include <map>
auto print_node = [](const auto& node) {
std::cout << "[" << node.first << "] = " << node.second << '\n';
};
auto print_result = [](auto const& pair) {
std:... | TEST | 0.850133 | 7.039627 |
c2b692ce-8560-4638-acfc-feb9564073bd | jose-melo/competitive-programming-studies | Round#655/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pii pair<int, int>
#define INF 0x3f3f3f3f
#define fi first
#define mp make_pair
#define se second
#define FI(n) for(int i = 0; i < n; i++)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define pb push_back
int t, n;
int... | ALGO | 0.999827 | 3.657405 |
7e176432-7fed-4560-b469-e07754fa0b4f | emon-swe-sust/IICT-CP | binaryTreeTraverse.cpp | #include<bits/stdc++.h>
using namespace std;
struct node {
int data;
struct node *left;
struct node *right;
};
node* newNode(int data) {
node* newNode = new node();
newNode->data = data;
newNode->left = NULL;
newNode->right = NULL;
return (newNode);
}
// Insert a node in level order
node* InsertNo... | ALGO | 0.999866 | 5.472355 |
ea453607-b8f7-47e7-bd0d-4d10cb8db3c6 | f-zyj/ACM | 按 OJ 分类/蓝桥杯/f-蓝桥-ALGO-14-回文数/f-蓝桥-ALGO-14-回文数/main.cpp | #include <iostream>
#include <cstring>
using namespace std;
const int MAXN = 100;
const int MAXSTEPS = 30;
int N, len;
char s[MAXN];
int num1[MAXN];
int num2[MAXN];
int num3[MAXN];
void add()
{
num3[len] = 0;
for (int i = len; i > 0; i--)
{
num3[i - 1] = (num1[i] + num2[i] + num3[i]) / N;
... | ALGO | 0.999925 | 3.757195 |
8cf31e09-d379-4b9c-b040-83a102c3f758 | songjihu/UnrealEngine-5.0.3-release | Engine/Source/Runtime/SignalProcessing/Private/FloatArrayMath.cpp | #include "DSP/FloatArrayMath.h"
#include "CoreMinimal.h"
namespace Audio
{
namespace MathIntrinsics
{
const float Loge10 = FMath::Loge(10.f);
const int32 SimdMask = 0xFFFFFFFC;
const int32 NotSimdMask = 0x00000003;
}
void ArraySum(TArrayView<const float> InValues, float& OutSum)
{
OutSum = 0.f;
int32 ... | ALGO | 0.996021 | 6.901399 |
28bc5509-8643-4e1a-b8bf-56cbac41cf3c | ishandutta2007/codeforces | dorost/normal/1025/D.cpp | /* * In the name of GOD */
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
const int N = 701;
bool ok[N][N], dp[N][N][2];
int a[N];
int32_t main() {
ios::sync_with_stdio(false);
cin.tie();
cout.tie();
int n;
cin >> n;
for (int i... | ALGO | 0.999993 | 3.749541 |
0617dcc9-b2f1-4bc3-97da-470658a4725d | raincross7/code-similarity | codes/train_code/problem402/problem402_7.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
double a, b;
cin >> a >> b;
a/=b;
cout << fixed << setprecision(10) << a;
}
| ALGO | 0.983948 | 3.515269 |
a7ef786e-7ff7-4117-9da8-edd7dd010efd | Dustin-Wang/Cplusplus_programming-study | Leetcode/Weekly-contest-339-2023-Apr-02/6364. Mice and Cheese.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <list>
#include <map>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <queue>
#include <random>
#include <set>
#include <sta... | ALGO | 0.999939 | 4.308193 |
ad556860-e751-435d-8a99-040737a42384 | ishandutta2007/codeforces | dengyipeng/normal/407/E.cpp | #include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<map>
#define maxn 200005
#define LL long long
using namespace std;
int n,K,i,j,k,ansl,ansr,nex[maxn],las[maxn],d0[maxn],d1[maxn];
LL a[maxn],mx,mi,d,t[maxn*4],tag[maxn*4];
map<LL,LL> s;
void Doit0(){
k=1,ansr=ansl=1;
for(i=1;i<=n;i++){... | ALGO | 0.999976 | 3.84321 |
449250ff-57d8-4def-9355-3c0a444c8b4d | XINGZHILU/CP4 | Chapter 1/kattis_conundrum.cpp | #include <bits/stdc++.h>
using namespace std;
int main () {
char str[305];
cin >> str;
int days = 0;
unordered_map<int, char> rep;
rep[0] = 'P';
rep[1] = 'E';
rep[2] = 'R';
for (int i=0; i<strlen(str); i++){
if (str[i] != rep[i%3]) days++;
}
cout << days;
return 0;
... | ALGO | 0.999764 | 3.429997 |
84a7fcc5-d033-4eaf-85ef-3c6378b59a9c | pharick/cpp | 1-year/13-digits/is-3.cpp | #include <iostream>
using namespace std;
int main() {
unsigned int number, is3 = false;
cin >> number;
do {
if (number % 10 == 3) {
is3 = true;
break;
}
number /= 10;
} while (number);
cout << (is3 ? "YES" : "NO") << endl;
return 0;
}
| ALGO | 0.9997 | 4.601509 |
7d268f89-7194-47f4-aaf4-a237fe6ca1f9 | LucasLagoeiro/runCodeInRAM | IAR/Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.916113 | 7.46982 |
466db45d-7d0d-470a-9574-b649989e7b84 | arturremizov/Leetcode | 2948.Make-Lexicographically-Smallest-Array-by-Swapping-Elements.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<int> lexicographicallySmallestArray(vector<int>& nums, int limit) {
vector<int> sortedNums = nums;
sort(sortedNums.begin(), sortedNums.end());
... | ALGO | 0.999998 | 5.504931 |
ca1300e6-fefd-46c3-b8ba-2f3a89e0d7a7 | Harsh20221/DSA | ARRAY ADT/Merging C++ DSA EXAMPLE CODE .cpp | #include <iostream>
#include <stdio.h> // !NOTE -- THIS IS AN EXAMPLE CODE WHICH MEANS IT IS NOT NATIVELY WRITTEN BY ME , I HAVE TAKEN THIS CODE FROM THE INTERNET AND MODIFIED IT TO MY NEEDS
#include <stdlib.h>
using namespace std;
struct Array
{
int A[10];
int length;
};
struct Array* Merge(struct Array *arr... | ALGO | 0.998523 | 3.846789 |
01ac04c9-f0e5-49fe-92d8-86e5fdc19090 | KizCode/FLUTTER-UJIKOM | 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 |
7da918fe-a302-4ce8-ba8e-ff7af6920a0b | rokib-ru-cse/problem-solving | codeforces_solved_problem/registrationsystem_4C.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
int t;
cin >> t;
map<string, int> ss;
while (t--)
{
cin >> s;
if (ss.count(s) == 0)
{
cout << "OK" << endl;
ss[s] = 1;
}
else
{
cout << s << ss... | ALGO | 0.999688 | 4.69237 |
70ae3f57-1e1d-41e1-9fa5-24774ff38ffa | KrishanKantAgnihotri/LeetCode | 1695-maximum-erasure-value/1695-maximum-erasure-value.cpp | class Solution {
public:
int maximumUniqueSubarray(vector<int>& nums) {
int n = nums.size();
map<int,int> m;
int l = 0 ;
if(nums.size() == 0) return 0 ;
m[nums[0]]++;
int cur = nums[0];
int ans = 0 ;
ans = max(ans,cur);
int len = 1 ;
... | ALGO | 0.999914 | 6.1845 |
6e925dd6-f61a-4f7f-adfb-aa69121f4be2 | jschwartzenberg/openjfx8 | modules/web/src/main/native/Source/WebCore/platform/network/DNSResolveQueue.cpp | #include "config.h"
#include "DNSResolveQueue.h"
#if USE(SOUP)
#include "DNSResolveQueueSoup.h"
#elif USE(CURL)
#include "DNSResolveQueueCurl.h"
#elif PLATFORM(JAVA)
#include "DNSResolveQueueJava.h"
#elif USE(CF)
#include "DNSResolveQueueCFNet.h"
#endif
#include <wtf/CompletionHandler.h>
#include <wtf/NeverDestroyed.... | TOOL | 0.850161 | 7.754248 |
fa5d22f3-0aea-46af-afdc-191e5e76a9bd | itzmk06/Conquer | DSA/Linked List/Questions/MergeTwoSortedList.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLis... | ALGO | 0.999972 | 5.55287 |
f54932c3-7ae2-4ffc-9ad2-27648f87bf80 | lXVILLALOBOSXl/TECMM | Estructura de Datos/Data Structure/Circular Data Structure/Index For Circular Buffer/main.cpp | /*
AUTOR: Luis Villalobos
CURSO: Estructura de Datos
PROGRAMA: Index Circular Buffer
FECHA: 21 de febrero del 2023
*/
#include <iostream>
using namespace std;
// Natural index: 1, 2, 3, 4, ...., n
// int forth(int i, int n) { return i % n + 1; }
// Mod index: 0, 1, 2, 3, ...., n - 1
int forth(int i... | ALGO | 0.999579 | 4.167564 |
78e0bdb6-2ccd-4a4f-8ffe-67438c5bb5bb | Dipankar2020-ai/LeetCode | Mathematics/sqrtsx.cpp | Problem:
https://leetcode.com/problems/sqrtx/
Solution:
class Solution {
public:
int mySqrt(int x) {
int ans=floor(sqrt(x));
return ans;
}
};
| ALGO | 0.999966 | 5.395192 |
0b3df46b-b4aa-4207-ad67-bee78c2dc5d5 | anas3a/Online-Judge-Solutions | E_Escape_from_Ayutthaya.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int arr[] = {0, 0, -1, +1};
int brr[] = {-1, +1, 0, 0};
bool vis[1005][1005];
int fx, fy;
int mn;
int t, n, m, pos1x, pos1y, pos2x, pos2y;
char ch[1005][1005];
bool yes1, yes2;
int tmp = INT_MAX;
void bfs(int x, int y, int curr)
{
queue<pair<pai... | ALGO | 0.999919 | 3.445262 |
8f6ab01d-6539-446d-9c07-4ebe06fa39ee | raincross7/code-similarity | codes/train_code/problem008/problem008_126.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILLl(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_... | ALGO | 0.991581 | 3.905691 |
52f9a528-1dae-4d9e-83f1-55b787320e06 | Zu-rin/AtCoder | AtCoder_Beginner_Contest/ABC159/ABC159E.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define MOD 1000000007
#define PI 3.14159265358979323846
#define INF 1 << 30
using namespace std;
typedef long long ll;
typedef pai... | ALGO | 0.999955 | 4.378779 |
65734541-ba7a-4061-89c9-0987636e113f | smuskova/C-3 | vectori/zad ot iteratori izmislena.cpp | #include<bits/stdc++.h>
using namespace std;
int main ()
{
int n, a; cout<<"n="; cin>>n;
vector<int > v;
vector< int > ::iterator it;
for(int i=0; i<n; i++)
{
cout<<"a="; cin>>a;
v.push_back(a);
}
int pr=1;
for(it=v.begin(); it!=v. end(); it++)
{
cout<<*it<<end... | ALGO | 0.999987 | 3.644139 |
8d27baa4-fc07-4b17-8c00-3d3667025cad | kundangupta04/CPP-DSA | c8/q1.cpp | // WAP to display multiplication of two matrices entered by the user.
#include<iostream>
using namespace std;
int main(){
int r1, c1;
cin>>r1>>c1;
int A[r1][c1];
for(int i=0; i<r1; i++){
for(int j=0;j<c1; j++){
cin>>A[i][j];
}
}
int r2, c2;
cin>>r2>>c2;
int... | ALGO | 0.999159 | 3.54334 |
3ae0ad54-b6d1-4b32-a3f6-575f9f9a6b7a | fyzel527/UnrealEngine-4.24Toon | Engine/Plugins/Experimental/ProxyLODPlugin/Source/ThirdParty/UVAtlasCode/UVAtlas/isochart/isochartmesh.cpp | /*
Terms:
L2 Stretch:
Corresponds to the root-mean-square stretch over all directions
in the domain.
Ln Stretch:
The worst-case norm Ln is the greatest stretch.
Note that both L2 and Ln increase to infinity as the parametrization of
face become... | ALGO | 0.98542 | 4.739882 |
70abe49f-f19a-4832-aba7-550b3b712b76 | asmisloff/PPP | ch08/ex_09.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
#include <climits>
using namespace std;
class Randomizer {
public:
Randomizer(int x0);
void seed(int x0);
int randint();
private:
int state = 0;
int a = 16807;
int m = 2147483647;
int c = 0;
};
Randomizer::Randomizer(int x0 = 0) {
... | TOOL | 0.99365 | 4.14528 |
7e78b1b4-bc1e-41e5-a305-0b18f26826dd | DjordjevicPetar/CodeForces-Problems | C. Alternating Subsequence/C. Alternating Subsequence/C. Alternating Subsequence.cpp | #include <iostream>
using namespace std;
long long Alternating_Sum() {
long long len, sum = 0, max = 0, sign = 1;
cin >> len;
for (int i = 0, temp; i < len; i++) {
cin >> temp;
if (temp * sign < 0) {
sum += max;
max = temp;
sign = (sign == 1) ? -1 : 1;
}
else {
if (max < temp)max = temp;
}
}
... | ALGO | 0.999917 | 4.551435 |
3571f082-7fb6-4620-b159-f5cfada163e2 | guptanikshay/DSA | 125_min_cost_of_tickets.cpp | #include <bits/stdc++.h>
using namespace std;
/* You have planned some train traveling one year in advance. The days of the year in which you will travel are given as an integer array days. Each day is an integer from 1 to 365.
Train tickets are sold in three different ways:
a 1-day pass is sold for costs[0] dollars... | ALGO | 0.999653 | 4.87246 |
6d664ec4-8f80-4867-b73f-8e42c4cd9976 | tao73bot/codes | codeforces_1520_C.cpp | #include <bits/stdc++.h>
using namespace std;
#define SIS std::ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define gelo return 0
#define khela_shuru int main()
#define ll long long
void solve()
{
int n,i,j,a;
cin >> n;
int x[n][n];
if(n==1){
cout << "1\n";
}
else if(n==2){
cout << "-1\n";
}
else{
a=1... | ALGO | 0.999468 | 4.486087 |
4587a08d-a1dc-4bfc-85a5-a38e4fa76400 | dogecash/dogecash-oldchain | src/coins.cpp | #include "coins.h"
#include "random.h"
#include <assert.h>
/**
* calculate number of bytes for the bitmask, and its number of non-zero bytes
* each bit in the bitmask represents the availability of one output, but the
* availabilities of the first two outputs are encoded separately
*/
void CCoins::CalcMaskSize(u... | ALGO | 0.960287 | 7.059897 |
82027ee0-015a-4bf1-b21c-72b79bc2b7cf | ZhiquanW/ECS-050 | ECS050-Homework/HW1/TriMatMult/triMatMult.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <cassert>
#include <vector>
#include <sstream>
#include <cmath>
using namespace std;
struct pos{
int x;
int y;
int x2;
};
int get_index(int,int,int);
pos get_pos(int,int);
int main(int argc,char** argv)... | ALGO | 0.99927 | 3.000265 |
20732216-c956-4716-8033-dc8c6dd1e7fa | Temsys-Shen/JLU-Toolbox | 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 |
b90a215f-22cd-432f-ba25-d033d3c91cb1 | pastjung/Algorithm | SWEA/D3/1209. [S/W 문제해결 기본] 2일차 - Sum/[S/W 문제해결 기본] 2일차 - Sum.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int func(vector<vector<int>> board, int N){
int maxSum = 0, left = 0, right = 0;
// 대각선
for(int i = 0; i < N; i++){
left += board[i][i];
right += board[i][N - 1 - i];
}
maxSum = max(max(left, right), max... | ALGO | 0.999901 | 4.657694 |
77641428-1799-47ee-9a8c-322686f26609 | priyajit27/Leetcode | 0221-maximal-square/0221-maximal-square.cpp | class Solution {
public:
int largestRectangleArea(vector<int>& histo) {
stack<int>st;
int area=0;
int n=histo.size();
int leftsmall[n];int rightsmall[n];
for(int i=0;i<n;i++){
while(!st.empty() && histo[st.top()]>=histo[i]){
... | ALGO | 0.999838 | 6.235708 |
0e3c8bdc-0063-4fe4-a9c7-d2f1dc0b9233 | T-Ageishi/AtCoder | support/library/UnionFind.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
typedef unsigned long long ull;
typedef long long ll; // 9*10^18
#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i >= b; i--)
const ll infl = 1LL << 60;
const int inf = INT_MAX / 2;
con... | ALGO | 0.999324 | 4.640513 |
546fe2b9-ebf4-4640-be9b-a6f60a9e8d33 | Tedxz/Online-Judge-Archive | POJ/3264.cpp | /*PKU 3264*/
#include<cstdio>
const int MAX_N=50010;
int n,m;
int a[MAX_N];
int vmax[131072],vmin[131072],l[131072],r[131072];
class segment_tree
{
private:
int max(int a, int b) { return a>b?a:b; }
int min(int a, int b) { return a<b?a:b; }
void build(int k, int left, int right)
{
... | ALGO | 0.999974 | 5.001132 |
bd40194e-df83-410d-9ec4-f9c7d3350a3b | ishandutta2007/codeforces | gonhxh/normal/1311/B.cpp | #include <bits/stdc++.h>
#define int long long
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define ff first
#define ss second
#define rep(i,l,r) for(int i = (i... | ALGO | 0.999993 | 3.723206 |
9242bfe9-6158-41b4-9cfa-bef2e54cfaba | namratabose32/Leetcode | 191-number-of-1-bits/191-number-of-1-bits.cpp | class Solution {
public:
int hammingWeight(uint32_t n) {
int c=0;
while(n){
n&=(n-1);
c++;
}
return c;
}
}; | ALGO | 0.999882 | 6.355866 |
88c332c2-7c19-4532-8493-6123aa52eeb1 | chaubey12/code_practice | epi_cpp/12_Recursion/01_gcd.cpp | #include <iostream>
using namespace std;
long long GCD(long long x, long long y){
return y == 0 ? x : GCD(y, x%y);
}
int main(){
cout << GCD(72, 36)<<endl;
return 0;
} | ALGO | 0.999685 | 5.001042 |
f004b456-07d7-44d3-965f-f31bfab1cb11 | AuroraDroid-og/frameworks_av | media/libeffects/config/src/EffectsConfig.cpp | #define LOG_TAG "EffectsConfig"
#include <algorithm>
#include <cstdint>
#include <functional>
#include <memory>
#include <string>
#include <unistd.h>
#include <tinyxml2.h>
#include <log/log.h>
#include <media/EffectsConfig.h>
#include <media/TypeConverter.h>
#include <system/audio_config.h>
using namespace tinyxml2... | TOOL | 0.867525 | 6.52387 |
2276cfcd-1dc2-4ba5-ab29-bf9adf14dbcd | nocotan/AOJ | Cpp/Volume027/2739.cpp | //#define _GRIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
// 基本テンプレート
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n... | ALGO | 0.999949 | 4.38937 |
beb77d12-4797-46ff-86e5-c6fc1e611b21 | born2hero/OOP-with-CPP-by-E-Balagurusamy | EBbook_programming_exercise/ex4.2.cpp | /*
Write a program to read a matrix of size m x n from the keyboard and display the same on the
screen using functions.
*/
#include<iostream>
using namespace std;
#define MAX 100
int matrix(int m,int n){
int i=0,j=0,arr[MAX][MAX];
for(i=0;i<m;i++){
for(j=0;j<n;j++){
cout<<"arr["<<i<<"]["<... | TOOL | 0.904832 | 4.409783 |
da4b8671-103a-4ec8-9435-fe1d669adce8 | ArpitSachan/Data-Structure-Questions | Linked List/pairwise swap nodes.cpp | class Solution {
public:
ListNode* swapPairs(ListNode* head) {
if(head==NULL || head->next==NULL) return head;
ListNode* first=head;
ListNode* second=head->next;
ListNode* prev =NULL;
while(second!=NULL && second->next!=NULL){
ListNode* next=second->next;... | ALGO | 0.999994 | 5.712391 |
c39902a4-2e21-4485-99ae-8e691506ec7b | rachitdhaka/Data-Structure-Algorithm | searching_sorting_class1.cpp | #include<iostream>
#include<vector>
using namespace std;
int binarysearch(int arr[],int size,int target){
int start=0;
int end=size-1;
int mid=(start+end)/2;
while(start<=end){
int element=arr[mid];
if(element==target){
return mid;
}
else if(element>targ... | ALGO | 0.999923 | 5.137054 |
29b08529-e799-4f32-b363-a2cdf78ee11f | dhruvdabhi101/LeetCode | 15-3sum/15-3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
sort(nums.begin(),nums.end());
vector<vector<int> > sol;
int n = nums.size();
for(int i=0;i<n-2;i++){
if(i == 0 || (i > 0 && nums[i] != nums[i-1])){
int low = i+1;
i... | ALGO | 0.999963 | 5.817043 |
fd64f462-6601-448a-94d1-9436f4d8271a | makio93/competitive-atcoder | abc292/abc292_e/main0.cpp | // 本番AC
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for... | ALGO | 0.999664 | 4.144717 |
86c70974-90a7-491f-849a-d373519f801c | schneider001/Par_progg | sequential.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <cmath>
#include <time.h>
double psi(double t);
double phi(double x);
double fun(double t, double x);
int main()
{
double X, T;
int I, J;
int a;
std::cin >> X >> T >> I >> J >> a;
double h = X / I;
double d = T / J;
std::v... | ALGO | 0.998681 | 3.454735 |
45a18d64-28a4-4e08-b190-cc70bd0bcd87 | METGDSC/GDSC-ProCode | 2022-Oct/11 Oct 2022/Pratik_Kumar.cpp | #include<iostream>
#include <string.h>
using namespace std;
int main()
{
char str[100];
gets(str);
int i,j,count=0;
for(i=0;str[i]!='\0';i++)
{
int flag=1;
for(j=0;j<=(i/2);j++)
{
if(str[j]!=str[i-j])
flag=0;
}
if(flag==1)
... | ALGO | 0.999546 | 4.137163 |
68d23157-3660-4368-99b0-81f92c4ee4db | akhi1-s/Leetcode-solutions | c++2/2149. Rearrange Array Elements by Sign.cpp |
class Solution {
public:
vector<int> rearrangeArray(vector<int>& nums) {
vector<int> ans(nums.size());
int i = 0, j = 1;
for (int x : nums) {
if (x > 0) {
ans[i] = x;
i += 2;
} else {
ans[j] = x;
j += 2;... | ALGO | 0.999989 | 5.337306 |
bf586999-65e5-4cfc-8805-7a2dc0a6e037 | NaVIn69/AlgoZenith_DSA | graph2/revision/find_number_of_connected_component.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
int n,m;
vector<vector<int>>g;
vector<int>vis;
vector<vector<int>>all_comp;
// here index will tell me about the component number , and
// in dfs we do the color twiking
void dfs(int node,int num_comp){
vis[node]=num_comp;
for(aut... | ALGO | 0.999973 | 5.099371 |
d6b292ae-a6b2-4152-b32a-69f589c1c260 | FDU-VTS/LOL | src/fast_gicp/thirdparty/Eigen/bench/benchmarkX.cpp | // g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef MATTYPE
#define MATTYPE MatrixXLd
#endif
#ifndef MATSIZE
#define MATSIZE 400
#endif
#ifndef REPEAT
#define REPEAT 100
#endif
int mai... | ALGO | 0.948096 | 3.370773 |
c1c3bc3e-391f-456d-9a0f-1d96104ece09 | Pranav-Rustagi/Problem-Solving | Topological sort - GFG/topological-sort.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
void mark(vector<int>& v, vector<bool>& vis, int ind, vector<int> adj[]) {
vis[ind] = true;
for(int n : adj[ind]) {
if(vis[n] == false) {
mark(v, vis, n, adj);
... | ALGO | 0.999938 | 6.740762 |
66179ecd-3d2e-443f-b53b-2ec1f2b2d7b9 | huytan29/CTDL_pTIT | DSA_goc/cpp-dsa/DSA09013.cpp | #include <bits/stdc++.h>
using namespace std;
int v, e, x, y, ans;
bool vs[1001];
vector<vector<int>> ls;
void DFS(int u) {
vs[u] = 1;
// cout << u << " ";
for (int i = 0; i < ls[u].size(); i++) {
int tmp = ls[u][i];
if (!vs[tmp]) DFS(tmp);
}
}
void canhcau() {
for (int i = 1; i <= ... | ALGO | 0.999939 | 4.266475 |
be6712f4-b9c3-4213-b4e8-98fd51676b7c | geekboxzone/mmallow_ndk | sources/cxx-stl/llvm-libc++/libcxx/test/containers/associative/set/find.pass.cpp | // <set>
// class set
// iterator find(const key_type& k);
// const_iterator find(const key_type& k) const;
#include <set>
#include <cassert>
#include "min_allocator.h"
#include "private_constructor.hpp"
int main()
{
{
typedef int V;
typedef std::set<int> M;
{
typedef M::iterator R;
... | TEST | 0.916099 | 4.084417 |
bc27a978-32d3-4ccb-a657-373a828964c7 | WillianYe/Multi-robot-dispatch-platform | server_ws/src/rmf/rmf_traffic/rmf_traffic/test/unit/agv/test_Negotiator.cpp | #include <rmf_traffic/agv/CentralizedNegotiation.hpp>
#include <rmf_traffic/DetectConflict.hpp>
#include <rmf_traffic/agv/Planner.hpp>
#include <rmf_traffic/agv/SimpleNegotiator.hpp>
#include <rmf_traffic/geometry/Circle.hpp>
#include <rmf_traffic/schedule/Database.hpp>
#include <rmf_traffic/schedule/Negotiation.hpp>
... | TOOL | 0.953455 | 6.495473 |
6ae687a6-7f51-408c-b441-5ec270e825e4 | ishandutta2007/codeforces | yashchandnani/normal/915/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int i = a; i <= (n); ++i)
#define repD(i, a, n) for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a) ... | ALGO | 0.999988 | 4.554668 |
59a85114-ee46-4eaa-907e-55bfc6a83faf | Pathak2101/Leetcode_solution | Reverse a String - GFG/reverse-a-string.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
string reverseWord(string str);
int main() {
int t;
cin>>t;
while(t--)
{
string s;
cin >> s;
cout << reverseWord(s) << endl;
}
return 0;
}
// } Driver Code Ends
//User function Template for C++
string rev... | ALGO | 0.999911 | 6.100614 |
f55a1e34-0452-4350-ab3f-be6c7f3fa45f | ishandutta2007/codeforces | amshz/normal/512/D.cpp | //khodaya khodet komak kon
# include <bits/stdc++.h>
/*
// ordered_set
# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
# define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
*/
using namespace std;
typedef lo... | ALGO | 0.999948 | 4.56442 |
f3cea6e5-b933-4541-8d65-2d485cb343da | mrmotabar/Coding_Problems | Vjudge/Socks.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <map>
using namespace std;
vector<int> adj[1000000];
int vis[2000000 + 10];
int co[1000000];
int y = 0;
map<int, int> mp[200000 + 10];
void dfs(int v)
{
vis[v] = 1;
mp[y][co[v]]++;
for (int u : adj[v])
{
if (!vis[u])
{
dfs(u);
}
}
}
int main... | ALGO | 0.999887 | 3.755208 |
aafae7eb-143c-4c4a-800f-11f97239d22a | bbppooii/c | 扫雷游戏/源.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include "game.h"
void menu(){
printf("----------------------\n");
printf("------ 1.ʼ ------\n");
printf("------ 0. ------\n");
printf("----------------------\n");
}
void game() {
char mine[ROWS][COLS];
char show[ROWS][COLS];
InitBoard(mine, ROWS, COLS, '0');
InitBoard(show... | TOOL | 0.957498 | 3.675303 |
c9883562-fe4b-4c5a-aa73-ee02b0d9dd62 | Abdullah-Asif/Codeforces | CodeForces/CF-1355B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t, n;
cin >> t;
while (t--) {
cin >> n;
vector <int> vc(n);
int cur = 0, ans = 0;
for (auto &i : vc)
cin >> i;
sort (vc.begin(), vc.end());
for(auto i : vc) {
++cur;
if (i <= cur) {
ans++;
cur = ... | ALGO | 0.999825 | 4.340841 |
8df2ebed-31a0-442f-91ed-36a7f56754c0 | maxomart/Ejercicios-de-la-facu-tp3 | ejer11/ejer11/main.cpp | #include <iostream>
using namespace std;
int main() {
int num;
bool es_primo = true;
cout << "Ingrese un numero entero positivo: ";
cin >> num;
// Verificar si el nmero es menor o igual a 1
if (num <= 1) {
es_primo = false;
} else {
// Iterar desde 2 hasta la mitad del nm... | ALGO | 0.998069 | 4.431127 |
b8bd7f84-6d5b-4a3e-88a0-46dd239ba709 | ritikaradh/learnDSA | DSA/LinkedList/DoublyLL.cpp | #include <iostream>
#include <iterator>
using namespace std;
class Node{
public:
int val;
Node* next;
Node* prev;
//constructor
Node(int val){
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
class doublyLL{
public... | ALGO | 0.995902 | 5.136179 |
fdb3f427-67bf-4c75-baaf-6cd4c48d920a | abhishek18124/DTC-2024 | Lecture 13/02 DP/001DP_FibonacciNumbers.cpp | /*
given a non-negative number n, find the nth fibonacci no.
Example :
Input : n = 7
Output : 13
*/
#include<iostream>
#include<vector>
using namespace std;
int cnt1 = 0;
int f(int n) {
cnt1++;
// base case
if (n == 0 || n == 1) {
// f(0) : find the 0th fibonacci no.
// f(1) : find the 1st fibonacc... | ALGO | 0.999974 | 5.767659 |
a933ea44-a8d4-44d1-be0e-921bbfe9e3ee | Shompa19/CGLABFINAL | CG LAB/ReflectionCircle/main.cpp | #include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
#include<string.h>
#define getch() _getch()
int main()
{
int r,xc,yc;
int choice;
//int gd=DETECT,gm;
//initgraph(&gd,&gm,(char *)"");
//Window measurement
//DWORD sw=GetSystemMetrics(SM_CXSCREEN);
//DWORD sh=GetSyst... | ALGO | 0.998886 | 3.363264 |
d04bc3b2-8c81-4d27-a2d1-2f6cd9d18aea | xLLLxLLLx/xLLLx | PE/3.cpp | #include<bits/stdc++.h>
#define fr(i,x,y) for(int i=x;i<=y;++i)
#define rf(i,x,y) for(int i=x;i>=y;--i)
#define LL long long
using namespace std;
int main(){
LL maxn=0;
LL n;scanf("%lld",&n);
LL len=sqrt(n);
fr(i,2,len){
if(n%i==0){
maxn=max(maxn,i*1LL);
while(n%i==0) n/=i;
}
}
maxn=max... | ALGO | 0.999944 | 3.750031 |
3fe71e69-d9c5-49fa-98f4-8dd9f516948d | ventZl/cmrx-examples | stm32h7-usb/Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.895418 | 7.471897 |
8fd9ed64-4bf9-49b3-bf2f-14c06164b9cb | aim-wip/frameworks_av | media/libstagefright/webm/EbmlUtil.cpp | #include <stdint.h>
namespace {
// Table for Seal's algorithm for Number of Trailing Zeros. Hacker's Delight
// online, Figure 5-18 (http://www.hackersdelight.org/revisions.pdf)
// The entries whose value is -1 are never referenced.
int NTZ_TABLE[] = {
32, 0, 1, 12, 2, 6, -1, 13, 3, -1, 7, -1, -1, -1, -1, ... | TOOL | 0.964154 | 6.877662 |
f3639664-5eb6-4f69-8afc-a345ba54ebc0 | Hriman-Mahanta/File-Structures | linked_allocation.cpp | #include <iostream>
#include <fstream>
#include <map>
#include <stdio.h>
using namespace std;
const int BLOCK_SIZE = 16; // Size of disk blocks in bytes
// Data structure for a disk block
struct DiskBlock {
char data[BLOCK_SIZE];
DiskBlock* nextBlock; // Index of the next block in the linked list
DiskB... | TOOL | 0.976452 | 4.5667 |
e815fc9c-bfeb-4a85-9e4a-62fee1980117 | chemesh/k_way_merge_sort | Project2/kMergeSort.cpp | #include "kMergeSort.h"
#include "Heap.cpp"
void quickSort(long int arr[], int low, int high) {
if (low < high) {
int pivot = partition(arr, low, high);
quickSort(arr, low, pivot - 1);
quickSort(arr, pivot + 1, high);
}
}
int partition(long int arr[], int left, int right)
{
int pivot = left;
int temp;
whi... | ALGO | 0.999941 | 4.106944 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.