uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
25063bed-e648-4fea-ba1e-3065cc0f23ff | ishandutta2007/codeforces | vercingetorix/normal/1385/B.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef long do... | ALGO | 0.999872 | 4.031049 |
71d45b6a-4d9e-4483-a07b-c4b396e7391e | refatK/P3_Mass_Spring_Euler | dependencies/eigen-eigen-323c052e1731/bench/bench_gemm.cpp |
// g++-4.4 bench_gemm.cpp -I .. -O2 -DNDEBUG -lrt -fopenmp && OMP_NUM_THREADS=2 ./a.out
// icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp && OMP_NUM_THREADS=2 ./a.out
// Compilation options:
//
// -DSCALAR=std::complex<double>
// -DSCALARA=double or -DSCALARB=double
// -DHAVE_BLAS
// -DDECOUPLED
//
#include... | TOOL | 0.955186 | 5.829477 |
9b60eaa9-c1eb-4e40-a627-da6b78128444 | mohammedowez/Assignment_programmming | Question9/Question9.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
// input the test case
int t;
cin>>t;
while(t--)
{
// enter the number
long n;
cin>>n;
// enter the array
long a[n];
for(int i=0;i<n;i++)
cin>>a[i];
// sorting an array in the ascending order
sort(a,a+n);
... | ALGO | 0.99954 | 3.433329 |
7bed502f-fd68-439d-87af-e4caa78fb414 | zobaer-ahmed-zihad/Phitron | Introduction_to_C++_for_DSA/module-02-5(practice).cpp/practice_Question_01.cpp | // Online C++ compiler to run C++ program online
#include <bits/stdc++.h>
using namespace std;
int *get_array(int n){
int *arr = new int[n];
for(int i = 0; i<n; i++){
cin>>arr[i];
}
return arr;
}
int main() {
int n;
cin>>n;
int *array = get_array(n);
for(int i = 0; i<n; i++){
... | ALGO | 0.984841 | 3.595051 |
2b6c7add-079f-4828-97f3-fd2fe041a5f2 | AndiA76/SDCND05_Motion_Planning_and_Decision_Making | project/starter_files/eigen-3.3.7/bench/vdw_new.cpp | #include <iostream>
#include <Eigen/Core>
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec;
using namespace std;
SCALAR E_VDW(const Vec &interactions1, const Vec &inter... | ALGO | 0.999807 | 3.519938 |
8f52c50e-de00-490f-98c2-3bbe3fc2b855 | zhangshaolei1998/Heart-rate-prediction-based-on-SNN | CARLsim4-master/tools/ecj_pti/examples/SumExample.cpp | /*! \brief Using PTI to search for strings that maximize or minimize the sum
* of all parameter values.
*
*/
#include "PTI.h"
#include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;
using namespace CARLsim_PTI;
namespace CARLsim_PTI {
class SumExperiment : public Experiment {
public:
... | ALGO | 0.99903 | 6.142488 |
5e5c92f7-95f7-41dc-addf-d02177e566e6 | eskyhome/ipic3d_20180913 | BeamParsek3D.cpp | // MPI
#include <mpi.h>
#include "mpidata/MPIdata.h"
// Topology
#include "processtopology/VirtualTopology3D.h"
#include "processtopology/VCtopology3D.h"
// input
#include "inputoutput/CollectiveIO.h"
#include "inputoutput/Collective.h"
// grid
#include "grids/Grid.h"
#include "grids/Grid3DCU.h"
// fields
#include "fie... | ALGO | 0.998837 | 4.128514 |
aeb5f7ab-9144-4a7d-abfb-fab962a884b1 | RogelRC/Competitive-Programming | Leading and Trailing.cpp | #include <bits/stdc++.h>
using namespace std;
long long modExp(long long base, long long exp, long long mod) {
long long result = 1;
base %= mod;
while (exp > 0) {
if (exp % 2 == 1) {
result = (result * base) % mod;
}
base = (base * base) % mod;
exp /= 2;
}
... | ALGO | 0.99983 | 5.236059 |
46f4dd6c-d9d7-4ff4-b63e-f77296b2b9fb | sarvex/leetcode-ocaml | solution/0200-0299/0225.Implement Stack using Queues/Solution.cpp | class MyStack {
public:
MyStack() {
}
void push(int x) {
q2.push(x);
while (!q1.empty()) {
q2.push(q1.front());
q1.pop();
}
swap(q1, q2);
}
int pop() {
int x = q1.front();
q1.pop();
return x;
}
in... | ALGO | 0.999786 | 5.713366 |
61afb38c-c7a9-4400-bdb8-ba5d50e1e56c | toptaran/rzpacker | tools/EciesCryptoPP/cryptopp/iterhash.cpp | // iterhash.cpp - written and placed in the public domain by Wei Dai
#ifndef __GNUC__
#define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES
#endif
#include "iterhash.h"
#include "misc.h"
NAMESPACE_BEGIN(CryptoPP)
template <class T, class BASE> void IteratedHashBase<T, BASE>::Update(const byte *input, size_t len)
{
HashW... | ALGO | 0.998117 | 6.912704 |
f0a7ca8c-f5df-40e7-92bd-7b8588c65921 | ks0727/AtCoder-Archive | ABC/251-300/267/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
string s;
cin >> s;
map<string,int> mp;
mp["Monday"] = 5;
mp["Tuesday"] = 4;
mp["Wednesday"] = 3;
mp["Thursday"] = 2;
mp["Friday"] = 1;
cout << mp[s] << endl;
return 0;
} | ALGO | 0.999913 | 3.645311 |
5f6957d0-9329-4843-afe8-b139ff64d2b3 | marco-marinho/leetcode | 1721. Swapping Nodes in a Linked List/Solution.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* swapNodes(L... | ALGO | 0.999999 | 5.748415 |
2c7e8d8b-b640-4a9a-a379-eaaae54ea2d9 | obito456/c- | SWITCH CASE 3.cpp | #include <iostream>
using namespace std;
int main() {
int n1;
cout<<"Enter n1="<<endl;
cin>>n1;
int n2;
cout<<"Enter n2="<<endl;
cin>>n2;
char op;
cout<<"Enter op="<<endl;
cin>>op;
switch (op) {
case '+':
cout<<n1+n2<<endl;
break;
case '-':
... | ALGO | 0.947423 | 3.277945 |
cbc1f772-8011-46e9-a080-b293eb7bcc4c | Obsywon/Moteur3D | Parser.cpp | #include "Parser.h"
Parser::Parser(const std::string &path, TGAImage &texture):
m_texture{texture}
{
// Initialisation des structures:
std::vector<std::string> words;
// Lecture et enregistrement de chaque ligne du fichier dans le vector
std::ifstream file(path);
if (file.is_open())
{
... | TOOL | 0.86772 | 4.174323 |
d3782804-96dc-43d0-8e66-f6b1441a26bf | seancheer/BladeToOffer | SomeAlgorithms/print_1_to_n.cpp | #include "print_1_to_n.h"
/************************************************************************/
/* ӡ1nλɳɵֵ
/* ע⼴
/* 1 ֱ۵Ľⷨʹַģ+1
/* 2 ڶֽⷨ0ӡλʵϾ0-9϶ѣֻӡʱӡ
/* λ0
/************************************************************************/
void print_1_to_max(int max_length)
{
if (max_length < 0)
{
puts("Invalid ar... | ALGO | 0.905841 | 4.279404 |
4b681f54-ff92-457a-abd2-19fdfbe0b795 | Srijitaz/LeetCode-solutions | 0027-remove-element/0027-remove-element.cpp | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int f = 0;
for(int s = 0; s< nums.size();s++){
if(nums[s]==val){
continue;
}
nums[f] = nums[s];
f++;
}
return f;
}
}; | ALGO | 0.998975 | 6.006249 |
544ac5d0-93cc-4098-8680-acf6401138ed | Qzxell/GOICPC | Problems/abc393c.cpp | #include <bits/stdc++.h>
using namespace std;
using ii = pair<int,int>;
using vii = vector<ii> ;
using vi = vector<int> ;
#define ln '\n'
#define ll long long
#define pb push_back
#define fi first
#define se second
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v... | ALGO | 0.999028 | 4.510726 |
ab0f0a50-6a25-41d1-8477-7c8d09c842ea | sumit23802380/CP | Contests/LeetCode/Weekly352/a.cpp | #include<bits/stdc++.h>
using namespace std;
using namespace chrono;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//#define pbds tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
#define fastio() ios_base::sync_with_stdio(false... | ALGO | 0.999858 | 4.688776 |
72643473-c50a-4aae-bac6-f0b180088351 | thanhphuong163/Solving-problems | CodeForces/Metro/solution.cpp | // Author: Nguyen Thanh Phuong
// Email: <EMAIL>
// Problem: https://codeforces.com/problemset/problem/1055/A
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#define vi vector<int>
#define vvi vector<vi>
using namespace std;
// Read input
void read_array(string line, ve... | ALGO | 0.999969 | 4.310789 |
485fc72b-c55f-4de5-917f-91e82806dd86 | abhaypatidar3/Leetcode-submissions | 167-TwoSumII-InputArrayIsSorted/167-TwoSumII-InputArrayIsSorted.cpp | // Last updated: 7/24/2025, 5:16:40 PM
class Solution {
public:
vector<int> twoSum(vector<int>& num, int target) {
int i=0;
int j=num.size()-1;
vector<int>temp;
while(i<j){
if((num[i]+num[j])==target){
temp.push_back(i+1);
t... | ALGO | 0.999947 | 6.560259 |
69686d47-7b2e-4090-a04b-b79bf84e3593 | DAD609/OOP_C | Lab2/RBPO.LAB2.Variant5.Task4.f2.cpp | #include <iostream>
module RBPO.LAB2.Variant5.Task4:f2;
namespace RBPO {
namespace Lab2 {
namespace Task4 {
double f2(double x) {
if (x <= 9.0) {
return pow(x, 2) - 3 * x + 9;
}
else {
return (1 / (pow(x, 3) + 6));
}
}
}
}
} | ALGO | 0.999144 | 3.947173 |
3ac45690-f36f-4d57-91db-5592d51e82cd | dekoden/VKR | Vision System/main.cpp | #include <opencv2/opencv.hpp>
#include "main.h"
#include <fstream>
using namespace cv;
using namespace std;
bool patternIsFound = false;
double rms1, rms2, rms;
int CHECKERBOARD[2]{ 6,9 };
int samplesCount = 0;
vector<Point3f> objp;
vector<vector<Point3f> > objectPoints;
vector<vector<Point2f> > imagePoints1, imagePo... | ALGO | 0.882459 | 4.677064 |
cba7f22e-a3a7-4913-961a-259a8d79abe4 | Divyanshu9794/GFG_POTD | Medium/Sequence of Sequence/sequence-of-sequence.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:
int helper(int prev,int m,int n)
{
if(prev>m)
return 0;
if(n==0)
return 1;
int ans=0... | ALGO | 0.999966 | 6.161479 |
bd676f27-ec07-48da-a75e-0b18767ffad7 | wellexam/leetcode | 986.cpp | #include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
vector<vector<int>> intervalIntersection(vector<vector<int>> &firstList, vector<vector<int>> &secondList) {
if (secondList.empty() || firstL... | ALGO | 0.999975 | 5.285912 |
020d1dc2-435e-4d1e-ad7d-61682ee9ae83 | 97joseph/Robotic_Motion | Project4-Animation&CGI-ElasticBodySimulation/t4m1/include/eigen/unsupported/doc/examples/FFT.cpp | // To use the simple FFT implementation
// g++ -o demofft -I.. -Wall -O3 FFT.cpp
// To use the FFTW implementation
// g++ -o demofft -I.. -DUSE_FFTW -Wall -O3 FFT.cpp -lfftw3 -lfftw3f -lfftw3l
#ifdef USE_FFTW
#include <fftw3.h>
#endif
#include <vector>
#include <complex>
#include <algorithm>
#include <iterator>... | ALGO | 0.995674 | 6.121914 |
38c95466-2d31-4034-bfc1-8d1a7adc160d | WaderManasi/Knowing-DataStructures-Algorithms | Tricky_Problems/MedianOf2SortedArrays.cpp | // Given two sorted arrays of sizes N and M respectively.
// The task is to find the median of the two arrays when they get merged.
// Solution:
// arr : given array with size n
// brr : given array with size m
int findMedian(int arr[], int n, int brr[], int m){
vector<int>v;
for(int i=0;i<n;i++)
v.e... | ALGO | 0.999687 | 6.782281 |
82603cf3-fcae-42d1-a1a9-920b4f68aac5 | misskalyani/Basic-CPP-Programming | Pointers/Swap.cpp | #include<iostream>
using namespace std;
void swap(int *a,int *b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;
}
int main()
{
int a,b;
cout<<"Enter First Number :: ";
cin>>a;
cout<<"Enter Second Number :: ";
cin>>b;
swap(a,b);
cout<<"After Swapping :: \n ";
cout<<"\na = "<<a;
cout<<"\nb = "<<b;
}
| ALGO | 0.999072 | 3.55362 |
fafc6d26-0e49-4bfa-94bd-676dc4672fe5 | shadowcat0202/cpp | BaekJoon/BaekJoon/Q2108.cpp | #include "avatar.h"
#include <queue>
void Q2108::run() {
int avg, middle, many, minmax;
std::cin >> N;
std::cin >> mid;
histogram[mid+4000]++;
for (int i = 2; i <= N; i++) {
int num;
std::cin >> num;
histogram[num + 4000]++; //ֺ
sum += num; //
if (mid > num) {
left.push(num);
}
else {
right.... | ALGO | 0.99986 | 3.95552 |
70e62fa5-1972-4092-8409-5ff3153182e5 | Tudat/tudat | src/astro/relativity/relativisticLightTimeCorrection.cpp | #include "tudat/astro/basic_astro/physicalConstants.h"
#include "tudat/astro/relativity/relativisticLightTimeCorrection.h"
namespace tudat
{
namespace relativity
{
//! Function to calculate first order relativistic light time correction due to a gravitating point mass.
double calculateFirstOrderLightTimeCorrectionFr... | ALGO | 0.997111 | 6.945475 |
b32dc00e-a225-4f4a-bd7a-f173bebc993a | Derek-TH-Wang/hybrid_gait | hybrid_gait/quadruped_ctrl/src/MPC_Ctrl/SparseCMPC.cpp | #include "SparseCMPC.h"
#include "Utilities/orientation_tools.h"
#include <Utilities/Timer.h>
#include "JCQP/QpProblem.h"
// X0 != x[0]
// X0 uses u[0] and dt[0] to get to x[0]
// so same number of steps in u, dt, x
// 0 - roll
// 1 - pitch
// 2 - yaw
// 3 - x_pos
// 4 - y_pos
// 5 - z_pos
// 6 - roll_rate
// 7 - pit... | ALGO | 0.999184 | 4.549241 |
e312c894-a43b-4973-8af5-835da79f29c9 | bootleg-q/bionic | libc/malloc_debug/Config.cpp | #include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <sys/cdefs.h>
#include <string>
#include <vector>
#include <private/bionic_macros.h>
#include "Config.h"
#include "debug_log.h"
// Config constants
static constexpr uint... | CONFIG | 0.952395 | 7.300901 |
9139ce91-c610-4e79-b902-902d69a40130 | Nayak2904/CPP | Book.cpp | #include <iostream>
using namespace std;
class Book
{
public:
string topic;
string defination;
string exapmle;
Book(string name, string chpt, string eg)
{
topic = name;
defination = chpt;
exapmle = eg;
}
void display()
{
cout << "Topic = " << topic << end... | ALGO | 0.89552 | 3.695349 |
426a2f94-ccc1-445e-a4f6-6e390180a35f | afrozchakure/Competitive-Programming-Solutions | LeetCode/Top Interview Questions/Top_Interview_Questions_Easy/Array/RemoveDuplicatesFromSortedArray.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int n = nums.size(); // 3
int j = 0;
for(int i=0; i<n; i++){ // 0,1,2
if(i < n-1 && nums[i] == nums[i+1]) // If two values are same, then continue the loop, don't update
continue;
n... | ALGO | 0.999791 | 6.263796 |
ea5c69bf-6649-4239-a374-1ba2b22f4f62 | PolarisYxh/pbd | ConfigurationLoader.cpp | #include "ConfigurationLoader.h"
#include <iostream>
#include <vector>
#include <map>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
using namespace Utilities;
Configuration& Utilities::Configuration::operator=(const Configuration& other)
{
m_clothNum = other.m_clothNum;
m_clothPath = ... | CONFIG | 0.903015 | 4.283752 |
7d683aff-6a37-4c00-a60a-297d8af8623a | YamamotoAsuka71/YamamotoAsuka | 20231129/queue.cpp | #include "stdlib.h"
#include <iostream>
#include <string.h>
#include <vector>
using namespace std;
vector<char> queue;
void Enqueue(char data)
{
queue.insert(queue.begin(),data);
cout<<data<<" enqueue"<<endl;
for (size_t i = 0; i < queue.size(); ++i)
{
cout << queue[i] << " ";
}
cou... | ALGO | 0.998057 | 3.596233 |
3ce5e9f0-9f0f-4c18-a01c-07012deef31a | basiliscos/syncspirit | src/utils/dns.cpp | #include "dns.h"
#include <cctype>
#include <charconv>
#include <ares.h>
#include <boost/asio/ip/address.hpp>
namespace syncspirit::utils {
using size_t = typename std::string::size_type;
using tcp = boost::asio::ip::tcp;
using udp = boost::asio::ip::udp;
std::vector<endpoint_t> parse_dns_servers(std::string_view s... | TOOL | 0.993355 | 7.530788 |
b452c567-5247-4d27-989e-595f74716bb3 | KMSBisko/Cpp-pratice-learning | whoopposite.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,i,r;
cin >> n;
int *a = new int [n];
int *b = new int [n];
int *c = new int [n];
int *d = new int [n];
for(i=0;i<n;i++)
cin >> a[i] >> b[i] >> c[i];
for(i=0;i<n;i++)
{
r = max(a[i],b[i])-min(a[i],b[i]);... | ALGO | 0.999872 | 3.679589 |
a29bbec0-b20f-491e-bdbb-f42f7022ce01 | FelipeZeferino/c204 | ExercRevisao3.cpp | #include <iostream>
using namespace std;
struct Produto
{
string name;
int estoque;
int id;
};
void InStock(string item, Produto produtos[], int quant){
for (int i = 0; i < quant; i++)
{
if (item == produtos[i].name)
{
cout << item << " em estoque!" << endl;
... | TOOL | 0.993749 | 4.701201 |
f03fbfe9-88c3-4673-96d7-ad33799c335d | fanghao1024/poj | 3635.cpp | #include<cstdio>
#include<cstring>
#include<queue>
using namespace std;
const int max_n=1005;
const int max_e=20005;
struct Edge{
int to,w;
int nxt;
}edge[max_e];
int p[max_n];
int head[max_n];
int N,M,cnt,Q;
int C,S,E;
bool vis[max_n][105];
int dp[max_n][105];
void add_edge(int x,int y,int w){
edge[cnt].to=y;
ed... | ALGO | 0.999964 | 4.240864 |
f3505a24-463f-4fff-8113-91c6bef965f7 | Apress/learn-cocos2d-2 | Learn Cocos2d 2/Cocos2D_ARC_Template_Projects/cocos2d-2.x-Box2D-ARC-iOS/cocos2d-2.x-Box2D-ARC-iOS/libs/Box2D/Collision/b2DynamicTree.cpp | #include <Box2D/Collision/b2DynamicTree.h>
#include <cstring>
#include <cfloat>
using namespace std;
b2DynamicTree::b2DynamicTree()
{
m_root = b2_nullNode;
m_nodeCapacity = 16;
m_nodeCount = 0;
m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode));
memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeN... | ALGO | 0.996633 | 7.714032 |
74bea416-c85d-4acb-8445-264ebd03ce1a | electronicarts/CnC_Generals_Zero_Hour | GeneralsMD/Code/Libraries/Source/WWVegas/WWMath/vp.cpp | /***********************************************************************************************
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
***********************************************************************************************
* ... | ALGO | 0.979125 | 4.625375 |
c0b83c89-fba7-4f9d-8f8b-6be3da528c99 | TebinJoseph/Wheelshare | 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 |
3f143747-71ae-4b5b-a79a-291737c995a7 | rishabhmishra51/Leetcode | 3372-longest-strictly-increasing-or-strictly-decreasing-subarray/3372-longest-strictly-increasing-or-strictly-decreasing-subarray.cpp | class Solution {
public:
int longestMonotonicSubarray(vector<int>& nums) {
int n=nums.size();
int si=1,sd=1,ans=1;
for(int i=1;i<n;i++){
if(nums[i]>nums[i-1]){
si++;
sd=1;
}
else if(nums[i]<nums[i-1]){
sd++;
... | ALGO | 0.999905 | 5.868505 |
5d97a609-55a2-402e-af68-428ddbd2d163 | XxroxiplxX/Algorithms-and-Optimization-Repository | Graph-Algorithms/Introduction/src/GraphReader.cpp | //
// Created by piotrkali on 3/5/23.
//
#include "GraphReader.h"
#include "iostream"
void GraphReader::initialCheck() {
std::string tmp;
getline(input, tmp);
type = types::UNDIRECTED;
for (auto item : tmp) {
if (item == 'D') {
type = types::DIRECTED;
}
}
if (type ==... | ALGO | 0.991951 | 4.686203 |
6e670ff2-0d74-4c7d-841a-51f51bb074d9 | KentNathnael/dataStructure | LatihanUTP/CaseLinkedListExc.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#define gc getchar();
struct tnode{
char name[100];
char member[100];
int prio;
tnode* next;
}*h;
int getPrio(char* member){
if(strcmp(member, "VVIP")==0){
return 1;
}
else if(strcmp(member, "VIP")==0){
... | ALGO | 0.996594 | 3.741657 |
595409f5-8667-4239-8aa4-d71cc2f921fa | Synoep/DSA- | 1621-number-of-subsequences-that-satisfy-the-given-sum-condition/1621-number-of-subsequences-that-satisfy-the-given-sum-condition.cpp | class Solution {
public:
const int mod=1e9+7;
vector<int> Power(int n) {
vector<int> power(n+1,1);
for (int i=1;i<=n;i++) {
power[i]=(power[i-1]*2LL)%mod;
}
return power;
}
int numSubseq(vector<int>& nums, int target) {
// long long mod=1e9+7;
s... | ALGO | 0.999998 | 5.918705 |
d1bea984-abd5-44f1-a351-24c6f6481e35 | RJ-Mitra/Programming101_CPP | removeMinIntervals.cpp | //Remove minimum intervals to make other intervals non-intersecting
//Given a list of start times and end times, find the minimum count of intervals
//that can be removed so that no intervals are intersecting each other
//Approach: We use two pointers on left and right intervals and move them
// according to... | ALGO | 0.999941 | 5.753341 |
66c7321c-d322-4f82-b82e-8c016c68bf99 | coolyuyuyu/leetcode | algorithm_0000-0999/962-Maximum Width Ramp/main.cpp | class Solution {
public:
// Time: O(n)
int maxWidthRamp(vector<int>& nums) {
// monotonic stack
// farthest greater or equal element
int n = nums.size();
stack<int> stk;
for (int i = 0; i < n; ++i) {
if (stk.empty() || nums[stk.top()] > nums[i]) {
... | ALGO | 0.999972 | 6.251901 |
d555a9bc-6e74-4b84-a090-4badd35b2215 | ShaoPeng-max/Competition | 3P/3-7.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#define maxn 90
char s[maxn];
char f[4] = {'C', 'H', 'O', 'N'};
double m[4] = {12.01, 1.008, 16.00, 14.01};
double solve(char* s)
{
double ret = 0;
int num[4] = {0, 0, 0, 0};
int i = 0;
int n = strlen(s);
while (i < n)
... | ALGO | 0.990628 | 3.199119 |
031ade83-3e02-471c-bd48-8c6d4934307c | coreqode/geometry_processing | deps/libigl/tutorial/713_ShapeUp/main.cpp | #include <igl/avg_edge_length.h>
#include <igl/barycenter.h>
#include <igl/jet.h>
#include <igl/shapeup.h>
#include <igl/quad_planarity.h>
#include <igl/readDMAT.h>
#include <igl/readOFF.h>
#include <igl/slice.h>
#include <igl/opengl/glfw/Viewer.h>
#include <igl/PI.h>
#include <vector>
#include <cstdlib>
#include "tut... | ALGO | 0.987154 | 5.770387 |
81219f23-a321-4439-8a2a-08a63e380333 | pkprajapati7402/LeetCode-Solutions | 476-Number-complement.cpp | // 476. Number Complement
// Easy
// Topics
// Companies
// The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation.
// For example, The integer 5 is "101" in binary and its complement is "010" which is the integer 2.
// Given an integer ... | ALGO | 0.999914 | 6.350839 |
be51bbbd-1ee7-4598-a3c8-6a5fc511027a | lijiaxin-dut/leetcode | leetcode_train/Solution_144.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include"TreeNode.h"
using namespace std;
//Given a binary tree, return the preorder traversal of its nodes' values.
//
//Example:
//
//Input: [1, null, 2, 3]
// 1
// \
// 2
// /
// 3
//
// Output: [1, 2, 3]
//
//ϵĽǿҽڵջ
//һֱ
//
class Solution_14... | ALGO | 0.999994 | 5.479916 |
4e123f86-e95c-4329-a616-d2f0f11e56da | tanzim721/Codeforces | Codeforces-A. Dubstep.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int f=1;
string s;
string c = "";
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='W' && s[i+1]=='U' && s[i+2]=='B'){
i+=2;
if(!f){
cout<<" ";
}
continu... | ALGO | 0.999895 | 3.330542 |
6db0a539-e2ea-4a7a-a58d-e0ae69855c6b | gustavomdz/beecrowd-solutions | 1143 - Quadrado e ao Cubo.cpp | #include <iostream>
using namespace std;
int main()
{
int N,P=1;
cin>>N;
for(int i=0;i<N;i++)
{
cout<<P<<" ";
cout<<P*P<<" ";
cout<<P*P*P<<"\n";
P++;
}
return 0;
}
| ALGO | 0.999739 | 3.157638 |
9f34e274-1f50-430e-bda7-fd00f52d9ff8 | wincle626/HLS_Legup | legup-4.0/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp | #include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetM... | ALGO | 0.873888 | 7.931576 |
3fdb729f-8bcf-4a7d-93a4-7baa3bb40f4a | Bostrix/FSL-fnirt | newimage/miscmaths/armawrap/tests/newmat/sort.cpp | //$$ sort.cpp Sorting
#define WANT_MATH
#include "include.h"
#include "newmatap.h"
#ifdef use_namespace
namespace NEWMAT {
#endif
#ifdef DO_REPORT
#define REPORT { static ExeCounter ExeCount(__LINE__,13); ++ExeCount; }
#else
#define REPORT {}
#endif
/******************************** Qui... | ALGO | 0.999989 | 5.949456 |
3f516b20-3e8b-48ad-bb79-f830bdb1532b | MinusDelta21/AnalisisAlgoritmos | BinarySearchTree/BinarySearchTree/BinarySearchTree.cpp | // BinarySearchTree.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
#include <vector>
#include <ctime>
struct Node {
//Value this node contains.
int key;
//Amount of times this value repeats.
int count;
//Child Nodes
Node * left... | ALGO | 0.999852 | 5.585891 |
625d1102-499c-4f5b-94d4-8a0b1c165291 | hirakuuuu/kyopro | virtual_contest/NUCODER/20231012/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
constexpr ll MOD = 1000000007;
constexpr int IINF = 1001001001;
constexpr ll INF = 1LL<<60;
template<c... | ALGO | 0.999972 | 3.855369 |
ebe9a6d3-1a3e-4bda-a43b-5bd688e2366e | arthurjeng/Deep-Blue-and-Gold | libraries/Source/BBPosNode.cpp | #include "Definitions.h"
#include "Constants.h"
#include "Utilities.h"
#if (IsDevHost)
#include <cassert>
#include <iosfwd>
#endif
#if (IsDevHost)
#include "Board.h"
#include "Move.h"
#include "TinyMove.h"
#include "Hash.h"
#include "BBMoveNode.h"
#include "BBPosNode.h"
BBPosNode::BBPosNode(const Hash& hashvalue)
{... | ALGO | 0.990851 | 5.420109 |
6056898a-f4ee-4fc6-8b95-cd765929c0ee | nhatminh2947/UVa-Online-Judge | 10908 - Largest Square/10908 - Largest Square.cpp | //******************************************************************
// Author: Huynh Nhat Minh
// Problem Name: 10908 - Largest Square
// Verdict: Accepted
//******************************************************************
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <cstrin... | ALGO | 0.999202 | 3.127838 |
9207c040-4cb4-4c3b-b392-e342b9c584e1 | shkim0622/cpp_lang | link_cpp/myapp.cpp | #include <iostream>
#include <list>
#include <stdlib.h>
#include <time.h>
using namespace std;
#include "common.h"
#include "myapp.h"
list<int> ml;
/**
* 리스트를 초기화하고, 랜도마이즈
* @param none
* @returns none
*/
void do_init() {
srand(time(NULL));
//pml = new MyList();
}
/**
* mylist에 append를 수행한다.
* @param... | TOOL | 0.957963 | 3.688156 |
c0b41aca-3b05-4931-bb87-e412479d0bf3 | tripathidivyansh/leetcode_question | 1489-pizza-with-3n-slices/pizza-with-3n-slices.cpp | class Solution {
public:
int solve(int index, int endIndex, vector<int>&slices, int n, vector<vector<int>>&dp){
if(n==0 || index >endIndex){
return 0;
}
if(dp[index][n] != -1){
return dp[index][n];
}
int take = slices[index] + solve(index+2, endIndex,... | ALGO | 0.999869 | 6.062317 |
8713a6f7-344f-44e3-8cad-caa6d2ed8687 | SonuLohani-1/LeetcodeProblems | LeetCode150/198.cpp | #include<bits/stdc++.h>
using namespace std;
// This is the solution of the problem 198 on leetcode - House Robber
// https://leetcode.com/problems/house-robber/
// The solution is to use dynamic programming
// This is the most optimized solution
// time complexity - O(n)
// space complexity - O(1)
class Solution {
p... | ALGO | 0.999802 | 5.747508 |
cd1d8032-236d-401c-84dd-db3369d6e473 | Vishalyadav0804/CP_Algorithm | Leetcode solutions/Custom sort string.cpp | class Solution {
public:
string customSortString(string S, string T) {
string s1, s2;
int a[26]={0};
for(char c: S) a[c-'a']++;
for(char c: T){
if(a[c-'a']==0) s2+=c;
else a[c-'a']++;
}
for(char c: S){
while(a[c-'a']>1){
... | ALGO | 0.999989 | 5.93406 |
170b3629-37d4-4232-a30e-e6a49b63f53d | DISTRHO/JUCE | modules/juce_box2d/box2d/Collision/b2CollidePolygon.cpp | #include "b2Collision.h"
#include "Shapes/b2PolygonShape.h"
// Find the separation between poly1 and poly2 for a give edge normal on poly1.
static float32 b2EdgeSeparation(const b2PolygonShape* poly1, const b2Transform& xf1, int32 edge1,
const b2PolygonShape* poly2, const b2Transform& xf2)
{
const b2Vec2* ve... | ALGO | 0.999796 | 7.008723 |
fcb410ed-9383-42fb-ae7b-605e8a60285d | AbdulrahmanJ204/cp | B_Re_Indexing.cpp | #include <bits/stdc++.h>
using namespace std;
#define test int t;cin>>t;while(t--)
#define ll long long
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define endl '\n'
#define cendl cout<<endl
#define cyes cout<<"YES"
#define cno cout<<"NO"
#define cin(v) for(ll i=0;i<v.size();i++)cin>>v[i];
#de... | ALGO | 0.999932 | 4.252969 |
186adf07-b028-4d9d-a977-537044171c9a | PrinceInScripts/Leetcode-Question | 6. August 2024/Problem 51 {Balanced Binary Tree}/Question.cpp | /*
# 110. Balanced Binary Tree
*/
/*
Given a binary tree, determine if it is
height-balanced
.
Example 1:
Input: root = [3,9,20,null,null,15,7]
Output: true
Example 2:
Input: root = [1,2,2,3,3,null,null,4,4]
Output: false
Example 3:
Input: root = []
Output: true
Constraints:
The number of nodes in the tree is in... | ALGO | 0.999641 | 6.575638 |
37173f18-9a5d-4dbe-880e-758cbac56662 | Bahubuli/DSA | Minimum X (xor) A - GFG/minimum-x-xor-a.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:
int minVal(int a, int b) {
bitset<32> sa(a);
bitset<32> sb(b);
int ac = sa.count();
... | ALGO | 0.999844 | 5.818017 |
32db8c0e-1cf7-4e75-95c3-09bc4c1972f8 | CodeLikeMagic/Code-Buzz | 0338-counting-bits/0338-counting-bits.cpp | class Solution {
public:
unsigned int countSetBits(unsigned int n)
{
unsigned int count = 0;
while (n) {
count += n & 1;
n >>= 1;
}
return count;
}
vector<int> countBits(int n) {
vector<int> answer;
for(int i... | ALGO | 0.999985 | 5.893176 |
e0178d36-4ad7-4664-be89-0748d07e1fbd | yun0529/Algorithm_study | lecture/ch8/ch8/1285.cpp | //#include <bits/stdc++.h>
//using namespace std;
//
//int n, t_cnt = 0, h_cnt = 0, sum = 0;
//char arr[24][24];
//int b[44], ret = 987654321;
//
//void go(int here) {
// if (here == n) { //
// sum = 0;
// for (int i = 1; i < (1 << (n)); i *= 2) {
// t_cnt = 0;
// for (int j = 1; j <= n; j++) {
// if (b[j] &... | ALGO | 0.999911 | 4.925051 |
70aab2ea-20b5-434a-8ba7-aa012b48978a | srshoruv/NextCodeForcesProblems | a+b.cpp | #include "bits/stdc++.h"
//#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define fr(i,a,b) for(int i = a; i < b; i++)
#define in(v,n) vi v(n); fr(i,0,n) cin>>v[i];
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef vec... | ALGO | 0.99942 | 5.041197 |
a807e20c-010f-402c-992d-19576a88e87f | bdqnghi/bi-tbcnn | code/knapsack/cpp/988.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
int knapsack(vector<int> &weight, vector<int> &value, int max_capacity)
{
int n = weight.size();
vector<vector<int>> dp(n+1, vector<int>(max_capacity+1, 0));
for(int i=1;i<=n;i++)
{
f... | ALGO | 0.999837 | 5.425849 |
aa1a8b9c-f5ee-49ab-a1e5-7c78ff71a3ad | Karandeep98/Algo-Pitampura-December-2019 | 30(Hollow Diamond Pattern)/main.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++){
int x=n;
for(int j=0;j<n;j++) {
if(i>0&&i<n-1&&j>0&&j<n-1&&j==n/2){
cout<<"\t";
}
else cout<<"*\t";
}
cout<<endl;
}
return 0;... | ALGO | 0.999901 | 3.244331 |
71d0c699-1081-4fe5-ac3b-f294003ac3c9 | iamprathamesh/algorithms | String/anagram.cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
****************************************... | ALGO | 0.999587 | 5.54943 |
b11cd87a-44a8-4bb4-982e-9dc11ff4456e | Damian1410/PL.SPOJ.COM | Latwe/1016.predkosc srednia/main.cpp | #include <iostream>
using namespace std;
int v1, v2, ile;
int main()
{
cin>>ile;
for(int i=1; i<=ile; i++)
{
cin>>v1>>v2;
cout<< 2*v1*v2/(v1+v2)<<endl;
}
return 0;
}
| ALGO | 0.998099 | 3.469641 |
5b6783d8-3d27-497d-8442-3461a78dcc6b | shubhamgyd/mission_TCS | Math/4_Primes.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAXN=1e5;
int main()
{
int is_prime[MAXN];
for(int i=0;i<MAXN;i++)
{
is_prime[i]=1;
}
is_prime[0]=is_prime[1]=0;
for(int i=2;i<MAXN;i++)
{
if(is_prime[i])
{
for(int j=i*i;j<MAXN;j+=i)
{
... | ALGO | 0.999059 | 4.496597 |
a730a54c-4971-4fef-8271-6d07975f216d | gokixus/C-Learning | 5_diziler_arrays/rastgele_dizi_elemanlari_kucukten_buyuge.cpp | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define MAX_SIZE 50
int main() {
int dizi[MAX_SIZE], siralanmis[MAX_SIZE], n, i, j;
int yedek, degismeyen = 0;
printf("Dizi boyutu giriniz: ");
scanf("%d", &n);
if(n > SIZE_MAX) {
printf("\nDizi boyutu 50'den fazla olmamalidir.");
return 0;
}
sra... | ALGO | 0.999539 | 3.554899 |
6e97028e-a573-4597-b066-321f1e248ff0 | justincsd/csd.code.github.io | Competition and SJ/NOIP_2020_T1.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>
#include <vector>
#define u128 __int128
using namespace std;
inline void print(u128 x)
{
if (x > 9)
print(x / 10);
putchar('0' + x % 10);
}
u128 gcd(u128 a, u128 b)
{
if (!b)
return a;
return gcd(b, a % b);
}
... | ALGO | 0.99996 | 3.384908 |
eb0e935b-d9bb-40d9-b0e3-1df0678f8dec | iliyian/oj.noi.cn | old/190118_noi1058.cpp | #include <iostream>
using namespace std;
int main(){
char ch;
string word(100, '1'), x;
do{
cin.get(ch);
if(ch != ' '){
x = x + ch;
}else{
if(x.length() < word.length()){
word = x;
}
x = "";
}
}while(ch != '... | ALGO | 0.963703 | 3.329439 |
e4378ba5-4769-4a00-b255-487dabd9d5e0 | mohammedjasam/Technical-Interview-Guide | HackerRank/delete-a-node-from-a-linked-list.cpp | /*
*
* Tag: Linked List
* Time: O(n)
* Space: O(1)
*/
/*
Delete Node at a given position in a linked list
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
Node* Delete(Node *head, int position)
{
// Complete this method
if(head == NULL)
return head;
Node dump;
... | ALGO | 0.999981 | 4.517912 |
ca339676-997f-400e-b9be-c4c7566eeb08 | Wu0409/NOIP_solution | 打家劫舍(Leetcode 198)/main.cpp | //QUESTION:打家劫舍
#include <iostream>
#include <vector>
using namespace std;
int rob(vector<int>& nums) {
if (nums.empty()) {
return 0;
}
// 子问题:
// f(k) = 偷 [0..k) 房间中的最大金额
// f(0) = 0
// f(1) = nums[0]
// f(k) = max{ rob(k-1), nums[k-1] + rob(k-2) }
int N = nums.size();
v... | ALGO | 0.999503 | 4.501032 |
10007d2a-46b1-499e-bb82-650e58398ef7 | dineshgroach/Algo | Modular Arithmetic/modulo.cpp | // Negative number modulo is given by :
long long MOD = 1e9+7;
cout << (n % MOD + MOD) % MOD << endl;
// To get nearest multiple after a number
// Assume y=10,k=6 then y1 will be 12 (nearest multiple of 6 after 10)
y1 = (y - (y % k)) + k;
// Modulus for multiplicaton of 2/3 integers
(a * b) % MOD = ((a % MOD) * (b % ... | ALGO | 0.999616 | 3.874285 |
d6af88a6-4016-4054-811c-92ca9e289c25 | diegothomas/SegmentedFusion | libs/InfiniTAM/include/ITMLib/Trackers/CPU/ITMColorTracker_CPU.cpp | #include "ITMColorTracker_CPU.h"
#include "../Shared/ITMColorTracker_Shared.h"
using namespace ITMLib;
ITMColorTracker_CPU::ITMColorTracker_CPU(Vector2i imgSize, TrackerIterationType *trackingRegime, int noHierarchyLevels, const ITMLowLevelEngine *lowLevelEngine)
: ITMColorTracker(imgSize, trackingRegime, noHierarch... | ALGO | 0.933588 | 5.40779 |
3abea1e1-0359-4b16-9e60-efdfd025b274 | P79N6A/Codes-1 | 2015.9~2016.3/0122O.cpp | #include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#define lowbit(x) (x & (-x))
#define root 1, n, 1
#define lson l, m, rt << 1
#define rson m + 1, r, ... | ALGO | 0.998832 | 4.118771 |
b8721a26-29a5-4de8-9264-c83a64e55979 | daniel-be/convex-hull | assignment_1/convex_hull.cpp | #include <vector>
#include <iostream>
#include "convex_hull.hpp"
#include "geometric_objects.hpp"
ConvexHull::ConvexHull(std::vector<Point>& points) : points(points), valid(false)
{
if (points.size() < 3)
{
std::cout << "The point vector must have at least 3 elements." << std::endl;
valid = false;
return;
}
... | ALGO | 0.997062 | 5.749904 |
b64010e3-2557-4498-b591-ec29ebb5cc42 | eranrund/mutebox | mios32-svn/tools/blm_scalar_emulation/juce/JuceLibraryCode/modules/juce_audio_basics/effects/juce_IIRFilter.cpp | #if JUCE_INTEL
#define JUCE_SNAP_TO_ZERO(n) if (! (n < -1.0e-8 || n > 1.0e-8)) n = 0;
#else
#define JUCE_SNAP_TO_ZERO(n)
#endif
//==============================================================================
IIRFilter::IIRFilter()
: active (false), v1 (0), v2 (0)
{
}
IIRFilter::IIRFilter (const IIRFilter& o... | ALGO | 0.928118 | 5.896201 |
d4e65e34-4309-4c22-ab60-cf1a98d7a781 | khadija1114/Online-Judge-Solutions | CSES/1672.cpp | #include<bits/stdc++.h>
#define pb push_back
using namespace std;
const int N = 505;
long long dis[N][N], inf = 1e18;
int main()
{
int n, m, q, i, j, k, a, b;
long long c;
cin >> n >> m >> q;
for (i = 0; i <= n; i++){
for (j = 0; j <= n; j++){
if (i == j) continue;
dis... | ALGO | 0.999978 | 4.141521 |
150ebbe8-5d38-46e3-83a0-1c7cc3301ded | 1Alisha/HACKTOBERFEST-22 | C++/LinkedList/DoublyLL.cpp | #include <iostream>
using namespace std;
// node creation
struct Node {
int data;
struct Node* next;
struct Node* prev;
};
// insert node at the front
void insertFront(struct Node** head, int data) {
// allocate memory for newNode
struct Node* newNode = new Node;
// assign data to newNode
newNode->data... | ALGO | 0.999383 | 5.815271 |
8be4b924-f585-42e0-9267-aeff97079e62 | joeporada-njit/IT266-Midterm | mpgame/ai/Monster_HarvesterDispersal.cpp | /*
================
rvMonsterHarvesterDispersal.cpp
AI for the Harvester on dispersal
================
*/
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
class rvMonsterHarvesterDispersal : public idAI {
public:
CLASS_PROTOTYPE( rvMonsterHarvesterDispersal );
rvMonsterHarvesterDi... | ALGO | 0.862679 | 4.140913 |
5bc30a43-f4dc-4ad7-a1a4-2c958b4c73a7 | NamanOli/Leetcode | 0997-find-the-town-judge/0997-find-the-town-judge.cpp | class Solution {
public:
int findJudge(int n, vector<vector<int>>& trust)
{
vector<int>inDegree(n + 1, 0);
vector<int>outDegree(n + 1, 0);
for (vector<int>&currTrust : trust)
{
int trustedPerson = currTrust[1];
int trustingPerson = currTrust[0];
... | ALGO | 0.999909 | 5.349435 |
68f1dd24-36f1-4475-a44d-6d0fd17397ad | manjeetsharma0796/algorithm-2 | ford_fulkerson.cpp | #include <climits>
#include <iostream>
using namespace std;
bool bfs(int** residual, int s, int t, int* parent, int N) {
bool* visited = (bool*)malloc(N * sizeof(bool));
for (int i = 0; i < N; ++i)
visited[i] = false;
int* queue = (int*)malloc(N * sizeof(int));
int front = 0, rear = 0;
queue... | ALGO | 0.999954 | 6.170773 |
6698ad3f-ecb4-4359-a078-adcd052d8212 | jcyinnovations/Extended-Kalman-Filter | src/tools.cpp | #include <iostream>
#include "tools.h"
#include <math.h>
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
using namespace std;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {... | ALGO | 0.997848 | 5.878798 |
8a1cd264-18f1-479a-87ed-2de0217ffc0b | Shubham05178/LeetcodeProblems | hard/Wildcard Matching.cpp | /**
* Leetcode Problem - https://leetcode.com/problems/wildcard-matching/
* Author - Shubham Nagaria
* Date - 24th Dec 2021
**/
class Solution {
public:
bool solve(string &s, string &p, int i,int j,vector<vector<int>>& dp){
if(j<0 && i<0)
return true;
if(j<0)
return false;
... | ALGO | 0.99999 | 5.887973 |
2ad3b085-299c-4627-89fd-82aad419aeab | anphsw/wive-ng-rtnl | tools/mksquash_lzma-3.2/lzma443/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp | // Compress/RangeCoder/RangeCoderBit.cpp
#include "StdAfx.h"
#include "RangeCoderBit.h"
namespace NCompress {
namespace NRangeCoder {
UInt32 CPriceTables::ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
static CPriceTables g_PriceTables;
CPriceTables::CPriceTables() { Init(); }
void CPriceTables::Init()
{
c... | ALGO | 0.981533 | 5.476203 |
030d83ca-ee10-44fa-9a47-a9296f36187d | ishandutta2007/codeforces | keshi/normal/1184/E1.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 100;
const int INF = 1e9;
#define ll int
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
ll n, m, u, v, c, ans;
bool visit... | ALGO | 0.999911 | 4.208919 |
23f26a61-c7e0-47b2-97cb-ca548e043443 | Jay7221/competitve-programming | codeforces/normal_rounds/Round818/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve(){
ll n;
cin >> n;
ll ans = n;
ans += 2 * (n / 2);
ans += 2 * (n / 3);
cout << ans << '\n';
}
int main(){
int t;
cin >> t;
while(t--){
solve();
}
} | ALGO | 0.999874 | 3.933498 |
1ec5d81a-8fca-461b-b8f3-f4e572ed9936 | LiruMouse/CoolVL | indra/llcommon/lldependencies.cpp | /**
* @file lldependencies.cpp
* @author Nat Goodspeed
* @date 2008-09-17
* @brief Implementation for lldependencies.
*
* $LicenseInfo:firstyear=2008&license=viewergpl$
*
* Copyright (c) 2010, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is p... | ALGO | 0.999237 | 7.900618 |
d607a02a-1449-4711-85dc-2d0c34aefeb0 | sungzh/leetcode | LeetCode/13. Roman to Integer.cpp | /*
* Given a roman numeral, convert it to an integer.
*
* Input is guaranteed to be within the range from 1 to 3999.
*
*/
/*
* Source: https://leetcode.com/problems/roman-to-integer
* Description: right + left -
* Author: guozheng
* Data: 20171119
*/
class Solution {
public:
int romanToInt(string s) {
... | ALGO | 0.99947 | 6.152073 |
e7d43cdc-085e-49d4-880b-cf90a8852fca | VANSHIKA1803/DSA | Lecture026 Pointer with Array & Functions/PointerArray.cpp | #include <iostream>
using namespace std;
int main()
{
/*
int arr[10] = {23, 122, 41, 67};
cout << "Address of First Element is: " << arr << endl; // Here we will get the address of first index
cout << arr[0] << endl; // Here we will get the value of the first in... | ALGO | 0.947183 | 3.360139 |
ddf3f332-e38d-445e-92d0-272a7965ece3 | delwar03/CF | F_Two_Subarrays.cpp | #include <bits/stdc++.h>
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T> using o_set ... | ALGO | 0.999655 | 5.24989 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.