uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c1a10c6f-ed32-4f63-b045-2ced5f99ca20 | alexandraback/datacollection | solutions_2449486_1/C++/Oakani/B.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int T;
cin >> T;
int caseNum = 1;
while(caseNum <= T)
{
int M,N;
cin >> M >> N;
vector< vector<float> > h(M,0);
for(int i=0;i<M;i++)
{
vector<float> v(N,0);
h[i] = v;
}
for(int i=0;i<M... | ALGO | 0.999906 | 3.631265 |
118cea75-eeed-4991-9c25-509c0298f1ea | ninaccl/algorithm_2 | 二叉树序列化.cpp | #include <vector>
#include <queue>
#include <iostream>
//树 1 2 4 -1 -1 5 -1 -1 3 6 -1 -1 7 -1 -1
// 1
// 2 3
// 4 5 6 7
typedef struct BinaryTreeNode
{
int data;
BinaryTreeNode *left;
BinaryTreeNode *right;
}BinaryTreeNode, *BiTree;
using namespace std;
void Create(BiTree &T)
{
int ch;
cin >> ch;
if ... | ALGO | 0.999927 | 4.054631 |
788ef14c-e205-4c35-9792-331664198d0d | davidfoxhu/angle | jni/Box2D/Dynamics/b2ContactManager.cpp | #include <Box2D/Dynamics/b2ContactManager.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Dynamics/Contacts/b2Contact.h>
b2ContactFilter b2_defaultFilter;
b2ContactListener b2_defaultListener;
b2ContactManager::b2ContactManager()... | ALGO | 0.959429 | 7.054889 |
261026cc-459c-4e9f-8247-46f80812ffa3 | intel/quantum-intrinsics | libc/src/math/generic/fminl.cpp | #include "src/math/fminl.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(long double, fminl, (long double x, long double y)) {
return fputil::fmin(x, y);
}
} // namespace __llvm_libc
| ALGO | 0.994307 | 5.765527 |
0726014c-73f1-404f-9828-fef0c0049e4b | ashishmh/geeksforgeeks | trees/binary-to-bst.cpp | // http://www.geeksforgeeks.org/binary-tree-to-binary-search-tree-conversion/
#include <iostream>
using namespace std;
class node
{
public:
int data;
node* left;
node* right;
node(int data) {
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
void binaryTreeToB... | ALGO | 0.999983 | 5.940707 |
e39e3bd2-4ef7-4f82-9564-f1cf88d94a26 | ishandutta2007/codeforces | tutis/normal/1615/D.cpp | /*input
4
6 5
1 2 -1
1 3 1
4 2 7
6 3 0
2 5 -1
2 3 1
2 5 0
5 6 1
6 1 1
4 5 1
5 3
1 2 -1
1 3 -1
1 4 1
4 5 -1
2 4 0
3 4 1
2 3 1
3 3
1 2 -1
1 3 -1
1 2 0
1 3 1
2 3 0
2 1
1 2 1
1 2 0
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("avx2")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace s... | ALGO | 0.999913 | 5.203611 |
9329f5e5-998e-4742-b0ed-08a391c6591c | nazmulnnb/Solved-Problems | Toph/Suffix Array is the Hardest Problem.cpp | #include <bits/stdc++.h>
using namespace std;
char str[1001];
struct suffix
{
int index;
char *suff;
};
int cmp(struct suffix a, struct suffix b)
{
return strcmp(a.suff, b.suff) < 0? 1 : 0;
}
int *buildSuffixArray(char *txt, int n)
{
struct suffix suffixes[n];
for (int i = 0; i < n; i++)
{
... | ALGO | 0.99989 | 4.269886 |
7d500cb8-6ee4-47a0-a37a-49379b193dcb | marcfp/proves | calculator01_meu_falla.cpp |
//
// This is example code from Chapter 6.6 "Trying the first version" of
// "Software - Principles and Practice using C++" by Bjarne Stroustrup
//
//#include "../std_lib_facilities.h"
#include <algorithm>
#include <cmath>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
using namespace s... | ALGO | 0.943225 | 7.06775 |
3b28a67c-18ec-4199-b2bb-0a0877af9858 | Rajeshnds/Competitive-Programming | codeforces/dragonmas/codeforces(c++)_old/canine_poetry/main.cpp | #include<bits/stdc++.h>
using namespace std;
int t,k;
string s;
int main(){
for(cin>>t;t--;){
cin>>s;
k=0;
for(int i=0;i<s.size();i++){
if(s[i]==s[i-1]||s[i]==s[i-2])s[i]='0',k++;
}
cout<<k<<endl;
}
}
| ALGO | 0.999636 | 3.589198 |
39c7a9b3-a982-4e05-a515-ffb9b120c1cb | cogle/Computer-Graphics-CSE_452- | shapes/Square.cpp | #include "Square.h"
#include "Cylinder.h"
Square::Square(){
}
Square::Square(std::vector<std::vector<Face_Normal>> & square, int scale){
std::vector<Face_Normal> temp;
const double base = 0.5;
const double scale_factor = double(1.0 / double(scale));
const double entry = base*scale_factor;
//double start_x, star... | TOOL | 0.885759 | 4.217358 |
a6affd72-6601-4d89-817d-947c720d6958 | SonarSystems/Tic-Tac-Toe-Cocos2d-x | C++/[9] Achievements/TicTacToePractise/cocos2d/cocos/platform/win32/CCFileUtils-win32.cpp | #include "platform/CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
#include "CCFileUtils-win32.h"
#include "platform/CCCommon.h"
#include <Shlobj.h>
#include <cstdlib>
#include <regex>
using namespace std;
NS_CC_BEGIN
#define CC_MAX_PATH 512
// The root path of resources, the character encoding is... | TOOL | 0.932028 | 5.982011 |
e5d6a407-71f0-4153-911a-d24d487ab0e2 | ishandutta2007/codeforces | shadowlight/normal/932/D.cpp | #include <bits/stdc++.h>
#define ll long long
#define TASKNAME ""
using namespace std;
const ll INF = 1e9 + 7;
const ll MAXN = 1e6 + 7;
const double EPS = 1e-8;
const ll LOGN = 30;
vector <vector <ll> > binup, sumup;
vector <ll> w;
ll lst = 1;
void add(ll v, ll w1) {
ll u = lst++;
w.push_back(w1);
if (... | ALGO | 0.999925 | 4.206335 |
512f52ed-92b6-4507-942c-f3a0ed3fae48 | HarshaVardhan31012007/Leetcode-and-Gfg-Codes | 0055-jump-game/0055-jump-game.cpp | class Solution {
public:
// bool solve(vector<int>&nums,int i,vector<int>&dp){
// if(i==nums.size()-1) return true;
// if(i>=nums.size()) return false;
// if(nums[i]==0) return false;//no need
// if(dp[i]!=-1) return dp[i];//noneed of nums[i]==0 return false//loop takes
// //care of it
// bool ans=false;
/... | ALGO | 0.999984 | 5.754848 |
c243e325-33bf-4ff0-8595-b569b0d17170 | qsnake/trilinos | packages/moertel/src/mrtr_functions.cpp | /* ******************************************************************** */
/* person and disclaimer. */
/* ******************************************************************** */
#include "mrtr_functions.H"
//===============================================================... | TOOL | 0.979102 | 7.036016 |
51a42365-9102-418b-907e-3eb543380dbc | thilio/Competitive-Programming | Codeforces-Rounds/Div2/#771/e.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define ms(x,i) memset(x,i,sizeof(x))
#define endl '\n'
#define dbg(x) cout << #x << " = " << x << endl
#define all... | ALGO | 0.997512 | 4.906343 |
9a29ac60-51dd-45bb-8590-befa4c0e14ad | taegun1011/problem-solving-cpp | repos/silver/11866.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
bool visited[1001];
int main() {
FASTIO;
int N, K;
cin >> N >> K;
if (N == 1) {
cout << "<1>\n";
return 0;
}
queue<int> Q;
for (int i = 1; i <= N; i++)
... | ALGO | 0.999959 | 3.34369 |
6995de86-9ab6-4c78-b29e-e58afd95444f | Haonan-DONG/PatchMatchStereo_linux | PatchMatchStereo_CPU/src/pm_red_black.cpp | #include "DisparityPlane.h"
#include "Matrix2D.h"
#include "PatchMatchRedBlack.h"
#include <algorithm>
#include <opencv2/opencv.hpp>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
float Evaluate(cv::Mat standard, cv::Mat myMap)... | ALGO | 0.993095 | 4.02567 |
6db398ce-b8e4-4065-b246-29c71e2e8e23 | sahiljuneja/Udacity-SDCND-Term-2 | P5-MPC/src/Eigen-3.3/bench/sparse_transpose.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
// -DNOGMM -DNOMTL
// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef... | ALGO | 0.980185 | 5.110691 |
0e63b4b6-72e9-4c45-8219-6e697a2f153b | masterchef2209/coding-solutions | codes/codechef/EARTSEQ.cpp | #include<bits/stdc++.h>
using namespace std;
int sieve[612000];
vector<long long>primes;
void precompute()
{
memset(sieve,0,sizeof(sieve));
for(long long i=2;i*i<=612000;i++)
{
if(sieve[i]==0)
{
for(int j=2*i;j<=612000;j+=i)
{
sieve[j]=1;
}
}
}
for(long long i=2;i<=612000;i++)
{
if(sieve[i]=... | ALGO | 0.99991 | 3.597132 |
21ac3997-966f-44d2-9a94-7486ae8e2f28 | Gigvo/Praktikum-Pemrograman | Pertemuan 8/code2.cpp | #include <iostream>
using namespace std;
double sum(int n) {
if (n == 0) {
return 0;
}
double num;
cout << "Masukkan angka ke-" << n << ": ";
cin >> num;
return num + sum(n - 1);
}
int main() {
int n;
cout << "Berapa banyak angka yang ingin dihitung rata-ratanya? ";
cin >... | ALGO | 0.998526 | 5.95673 |
6f40777b-444e-4ec2-9fad-5a13ea53efd5 | ixray-team/ixray-1.6-stcop | src/3rd party/MagicSoftware/FreeMagic/Source/Intersection3D/MgcIntr3DTriCone.cpp | #include "MgcIntr3DTriCone.h"
using namespace Mgc;
//----------------------------------------------------------------------------
//#define MGC_DEBUG_TRICONE
#ifdef MGC_DEBUG_TRICONE
#include "MgcRTLib.h"
static const int gs_iMaxSample = 128;
//--------------------------------------------------------------------------... | ALGO | 0.954346 | 6.655499 |
8bfd9cd5-86b9-4c7d-ad4e-64693fe8a87a | jakubwiczkowski/aizo-graphs | src/main.cpp | #include <iostream>
#include <fstream>
#include <chrono>
#include "graph/matrix/matrix_graph.h"
#include "graph/list/list_graph.h"
#include "algorithm/mst/prim_algorithm.h"
#include "algorithm/mst/kruskal_algorithm.h"
#include "algorithm/shortest/dijkstra_algorithm.h"
#include "algorithm/shortest/fordbellman_algorithm... | ALGO | 0.945151 | 4.222774 |
82911d41-a0dc-42e6-b653-d06be514ca5a | amratansh03/C-Lab-Programs | 47DisplayListOfStudentAccordingMarks.cpp | // Write a program to display the list of students according to their marks.
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
// Sturcture to represent the student
struct Student{
string name;
int marks;
};
// Function to compare two students based on their marks
bool compareMarks(c... | ALGO | 0.999896 | 6.319406 |
c9787984-abbd-4d40-932f-33be82e545e2 | Aditya-567/Leetcode | 1846_Maximum Element After Decreasing and Rearranging.cpp | class Solution {
public:
int maximumElementAfterDecrementingAndRearranging(vector<int>& arr) {
sort(arr.begin(),arr.end());
int max =1;
arr[0]=1;
for(int i =1;i<arr.size();i++){
if(arr[i]>max){
max += 1;
}
}
return max;
}
};... | ALGO | 0.999933 | 5.621762 |
313af17e-3061-44c4-9dc3-897eb772ebe9 | cwang588/algorithms | Codeforces Round #783 (Div. 2)/E.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
if(n==1)return !printf("1\n1 1\n");
int m=(2*n-1)/3;
while(3*m<2*n-1)++m;
printf("%d\n",m);
while(n%3!=2)printf("%d %d\n",n--,n);
int num=(2*n-1)/3;
for(int i=1;i<=num/2+1;++i)printf("%d %d\n",i,num/2+1-i+1);
for(int i=1;i<=num/2;++i)pri... | ALGO | 0.999831 | 3.086865 |
6db5a53e-38df-4288-9e38-48281deb53e0 | ZCube/boost-cmake | libs/multi_index/perf/test_perf.cpp | #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <assert.h>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/ne... | TOOL | 0.890862 | 7.568899 |
f6154469-4f05-4d85-a02f-0aac6d3f8bca | Fabio-Pina/logica-algoritmo | 010 - LINGUAGEM C++/0182/SomaImpares/main.cpp | #include <iostream>
using namespace std;
int main()
{
int x, y, troca, soma;
cout << "Digite dois números: " << endl;
cin >> x >> y;
if (x > y) {
troca = x;
x = y;
y = troca;
}
soma = 0;
for (int i = x + 1; i < y; i++) {
if(i % 2 != 0) {
soma ... | ALGO | 0.999703 | 4.826926 |
93a886ab-4136-4de5-aa13-3e2ef3ffb354 | Katerina-Smetanina/Uni_basic_C | Пирамида,жадные/Greedy_algorithm/Greedy_algorithm.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
bool* x = new bool[n];
int* s = new int[n];
int* f = new int[n];
if (n <= 1) {
cout << n;
}
else {
for (int i = 0; i < n; i++) {
cin >> s[i] >> f[i];
x[i] = true;
}
for (int i = 0; i < n; i++) {
for (int j = (n - 1); j >... | ALGO | 0.999977 | 3.365099 |
22939c71-ff97-44eb-9820-4f83529e201e | gymnasiumlife/Gymnasium | src/dashbls/src/legacy.cpp | #include "legacy.hpp"
#define B12_P381_S3 "BE32CE5FBEED9CA374D38C0ED41EEFD5BB675277CDF12D11BC2FB026C41400045C03FFFFFFFDFFFD"
#define B12_P381_S32 "5F19672FDF76CE51BA69C6076A0F77EADDB3A93BE6F89688DE17D813620A00022E01FFFFFFFEFFFE"
/**
* Returns the (sqrt(-3) - 1) / 2 mod q in the curve, where q is the prime.
*
* @pa... | ALGO | 0.996046 | 4.659684 |
ab79a322-b80d-4fe9-b5ab-c14e958a5d53 | ashneg/competitive_coding | hackerrank/c++/Variable_Sized_Arrays/solution.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main() {
int i,b;
cin>>i>>b;
for(int a=i;a<=b;a++)
{
if(a<10)
{
if(a==1)
cout<<"one";
else if (a==2)
cout<<"two";
else if (a==3)
cout<<"three";
else if (a==4)
... | ALGO | 0.999838 | 3.780993 |
52671dce-a59f-46a1-975f-bbfa68a5ea05 | vaneela/Ds-algo | LC_study_plans/Algorithms_I/Day_5_Two_pointers/Remove_nth_node_from_end_LL.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* removeNthFr... | ALGO | 0.999982 | 5.910883 |
499553cb-6349-44cc-8511-7db45660bd32 | kwylliam/OOP-c-- | Lab programs 2/reverse_elements.cpp | #include<iostream>
#include<array>
#include<cmath>
using namespace std;
int center(int s){
int c=0;
if(s%2!=0){
c=ceil(s/2);
}
else{
c=(s/2)+1;
}
return c;
}
int main()
{
cout<<"For an array with an odd number of elements"<<endl;
array<int,5> arr={1,2,3,4,5};
array<int, 6>arr2={6,7,8,9,10,11};
for(int ... | ALGO | 0.998627 | 4.442033 |
3a2b8f5d-4af5-410d-9512-8699396531d3 | Trianan/IDenTity-1 | Project_Euler_I/EP_018.cpp | // Isaiah Campsall EP_18.cpp Jan. 14, 2022
/*
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
3
7 4
2 4 6
8 5 9 3
That is, 3 + 7 + 4 + 9 = 23.
Find the maximum total from top to bottom of the triangle below:
... | ALGO | 0.99932 | 4.353616 |
1801719f-d51d-4622-b4be-4b13884aec09 | sayeed-rana/DevSkill-Problem-Solution- | DCP-69 Funny Sum.cpp | #include<iostream>
using namespace std;
int main()
{
int tc,i=0,j,num,t;
cin>>tc;
while(tc--)
{
long long m_add=0,my_add=0;
cin>>j;
for(i=0;i<j;i++)
{
cin>>num;
my_add+=num;
t=num-i;
if(t>=0)
{
m_a... | ALGO | 0.99966 | 3.480718 |
cd049269-5944-4ffc-9c58-e7912cce0416 | tomi45bg/- | str83.2/str83.2.cpp | #include <iostream>
#include <vector>
using namespace std;
// Функция за пресмятане на разделената разлика
double divided_difference(const vector<double>& x, const vector<double>& y, int start, int end) {
if (start == end) {
return y[start];
}
else {
return ((divided_difference(x, y, start ... | ALGO | 0.999751 | 5.699035 |
65fb366a-fb14-4f3e-994c-d301fd6a7750 | avijit-ro-y/Leetcode | C++/700. Search in a Binary Search Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.99999 | 6.124129 |
2f7529c1-d57a-4cc6-a4d3-1cb7cc76c450 | OpenBlatam/TruthGPT-chatGPT | TruthGPT/Without-Framework/Production/pytorch-main/c10/util/int128.cpp | #include <c10/util/Logging.h>
#include <c10/util/int128.h>
#include <iomanip>
#include <ostream> // NOLINT(readability/streams)
namespace c10 {
const uint128_pod kuint128max = {
uint64_t{0xFFFFFFFFFFFFFFFFu},
uint64_t{0xFFFFFFFFFFFFFFFFu}};
// Returns the 0-based position of the last set bit (i.e., most sign... | TOOL | 0.902549 | 7.484593 |
12414980-fc2d-4cfd-8376-93950c52f03c | vmad18/coding-problems | Coding Problems/LeetCode/Medium/All Paths From Source To Target.cpp | void backTrack(vector<vector<int>>& adj, vector<vector<int>> &ans, vector<int> con){
vector<int> tr=con;
for(int n:adj[con[con.size()-1]]){
tr.push_back(n);
if(n==adj.size()-1){
ans.push_back(tr);
}else{
backTrack(adj, ans, tr);
}
tr.pop_back();... | ALGO | 0.99991 | 5.977124 |
ecaf4579-3c95-4d46-9240-473bc9089588 | sysudengle/rstm | libstm/algs/norecprio.cpp | /**
* NOrecPrio Implementation
*
* This is like NOrec, except that too many consecutive aborts result in
* this thread gaining priority. When a thread has priority, lower-priority
* threads cannot commit if they are writers
*/
#include "../profiling.hpp"
#include "algs.hpp"
#include "RedoRAWUtils.hpp"... | ALGO | 0.988335 | 6.746641 |
babb4bcc-d4a0-4742-8d49-60c599676992 | ishandutta2007/codeforces | tute7627/normal/1741/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
#define spa << " " <<
#define rep(i,n,m) for(int i=(n);i<int(m);i++)
#define rrep(i,n,m) for(int i=int(m)-1;i>=int(n);i--)
using ll=long long;
template<typename T1, typename T2>
bool chmin(T1 &a,T2 ... | ALGO | 0.999965 | 4.024383 |
8d0c3508-5505-4772-9b9a-1f40c02234c5 | VijayKYadav/LeetCode-2025 | February/Count Number of Bad Pairs.cpp | I Approach (Using HashMap)
class Solution {
public:
long long countBadPairs(vector<int>& nums) {
long long n=nums.size();
vector<int> dif(n);
unordered_map<int,int> mp;
for(int i=0;i<n;i++)
{
dif[i]=i-nums[i];
mp[dif[i]]++;
}
long lon... | ALGO | 0.99984 | 6.360506 |
06192d99-27d2-42ae-84f9-04397efeb954 | uibcdf/PyPharmer | Pharmit_code/src/SphereGrid.cpp | /*
* SphereGrid.cpp
*
* Created on: May 6, 2010
* Author: dkoes
*/
#include "SphereGrid.h"
#include <queue>
using namespace OpenBabel;
#define ADDPT(x,y,z) pts.push_back(vector3(x,y,z))
//twenty uniformly spaced points
void SphereGrid::makeDodecahedron()
{
vector<vector3> pts;
pts.reserve(20);
ADDPT(... | ALGO | 0.990137 | 5.962782 |
669228e9-82d3-461d-b929-364bd2aebfa7 | Seairth/AoC2021 | src/day09.cpp | #include <stdio.h>
#include <string>
#include <fstream>
#include <algorithm>
#include <list>
#include <numeric>
#include <stack>
#include <vector>
using namespace std;
#define INPUT_FILENAME "../input/day09.txt"
#define MAP_DIM 100
static void init_map(vector<string> &m, istream &f)
{
string line;
m.pus... | ALGO | 0.999413 | 6.945331 |
368f155c-93d2-493b-9fdf-dfaeca794fc5 | Xinyumi/3D-reconstruction-for-healthcare | preprocess_custom_data/aruco_preprocess/calibration.cpp | #include <cnpy.h>
#include <cmath>
#include <cstring>
#include <string>
#include <iostream>
#include <fstream>
#include <opencv2/opencv.hpp>
#include <opencv2/aruco.hpp>
void Calibrate(std::string work_dir, int n_images, double raw_scale) {
std::vector<std::vector<cv::Point3f>> obj_points;
std::vector<int> board_i... | TOOL | 0.8618 | 5.426865 |
e9bccf90-8731-4469-9a2f-966bc6537f3b | hoangtien2k3/Code | Bai_2_Mang_2_Chieu.cpp |
/*
Nhập vào mảng 2 chiều:
a. in mảng
b. Tính tổng các số lẻ là số âm
c. Đếm phần tử có tận cùng bằng 3
d. Tính tổng các phần tử nằm phía trên đường chéo chính ( tam giác trên )
e. Tính tổng các phần tử trên cột k ( với k nhập từ bàn phím )
f. sắp xếp mảng giảm đần
... | ALGO | 0.998349 | 3.219804 |
2cb2e348-1131-4b11-b958-0e42ebbf9d0d | sujanrupu/Striver_SDE_sheet | Dynamic Programming/Maximum Product Subarray.cpp | //Link: https://leetcode.com/problems/maximum-product-subarray/description/
class Solution {
public:
int maxProduct(vector<int>& nums) {
int n = nums.size(), minProd = nums[0], maxProd = nums[0], ans = nums[0];
for(int i=1; i<n; i++) {
int temp = minProd;
minProd = min({nums... | ALGO | 0.999989 | 6.019175 |
c61e42fc-dbd7-4414-92d8-8aa93e0ace6f | SwapnilD03/-CrackYourInternship | Sum-of-Subarray-Minimums(28-08-24).cpp | class Solution {
public:
int sumSubarrayMins(vector<int>& arr) {
int ans=0;
const int MOD=1e9+7;
int n=arr.size();
vector<int> nsl(n);
vector<int> nsr(n);
stack<int> st;
for(int i=0;i<n;i++){
if(st.empty()){
nsl[i]=-1;
... | ALGO | 0.999995 | 5.799772 |
3ef78946-c272-45c2-bd2e-3b186bcec61a | ishandutta2007/codeforces | ngochai94/normal/513/B1.cpp | #include <bits/stdc++.h>
using namespace std;
#define For(i,a,b) for(int i=a;i<b;i++)
#define mp make_pair
#define pb push_back
#define mod 1000000007
int n,m;
void solve(int up,int down,int mm)
{
if(up==down) cout<<up<<' ';
else
{
int k=up-down-1;
if(mm<=(1<<k))
{
cout... | ALGO | 0.999993 | 3.326316 |
50421ab3-661a-4510-94ce-b649a14476ff | Summeli/TweeJump4wp8 | Box2D/Dynamics/b2WorldCallbacks.cpp | #include "pch.h"
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Dynamics/b2Fixture.h>
// Return true if contact calculations should be performed between these two shapes.
// If you implement your own collision filter you may want to build from this implementation.
bool b2ContactFilter::ShouldCollide(b2F... | TOOL | 0.877599 | 7.108605 |
7f88c7d3-f21c-40eb-aae6-ed308d66ea3e | Hoang17072004/DSA | CodeforcesProblem/sellingMegane.cpp | #include<bits/stdc++.h>
using namespace std;
void solve() {
int n; cin>>n;
int a[n];
vector<int>sons(n,0);
vector<int> ans;
for (int i=0;i<n;i++ ) cin>>a[i],a[i]--,sons[a[i]]++;
int c[n];
for (int i=0;i<n;i++) cin>>c[i];
queue<int> q;
for (int i=0;i<n;i++) if (sons[i]==0) q.push(i);
bool added[n]={0};
while(... | ALGO | 0.999993 | 3.543641 |
2d0f6f77-a931-475b-8399-d5802d84946d | mohnishunity3ddev/Shoora | engine/memory/freelist_allocator.cpp | #include "freelist_allocator.h"
#include "memory_utils.h"
#include <platform/platform.h>
void
freelist_allocator::Initialize(void *Memory, size_t Size)
{
ASSERT(Memory != nullptr && Size > 0 && "You have to pass in something valid here!");
this->Memory = Memory;
this->TotalSize = Size;
flNode *newNo... | TOOL | 0.949586 | 6.609401 |
f3531de3-f3de-4f74-9f1c-312c8f2fa0fc | KmFahimHossain/LeetCode_TopInterview150_SolutionsByMe | Array_String/Product_of_Array_Except_Self.cpp | #include <iostream>
#include <vector>
using namespace std;
// Problem statement - https://leetcode.com/problems/product-of-array-except-self/description/
vector<int> solution(vector<int>& nums)
{
int product = 1;
int productIfZero = 0;
int size = nums.size();
for(int i = 0; i<size; i++)
{
... | ALGO | 0.999957 | 5.64518 |
17e8544b-8f07-4067-b5df-7ba479967689 | mjxyiyao/myblog | leetcode backtracking51.cpp | //Leetcode 51 N-queens
class Solution {
public:
vector<vector<string>> solveNQueens(int n) {
vector<vector<string>> res;
int dp[n]; //用来记录以前所有行中的列,dp[i]记录的是第i行的第j列
vector<string> temp(n, string (n, '.'));
helper(res, temp, dp, 0, n);//从第0行开始,直到递归到第n行结束
return res;
... | ALGO | 0.999763 | 5.743237 |
f1557c1b-4d9c-4678-9221-0af42119afc8 | abhishek1711/COdeforces | codeforces/berpok.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int fac[1000];
int temp = arr[0];
while(temp%2==0){
temp = temp/2;
}
while(temp%3==0){
temp = temp/3;
}
int cnt=0;
for(int i=3;i<=sqrt(temp);i++){
while(temp%i==0){
fac[cnt... | ALGO | 0.999986 | 3.837764 |
6f5111e3-d0e5-48c8-bf9c-b9c36f8db752 | FrederickPi1969/Course-Projects | Computational_Photography/Floodfill_Image/colorPicker/MyColorPicker.cpp | #include "../cs225/HSLAPixel.h"
#include "../Point.h"
#include "ColorPicker.h"
#include "MyColorPicker.h"
#include "../cs225/PNG.h"
#include <math.h>
#include <cmath>
using namespace cs225;
/**
* Picks the color for pixel (x, y).
* Using your own algorithm
*/
MyColorPicker::MyColorPicker(PNG image) : picture(ima... | ALGO | 0.960649 | 4.690114 |
139f94eb-d7f3-480c-ae8e-738ab785af87 | Giatroo/Competitive-Programming | Codeforces/189A.cpp | #include <bits/stdc++.h>
typedef long long int ll;
typedef long double lld;
#define fora(i, n) for (ll i = 0; i < n; i++)
#define forai(i, n) for (ll i = 1; i <= n; i++)
#define ford(i, n) for (ll i = n-1; i >= 0; i--)
#define fordi(i, n) for (ll i = n; i >= 0; i--)
#define forita(it, c) for(auto it = c.begin(); it != ... | ALGO | 0.999795 | 3.659398 |
031bc124-e0ba-408e-9def-bc1c0de7f0f3 | Kugelblitz101/PerlinCuda | Utils.cpp | #include "Utils.hpp"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/resource.h>
#include <tiffio.h>
#include <time.h>
#include <unistd.h>
#include "MergeSort.hpp"
#include "open-simplex-noise-in-c/open-simplex-noise.h"
void setStackSize(int sizeMB) {
const rlim_t kStac... | TOOL | 0.997248 | 5.370154 |
cb9463a8-c452-4220-9bdb-cfbf0ca3ab5d | mako666/Eluna-CMaNGOS-Classic | src/game/vmap/DynamicTree.cpp | #include "DynamicTree.h"
#include "Log.h"
#include "Timer.h"
#include "BIHWrap.h"
#include "RegularGrid.h"
#include "GameObjectModel.h"
template<> struct HashTrait< GameObjectModel>
{
static size_t hashCode(const GameObjectModel& g) { return (size_t)(void*)&g; }
};
template<> struct PositionTrait< GameObjectModel... | ALGO | 0.902253 | 5.909898 |
09242071-5829-4d61-9e6d-45ca8455e513 | Shanwanth-16/CompetitiveProgrammingLab | lecture16/possibleSubSequence.cpp | #include <iostream>
using namespace std;
void recurse(string curr,vector<string> &ans,string input,int index)
{
if(index==input.length())
{
ans.push_back(curr);
}
else{
recurse(curr+input[index],ans,input,index+1);
recurse(curr,ans,input,index+1);
}
}
int main()
{
co... | ALGO | 0.999294 | 4.324462 |
7ca36595-7aaf-4727-865c-ab0588b32cdc | ayush-848/C_plus_plus | fibronacci_recursion.cpp | // Fibonacci Series using Recursion
#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)<<endl;
return 0;
}
| ALGO | 0.999955 | 4.989269 |
397a7bb4-b731-4937-841c-5de6b6b0387f | SanthoshBala/protein-modules | lib/cgal/demo/CGAL_ipelets/simple_triangulation.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/CGAL_Ipelet_base.h>
namespace my_triangulation{
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Delaunay_triangulation_2<Kernel> ... | ALGO | 0.964435 | 6.645135 |
cfb08588-f424-4b5d-94de-ded1d47ef4d5 | nccaiteam/histopathology_annotation_nia | libs/boost_1_67_0/libs/spirit/example/karma/num_list3.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demonstrates a generator for a comma separated list of numbers.
// No actions. It is based on the example qi/num_lists.cpp for reading in
// some numbers to generate.
//
/////////////////////////////////////////////////... | TOOL | 0.860705 | 6.686377 |
fcb1158c-6111-44d7-a4b8-0bf302511955 | josephding23/CCF | 201509-3.cpp |
#include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;
int main() {
int n, m;
vector<string> tv;
string key, value, temp;
map<string, string> dict;
int prev, next;
cin >> n >> m;
getchar();
for(int i = 1; i <= n; i++) {
getline(cin, temp);
... | ALGO | 0.998962 | 3.825624 |
e0233baa-27f4-4fb6-8f08-0e6e9cade602 | iyaacs/algospot | FANMEETING.cpp | #include<iostream>
#include<string>
#include <vector>
#include <algorithm>
using namespace std;
const double SIZE = 29.0;
const long long ISIZE = 29;
const long long PIVOT = (1 << ISIZE) - 1;
//OverFlow 허용
void MoveToRight(vector<long long>& bits2, bool rightBit, long long s1len) {
long long lastGroup = bits2.size()... | ALGO | 0.999717 | 5.401047 |
4b601bc4-ae88-4f62-8232-5aeab962905c | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc051/D/3638765.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
typedef long long lint;
usi... | ALGO | 0.99998 | 3.819831 |
fb039bba-0f7e-423f-bd49-64dc5ef91238 | EmmanuelEmu/DSA_-_leetcode | Dynamic programming/LIS/leetcode_1048. Longest String Chain.cpp | #include <bits/stdc++.h>
using namespace std;
bool compareStr(string &a, string &b)
{
if (a.size() != b.size() + 1)
{
return false;
}
int first = 0, second = 0;
while (first < a.size())
{
if (second < b.size() && a[first] == b[second])
{
first++;
... | ALGO | 0.999972 | 5.02818 |
72bd2f69-155d-4c57-86b1-d08971292f40 | cuckydev/FunkinPS1-public | tools/lib/FunkinAlgo/FunkinAlgo.cpp | #include "FunkinAlgo.h"
#include <libimagequant.h>
#include <comper.h>
#include <cmath>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#undef STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_RESIZE_IMPLEMENTATION
#include "stb_image_resize.h"
#undef STB_IMAGE_RESIZE_IMPLEMENTATION
// Quantization
void Quant::Ge... | ALGO | 0.988824 | 5.115328 |
77f817e9-04e2-4df4-848f-6c8f6c82ffb6 | apenugon/CUDABPM | src/BeatCalculator/BeatCalculator.cpp | #include <iostream>
#include <stdio.h>
#include <mpg123.h>
#include "omp.h"
#include <kiss_fftr.h>
#include <cmath>
#include "BeatCalculator.h"
BeatCalculator::BeatCalculator() {
printf("Initialized Beat Calculator\n");
}
BeatCalculator::~BeatCalculator() {
printf("Terminated Beat Calculator\n");
}
void clea... | ALGO | 0.973033 | 4.3199 |
32fa0fc6-cbe4-4e25-9a4c-ccc76ab53c71 | SJMA11723/Problem-solving | codeforces/Educational Codeforces Round 161 (Rated for Div. 2)/B.cpp | /**
* Author: Jorge Raul Tzab Lopez
* Github: https://github.com/SJMA11723
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t; cin >> t;
while(t--){
int n; cin >> n;
int64_t cub[n + 2] = {};
for(int i =... | ALGO | 0.999847 | 4.809806 |
6539998f-3ef3-46a6-91ab-b728951905eb | 0xm4yo/compro | atcoder/asakatsu/asakatsu20231122/B.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
#define rep(i, a, b) for(ll i=a; i<b; i++)
#define rrep(i, a, b) for(ll i=a; i>=b; i--)
#define all(a) (a).begin(), (a).end()
#define YesNo(bool) if(bool){cout<<"Yes"<<en... | ALGO | 0.999986 | 4.914842 |
ae9d67f8-b855-4440-8630-539692138fa4 | ms-iot/winml_ros_demo | src/demo.cpp | #define _USE_MATH_DEFINES
#define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS 1 // The C++ Standard doesn't provide equivalent non-deprecated functionality yet.
#include <math.h>
#include <ros/ros.h>
#include <tf/tf.h>
#include <tf/transform_datatypes.h>
#include <angles/angles.h>
#include <sensor_msgs/LaserScan.h>
#inclu... | TOOL | 0.944475 | 5.062348 |
eab173cf-0d4e-499e-978b-7ca5134d4208 | algo-geek/Codes | Recursion/remove duplicates in string.cpp | #include <bits/stdc++.h>
using namespace std;
string removeDup(string s)
{
if(s.size()==0)
return "";
char ch=s[0];
string ans = removeDup(s.substr(1));
if(ch==ans[0])
{
return ans;
}
return (ch+ans);
}
int main()
{
string s;
cin>>s;//aaabbccdddee
cou... | ALGO | 0.999956 | 4.537302 |
0c180033-1cf7-43fc-8839-4722112921a4 | loremzlimpa/Northern | src/obfuscation.cpp | #include "obfuscation.h"
#include "coincontrol.h"
#include "init.h"
#include "main.h"
#include "masternodeman.h"
#include "script/sign.h"
#include "swifttx.h"
#include "ui_interface.h"
#include "util.h"
#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>... | TOOL | 0.931888 | 5.578876 |
99b10e36-b63f-4736-9085-24e4cbf01679 | 7thKsJ/boj | 2/2551.cpp | #include <bits/stdc++.h>
using namespace std;
long long int arr[10010], ms1 = 90987654321, ms2 = 90987654321, v1, v2;
int n, x;
int main (){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
for(int i = 0; i < n; i++){
cin >> x;
arr[x]++;
}
for(long lon... | ALGO | 0.999804 | 3.653083 |
74c1b8c1-0b29-469a-a954-3f265c8b183c | LimJeonghyun/CodingTestStudy | Practice/P_142086.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
vector<int> solution(string s)
{
vector<int> answer;
string tmp = "";
for (int i = 0; i < s.size(); i++)
{
int idx = tmp.find_last_of(s[i]);
if (idx == -1)
{
answer.push_back(idx);
... | ALGO | 0.999619 | 4.438703 |
7e091ce0-1e3e-43f1-9325-aea05702092a | MohamedMamdouh18/Problem-Solving | Code Forces Problems/Level C/Substring Game in the Lesson/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define se second
#define fi first
#define el "\n"
#define ll long long
#define all(a) a.begin(),a.end()
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PREC cout.precision(20);
const ll mod = 1e9, N =... | ALGO | 0.999622 | 3.976394 |
b022cc2d-9786-47bb-a248-dc4f72e1b35a | ishandutta2007/codeforces | cheissmart/normal/622/A.cpp | #include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl
using namespace std;
typede... | ALGO | 0.999932 | 3.597788 |
3ade80f1-c22e-441c-bbff-6d64f92d8617 | SR-Akash/Problem-Solving | Codeforces/cf_Devu, the Singer and Churu, the Joker.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,d;
cin>>n>>d;
int sum=0,count=0,countt=0,res;
for(int i=0;i<n;i++)
{
int xx;
cin>>xx;
count++;
sum+=xx;
}
int multi=(count-1)*10;
int mc=multi+sum;
// int ans=sum+multi;
... | ALGO | 0.999904 | 3.18185 |
d74efe90-2f0f-4a43-8ae0-9637a502c91a | jer22/OI | hdu/bestcoder19/1001/1001.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int n;
int isprime[1000000];
int pp[400000];
int primeNum = 0;
void initPrime() {
isprime[1] = 1;
for (int i = 2; i < 1000000; i++) {
if (!isprime[i]) {
for (int j = i << 1; j < 1000000; j += i) {... | ALGO | 0.999966 | 4.137375 |
26bd12b9-cc3f-4f30-897f-725cd80e0772 | ishandutta2007/codeforces | rqi/normal/1677/B.cpp | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | ALGO | 0.99993 | 4.800352 |
a731600b-af28-450e-a560-e5365591232b | SuperArtisMickens/CS151 | Labs/lab12.cpp | #include <iostream>
using namespace std;
bool ConsecutiveNums(double A,double B,double C)
{
if ((A+B+C)/3 == A || (A+B+C)/3 == B || (A+B+C)/3 == C){
cout << "True\n";
return true;
}
else
cout << "False\n";
return false;
}
void SwapIfLessThan(double D,double E)
{
do... | ALGO | 0.997531 | 3.395888 |
3de977db-9991-4db7-a2cc-4b2bc5ef16d4 | Islammelgendy/ProblemSolvingwithcpp | antonanddanik.cpp | #include <iostream>
using namespace std;
int main(){
int anton{0}, danik{0}, gamesNumber;
string score;
cin >> gamesNumber;
cin >> score;
for (int i=0; i < gamesNumber; i++){
if (score[i] == 'A') anton++;
else danik++;
}
if (danik > anton) cout << "Danik\n";
els... | ALGO | 0.999805 | 4.208303 |
98e5f1c6-319d-4d50-b65b-853957bb1832 | ZHENGXi-git/SafetyQuantifiable-PLVINS | src/PriorLineVisualLocalization/map_fusion/src/factor/pose_local_parameterization.cpp |
#include "pose_local_parameterization.h"
bool PoseLocalParameterization::Plus(const double *x, const double *delta, double *x_plus_delta) const
{
// x: state ==> x, y, z, w, x, y, z
// delta
x_plus_delta[0] = x[0] + delta[0];
x_plus_delta[1] = x[1] + delta[1];
x_plus_delta[2] = x[2] + delta[2];
... | ALGO | 0.982507 | 5.991108 |
1ec56414-991a-42b3-a100-de350dc0e8bd | brownwj/leetcode | reverseInteger.cpp | class Solution {
public:
int reverse(int x) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
stringstream ss;
int result;
ss.clear();
int flag=1;
if(x<0) {flag=-1;x=-x;}
string temp;
ss<<x;
ss>>temp;
... | ALGO | 0.99985 | 5.613065 |
bde3d520-9f3f-49b3-aaf2-10a78b0a74ef | raincross7/code-similarity | codes/train_code/problem059/problem059_368.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;
void solve() {
int n, x, t; cin >> n >> x >> t;
cout << t * ((n + x - 1) / x);
}
// CHECK LIMITS (n <= 10^5)
// CHECK CORNER CASES (n == 1)
int main() {
ios::sync_with_stdio(NULL), cin.tie(0), cout.ti... | ALGO | 0.999687 | 4.347942 |
04f665da-9fd8-4bc7-b371-1c26ade51909 | PeteMango/Contest | DMOJ/ccc/2024/senior/ccc24s2.cpp | #include <iostream>
#include <set>
#include <vector>
using namespace std;
bool solve(string s) {
vector<int> freq(26, 0);
for (int i = 0; i < s.size(); i++) {
freq[s[i] - 'a'] += 1;
}
set<char> hvy, lgt;
for (int i = 0; i < 26; i++) {
if (freq[i] == 1) {
lgt.insert((char)(i + (int)('a')));
... | ALGO | 0.999886 | 5.267573 |
c1b1d5ec-ea6c-4bea-b248-c1d1ea20a7f0 | u70hcs00/C | ch6/List6_2a.cpp | #include<iostream>
using namespace std;
#define PI 3.1416
#define ERROR_MESSAGE cout<<"Radius needs \
to be positive!"<<endl
int main()
{
float fRadius; // radius
float fArea; // area
cout<<"Please input the radiusG";
cin>>fRadius;
if(fRadius < 0){
ERROR_MESSAGE;
}
else{
fArea = PI * fRadius * fRadius;... | ALGO | 0.888887 | 3.459729 |
1428a3c6-d334-4aed-8325-43d8002a0555 | Mackenzie-98/Solutions | CSES/Sorting and Searching/Movie_Festival.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define ft first
#define sd second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#def... | ALGO | 0.999903 | 5.03809 |
849b06ac-9289-415e-8b80-7e09f2951e11 | CJunette/CPP_Learning | 002/课程/2.4_003/2.4_003/2.4_003.cpp | // 2.4_003.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
int main()
{
int i = 1;
int sum = 0;
while ( i <= 10 )
{
sum += i++;
}
cout << "The sum is " << sum << "." << endl;
}
| ALGO | 0.941138 | 3.871825 |
3e57f832-a2f7-40c3-ba65-55de482e9b8b | andreisimion99/Diverse-projects-with-Stacks-Queues-Linked-Lists-Graphs-BST-and-Heaps | Homework2/main_ex2.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> ans;
void dfs(vector<int>& deg, vector<vector<int> > & adj, vector<int>& path, int st , int ct,int e)
{
if(ct==e)
{
ans=path;
return;
}
if(deg[st]>0)
{
vector<int> x = adj[st];
for(int i=0;i<x.size();i++)
{
deg[st]--;
path.push_back(st);
... | ALGO | 0.999982 | 4.221175 |
4835eb6b-e9c2-407f-add1-c4ff69deed52 | AkshatAggarwal14/Competitive-Programming | CodeForces/Gym/103496A.cpp | #ifdef LOCAL
// https://github.com/AkshatAggarwal14/Competetive-Programming
#include "Akshat.hpp"
#else
#include "bits/stdc++.h"
using namespace std;
#define dbg(...)
#endif
using ll = long long;
constexpr auto sz = [](const auto &container) -> ll { return ll(container.size()); };
#define all(x) (x).begin(), (x).end()
... | ALGO | 0.999468 | 4.42887 |
1f225ef4-acdc-4fd4-920e-36d2ef327463 | CodeMatias/bullet-old | src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp | #include "SpuGatheringCollisionDispatcher.h"
#include "SpuCollisionTaskProcess.h"
#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
#include "SpuContactManifoldCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatc... | ALGO | 0.882697 | 6.152397 |
fc8317eb-aa07-475f-96e7-e4e92eb2c895 | Autoratch/submissions | Codeforces/1138C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1000;
int m,n;
int a[N][N],r[N][N],c[N][N],mxr[N],mxc[N];
set<int> s;
unordered_map<int,vector<int> > ma;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> m >> n;
for(int i = 0;i < m;i++) for(int j = 0;j < n;j++) cin >> a[i][j];
... | ALGO | 0.999952 | 3.879903 |
ea1927e7-5ac3-4863-a2d2-98591066a091 | Stone-sy/CSF | point_cloud.cpp | #include "point_cloud.h"
void csf::PointCloud::computeBoundingBox(Point& bbMin, Point& bbMax) {
if (empty()) {
bbMin = bbMax = Point();
return;
}
bbMin = bbMax = at(0);
for (std::size_t i = 1; i < size(); i++) { // zwm
const csf::Point& P = at(i);
for (int d = 0; d < ... | TOOL | 0.99555 | 4.836316 |
bfeee443-a296-4ad9-99dc-59454dcd96b8 | Olde-Skuul/directplay | Samples/Maze8/MazeCommon/Maze.cpp | #if defined(__WATCOMC__)
#define sqrtf sqrt
#endif
#include "Maze.h"
#include "DXUtil.h"
#include "MazeServer.h"
#include <dxerr8.h>
#include <malloc.h>
#include <math.h>
#include <stdio.h>
// Disable a warning on Windows calls for CodeWarrior
#if defined(__MWERKS__)
#pragma warn_no_side_effect off
#endif
#if define... | ALGO | 0.938995 | 6.39671 |
c4065799-1049-4b8a-8814-c397f4a0bd8f | Mulab11/cntt2016-hw1 | TC-SRM-570-div1-550/oysq.cpp | #line 2 "CentaurCompany.cpp"
#include <bits/stdc++.h>
using namespace std;
#define ui unsigned
#define ll long long
#define pii std::pair<int,int>
#define mp std::make_pair
#define fi first
#define se second
#define SZ(x) (int)(x).size()
#define pb push_back
template<class T>inline void chkmax(T &x, const T &... | ALGO | 0.999232 | 3.92577 |
d3c4fe06-d9ec-4965-bc2d-a40768cc1f0b | Katsudon10/Competitive-programming | Atcoder/ABC/ABC379/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define ALL(a) (a).begin(),(a).end()
const int inf = INT_MAX;
using ll = long long;
const ll INF = 1e18;
using P = pair<int,int>;
struct Edge{
int to;
ll cost;
Edge(int to,ll cost):to(to),cost(cost){}
};
using kEdge = pair<... | ALGO | 0.999943 | 3.583447 |
db883457-e165-4601-a0b3-f866aea95399 | cofls6581/hongjangal | 코드/10월1주차/hyejun/1781_그리디.cpp | #include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
typedef pair<int, int> pp;
int n, ans;
vector<pp> v;
priority_queue<int, vector<int>, greater<int>> pq;
int main(void) {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int d, r;
cin >> n;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.99991 | 3.708897 |
6785f49d-30ea-47bf-ad72-40280a4b30f9 | PhamDoanAnhDuy/C_basic | 4_phuongtrinhtrungphuong.cpp | #include "stdio.h"
#include "conio.h"
#include "math.h"
int main()
{
float a,b,c;
float denta,t1,t2;
float t;
printf("Nhap a,b,c: ");
scanf("%f%f%f",&a,&b,&c);
denta=(float)(b*b-4*a*c);
t1=(float)((-b+sqrt(denta))/(2*a));
t2=(float)((-b-sqrt(denta))/(2*a));
if (denta!=0) {
if (denta<0) printf("Phuong trinh v... | ALGO | 0.999635 | 3.340347 |
9cb49649-f92d-4f9e-85b6-8dc2658aa4fb | raincross7/code-similarity | codes/train_code/problem381/problem381_412.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#defin... | ALGO | 0.999965 | 3.352867 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.