uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4f0dae9a-0181-43ab-9f02-88d2350e12b3 | rishabhjha05/CodeStruct | Module_21/Pre_fix/Leetcode_1480.cpp | #include <iostream>
#include <vector>
using namespace std;
string suffix(int i)
{
switch (i % 10)
{
case 1:
return "st";
case 2:
return "nd";
case 3:
return "rd";
default:
return "th";
}
}
vector<int> runningSum(vector<int> &nums)
{
int n = nums.size(), i ... | ALGO | 0.999506 | 4.9374 |
324c2c34-1ed1-4c4e-8ded-1a7de6732471 | zpt1376241/algorithms | code/Atocder/ABC354/B.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n,sum=0;
cin>>n;
vector<string> s;
for(int i=1;i<=n;i++)
{
string t;
cin>>t;
s.push_back(t);
int k;
cin>>k;
sum+=k... | ALGO | 0.999964 | 3.746353 |
2f5f35d2-143c-497f-a622-a6ef8c69aee4 | Zapryanovx/FMI-SDA-2024-PREP | Week 03/Sem Group 05/count_inversions.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
long long mergeAndCount(vector<int>& nums, int left, int mid, int right)
{
vector<int> sorted(right - left + 1);
int leftIndex = left;
int rightIndex = mid + 1;
int currIndex = 0;
int... | ALGO | 0.999984 | 5.276623 |
4b738fa4-cb8c-443b-ba71-667be85f99ab | sunhao-seu/C-plus-plus-projects | SLAM course/HW2_SIMPLE_VO/main.cpp | #pragma warning( disable : 4996)
#include <read_files.h>
#include <Basic_VO_function.h>
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "opencv2/imgproc/imgproc.hpp" //line
#include <opencv2/opencv.hpp> //ransac
const in... | ALGO | 0.983877 | 3.441526 |
288adbb3-b10a-4f46-b19a-997ac9377936 | bill2766/patGo | 1100/1100. advanced.cpp | #include <iostream>
#include <string>
using namespace std;
string a[13] = {"tret", "jan", "feb", "mar", "apr", "may", "jun", "jly", "aug", "sep", "oct", "nov", "dec"};
string b[13] = {"####", "tam", "hel", "maa", "huh", "tou", "kes", "hei", "elo", "syy", "lok", "mer", "jou"};
string s;
int len;
void func1(int t) {
... | ALGO | 0.999285 | 3.992147 |
4aa95924-600d-43ca-9614-d2c62e5456f7 | huchongjun233/bullet3Lib | include/BulletCollision/CollisionShapes/btSdfCollisionShape.cpp | #include "btSdfCollisionShape.h"
#include "btMiniSDF.h"
#include "LinearMath/btAabbUtil2.h"
ATTRIBUTE_ALIGNED16(struct)
btSdfCollisionShapeInternalData
{
BT_DECLARE_ALIGNED_ALLOCATOR();
btVector3 m_localScaling;
btScalar m_margin;
btMiniSDF m_sdf;
btSdfCollisionShapeInternalData()
: m_localScaling(1, 1, 1),
... | ALGO | 0.948317 | 7.036384 |
5a52952f-64a8-4b27-9d7c-f42b010b4fda | Apizz789/C_and_Cpp | 1/Untitled6.cpp | #include <iostream>
using namespace std;
int main()
{
int n,num=0,k=1;
cout<<"Enter the Number of Rows : ";
cin>>n;
for(int i=1;i<=n;i++)
{
num=num+i;
num=num*10;
k*=10;
}
num=num/10;
k=k/10;
for(int i=1;i<=n;i++)
{
cout<<num<<endl;
num=(nu... | ALGO | 0.999338 | 3.456393 |
de809ada-6fa0-47a4-98a0-d0d22eb9a356 | Asik8/BeeCrowd-Problems | Super_Primes_Engage.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ios::sync_with_stdio(false);
int n;
while (cin>>n)
{
if(n<=1)
{
cout<<"Nada\n";
continue;
}
int l = sqrt(n);
bool prime = true;
for(int i=2;i<=l;i... | ALGO | 0.999271 | 4.423196 |
e3663b12-c392-4452-8945-0be3162c8a35 | KT19/parallel_algorithms | prefix_sum/scan.cpp | #include<iostream>
#include<vector>
#include<ctime>
#include<chrono>
using namespace std;
//prototype
int random_generate(int min_num = 0, int max_num = INT_MAX);
void calc_prefix_sum(vector<int>& A);
int main(int argc, char* argv[]) {
if(argc != 2) {
cout<<"Error in arguments"<<endl;
cout<<"Plea... | ALGO | 0.978393 | 4.916139 |
d68e7fb7-cb62-4b50-aadd-81bb8813c508 | TropicalTeamYard/tty.oj.gallery | cpp.zjut/z_1600.cpp | #include<iostream>
using namespace std;
int main()
{
int num;
while (cin >> num && num != 0)
{
cout << num * (num + 1) / 2 << endl;
}
return 0;
} | ALGO | 0.999314 | 4.211329 |
1963c0a9-cafb-4c08-af24-ccb492887deb | ishandutta2007/codeforces | enchom/normal/265/A.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
typedef long long Int;
char s[51];
char t[51];
Int sL,tL;
int main()
{
Int i;
Int uk=0;
scanf("%s",s);
sL=strlen(s);
scanf("%s",t);
tL=strlen(t);
for (i=0;i<tL;i++)
{
if (t[i]==s[uk])
... | ALGO | 0.999807 | 3.334442 |
2ae1d6d3-69f6-4e3a-96db-7a9e69a223d2 | MatthewDZane/UnrealQRCodeScanner | Source/ThirdParty/ZXingLibrary/Hololens/core/src/zxing/common/PerspectiveTransform.cpp | #include <zxing/common/PerspectiveTransform.h>
namespace zxing {
using namespace std;
PerspectiveTransform::PerspectiveTransform(float inA11, float inA21,
float inA31, float inA12,
float inA22, float inA32,
... | ALGO | 0.995904 | 5.958822 |
99e75b8e-3a64-4712-84ce-07c9b622fe2e | meomnzak/Problem-Solving | LeetCode-Solutions/detect_squares/solution.cpp | class DetectSquares {
public:
vector<vector<int>> vec;
map<pair<int,int>,int> mp;
DetectSquares() {
vec.clear();
mp.clear();
}
void add(vector<int> point) {
vec.push_back(point);
mp[{point[0],point[1]}]++;
}
int count(vector<int> point) {
int... | ALGO | 0.999805 | 5.90195 |
d06dfcde-f064-4cb8-aab8-d53be2d23870 | angelicaVargas/Cpts_223 | hw02/sequential_search.cpp | #include <iostream>
using namespace std;
int search(int arr[], int n, int value) {
int i;
for (i = 0; i < n; i++)
if (arr[i] == value)
return i;
return -1;
}
int main(void) {
int arr[] = { 4, 8, 5, 10, 50 };
int value = 10;
int n = sizeof(arr) / sizeof(arr[0]);
//fun... | ALGO | 0.999461 | 5.507154 |
e6529f54-47ed-495e-ac3b-0098eaf1fcc3 | ImmuGG/DS-LAb | prac6_linearsearch.cpp | #include <iostream>
using namespace std;
int main() {
int arr[100]; // Assuming a maximum of 100 elements
int size, searchValue;
cout << "Enter the size of the array: ";
cin >> size;
cout << "Enter " << size << " elements: ";
for (int i = 0; i < size; i++) {
cin >> arr[i];
}
... | ALGO | 0.999546 | 5.72644 |
c54aacb5-265a-4f49-836e-d73b818a75ee | liuxuanhai/book-code | Cpp_Primer_Answers-Chinese/ch03/exercise3_36.cpp | #include <iostream>
#include <vector>
#include <iterator>
using namespace std;
bool compare(int* const pb1, int* const pe1, int* const pb2, int* const pe2)
{
if ((pe1 - pb1) != (pe2 - pb2))
return false;
else
{
for (int* i = pb1, *j = pb2; (i != pe1) && (j != pe2); ++i, ++j)
if (*i != *j) return false;
}
... | TEST | 0.993327 | 5.1148 |
f5cb696e-d269-4a4d-84c5-1118207a4b48 | novo1985/Leetcode | DFS backtracking/216. Combination Sum III.cpp | /* Find all possible combinations of k numbers that add up to a number n, given that only
* numbers from 1 to 9 can be used and each combination should be a unique set of numbers.*/
//Ak belongs [1, .., 9], combination is a set, no duplicate numbers
class Solution {
public:
vector<vector<int>> combinationSum3(in... | ALGO | 0.999979 | 6.331818 |
a651fe11-5e71-4897-936b-f9155cb66cea | watsonjj/OxTools | source/src/PulseSpectrumFit.cpp | //
// Created by Jason Watson on 08/04/2016.
//
#include "PulseSpectrumFit.h"
double_t gaussianFunction(Double_t *x, Double_t *par) {
return par[0] * (ROOT::Math::normal_pdf(x[0], par[2], par[1]));
}
double_t risingedgeFunction(Double_t *x, Double_t *par) {
return (par[3] * // scaling parameter
(ROOT::Mat... | TOOL | 0.984339 | 4.881426 |
a96873c2-4876-460d-b507-f3d014efd5df | Aashish774-star/45Day_DSA_Challenge | Q9.cpp | // Write a program that checks if Aashriya's emotional balance is maintained based on the frequency of characters in a given string. If all characters have the same frequency, print "Aashriya smiles: Emotional balance found." Otherwise, print "Aashriya wonders: These thoughts were scattered."
#include <bits/stdc++.h>
... | ALGO | 0.999694 | 6.411728 |
47d56ec9-2cd1-4077-b8f8-57973a9a895c | Aneekesh/OOP-LAB-ASSIGNMENTS | lecture/17.cpp | #include<iostream>
using namespace std;
// inline int product(int a , int b){
// return a*b;
// }
//********************************************************
// float moneyReceived(int currentMoney , float factor = 1.04){
// return currentMoney * factor ;
// }
//************************************************... | ALGO | 0.922516 | 3.126465 |
0cbf663d-5168-4f7d-932a-d83a160b5d67 | himani1717/gsoc_assignment | assignment4/adding digits.cpp | class Solution {
public:
int addDigits(int n) {
int sum=0;
while(n>0){
sum=sum+n%10;
n=n/10;
}
if(sum>9){
return addDigits(sum);
}
return sum;
}
};
| ALGO | 0.999677 | 6.483952 |
90f3ac76-febe-4ece-90d7-005512375e00 | arnabs542/LeetCode-26 | C++/0057-insert-interval.cpp | // Tags: Array Sort Google
// Time: O(n)
// Space: O(1)
class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) {
vector<vector<int>> res;
size_t i = 0;
// Insert intervals appeared before newInterval
// intervals[i]: [ ]
... | ALGO | 0.999987 | 6.351202 |
90fb589f-6788-46b9-893f-700c7a4e7c45 | davidhin/Misc-Works | rosalind/sortingAlgos/16-median.cpp | #include <iostream>
#include <fstream>
#include <random>
void printArr(int* a, int n, int j = -1, int p = -1, int q = -1, int loHl = -1, int red = -1)
{
for (int i = 0; i < n; i++)
{
if (i == j)
std::cout << "\033[1;32m" << a[i] << "\033[0m" << " ";
else if (i == p)
std::cout << "\033[1;33m" << a[i] << "... | ALGO | 0.999735 | 4.345561 |
25d0ed49-863b-402b-a119-f2ac6373d85c | divyansh884/Leetcode | 0216-combination-sum-iii/0216-combination-sum-iii.cpp | class Solution {
public:
void solve(int index,int &sum, vector<vector<int>> &ans,int k, int n,vector<int> &qd){
if(qd.size()==k){
if(sum==n)
ans.push_back(qd);
return;
}
if(sum>=n && qd.size()<k)
return;
if(sum<n && qd.size()>=k)
return;
for(int i=index;i<=9;i++){
... | ALGO | 0.999968 | 6.553534 |
c56cf370-8dd8-45cb-bb91-8ac68fa16963 | SwapBhave/BasicCodes | C++ Codes/11_Public Class Modifier/PublicModifier.cpp | #include<iostream>
using namespace std;
class Area
{
public:
int Radious;
float CirculeArea(int);
};
float Area::CirculeArea(int Radious)
{
return 2 *3.14*Radious;
}
int main()
{
Area area;
shape sh;
float Output = area.CirculeArea(20);
cout << "Radious is:" << Output << endl;
}
| TOOL | 0.981879 | 4.09159 |
2d3c035f-3985-42cc-831f-8e6055865608 | 1119-2916/competitive-programming | atcoder/other/xmas/19/gg.cpp | #include<bits/stdc++.h>
#define MOD 1000000007
#define EPS 1e-10
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vecto... | ALGO | 0.99994 | 3.128404 |
4dd8885d-06e2-472d-970e-709c58c48720 | wasd96040501/conv3x3 | eigen-git-mirror/doc/examples/TutorialLinAlgRankRevealing.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 5,
2, 1, 4,
3, 0, 3;
cout << "Here is the matrix A:\n" << A << endl;
FullPivLU<Matrix3f> lu_decomp(A);
cout << "The rank of A is " << lu_decomp.rank() << endl;
c... | ALGO | 0.999869 | 3.720849 |
dd481f17-715c-47c4-8a56-9ee33e447d79 | obtusecoin/Plebcoin | src/hash.cpp | #include "hash.h"
inline uint32_t ROTL32 ( uint32_t x, int8_t r )
{
return (x << r) | (x >> (32 - r));
}
unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char>& vDataToHash)
{
// The following is MurmurHash3 (x86_32), see http://code.google.com/p/smhasher/source/browse/trunk/MurmurH... | ALGO | 0.987379 | 6.215198 |
b2cabdbd-562a-4136-9637-591f48d4e7ba | ishandutta2007/codeforces | lqs2015/normal/750/C.cpp | #include<iostream>
using namespace std;
int n,l,r,c,x,y;
int main()
{
l=-1e9;r=1e9;
cin>>n;
for (int i=1;i<=n;i++)
{
cin>>x>>y;
if (y==1) l=max(l,1900-c);
else r=min(r,1900-c);
c+=x;
}
if (l>=r) cout<<"Impossible"<<endl;
else if (r==1e9) cout<<"Infinity"<<endl;
else cout<<r+c-1<<endl;
return 0;
} | ALGO | 0.999731 | 3.345335 |
1c3c2ce5-1323-4d49-a4d9-0aeab640678b | prepare/xetex | source/libs/icu/icu-55.1/source/common/punycode.cpp | /* This ICU code derived from: */
/*
* ICU modifications:
* - ICU data types and coding conventions
* - ICU string buffer handling with implicit source lengths
* and destination preflighting
* - UTF-16 handling
*/
#include "unicode/utypes.h"
#if !UCONFIG_NO_IDNA
#include "unicode/ustring.h"
#include "unicod... | TOOL | 0.891316 | 3.965116 |
29dc7c89-0af3-466c-8134-c7c614a290ea | NiteshKG/coding_questions_practice | L_pattern.cpp | // L pattern
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cout<<"Enter value of n : \n";
cin>>n;
cout<<"\n\n";
for(int i=1;i<=n;i++){
// for(int s=1;s<=(n-i);s++)
for(int p=1;p<=n;p++){
if(p == 1 || i==n )
cout<<"*";
... | ALGO | 0.999743 | 3.808694 |
e767cc76-6f51-47bf-ab79-81c80dd0bb32 | khushidhir3/geeksforgeeks-problems | Mirror Tree.cpp | /*
class Node {
public:
int data;
Node *left;
Node *right;
Node(int x) {
data = x;
left = right = NULL;
}
};
*/
class Solution {
public:
// Function to convert a binary tree into its mirror tree.
void mirror(Node* node) {
// code here
if(node==nullptr){
... | ALGO | 0.999975 | 6.595164 |
1c103921-e3d9-4e66-9f6a-ddc4704b8ecb | Shahid-Fahad/Online-Judge-Solution | Codeforces+Others/M_-_Candies.cpp | ///Bismillahir Rahmanir Rahim
//ShzFahad
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define case_(tc) cout <... | ALGO | 0.999975 | 3.943773 |
9d47e471-b163-4522-96e1-25fd271df291 | RydKrm/Competitive_Program | Codeforces/977D Divide by three ,multiple by two.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
int n,i,p,fg=0;
vector<int>vec2,vec3,vec23,vec4;
cin>>n;
for(i=0;i<n;i++){
cin>>p;
if(p%2==0&&p%3==0){
vec23.push_back(p);
continue;
}
if(p%2==0){
vec2.push_back(p);
continue;
}
if(p%3==0){
vec... | ALGO | 0.999959 | 3.218812 |
64ecc493-8dd4-41d3-b77c-c796a2ae50ab | sarvex/leetcode-beef | lcof/面试题57 - II. 和为s的连续正数序列/Solution.cpp | class Solution {
public:
vector<vector<int>> findContinuousSequence(int target) {
vector<vector<int>> ans;
int l = 1, r = 2;
while (l < r) {
int s = (l + r) * (r - l + 1) / 2;
if (s == target) {
vector<int> t(r - l + 1);
iota(t.begin(),... | ALGO | 0.999968 | 5.91021 |
f9acf429-8fba-45b8-89f5-6fd347643663 | pranavjawale01/cp.exe | GFG/Medium/Top View of Binary Tree/top-view-of-binary-tree.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999673 | 7.032098 |
5f3d2054-46b1-486b-ad80-184294474206 | VuNA2k2/SPOJ_PTIT | PTIT134A.cpp | #include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
while(cin >> s)
{
vector<int> a(27);
for(int i=0;i<s.size();i++)
{
a[s[i]-'a']++;
}
int d=0;
for(int i=0;i<a.size();i++)
{
if(a[i]%2!=0)d++;
}
if(d<... | ALGO | 0.999987 | 4.025874 |
e43af69b-50a4-4f9f-be03-14b71e5fa2c4 | ranystephan/CMPS270_Asst2 | my_stack/my_stack.cpp | //
// Github: ranystephan
// my_stack.cpp
// ranystephan.rcs04.asst2
//
// Created by Rany STEPHAN
//
#include "my_stack.hpp"
#include <iostream>
#include <vector>
using namespace std;
#include "my_stack.hpp"
#include <iostream>
#include <vector>
using namespace std;
template <class T> class Stack ;
templat... | TEST | 0.965744 | 5.071328 |
fa3d223f-39e8-4ade-ab81-94dc34b45d87 | ksb451/Cpp_DSA | CONTEST/Archive/717_DIV2/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define MX 100000
vector<int> p[100005];
int a[100005],nex[100005],dp[20][100005];
int main()
{
int n,q;
scanf("%d%d",&n,&q);
for (int i=1;i<=n;i++)
scanf("%d",&a[i]);
for (int i=2;i<=MX;i++)
{
if (p[i].empty())
{
nex[i]=n... | ALGO | 0.99986 | 3.673979 |
1b0a7455-8214-43c7-84ae-be35b0a72ee3 | Ascend/op-plugin | op_plugin/ops/aclops/CdistKernelNpu.cpp | #include "op_plugin/AclOpsInterface.h"
#include "op_plugin/utils/OpAdapter.h"
namespace acl_op {
using npu_preparation = at_npu::native::OpPreparation;
at::Tensor _cdist_forward(const at::Tensor &x1, const at::Tensor &x2, const double p,
c10::optional<int64_t> compute_mode)
{
TORCH_CHECK... | ALGO | 0.990586 | 7.046708 |
ea6f329d-e940-4f32-9c4d-5b73a28d5b74 | Kanazawanaoaki/atcoder_memo | abc/abc116/abc116c2.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
/*hantei(int num,int *h){
... | ALGO | 0.99994 | 3.204693 |
3a6f8c8a-1647-4a2e-b5ee-b00790ee280f | Broduker/oj | pat/pat_a1043.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
const int MAXN = 1010;
struct Node
{
int key;
Node *left,*right;
};
bool cmp(int t1,int t2);
Node* buildTree(int st,int ed,int ft,int last,int flag);
void PostOrder(Node *ft);
int preorder[MAXN],inorder[MAXN],p... | ALGO | 0.999999 | 3.789998 |
beaceb13-df08-4bf2-b72e-33afd9e6661c | PulkitDagar/DSA | Queue/GasStationLeetcode134.cpp | class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int deficit = 0;
int balance = 0;
//index from where we are starting the movement
int start = 0;
//har ek index ko check kr raha hai ki vo answer hai ya nhi
for(int i=0; i<gas.siz... | ALGO | 0.999992 | 5.982771 |
208e7ab6-842c-4e0e-a6fa-5e240a38d274 | juubza/threading-server | Trabalho1Alg2Linux.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int maternidade(int lad, float roll);
int leitura();
void prctfinal(float roll, float x, int cont);
int leitura2();
int maternidade2(int dadis, int lad, float roll);
int present() {
cout << endl;
cout << "ROLAGEM DE DADOS ULTRA DELU... | TOOL | 0.937806 | 3.317457 |
9b723298-d72a-4d3d-b36c-e932e1d3e2f9 | JustAG7/Competitive_Programming | VKU/2024/CP Class VKU 2024/Week 2/cpair.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cout.tie(NULL);cin.tie(NULL);
#define ll long long
#define int long long
#define pb push_back
#define pf push_front
#define db double
#define X first
#define Y second
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegi... | ALGO | 0.999815 | 3.922804 |
af4f8e82-799b-4bc4-becc-22cf91344bdd | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9024_12.cpp | #include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
void qread(int &x) {
int neg = 1;
x = 0;
char c = getchar();
while (c < '0' || c > '9') {
if (c == '-') neg = -1;
c = getchar();
}
while (c >= '0' && c <= '9') x = 10 * x + c - '0', c = getchar();
x *= neg;
}
const int maxn = 40... | ALGO | 0.999927 | 3.953403 |
2bbb3e29-529b-4d7e-a428-b72f7580146a | DuoZhangRobotics/Bilevel-Differential-Grasp-Optimization | ThirdParty/Ipopt-3.12.11/Ipopt/examples/ScalableProblems/LuksanVlcek7.cpp | #include "LuksanVlcek7.hpp"
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#include "configall_system.h"
#endif
#ifdef HAVE_CMATH
# include <cmath>
#else
# ifdef HAVE_MATH_H
# include <math.h>
# else
# error "don't have header file for math"
# endif
#endif
#ifdef HAVE_CSTDIO
# include <cstdio>
#else
# ifdef HAVE_S... | ALGO | 0.997752 | 5.618197 |
4ead1777-d533-494d-b628-219e0099b6f1 | ThiagoFBastos/programacao-competitiva | spoj/MDST - Minimum Diameter Spanning Tree.cpp | #include "bits/stdc++.h"
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
using i32 = int;
using u32 = unsigned;
using i16 = short;
using u16 = unsigned short;
using ld = long double;
using ii = pair<int, int>;
const int N = 1e3 + 10;
vector<int> adj[N], t[N];
vector<tuple<int, int, int... | ALGO | 0.999354 | 4.900751 |
76257d5a-e923-484b-b46b-afec3d51aefd | soonho-tri/ibex-lib | plugins/continuation/examples/3RPR.cpp | #include "ibex.h"
#include "ibex_Cont.h"
#include <list>
#include <utility>
#include <cassert>
#include <fstream>
using namespace std;
using namespace ibex;
int main() {
Function f("x1","x2","x3","q1","q2","q3",
"(-1.*(q1)^2 + (0.8660254037844386 - 1.*x1 - 0.5*cos(0.5235987755982988 + x3))^2 + (-0.5 - 1.*x... | ALGO | 0.9999 | 4.689429 |
84841ccb-49fb-4520-ab9f-2bc8a3c3c9f5 | ishandutta2007/codeforces | origenes/normal/993/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define all(x) (x).begin(), (x).end()
#define reset(x, y) memset(x, ... | ALGO | 0.999982 | 3.703852 |
1bb4b794-b06e-4568-a0ee-b4809e2b820c | maruf2k21/Problem-Solve | A_Pashmak_and_Garden.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// less = set, greater = set, less_equal = multi... | ALGO | 0.999726 | 3.863119 |
99705714-2a6e-472a-bd58-3d0e19902cdc | Zhenghao-Liu/LeetCode_problem-and-solution | 0076(重要).最小覆盖子串/solution_sliding_window.cpp | class Solution {
public:
string minWindow(string s, string t)
{
int s_size=s.size(),t_size=t.size();
if (s_size==0 || t_size==0 || t_size>s_size)
return "";
unordered_map<char,int> t_number_of_letters;
for (char i:t)
++t_number_of_letters[i];
int left=0,right=-1;
unordered_map<char,int> window_number_of_lette... | ALGO | 0.999995 | 6.331309 |
69040348-a354-4e1a-b68e-7f0c4c79efb7 | mohaimenhasan/practiceAlgoQuestion | 454. 4Sum II/mohaimen.cpp | /// GOT MAJOR HELP DIDN'T DO IT MYSELF
// LAD
class Solution {
public:
int fourSumCount(vector<int>& A, vector<int>& B, vector<int>& C, vector<int>& D) {
int count = 0;
unordered_map<int, int> my_map;
for(int i = 0; i < A.size(); i++){
for(int j=0; j < B.size(); j++){
int sum... | ALGO | 0.996936 | 6.19494 |
06853526-4227-4efc-8a02-16e9079eb01e | snehalmparmar/CarND-Path-Planning-Project | src/Eigen-3.3/doc/examples/TutorialLinAlgSelfAdjointEigenSolver.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix2f A;
A << 1, 2, 2, 3;
cout << "Here is the matrix A:\n" << A << endl;
SelfAdjointEigenSolver<Matrix2f> eigensolver(A);
if (eigensolver.info() != Success) abort();
cout << "The eigenvalues of A ... | ALGO | 0.99907 | 3.846247 |
3af37ad6-f8ca-425a-8eaa-df19cebc8263 | shubham691438/coding-Problems | E_Romantic_Glasses.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 1000000
#define mod LLONG_MAX
#define endl "\n"
#define ff first
#define ss second
#define w(t) ll t; cin >> t; while(t--)
#define fastio ios_base... | ALGO | 0.999595 | 4.213765 |
825640ab-cdd0-485f-b467-838ac8b9bc25 | Nonbangkok/Competitive_Programming | POSN/Camp_2/Graph/Problems/PR_EX_STP2.cpp | #include <bits/stdc++.h>
#define coutf(n, m) cout << fixed << setprecision(n) << m
#define forr(i, a, n) for (int i = a; i < n; i++)
#define forl(i, a, n) for (int i = a; i > n; i--)
#define macos ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endll "\n"
#define sp " "
typedef long long ll;
using namespace std;... | ALGO | 0.999985 | 3.98907 |
829c845d-104d-41bb-99d4-f8dd09ce3797 | vovinov/MOS_1023 | temp.cpp | #include <iostream>
namespace std;
// Функция для нахождения определителя матрицы
int determinant(int matrix[2][2]) {
int det = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];
return det;
}
int main() {
int matrix[2][2] = {{1, 2}, {3, 4}};
int det = determinant(matrix);
cout << "Опреде... | ALGO | 0.999756 | 5.389197 |
49dcc411-0367-40e1-a01a-51e0c9177983 | luanaamorim04/competitive_programming | cses/subarray_sum_queries.cpp | #include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iomanip>
#include <map>
#include <cstring>
#include <set>
#include <bitset>
#define ll long long
#define INF (1e9)
#define MAX (int) (2e5 + 5)
#define MOD 1000000007
#define par pair<int, int>
#defin... | ALGO | 0.999931 | 4.60695 |
0a6533d9-ec48-4b40-af58-5a466e887387 | Younghusband/CppPractice | CodeTemplate.cpp | // //
// // Created by Younghusband on 2024/8/1.
// //
// #include <iostream>
// #include <vector>
// using namespace std;
//
// class Solution {
// public:
// vector<int> QuickSort(const vector<int> &numbers) {
// vector<int> result;
// result.push_back(numbers[0]);
// int leftMax = numbers... | ALGO | 0.999918 | 6.043182 |
d2123605-800f-412a-9300-e8e1375fea3b | hpatel424/Computer-Programing-1 | Lab3a-MathFunction.cpp |
//Harry Patel
#include <iostream>
using namespace std;
double f(double);
int main() {
cout << "This is the f(x) = 2x+3 application \n\n" << endl;
double x;
cout << "Enter an x-value for Function ";
cin >> x;
cout << " \n\nResult : f(" << x << ") = 2(" << x << ") + 3 = " << f(x) << endl;
system("pause");
ret... | TOOL | 0.946303 | 4.356007 |
e4be7e4c-8770-4d01-ae1c-05069f175c1a | codiren/hoi4-mod-play-as-eu4 | make wasteland.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ifstream idsa("byrealidv2.txt");//province; state; eu4 province
map<int,int> astate;
int tt,ttt,tttt;//prov/state/euprov
while(idsa>>tt){
idsa>>ttt;idsa>>tttt;
astate[tttt] = ttt;
}
string t;string ta;string full;
idsa.close();
ifstream idsam("wastel... | TOOL | 0.89778 | 3.405538 |
32556db7-1d83-4a67-bb9a-d0302046a5c6 | alibaba/MNN | source/backend/cpu/x86_x64/sse/GemmSSE.cpp | #include "FunctionSummary.hpp"
#include "GemmCommon.hpp"
#include "core/Macro.h"
#define MNNSSEFMA(x, y, z) _mm_add_ps(_mm_mul_ps(x, y), z)
#include "GemmFunction.hpp"
void _SSE_MNNPackedMatMul(float* C, const float* A, const float* B, const size_t* parameter,
const float* postParameters, con... | ALGO | 0.998066 | 6.053147 |
63639bb1-91c5-4495-8e5c-38f7663f6d16 | pkprajapati7402/Data-Structure-and-Algorithms | Love Babbar DSA Sheet Solutions/BackTracking/Print All Palindromic Partitions/PrintAllPalindromicPartitions.cpp | /*
Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.
A palindrome string is a string that reads the same backward as forward.
Example 1:
Input: s = "aab"
Output: [["a","a","b"],["aa","b"]]
Example 2:
Input: s = "a"
Output: [["a"... | ALGO | 0.99991 | 6.75192 |
a539f795-f62f-45da-85cd-5e9dc8743032 | ishandutta2007/codeforces | w0nsh/normal/1270/D.cpp | #include <bits/stdc++.h>
#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define TRAV(i, n) for(auto &i : n)
#define SZ(x) (int)(x).size()
#define PR std::pair
#define MP std::make_pair
#define X first
#define Y second
typedef long long ll;
typedef std::pair<int, int> ... | ALGO | 0.999831 | 3.222008 |
36dbfa9e-d228-42f6-be16-ccd5e4d435b1 | poulson/Clique | tests/Refactor.cpp | #include "clique.hpp"
using namespace cliq;
int
main( int argc, char* argv[] )
{
Initialize( argc, argv );
mpi::Comm comm = mpi::COMM_WORLD;
const int commRank = mpi::Rank( comm );
try
{
const int n1 = Input("--n1","first grid dimension",30);
const int n2 = Input("--n2","second gri... | ALGO | 0.999368 | 4.757607 |
e6cc073a-f3f8-44bb-aee7-886420191042 | Whalesea-Gustav/coding-backend | dependency/leetcode-debug/lc-1092.cpp | #include <GP/GP_macro.h>
#include "header.h"
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
string shortestCommonSupersequence(string str1, string str2) {
int n = str1.size(), m = str2.size();
vector<vector<string>> memo(n, vector<string>(m));
function<string(int... | ALGO | 0.999978 | 5.937658 |
2e83e9f2-b2b6-428b-9021-4bd450730655 | annusachan24/Codes | cf_JotyandChocolate.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll n,a,b,p,q, ans1,ans2;
cin>>n>>a>>b>>p>>q;
ll nr=n, nb=n;
ll arr[n];
memset(arr, 0, sizeof(arr));
ll rc=0, bc=0;
ll v=1;
while(nr>=a)
{
arr[v*a -1]=1;
rc++;
//nr=nr/a;
nr=nr-a;
v++;
//cout<<"nr ... | ALGO | 0.99972 | 3.332332 |
24feefe0-91e0-4bf8-bfe9-0a02a0f0e10d | HosamEissa/Competitive-programming- | UVA/10301.cpp | /*
Author: Hossam Eissa
Idea:connect two nodes if they are connected in disjoint set
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<iomanip>
#include<stdio.h>
#include <map>
#include<unordered_map>
#include<complex>
using namespace std;
typedef complex<double> point;
#define X real()
#defin... | ALGO | 0.999866 | 4.193954 |
2754acf1-4d4c-4230-9dd2-387058845a21 | ishandutta2007/codeforces | frame233/normal/1148/G.cpp | // Author -- Frame
#include<bits/stdc++.h>
#define lowbit(x) ((x)&(-(x)))
#define Finline __inline__ __attribute__ ((always_inline))
#define DEBUG fprintf(stderr,"Running on Line %d in Function %s\n",__LINE__,__FUNCTION__)
#define SZ(x) ((int)x.size())
#define mkpr std::make_pair
#define pb push_back
typedef long lo... | ALGO | 0.999982 | 3.380437 |
72a28800-61c2-4eec-b9f5-cc9d9de5e823 | MichaelJmad/3DPrinting-Stuff | JMADS Printer-CNC/Marlin Firmware/Marlin-2.1_SKR14_NoBlTouch/Marlin/src/gcode/motion/G5.cpp | #include "../../inc/MarlinConfig.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#if AXIS_COLLISION('I') || AXIS_COLLISION('J')
#error "G5 parameter 'I' or 'J' collision with axis name."
#endif
#include "../../module/motion.h"
#include "../../module/planner_bezier.h"
/**
* Parameters interpreted according to:
* https://li... | ALGO | 0.883325 | 7.579149 |
b7abc04a-492c-44cc-adae-93727b778495 | Hasanzakaria/SPOJ | EXPEDI.cpp | #include<bits/stdc++.h>
using namespace std;
int main ()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
long long int n,i,a,j,k,l,r,f,cou,flag;
cin>>n;
for(i=1;i<=n;i++)
{
flag=0;
cou=0;
r=0;
cin>>a;
pair<long long int,long long int>pq[a];
priority_queue<lo... | ALGO | 0.999827 | 3.430227 |
9147ce63-a557-440c-a7d8-4fba81597a02 | dllrazvi/Data-Structures-and-Algorithms | Labs/Lab Assignments Solved/Assignment-2/SDA-2/SDA-2/Matrix.cpp | #include "Matrix.h"
#include <exception>
Matrix::Matrix(int nrLines, int nrCols) {
lines = nrLines;
columns = nrCols;
head = nullptr;
}
Matrix::~Matrix() {
Node* current = head;
while (current != nullptr) {
Node* next = current->next;
delete current;
current = next;
}
}... | ALGO | 0.925494 | 4.29173 |
5488edaf-812f-4638-9ce1-d4605c22107e | lipeiyuuuuuu/PTA- | PTA code/7-2 验证“哥德巴赫猜想.cpp | /*ѧġ°ͺղ롱Ĵ˼ǣκһ2żܱʾΪ֮͡磺24=5+19
519ʵһ֤20ڵżԷֽ֮͡
ʽ
һиһ(2, 2 000 000 000]ΧڵżN
ʽ
һаոʽN = p + qNֽ⣬p qΪΪķֽⲻΨһ
24ԷֽΪ7+17ҪнpСĽ⡣*/
/*
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int judge_prime(long int n);
int main()
{
long int x,b,s,i;//b ϴǸ sСǸ
scanf("%ld", &x);
// long int i = 1;
... | ALGO | 0.999812 | 3.090832 |
336418eb-1cb7-436a-83af-d81a94694750 | voe09/CPPPlayGround | Round1/LintCode/Array/PartitionEqualSubsetSum.cpp | /*
Given a non-empty array containing only positive integers, find if the array
can be partitioned into two subsets such that the sum of elements in both
subsets is equal.
Notice
Each of the array element will not exceed 100.
The array size will not exceed 200.
Have you met this question in a real interview? Yes
Ex... | ALGO | 0.999918 | 5.867434 |
d7dfbd51-452a-4ac7-8691-e79a95e398c4 | DhruvDave12/DSA-Practice | Dynamic Programming/minCoinChange.cpp | #include <bits/stdc++.h>
using namespace std;
int minCoinsReq(vector<int> &coins, int sum){
vector<vector<int>> dp(coins.size()+1, vector<int>(sum+1));
for(int i=0; i<dp.size(); i++){
for(int j=0; j<dp[i].size(); j++){
if(i == 0){
dp[i][j] = INT_MAX-1;
}
... | ALGO | 0.999925 | 5.365713 |
06566b04-ff24-4e32-8e18-067af7c6c0a6 | Marine-XIV/acmp-task | 0092.cpp | #include <iostream>
using namespace std;
int main() {
int s;
cin >> s;
int p = s / 6;
int k = 2 * (p + p);
cout << p << " " << k << " " << p << endl;
return 0;
}
| ALGO | 0.995192 | 3.195611 |
4ce5420c-aad3-4458-922d-ee900e1c3660 | Bojzen-I-Mitten/thomas | ThomasCore/include/BulletCollision/CollisionShapes/btConvexHullShape.cpp | #if defined (_WIN32) || defined (__i386__)
#define BT_USE_SSE_IN_API
#endif
#include "btConvexHullShape.h"
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
#include "LinearMath/btQuaternion.h"
#include "LinearMath/btSerializer.h"
#include "btConvexPolyhedron.h"
#include "LinearMath/btConvexHullComputer.... | ALGO | 0.996024 | 7.503744 |
e4f99cb7-3a3e-460c-8f21-ac457a118583 | strange-suraj/LeetCode-Susbmission | Buy Stock 2 - GFG/buy-stock-2.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long maximumProfit(vector<long long>&p, int n) {
// Code here
long long res = 0;
for(int i=1;i<n;i++){
if(p[i] > p[i - 1]){
res += p[i] - p... | ALGO | 0.999575 | 6.354931 |
5c40a9f7-1506-4989-a245-8af1019f1162 | K1M-MinW00/Study | Gori/SWEA/상품권배분/user.cpp | // 문제 : https://swexpertacademy.com/main/code/codeBattle/problemDetail.do?contestProbId=AY0Kg1LKJpEDFASg&categoryId=AY06CVdK6wwDFASg&categoryType=BATTLE&battleMainPageIndex=1
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
int number = 0, idx = 0;
vector<int> parent(18001);
vector... | ALGO | 0.99982 | 4.495119 |
1404f333-523a-48ef-80b0-daa0e2b505f8 | andrey18083/C-Python | C++/algos3/Бор_и_Ахо-Корасик/25.cpp | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <unordered_map>
using namespace std;
const int MOD = 1000000007;
struct AhoCorasick {
struct Node {
int next[256];
int fail;
bool output;
Node() : fail(0), output(false) {
fill(begin(nex... | ALGO | 0.999985 | 5.543312 |
5f5cdc62-6bf8-460d-b5dc-2889388503ff | InFluX-M/Solving-Problem | Contests/ICPS BootCamp/Contest1/main1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vector_ll;
typedef vector<string> vector_string;
typedef vector<char> vector_char;
typedef vector<bool> vector_bool;
typedef vector<int> vector_int;
#define find_vec(vec, item, first_index, last_index) find(vec.begin() + first_... | ALGO | 0.999623 | 4.517329 |
6db0e571-570e-4647-8c5a-29a80ca1123b | ishitagupta1198/Data-Structures- | Stacks/balancing parenthesis stack.cpp | #include<iostream>
#include<stack>
#include<string.h>
using namespace std;
int checkpar(char str[])
{
int i;
stack <char> st;
for (i=0;i<strlen(str);i++)
{
if(str[i]=='('||str[i]=='['||str[i]=='{')
st.push(str[i]);
else
{
if(st.empty())
ret... | ALGO | 0.999211 | 4.267832 |
9c80d3be-ebe5-4d14-b8d4-f82ff3e8f72f | Vaibhav4228/my-dsa-codes | 63. CLASS CODE/PROBLEM01.CPP | // 1. Number of Provinces (Leetcode-547)
/*
PROBLEM STATEMENT:
There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b,
and city b is connected directly with city c, then city a is connected indirectly with city c.
A province is a group of directly or indirectl... | ALGO | 0.999963 | 6.633144 |
db2878e0-9da0-485f-be1e-ae06143933e2 | opengauss-mirror/openGauss-server | contrib/pgcrypto/pgp-mpi-openssl.cpp | #include "postgres.h"
#include "knl/knl_variable.h"
#include <openssl/bn.h>
#include "px.h"
#include "mbuf.h"
#include "pgp.h"
static BIGNUM* mpi_to_bn(PGP_MPI* n)
{
BIGNUM* bn = BN_bin2bn(n->data, n->bytes, NULL);
if (!bn)
return NULL;
if (BN_num_bits(bn) != n->bits) {
px_debug("mpi_to_... | ALGO | 0.988383 | 5.500684 |
d9772a24-3fee-4773-be18-5e35e6583014 | Guitar-Sound-Processing/GSP | gsp_daisy/Effects/Overdrive/overdrive.cpp | #include <math.h>
#include <stdio.h>
#include "overdrive.h"
// *****************************************************************************
void GSP_Overdrive::Init(uint32_t sampling_rate)
{
/*
Initiate the Overdrive Class.
sampling_rate
ADC sampling rate (Hz)
*/
float dt, cap, res, a0_us, a0_ub, vma... | TOOL | 0.989042 | 5.92765 |
d379ef69-b6f1-4b10-871c-998bc9163836 | chaitusvk/astra_sim_complete | extern/network_backend/garnet/gem5_astra/src/systemc/tests/systemc/misc/stars/star102574/star102574.cpp | /*****************************************************************************
star102574.cpp --
Original Author: Preeti Panda, Synopsys, Inc., 2000-08-09
*****************************************************************************/
/***************************************************************************... | TOOL | 0.93723 | 3.577937 |
3a4a4b32-bfc3-4cb5-8ca1-f3557aece915 | cold-su/cold-su | code/2024/10/23/682. 棒球比赛.cpp | class Solution {
public:
int calPoints(vector<string>& operations) {
std::stack<int> stack;
for (int i = 0; i < operations.size(); i++) {
auto s = operations[i];
if (s == "C" || s == "D" || s == "+") {
if (s == "C") {
stack.pop();
} else if (s == "D"... | ALGO | 0.999761 | 6.410076 |
608efa01-5bd8-46f7-9cbc-7cdff59612c7 | HGSChandeepa/MovieWave-TMDB-API-App-11 | 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.998799 | 6.776823 |
e154b6ec-6ebf-4fe2-9a64-852b7c0791d6 | Metrolina-Regional-Model-Team/MRM22v2.0 | pgm/ModeChoice/Transims60/Transims60/Relocate/Dir_Path.cpp | //*********************************************************
// Dir_Path.cpp - build a path between two links
//*********************************************************
#include "Relocate.hpp"
#include "Dir_Path_Data.hpp"
//---------------------------------------------------------
// Dir_Path
//---------------------... | ALGO | 0.999672 | 4.919002 |
6141852d-6623-4296-b3f9-080a836856fb | xxmen/ACMTraining | 2014-09-01/hdu3032(Nim).cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
using namespace std;
int n, SG[110];
bool v[1010];
void init_SG()//打表找SG函数规律
{
SG[0] = 0;
SG[1] = 1;
for (int i = 2; i <= 100; i++)
{
memset(v, false, sizeof(v));
for (int j =... | ALGO | 0.999989 | 3.997756 |
11ede84b-dbf2-4718-b06f-883a893509bd | SIGMOD23p561/free-join | duckdb/extension/icu/third_party/icu/common/ucharstrieiterator.cpp | #include "unicode/utypes.h"
#include "unicode/ucharstrie.h"
#include "unicode/unistr.h"
#include "uvectr32.h"
U_NAMESPACE_BEGIN
UCharsTrie::Iterator::Iterator(ConstChar16Ptr trieUChars, int32_t maxStringLength,
UErrorCode &errorCode)
: uchars_(trieUChars),
pos_(uchars_... | ALGO | 0.976657 | 7.693824 |
89150a4b-b9e3-4a05-b73d-ef8396b1673e | followDm/CodingInterviewChinese2 | 68_CommonParentInTree/CommonParentInTree.cpp | //==================================================================
// ָOfferԹپͱ⡷
// ߣκ
//==================================================================
// 68
// Ŀ㣬ǵȡ
#include <cstdio>
#include "../Utilities/Tree.cpp"
#include <list>
using namespace std;
bool GetNodePath(const TreeNode* pRoot, const TreeNode... | ALGO | 0.999601 | 4.727991 |
40c46e8c-1ba4-4041-a909-d0069b9e8895 | VerdanShandilya/leetcodeSol | 1839-decode-xored-array/decode-xored-array.cpp | class Solution {
public:
vector<int> decode(vector<int>& encoded, int first) {
vector<int> ans;
ans.push_back(first);
for(int i=0;i<encoded.size();i++){
ans.push_back(ans[i]^encoded[i]);
}
return ans;
}
}; | ALGO | 0.999985 | 4.943125 |
3d2c558b-a46b-4b64-b069-555b0548dbc1 | daniel-ankit/Leetcode | 2492-minimum-score-of-a-path-between-two-cities/2492-minimum-score-of-a-path-between-two-cities.cpp | class Solution {
public:
int minScore(int n, vector<vector<int>>& roads) {
vector<pair<int, int>>adj[n+1];
for(auto x:roads)
{
adj[x[0]].push_back({x[1], x[2]});
adj[x[1]].push_back({x[0], x[2]});
}
int ans = INT_MAX;
vector<int>vis(n+1, 0);
... | ALGO | 0.999665 | 5.536606 |
a846930f-790f-47af-a43c-af1e5d65ccfd | aeongiing/codetree-TILs | 240110/합성수 판별기/factorization-discriminator.cpp | #include <iostream>
using namespace std;
int main() {
int n;
bool tf=false;
cin >> n;
for(int i=2; i<n; i++){
if(n%i==0){
tf=true;
}
}
if(tf==true){
cout << "C";
}
else{
cout << "N";
}
return 0;
} | ALGO | 0.999989 | 3.870063 |
0712c41e-6106-49d6-a9ca-5c5b31176eb8 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/04/0427/personal_submission/cf573b_baile.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
typedef long long LL;
void solve()
{
int n;
cin>>n;
vector<int> dp1(n+10);
vector<int> dp2(n+10);
vector<int> a(n+10);
for(int i=1;i<=n;i++)
cin>>a[i];
dp1[1] = 1;
dp2[n] = 1;
for(int i=2;i<=n;i++)
d... | ALGO | 0.999912 | 4.201103 |
b90487ac-3e6b-4a18-934f-08d0f986d6f8 | joelibaceta/practica-2-ia | Problema07.cpp | #include <iostream>
using namespace std;
void ingresarDatos(int arr[], int& size) {
cout << "Ingrese la cantidad de empleados: ";
int n;
cin >> n;
int index = 0;
for (int i = 0; i < n; i++) {
cout << "Ingrese el código del empleado " << (i + 1) << ": ";
cin >> arr[index++];
... | ALGO | 0.999877 | 5.307277 |
7a15a203-be9c-4c35-a24b-5f0562d50dde | andrew2719/Algorithms | exm/cpp/hsort.cpp | // C++ program for implementation of Heap Sort
#include <iostream>
using namespace std;
// To heapify a subtree rooted with node i which is
// an index in arr[]. n is size of heap
void heapify(int arr[], int n, int i)
{
int largest = i; // Initialize largest as root Since we are using 0 based indexing
int l = 2 * i ... | ALGO | 0.999997 | 5.036318 |
bfac6293-1a65-4ae2-9f1d-6a8716c45e83 | ishandutta2007/codeforces | yaobig/normal/1327/G.cpp | #include "bits/stdc++.h"
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,a,n) for(int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define FI first
#define SE second
#define maxn 1010
#define mod 998244353
#define inf 0x3f3f3f3f
template<class T> bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} ... | ALGO | 0.999968 | 3.880547 |
3eeb232d-7b66-4bbc-ab69-52244f77649c | Nastasi-Santino/Level-4 | mouseAI.cpp | /**
* @brief Implementa los calculos del raton.
**@author Nastasi Santino
* @author Renzo Amorbello
* @author Gregorio Matias Andrade
*
* @copyright Copyright (c) 2023-2024
*/
#include "mouseAI.h"
#include "API.h"
/**
* @brief mueve el raton hacia adelante (adelante segun la orientacion del raton).
*
* @para... | ALGO | 0.99834 | 4.734985 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.