uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
383e38cf-2faf-4541-9f38-23f2e6ad637a | HorsePowerCoin/HorsePowerCoin | 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.987844 | 6.222775 |
c4afe2d2-c292-4ab6-a20c-3e98aa4c1a1a | ybieri/algolab | 2017/week5/light_at_the_museum/light_at_the_museam.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<pair<bool, bool> > switches;
int num_off;
int num_switches;
//for room 0
//i:switch, j:brightness
bool f(int i, int j, vector<vector<int> >& state){ //i:which switch, j=current sum of lights on
if(j == 0) return true; //subset achieved
if(i =... | ALGO | 0.998736 | 4.118693 |
ff13960e-5a7c-41e9-973a-d8060a7706f1 | shelltdf/osgall | prebuild/cgal-master/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/algebraic_segments.cpp | //! \file examples/Arrangement_on_surface_2/algebraic_segments.cpp
// Constructing an arrangement of algebraic segments.
#include <iostream>
#include <cassert>
#include <CGAL/config.h>
#if (!CGAL_USE_CORE) && (!CGAL_USE_LEDA) && (!(CGAL_USE_GMP && CGAL_USE_MPFI))
int main ()
{
std::cout << "Sorry, this example need... | ALGO | 0.998643 | 5.672489 |
b4ff719b-e43c-4079-b54f-86801dba3751 | HenriqueTavaresR/simulado2erthal | quest2A.cpp | /*Ler o resultado (número de gols de cada time) de N (definido em uma constante) partidas
de futebol jogadas por um mesmo time contra diversos adversários, informando em seguida o
número total de pontos ganhos e o total de gols pró (gols feitos - gols dos adversários).*/
#include <iostream>
using namespace std;
#def... | ALGO | 0.99984 | 3.599689 |
288e77b7-974a-4036-83d2-70b5acbdd4c7 | WJ-self/algorithm | .history/acwing/basic/图论/849_Dijkstra求最短路_20230902231310.cpp | #include<bits/stdc++.h>
using namespace std;
int n,m;
const int N = 510, M = 1e5+10;
int w[N][N]; //权重
int d[N][N]; //从节点1->ij的距离
int main() {
cin >> n >> m;
int a,b,c;
for (int i=0; i<m; i++){
cin >> a >> b >> c;
w[a][b] = c;
}
int
}
| ALGO | 0.999932 | 4.027006 |
a1da2ff1-d994-4684-bed6-40f47c86c56f | mpfeifer1/Kattis | antiarithmetic.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(int n) {
vector<int> v(n);
vector<int> pos(n);
for(int i = 0; i < n; i++) {
cin >> v[i];
pos[v[i]] = i;
}
for(int s = 0; s < n; s++) {
for(int d = -n; d <= n; d++) {
if(s+d+d >= 0 && s+d+d < n) {
... | ALGO | 0.99987 | 4.336369 |
10b6acb5-119b-47a8-8b98-ca1411d386fa | availrum/newb | sequenceandquery16.cpp | #include<iostream>
#include<vector>
using namespace std;
class minidx_segment_tree{
private:
vector<int> tree; //인덱스
vector<int> data; //값
int n;
void buildtree(int node, int start, int end){
if(start==end){
tree[node]=start;
}
else... | ALGO | 0.999992 | 4.889627 |
9c634eea-4e20-4cd1-9b79-71ba157422d7 | xin-lover/leetcode-explore | main714.cpp | //leetcode 714. 买卖股票的最佳时机含手续费
#include <vector>
#include <cstdio>
using namespace std;
int maxProfit(vector<int>& prices, int fee) {
//思路:使用动态规划,那buy[i]就表示第i天持有股票的最大收益,sell[i]表示第i天不持有股票最大收益
// vector<int> buy(prices.size(),0);
// vector<int> sell(prices.size(),0);
// buy[0] = -prices[0];
// int... | ALGO | 0.999863 | 4.812962 |
f94e8293-d5d7-4c12-b385-91a53a24ea63 | taemt94/Udacity_Self-Driving_Car_Engineer_Project | 5_Control_and_Trajectory_Tracking_for_Autonomous_Vehicles/project/pid_controller/eigen-3.3.7/unsupported/doc/examples/MatrixSquareRoot.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(2,2);
A << cos(pi/3), -sin(pi/3),
sin(pi/3), cos(pi/3);
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix square root of A is:... | ALGO | 0.999543 | 3.930508 |
93c21b07-089e-4c0a-ad1f-b80a5ef13fa7 | KhaiJP/AtCoder | ABC/<300/255/C++/C.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef int64_t ll;
#define rep(i, s, t) for(int i = (s); i < (t); ++i)
int main(){
ll X, A, D, N; cin >> X >> A >> D >> N;
if(D == 0){cout << abs(X-A) << endl; return 0;}
if(D < 0) A = A+(N-1)*D, D = -D;
if(A+(N-1)*D < X){cout << ... | ALGO | 0.999925 | 3.667567 |
a9f646ea-3ae0-40a5-b1c6-c95cc790ef29 | kollmorgen/kollmogren_repository | slave/测试/test1/test1.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main (int argc, char *argv[])
{
if (argc < 2)
{
fprintf(stdout,"Usage: %s number\n",argv[0]);
return 1;
}
double inputValue = atof(argv[1]);
double outputValue = sqrt(inputValue);
fprintf(stdout,"The square root of %g is %g\n",
... | TOOL | 0.989959 | 3.216444 |
3baba961-be14-41d6-81e8-4530fe4d09af | mbslet/Exercicio-programavel-1 | src/matrix.cpp | #include "matrix.hpp"
#include<iostream>
using namespace std;
Matrix::Matrix(){
for(int l = 0; l<40; l++){
for(int k = 0; k<70; k++){
grid[l][k] = false;
}
}
}
Matrix::~Matrix(){
}
void Matrix::printGrid(){
cout << "\e[2J\e[H";
for (int i = 0; i < 40; i++) {
for (int j = 0; j < ... | ALGO | 0.995797 | 3.731311 |
27ea57e6-5c02-41ce-84a4-6b1a746e63cf | dipesh-m/Data-Structures-and-Algorithms | GFG Submissions/Linked List/reverse a linked list in groups of given size.cpp | #include<bits/stdc++.h>
using namespace std;
/* Link list node */
struct node *reverse (struct node *head, int k);
struct node
{
int data;
struct node* next;
node(int x){
data = x;
next = NULL;
}
};
/* UTILITY FUNCTIONS */
/* Function to push a node */
/* Function to print linked l... | ALGO | 0.999853 | 5.532327 |
37c1dcf0-443b-47b8-8c93-9ceeb0045f47 | dgcnz/competitive-programming | atcoder/abc131_c-anti-division.cpp | #ifdef DBG_MACRO_NO_WARNING
#include <dbg.h>
#else
#define dbg(...) ((void)0)
#endif
#include <bits/stdc++.h>
#define all(c) begin(c), end(c)
#define isz(c) (int)(c).size()
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
ll ceil(ll a, ll b) { return (a + b - 1) / b; }
in... | ALGO | 0.999853 | 4.39271 |
49e1f23e-6634-4b1d-97d8-e242ef4760c5 | ishandutta2007/codeforces | mateocv/normal/1155/E.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ThxDem=b;i<ThxDem;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.ti... | ALGO | 0.999673 | 3.455529 |
361ae141-9047-46e0-b65f-587cf7f2d09e | jatin69/coding-practice | leetcode/algorithms/dynamic-programming/longest-increasing-subsequence/Q674-longest-continuous-increasing-subsequence.cpp | /*
* Author : Jatin Rohilla
* Date : June-July-2019
*
* Compiler : g++ 5.1.0
* flags : -std=c++14
*/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int findLengthOfLCIS(vector<int>& nums) {
if(nums.size()==0) return 0;
if(nums.size()==1) return 1;
int max... | ALGO | 0.999861 | 5.917463 |
57949030-7459-487b-a251-f8d296752b1b | IbraimAblyametov/Programming-New | Practice/25/C++/main.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include "bozosort.hpp"
typedef std::vector<int> vector_t;
typedef std::vector<std::vector<int>> matrix_t;
//using namespace BozoSort;
void print_vector(
vector_t vector,
const char* start = "",
const char* delim = " ",
const char* end = "\n");
... | ALGO | 0.99925 | 3.942382 |
0edf3083-578b-4010-a141-95420878c70d | pacs-course/pacs-Labs | Labs/2025/07-eigen/src-solution-2/main.cpp | #include "Jacobian.hpp"
#include "JacobianFactory.hpp"
#include "Newton.hpp"
#include "NewtonTraits.hpp"
#include <iomanip>
#include <iostream>
int
main(int argc, char **argv)
{
// Scalar problem.
{
constexpr auto ProbType = ProblemType::Scalar;
using VariableType = NewtonTraits<ProbType>::VariableType;
... | ALGO | 0.998948 | 6.83709 |
a374eb9b-2577-4f9d-946a-0d6aafa71ee6 | ashishnagpal2498/CPP_Concepts_and_Codes | Practice_June_July_2019/3) Arrays/arrays_basics.cpp | //Arrays and Functions -
//Binary Search
#include<iostream>
using namespace std;
int binary_search(int arr[],int s,int e,int key)
{
int mid;
int ans =-1;
while(s<=e)
{ int mid = (s+e)/2;
if(arr[mid]==key) { ans = mid ;s = mid +1;}
else if(arr[mid]>key) e=mid-1;
else s = mi... | ALGO | 0.999923 | 5.32454 |
9062a827-5217-4d98-9fe6-884bb7ba7989 | ishandutta2007/codeforces | chaeyihwan/normal/1537/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(false); cin.tie(NULL);
int t;
cin >> t;
while(t--){
int n; cin >> n;
int sum = 0;
for(int i=1;i<=n;i++)
{
int a; cin >> a;
sum += a;
}
... | ALGO | 0.999759 | 3.539698 |
cac10b94-9b89-472c-83d3-71d9a291c0b9 | nbyaya/LegionCore-7.3.5 | dep/recastnavigation/Detour/Source/DetourNavMesh.cpp | #include <float.h>
#include <string.h>
#include <stdio.h>
#include "DetourNavMesh.h"
#include "DetourNode.h"
#include "DetourCommon.h"
#include "DetourMath.h"
#include "DetourAlloc.h"
#include "DetourAssert.h"
#include <new>
inline bool overlapSlabs(const float* amin, const float* amax,
const float* bmin, const... | ALGO | 0.935817 | 7.516425 |
ff52692e-d32f-4522-9f6d-c2f71de4e498 | rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning | packages/intrepid/example/Drivers/example_01.cpp | /** \file example_01.cpp
\brief Example building mass and stiffness matrices and right hand side
for a div-curl system on a hexahedral mesh using curl-conforming
(edge) elements.
\verbatim
curl u = g in Omega
div u = h in Omega
... | ALGO | 0.949793 | 5.23477 |
871f471f-e0a6-4e7f-8cf4-6c5c4123ba1f | thegamer1907/Code_Analysis | Graphs/1305.cpp | #include <bits/stdc++.h>
#define ull unsigned long long
#define PB push_back
#define MOD 1000000007
using namespace std;
bool solve(int t, int size, int * & a) {
a[size-1] = 1;
for (int i = 1; i <= size; i += a[i]) {
if (i == t) return true;
else if (i > t) {
return false;
}
}
return false;
}
int main()... | ALGO | 0.999977 | 4.113868 |
c7294797-ee1b-4e54-915b-cc2640d3dc01 | DuncanDai/LineSegmentsDetection | Classical_Image_Process/IP_5MCMLSD/Toolkit/edges-master/toolbox-master/channels/private/imPadMex.cpp | #include "wrappers.hpp"
#include "string.h"
typedef unsigned char uchar;
// pad A by [pt,pb,pl,pr] and store result in B
template<class T> void imPad( T *A, T *B, int h, int w, int d, int pt, int pb,
int pl, int pr, int flag, T val )
{
int h1=h+pt, hb=h1+pb, w1=w+pl, wb=w1+pr, x, y, z, mPad;
int ct=0, cb=0, cl=0... | TOOL | 0.966573 | 4.43011 |
20e89c49-4430-472b-b7b6-20c015f0d932 | tony11306/haker-rank-solution | Algorithms/dynamic programming/The Coin Change Problem.cpp | // problem source: https://www.hackerrank.com/challenges/coin-change/problem
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'getWays' function below.
*
* The function is expected to return a LONG_IN... | ALGO | 0.999996 | 5.216296 |
3431e565-ef16-4be0-9a74-be901b5ad394 | gyohng/NewJucePluginTemplate | JUCE/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp | namespace juce
{
DirectoryContentsList::DirectoryContentsList (const FileFilter* f, TimeSliceThread& t)
: fileFilter (f), thread (t)
{
}
DirectoryContentsList::~DirectoryContentsList()
{
stopSearching();
}
void DirectoryContentsList::setIgnoresHiddenFiles (const bool shouldIgnoreHiddenFiles)
{
setTypeFla... | TOOL | 0.914211 | 6.950219 |
21a3d5be-d8ff-43d1-894b-4cef8dbf70d3 | shashwata2003/DSA | 3.DSA450/DSA Striver/Array/IMPFindTheProductArrayExceptItself.cpp | #include<iostream>
#include <bits/stdc++.h>
#include <array>
using namespace std;
/*
Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].
The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.
You mu... | ALGO | 0.99997 | 6.10479 |
f96532bf-84c3-4bfc-8ca9-c060456b25f5 | Rakesh-0786/DSA-Practice | DSA-Practice/Operators/condtionals/mcq.cpp | // what is the output of the following snippet?
#include<bits/stdc++.h>
using namespace std;
int main(){
int x=60,y=90;
if (y%x==0)
{
cout<<"good"<<endl;
}else{
cout<<"bad";
}
return 0;
}
// output= bad | ALGO | 0.979921 | 3.248383 |
b42f3e91-04c8-42b4-8b5a-74de9b94074f | arunnsit/allcodes | files/bc.cpp | #include<stdio.h>
#include<algorithm>
int main()
{int t,n,i,j,r;long long c,p;
scanf("%d",&t);
while(t){scanf("%d",&n);c=0;
for(j=1;j<=n;j++){p=1;if(j>n/2){r=n-j;}else{r=j;}
for(i=1;i<=r;i++){p=((p)*((n-j+i)/(i)));}
c=(c%1000000007+p%1000000007)%1000000007;
}
printf("%lld\n",c);t--;
}}
| ALGO | 0.999907 | 3.993603 |
762f13bb-a1a0-457d-877c-e0755805256a | x1rh/ACAutomaton | leetcode/0517(超级洗衣机)/0517(超级洗衣机).cpp | class Solution {
public:
int findMinMoves(vector<int>& machines) {
int sm = accumulate(machines.begin(), machines.end(), 0);
if(sm % machines.size() != 0) return -1;
int avg = sm / machines.size();
int ans = 0, ta = 0;
for(auto &x : machines){
x -= avg;
... | ALGO | 0.99989 | 5.756157 |
2dcb6b34-c30f-420e-a17a-077613bc720f | derekkkzhang/WAAM_Modelling | include/igl/eigs.cpp | #include "cotmatrix.h"
#include "sort.h"
#include "slice.h"
#include "massmatrix.h"
#include <iostream>
template <
typename Atype,
typename Btype,
typename DerivedU,
typename DerivedS>
IGL_INLINE bool igl::eigs(
const Eigen::SparseMatrix<Atype> & A,
const Eigen::SparseMatrix<Btype> & iB,
const size_t k,
... | ALGO | 0.99975 | 5.521547 |
2dccd4b2-b90c-4dc9-9464-2db7f31ec3af | kunyavskiy/competitive-programming-archive | opencup/17-18/180317/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < (int)(n); i++)
const int N = 203;
int f[N][N][2];
int main() {
ios_base::sync_with_stdio(0);
int n, m;
cin >> n >> m;
vector<vector<bool>> c(n, vector<bool>(n));
vector<int> p(n), size(n), edges(n);
forn(i, n)
p[i] = i, e... | ALGO | 0.999957 | 3.94422 |
96f96eaf-52c8-4a57-9622-0d69654e78ad | ddv2311/help | Lecture004 Solving Pattern Questions (Part-2)/all_triangle_patterns.cpp | #include <iostream>
using namespace std;
void pattern1();
void pattern2();
void pattern3();
void pattern4();
int main()
{
int no_of_pattern;
cout << endl;
cout << "Select which pattern you want to print from below list:\n";
cout << endl;
cout << "1. Inverted & Reverse Same Number Triangle Pattern... | ALGO | 0.991676 | 3.69205 |
7d2feaa6-4a40-4b18-af17-2db79ca9ec74 | singhalshubh/Conveyors-Design-Reinvented | test/get_selector_shmem.cpp | /*! \file ig_selector_shmem.upc
* \brief A Selector implementation of indexgather.
*/
#include <shmem.h>
extern "C" {
#include <spmat.h>
}
#include "selector_shmem.h"
#define THREADS shmem_n_pes()
#define MYTHREAD shmem_my_pe()
/*!
* \brief This routine implements the conveyor variant of indexgather.
* \param *t... | TOOL | 0.930207 | 3.516799 |
62239fc3-3018-40f8-bbff-12ddf3d4c129 | poseidonKey/riverpod_sample | 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 |
bd5855c1-27f4-4115-b981-5d113a190f52 | mahfux090/My-Competitive-Programming-Journey | Personal/Regular Solving/A_Word_Capitalization.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if(islower(s[0])) s[0] = toupper(s[0]);
cout << s << endl;
return 0;
}
| ALGO | 0.978993 | 4.526831 |
04d2b367-e267-4afb-b6c7-4899a717e4af | Bisikha26/CPP_LEC | Class_Content/chapter4_object_class/Others/pointer_member_access.cpp | // Pointers are used to store and manage the addresses of dynamically allocated blocks of memory.
// pointer refers to a variable that holds the address of another variable
// To access pointer to a member of a class, we use operator (->)
// Pointer initialization before using pointer is must
#include<iostream>
using ... | ALGO | 0.967821 | 5.396095 |
d921f01c-c8ac-4b9a-87fd-be1aefffce1b | dimmarvel/newbellcoin | src/txorphanage.cpp | #include <txorphanage.h>
#include <consensus/validation.h>
#include <logging.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <cassert>
/** Expiration time for orphan transactions in seconds */
static constexpr int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60;
/** Minimum time between orphan transac... | TOOL | 0.884308 | 7.251966 |
b60d0c5b-2cb5-47b0-b93e-338a8d5e6a40 | fujicoin/fujicoin-0.21.1 | src/policy/fees.cpp | #include <policy/fees.h>
#include <clientversion.h>
#include <streams.h>
#include <txmempool.h>
#include <util/system.h>
static constexpr double INF_FEERATE = 1e99;
std::string StringForFeeEstimateHorizon(FeeEstimateHorizon horizon) {
static const std::map<FeeEstimateHorizon, std::string> horizon_strings = {
... | ALGO | 0.989633 | 6.973273 |
736356ba-aeb7-4eef-859c-907324ee5ad2 | simran1802/Data-Structures-and-Algorithms-using-C- | dupicate_ele_hashing.cpp | #include <iostream>
using namespace std;
int min(int A[],int n)
{
int m=A[0];
for(int i=0;i<n;i++)
{
if(A[i]<m)
m=A[i];
}
return m;
}
int max(int A[],int n)
{
int m=A[0];
for(int i=0;i<n;i++)
{
... | ALGO | 0.999843 | 4.512061 |
9f1ced7a-fb52-4175-a3fd-d4f142d93772 | heiseish/Competitive-Programming | kattis/buzzwords/buzzwords.cpp | /**
In this world,where ever there is light - there are also shadows. As long as the concept of winners exists, there must also be losers. The selfish desire of wanting to maintain peace causes wars, and hatred is born to protect love.
*/
#include <bits/stdc++.h>
#define forn(i, l, r) for(int i=l;i<=r;i++)
#de... | ALGO | 0.99996 | 3.97238 |
a93c8102-9a2f-45fa-a156-815edc3a9fb2 | thuyle2000/T1.2309.M1 | 1.LBEP/pretest4b.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
void Q1();
void Q2();
int main()
{
system("cls");
int option = 0;
// menu chay lien tuc, cho den khi user chon chuc nang ket thuc
while (1 == 1)
{
printf("\n");
printf("**************************************************\n"... | TOOL | 0.942502 | 3.041582 |
40e61ad7-409d-445b-a006-4cc06358a14f | liuq901/code | LOJ/l_1267.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
struct tree
{
int l,r,sum;
};
tree a[530000];
void build(int x,int l,int r)
{
a[x].l=l,a[x].r=r,a[x].sum=0;
if (l==r)
return;
int ls=x<<1,rs=ls+1,mid=a[x].l+a[x].r>>1;
build(ls,l,mid);
build(rs,mid+1,r);
}
void... | ALGO | 0.99988 | 4.064425 |
ede88882-e627-4a90-a5c5-7ee1cc3ad9ca | koba-e964/contest | poj/2566-short.cpp | #include <algorithm>
#include <cstdio>
#define R(n)for(int i=0;i<(int)(n);i++)
typedef long long l;
typedef std::pair<l,int>P;
l a[100010],t,w,j;
P p[100010];
l m(l x){return x>0?x:-x;}
int n,k,c,b,s;
int main(){
for(;scanf("%d%d",&n,&k)&&n+k;){
R(n)scanf("%lld",a+i);
p[n]=P(w,0);
R(n)w+=a[i],p[i]=P(w,i+1... | ALGO | 0.999941 | 3.052806 |
589737a4-b684-4f25-8cbe-db7627669d7d | Rahulkumar8967/CSSubject | c++coding/basicCode/practice1.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
if (n%2==0 && n%3=0){
cout<<"divisible by both"<<endl;
}else if(n%2==0){
cout<<"divisible by two"<<endl;
}else{
cout<<"divisible by none"<<endl;
}
return 0;
} | ALGO | 0.999815 | 3.959749 |
fbc8522c-8a8c-4fd3-9341-08d79f8f6503 | ishandutta2007/codeforces | dorost/normal/903/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int main(){
int n, x;
cin >> n;
for (int i = 0; i < n; i++){
cin >> x;
bool f = false;
for (int j = 0; j <= x; j += 7){
if ((x - j) % 3 == 0){
f = true;
}
}
cout << (f ? "YES\n" : "NO\n");
}
} | ALGO | 0.999897 | 4.099294 |
89fd4ba7-f37a-4b14-8ec5-c36955377bff | MaharshiErata/cs230-project | champsim/programs/bfs.cpp | /**
* bfs.cpp -- Simple program that does a breadth-first search over a binary-tree
*
* NOTE: Increase the N_NODES value for more computations.
* Higher values are preferred as you'll get to see the results in VTune more precisely.
* This will depend on what processor your system has, so tweak accord... | ALGO | 0.999962 | 6.33212 |
c57f180d-3326-4211-8482-832bc16331a6 | BansiddhaBirajdar/C- | program3.cpp | // 3. Write a C++ program to check two given integers, and return true if one of them is 30 or if their sum is 30.
// Sample Input:
// 30, 0
// 25, 5
// 20, 30
// 20, 25
// Sample Output:
// 1
// 1
// 1
// 0
#include<bits/stdc++.h>
using namespace std;
bool check(int ino1,int ino2){
return (ino1==30)||(ino2==30)||(ino... | ALGO | 0.998251 | 3.559017 |
319fe44e-4816-4640-aa9f-f05068d1ce56 | ishandutta2007/codeforces | felerius/normal/1440/D.cpp | // Graph Subset Problem (https://codeforces.com/contest/1440/problem/D)
#include <bits/stdc++.h>
#if __has_include("dbg.h")
# include "dbg.h"
#else
# define dbg(...) do {} while (0)
#endif
#define cp_lib_4th(_1, _2, _3, x, ...) x
#define cp_lib_rep(i, l, r) for (int i = (l); (i) < (r); ++(i))
#define c... | ALGO | 0.999979 | 5.007628 |
336d951b-9a6d-4d9d-95bd-a599b4c37909 | Mustafa-Mohamed26/competitive_programming | CodeForces/677A_Vanya and Fence/main.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
int h;
cin >> h;
int a;
int result = 0;
for (int i = 0; i < n; ++i) {
cin >> a;
if(a <= h){
result += 1;
}else if(a > h){
result += 2;
}
... | ALGO | 0.999783 | 3.500915 |
c969a032-e290-44e1-b816-e7c4a5b43018 | sarvex/leetcode-elixir | solution/2400-2499/2469.Convert the Temperature/Solution.cpp | class Solution {
public:
vector<double> convertTemperature(double celsius) {
return {celsius + 273.15, celsius * 1.8 + 32};
}
}; | ALGO | 0.998293 | 6.377139 |
fd0e2989-b30d-420b-a9bd-151108198ff4 | sanma-icfpc/icfpc2021 | libs/boost_1_76_0/libs/polygon/example/gtl_custom_polygon_set.cpp | #include <boost/polygon/polygon.hpp>
#include <list>
#include <time.h>
#include <cassert>
#include <deque>
#include <iostream>
namespace gtl = boost::polygon;
using namespace boost::polygon::operators;
//once again we make our usage of the library generic
//and parameterize it on the polygon set type
template <typenam... | ALGO | 0.914552 | 7.807999 |
87c444bd-a803-4df5-8a46-aabbec23c9af | codeAntu/LeetCode-problems | cpp/longest-nice-subarray.cpp | #include "vector"
using namespace std;
class Solution {
public:
int longestNiceSubarray(vector<int>& nums) {
int l = 0, r = 0, useBits = 0, maxLen = 0;
for (r = 0; r < nums.size(); r++) {
while ((useBits & nums[r]) != 0) {
useBits ^= nums[l++];
}
useBits |= nums[r];
maxLen ... | ALGO | 0.99991 | 6.073226 |
bcd24ac8-1d4d-45be-a02f-2cf9d778583d | nodehubs/navigation2 | smac_planner/src/smac_planner_2d.cpp | #include <string>
#include <memory>
#include <vector>
#include <limits>
#include <algorithm>
#include "smac_planner/smac_planner_2d.hpp"
// #define BENCHMARK_TESTING
namespace smac_planner
{
using namespace std::chrono; // NOLINT
SmacPlanner2D::SmacPlanner2D()
: _a_star(nullptr),
_smoother(nullptr),
_costmap(n... | TOOL | 0.881348 | 6.227347 |
19a4df0b-a80e-4005-bd15-0686a9ccc49c | brown0394/algorithm_practice | writeNumberNextToEach.cpp | #include <iostream>
int main() {
int n;
scanf_s("%d", &n);
int digits[]{ 9, 90, 900, 9000, 90000 };
long long base = 9;
if (n < 10) printf("%d\n", n);
else {
long long sum = 0;
int digit = 10;
int check;
for (int i = 1; i <= 9; ++i) {
check = n / digit;
if (!check) {
digit /= 10;
sum += ((n... | ALGO | 0.999652 | 4.146467 |
8d5eefc9-0dec-4534-ad55-39a1d0ebd6bc | Ujjwlkushwaha/Coding-Streak | Coding-Streak/02 October/12 Day/01Solution.cpp | #include <bits/stdc++.h>
using namespace std;
int minGroups(vector<vector<int>> &intervals)
{
vector<pair<int, int>> events;
// Create start and end events for each interval
for (const auto &interval : intervals)
{
int left = interval[0], right = interval[1];
events.push_back({left, 1}... | ALGO | 0.999917 | 6.389026 |
d810e471-5d78-448a-8c56-78582149f663 | Sumon-Ict/UVA-Problem-Solution | UVA solution file2/matrixchain.cpp |
#include<stdio.h>
#include<limits.h>
int MatrixChainOrder(int p[], int n)
{
int m[n][n];
int i, j, k, L, q;
/* m[i,j] = Minimum number of scalar multiplications needed
to compute the matrix A[i]A[i+1]...A[j] = A[i..j] where
dimension of A[i] is p[i-1] x p[i] */
// cost is zero when mu... | ALGO | 0.999991 | 3.403576 |
7903bd7e-302d-4839-bbff-24216917b0d2 | CaroCaros/Mashupishu | 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 |
1b7cad5b-52b1-4c68-815d-7c9dafd94b2a | TimatoPaste/tim-code-learning | CPP/0024_PassByReferenceOrValue/main.cpp | #include <iostream>
#include <string>
#include <vector>
using std::cout;
using std::string;
using std::vector;
void swap(int a, int b){
int temp = a;
a = b;
b = temp;
}
void swapReference(int& a, int& b){
int temp = a;
a = b;
b = temp;
}
string makeUppercase(string name){//this only makes th... | TOOL | 0.951854 | 5.322675 |
855d8cc0-c9f4-44be-9c6d-86253b706c22 | mooleetzi/ICPC | contest/图的连通性/HDU_1269.cpp | /*
tarjan模板题,求强连通分量个数
*/
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#include <v... | ALGO | 0.999985 | 4.715407 |
5d8345e4-daa5-4ea9-be71-bccbbd59a7cb | jizhuoran/pyZKP | aten/src/ATen/native/quantized/cpu/BinaryOps.cpp | #define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#include <ATen/core/Tensor.h>
#include <ATen/Context.h>
#include <ATen/Dispatch.h>
#include <ATen/ExpandUtils.h>
#include <torch/library.h>
#include <ATen/quantized/Quantizer.h>
#include <ATen/native/quantized/cpu/QuantizedOps.h>
#include <ATen/native/quantized/cpu/init_qnnpac... | TOOL | 0.850926 | 6.856551 |
51856055-2e4d-464d-8a15-51f8259727ce | open-gpdb/gpdb | src/backend/gporca/libgpopt/src/operators/CLogicalLeftAntiSemiJoinNotIn.cpp | #include "gpopt/operators/CLogicalLeftAntiSemiJoinNotIn.h"
#include "gpos/base.h"
#include "gpopt/base/CColRefSet.h"
#include "gpopt/operators/CExpression.h"
#include "gpopt/operators/CExpressionHandle.h"
using namespace gpopt;
//---------------------------------------------------------------------------
// @functi... | TOOL | 0.872307 | 5.544936 |
39fd49e3-7f04-427b-abd1-009df30fdfb4 | Ziklon/algorithms | tc/testprograms/LCMRange.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999585 | 5.19491 |
444d3861-f17c-4644-84b2-3fbd8d12bd14 | nthu-pllab/llvm9-project-rvp | llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp | #include "ELFObjcopy.h"
#include "Buffer.h"
#include "CopyConfig.h"
#include "Object.h"
#include "llvm-objcopy.h"
#include "llvm/ADT/BitmaskEnum.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "l... | TOOL | 0.874685 | 6.879745 |
c35476ee-39a2-4b9d-ad8a-4b98b7bd9181 | AshwinDEM/DAA_LAB_4SEM_RVCE | 9/CPP/MChainMultiplication.cpp | #include <bits/stdc++.h>
using namespace std;
// Matrix Chain Multiplication
// I don't know if this is the correct implementation of MCM, this is what is in GFG, optimised using DP
int MCM(vector<int> &arr)
{
int n = arr.size();
vector<vector<int>> dp(n, vector<int>(n, 0));
for (int i = 1; i < n - 1; i++... | ALGO | 0.999935 | 4.560384 |
e096754d-5cb7-496a-bb88-17134b810903 | call-me-bammer/montmartre-hill | baekjoon/25600/main.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int maxScore = 0;
int a, d, g;
for (int i = 0; i < n; i++) {
cin >> a >> d >> g;
int score = a * (d + g);
if (a == (d + g)) {
score *= 2;
}
if (score > maxScore) {
... | ALGO | 0.99956 | 4.562455 |
93b04790-f59d-42af-847d-cea6e14d5a3a | ZhouWeikuan/zoj | zju.finished/2264.cpp | #include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
enum {
SIZ = 204,
};
int N, D;
string name[SIZ];
char buf[20];
int mat[20][20];
int calc(const char *a, int i, int n,
const char *b, int j, int m){
if (mat[i][j] != -1)
return mat[i][j];
if (i==n || j==m){
... | ALGO | 0.999936 | 3.72607 |
ad56b3a8-21d3-44ff-a6ae-7326379bbed4 | odorenskyi/Habur-Artem-KB24 | lab09/prj/9_3.cpp | #include <iostream>
#include <bitset>
#include <windows.h>
using namespace std;
void task3() {
SetConsoleOutputCP(65001);
unsigned int N;
cout << "Введіть натуральне число від 0 до 7483650: ";
cin >> N;
if (N > 7483650) {
cout << "Помилка: число перевищує 7483650!" << endl;
ret... | ALGO | 0.952923 | 5.486663 |
d6ea7dc9-4b69-4459-980d-6986be04ceb5 | ishandutta2007/codeforces | aqt/normal/314/D.cpp |
// Problem : D. Sereja and Straight Lines
// Contest : Codeforces - Codeforces Round #187 (Div. 1)
// URL : https://codeforces.com/contest/314/problem/D
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
using namespace std;
int N... | ALGO | 0.999955 | 5.058294 |
def16945-ee89-479f-994b-e46daa095baa | Rajveer-Singh-Parihar/C-Expertise | template c++/temp5.cpp | #include<iostream>
using namespace std;
template<class T>
T getSquare(T x){
T y;
y = x*x;
return y;
}
int main(){
cout<<getSquare(12)<<endl;
cout<<getSquare(2.2)<<endl;
return 0;
} | TOOL | 0.878399 | 4.362525 |
23f6c6bb-eaac-4dff-a830-3068726d1fc1 | ckumar860/Basic-patterns | pattern17.cpp | // 1 2 3 4 5
// 2 3 4 5
// 3 4 5
// 4 5
// 5
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int i = 1;
while(i <= n){
int spaces = i-1;
while(spaces){
cout << " ";
spaces--;
}
int j = i;
wh... | ALGO | 0.999897 | 4.172582 |
1012b7ee-3d2a-4012-8053-f9c0002efc7f | opensource-hisense/SmartTV-SeriesVidaaU7_NT | oss/part1/boost/boost_1_73_0/libs/geometry/doc/index/src/examples/rtree/mapped_file.cpp | //[rtree_mapped_file
#include <iostream>
#include <boost/interprocess/managed_mapped_file.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/index/rtree.hpp>
namespace bi = boost::interprocess;
namespace bg = boost::geometry;
namespace bgm = bg::model;
namespa... | ALGO | 0.893423 | 5.736688 |
883e6e51-cd41-4bcb-9ad2-9ecfb7b08c30 | RohitKotha/geeksforgeeksprograms | Difficulty: Hard/Minimum Cost Path/minimum-cost-path.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
int minimumCostPath(vector<vector<int>>& grid)
{
int n=grid.size();
vector<vector<int>> dist(n,vector<int>(n,INT_MAX));
priority_queue<pair<int,pair<int,int>>,vector<... | ALGO | 0.999938 | 6.307173 |
b6f77a11-b244-46b3-9860-fadc499cce5e | lc-3-2/llvm | libcxx/test/std/algorithms/alg.sorting/alg.merge/ranges_merge.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
// <algorithm>
// template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
// weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity,
// class Proj2 = identity>
// ... | TEST | 0.99644 | 7.67309 |
e67e9e13-da14-477a-abc6-e6c979f2e07e | CheemsCommander/Thumder | src/crypto/hmac_sha256.cpp | #include <crypto/hmac_sha256.h>
#include <string.h>
CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen)
{
unsigned char rkey[64];
if (keylen <= 64) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 64 - keylen);
} else {
CSHA256().Write(key, keylen).Finalize(rke... | ALGO | 0.980939 | 5.862724 |
a1f9baa4-bcde-4849-95fb-78b6e8010a2a | hallowoo/Algorithm | 프로그래머스/2/12953. N개의 최소공배수/N개의 최소공배수.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> arr) {
int answer = 0;
sort(arr.begin(), arr.end(), greater<>());
for(int m = 1;; m++)
{
for(int i = 1; i < arr.size(); i++)
{
if((arr[0]*m)%arr[i] != 0)
{
... | ALGO | 0.999973 | 3.960315 |
d91a07e0-a4f2-4f1e-a5ef-e87d58e73f0e | ak8415129/leetcode-GFG | 2727-number-of-senior-citizens/number-of-senior-citizens.cpp | class Solution {
public:
int countSeniors(vector<string>& details) {
int count=0;
for(int i=0; i<details.size(); i++)
{
int f=details[i][11]-'0';
int s=details[i][12]-'0';
cout<<f<<endl;
if(f>5)
{
if(f==6 && s... | ALGO | 0.999052 | 5.890048 |
2a4f8b6f-2497-43dc-bd40-7f145a0c4123 | tasifhe/VISUALPROJECT | Practice_CPP/SHAPE_CALCULATOR.cpp | #include <iostream>
using namespace std;
class shape
{
public:
string a = "ERASE";
int p = 2;
void erase()
{
while(p != 0)
{
cout << "Type ERASE to erase the shape..." << endl;
cin >> a ;
if (a == "ERASE")
{
cout << " " << endl;
cout << "The shape has b... | TOOL | 0.947929 | 3.1974 |
be94dbea-5f85-4586-8f22-4a457ce5e7bb | Pratikjalodkar/problem-solving | number/fibonnacci_sum.cpp | #include<bits/stdc++.h>
using namespace std;
int fib(int n){
if(n<=1)
return n;
return fib(n-1)+fib(n-2);
}
int main()
{
int n;
cin>>n;
cout<<fib(n);
return 0;
}
| ALGO | 0.999994 | 4.461323 |
f05bd3ee-ade4-47c1-9c99-98b9396ef1a1 | Bingurrr/Cpp-Algorithm | 방크기.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
struct element { char x, y; };
element moveD[4] = { {1, 0}, {-1, 0}, {0, 1}, {0, -1} };
char room[100][100];
char visited[100][100];
int m, n;
int cnt;
void HowManyRoom(int x, int y) {
visited[x][y] = '+';
cnt+... | ALGO | 0.999937 | 3.869784 |
c5af9be8-6451-4d42-8e35-bf53a6a2e38b | Limworld98/Algorithms | Algorithms/Lab Work1-2.cpp | #include <iostream>
#include <string>
using namespace std;
template <typename itemType>
class Stack1
{
private:
itemType* stack;
int p;
public:
Stack1(int max = 100)
{
stack = new itemType[max];
p = 0;
}
~Stack1()
{
delete stack;
}
inline void push(itemType ... | ALGO | 0.99986 | 4.425832 |
28da59a0-846f-4ad8-ac09-e30e6f776397 | viscrisn/mit-algo-cpp | CPP Projects/Code Chef/August Long 2013/chef and segments.cpp | #include<iostream>
#include<stdio.h>
#include<cstring>
#include<stdlib.h>
#include<cmath>
#include<vector>
#include<algorithm>
#include<map>
#include<functional>
#include<stack>
#include<set>
#include<queue>
#include<fstream>
using namespace std;
int main()
{
int n;
cin>>n;
long long a[n];
long long l... | ALGO | 0.999949 | 3.273769 |
5b7d48dc-7af7-4878-bd4b-435ae762b7f5 | 12345231534/DSA_PTIT | 4001.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 +7;
long long poww(int n, int k){
if(k==1) return n;
long long x = poww(n,k/2);
if(k%2==0){
return (x*x) % mod;
}
else{
return ((x*x) %mod * n) %mod;
}
}
int main(){
int t;
cin >>t;
while(t--){
int n,k;
cin >>n>>k;
long long res=poww(... | ALGO | 0.999961 | 4.753316 |
25443b3f-6242-4b6c-820d-9c632a40e7c9 | phanvanthuan06052004/Data-Structures-Algorithms | testtree.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node* left;
Node* right;
};
typedef Node *Tree;
void CreateTree(Tree &root){
root = NULL;
}
Node *makeNode(int x){
Node *p = new Node;
p->data = x;
p->left = NULL;
p->right = NULL;
return p;
}
void addNode(Tree &root, int x){
Node *tmp=make... | ALGO | 0.999886 | 4.334898 |
49f50e68-2390-4985-8872-62389cfd38ab | rajesh-1920/Competitive_Programming_Problem_Solving | Vjudge/B_Rare_Nines.cpp | // Author: Rajesh Biswas
// CF : rajesh-1920
// Date : 07.01.2025
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
//----------------------------(definition section)-----------------------------------------
#define dbg(x) cout << #x << " = " << x << '\n'
#define fi first
#define sc second... | ALGO | 0.999611 | 4.795524 |
a553f574-6bea-4d44-8ec1-5e6f14ef189c | bashell/leetcode | 86_PartitionList.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* partition(ListNode* head, int x) {
if(head == NULL || head -> next == NULL)
return head;
vecto... | ALGO | 0.999996 | 5.061872 |
ff4de580-b261-47c2-8e7d-a0138055a0d5 | suyash-dabral/DSA_Concepts | Sliding_Window/Max_Sum_Subarray.cpp |
// Maximum sum subarray of size k
/*
We will use Slding window approach for optimization of brute force solution.
1- Declare the start (i) and end(j) of the window.
2- Declare a variable sum for storing the sum of the variables and mx to count the maximum sum
3- Now, the last possible position of j ... | ALGO | 0.999953 | 5.803033 |
5a94a991-1394-4279-be90-3984d93098ed | onecode369/CompetitiveProgramming | GeeksForGeeks/OddTriplets.cpp | #include<bits/stdc++.h>
#define DEBUG(x) cerr << #x << " = " << x << endl
#define MOD 1000000007LL
#define INF INT_MAX
#define reset(arr,n,i) fill(arr, arr+n, i)
#define iseql(a,b) ((abs(a-b) - 1e-9 < 0) ? 1 : 0)
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen... | ALGO | 0.999996 | 4.05783 |
6f726db3-0415-4df3-b076-516cd7fea259 | JaxWilliamson/C-3-sort-project | src/main.cpp | #include <iostream>
#include <fstream>
#include "insertionSort.cpp"
#include "bubbleSort.cpp"
#include "quickSort.cpp"
#include <chrono>
using namespace std;
int main()
{
fstream f;
chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
chrono::steady_clock::time_point end = std::chrono::steady_... | ALGO | 0.998827 | 4.587744 |
f94cc980-0881-4589-a9d6-9af7e62d5ca0 | NMRanaHamid/Problem_Solving | XPSC/week-02/day-01/B_Sum_of_Digits.cpp | #include <bits/stdc++.h>
using namespace std;
// rename macro of operations using typedef
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef vector<ll> vll;
typedef vector<int> vii;
typedef vector<vector<int> > vvii;
typedef vecto... | ALGO | 0.999895 | 4.79401 |
f308ac6c-13d7-4a74-8433-0d4f78be9e04 | Modding-Zaibatsu/ue5-polaris | Engine/Plugins/Runtime/GeometryProcessing/Source/DynamicMesh/Private/Operations/PolygroupRemesh.cpp | #include "Operations/PolygroupRemesh.h"
#include "Algo/ForEach.h"
#include "DynamicMeshEditor.h"
#include "Operations/PlanarHoleFiller.h"
#include "MeshRegionBoundaryLoops.h"
using namespace UE::Geometry;
bool FPolygroupRemesh::Compute()
{
bool bSuccess = true;
FMeshNormals OriginalTriNormals(Mesh);
OriginalTri... | TOOL | 0.979095 | 7.045701 |
42e642c2-4c34-4185-b222-1203db7e8518 | KrishWadhwa24/LeetCode | Dynamic Programming/best_sightseeing_pair.cpp | #include <bits/stdc++.h>
using namespace std;
/*
You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance j - i between them.
The score of a pair (i < j) of sightseeing spots is values[i] + values[j] + i - j: the sum of the v... | ALGO | 0.999992 | 6.22229 |
49614fe0-b04e-4a39-b29a-96ec3bf7cd99 | udaykirankavaturu/design-patterns | structural/composite/composite.cpp | #include <iostream>
#include <vector>
#include <memory> // For smart pointers
// Abstract Base Component
class FileSystemComponent {
public:
virtual void showDetails(int depth = 0) const = 0; // Pure virtual function
virtual ~FileSystemComponent() = default; // Virtual destructor
};
// Leaf: Represents a File... | TOOL | 0.915322 | 6.402312 |
c7152b65-4a12-4b2a-b8ab-8fd5da5d0919 | purveshjambhulkar/Strivers-DSA-Sheet | 06.Recursion/03.Trying out all Combos Hard/04.Rat in a Maze Problem - I.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
void findPathUtil(vector<vector<int>> &mat,vector<string> &ans, string temp,int n , int row, int col){
// Check if out of bounds or on an obstacle
... | ALGO | 0.999293 | 6.939549 |
6a536b72-ccd5-4307-8306-08739d6e2331 | crimson000000/OIcode | luogu/4725.cpp | #define LOCAL
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
inline ll read()
{
ll x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
ch = getchar();
}
while(ch >= '0' && ch <= '9')
{
... | ALGO | 0.999973 | 3.792574 |
d7eacde3-c7ad-4b39-bff2-25ae3eb8c51a | coolguycaden/schoolwork | 2023-2024/spring2024/Algo-and-Datastruct/lab/lab6/T1.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
double closestPair(std::string filename);
int main()
{
double min = closestPair("points10.txt");
//ASSERT_NEAR(min, 0.068553744951327016954, 0.00000000000001e-02);
if (std::abs(min - 0.068553744951327016954) > 0.00000000000001e-02)
{
std... | TEST | 0.977384 | 4.555793 |
4614921c-be09-4944-a898-86332d2a6dd1 | adityasheth2000/cp_library | Regional-sheet/Persistent data structures.cpp | int st[21*N],lpt[21*N],rpt[21*N];
int root[N];
int NODE=0;
int build(int l,int r)
{
int curnode=NODE++;
if(l==r)
return curnode;
int m=(l+r)/2;
lpt[curnode]=build(l,m);
rpt[curnode]=build(m+1,r);
return curnode;
}
int insert(int oldnode,int l,int r,int w)
{
if(w>=l && w<=r){
... | ALGO | 0.9998 | 3.336797 |
b908ade9-8f7e-41f9-b8b6-f2caaa001a12 | Aditya-9131/Data_Structure_Algorithm_C_plus | PartReverseArray.cpp | # include <iostream>
# include <vector>
using namespace std;
void display(vector<int> &a){
for(int i=0; i<a.size(); i++){
cout<<a[i]<<" ";
}
cout<<endl;
}
void reversePart(int i, int j, vector<int> &a){
while(i<=j){
int temp = a[i];
a[i] = a[j];
a[j] = temp;
i++;
... | ALGO | 0.999238 | 4.041328 |
c5c091a5-8d78-4615-b3dd-8b3daf3b63ec | feliposz/leetcode-solutions | C++/power-of-two.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
if (n < 1) {
return false;
}
long x = 1;
while (x <= n) {
if (n == x) {
return true;
}
x *= 2;
}
return false;
}
}; | ALGO | 0.999192 | 6.616492 |
9b4a1b20-3666-40a9-8a21-3907abad6c24 | ishandutta2007/codeforces | kostia244/normal/1060/F.cpp | #include<bits/stdc++.h>
#define all(x) begin(x), end(x)
using namespace std;
const int maxn = 55;
using ll = long long;
using ld = long double;
using DP = array<ld, maxn>;
int n;
ll C[maxn][maxn];
vector<int> g[maxn];
int sz[maxn];
ld factorial(int x) {
ld r = 1;
for(int i = 1; i <= x; i++) r *= i;
return r;
}
ld mr... | ALGO | 0.99995 | 4.027519 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.