uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
311db81b-5688-4587-9ed8-dce49c2ebf7e | StandardCyborg/scsdk | scsdk/c++/scsdk/standard_cyborg/algorithms/EstimatePlane.cpp | #include "standard_cyborg/algorithms/EstimatePlane.hpp"
#include <cmath>
#include <cstdlib>
#include <map>
#include <queue>
#include "standard_cyborg/util/DataUtils.hpp"
#include "standard_cyborg/math/Vec3.hpp"
#include "standard_cyborg/sc3d/VertexSelection.hpp"
using standard_cyborg::sc3d::Face3;
using standard_cy... | ALGO | 0.9996 | 7.141511 |
31e87123-930c-46bf-bef7-83e92bdbf74a | adityak54/cp | before-aug-24/B_Permutations_Primes.cpp |
#define pi pair<int,int>
#define ll long long int
#include <bits/stdc++.h>
using namespace std;
ll powerof2(ll a){
return a && !(a&a-1);
}
struct cmp{
bool operator()(pi a,pi b){
if(a.first>b.first) return true;
if(a.first==b.first){
if(a.second<b.second) return true;
}
return false;
}
};
bo... | ALGO | 0.999557 | 4.283091 |
94c28092-06d7-435b-b59c-bc61559e1f0c | imutsavyadav/data-structure-algorithm | BIT Manipulation /14_5_problem.cpp | // wap a program to find a unique number in an Array wherea ll number except
// one , are present thrice .
#include<bits/stdc++.h>
using namespace std ;
bool getBit(int n , int pos){
return ( n & (1 << pos)) !=0;
}
int setBit(int n , int pos){
return (n | (1<<pos));
}
int find_unique(int arr[] ,int n){
... | ALGO | 0.999893 | 4.697295 |
c2f86884-de42-4788-9bd9-5b375174f74e | DUSHYANT2026/LeetCode-Questions | 2387-partition-array-such-that-maximum-difference-is-k/2387-partition-array-such-that-maximum-difference-is-k.cpp | class Solution {
public:
int partitionArray(vector<int>& nums, int k) {
sort(nums.begin(),nums.end());
int ans = 1;
int index = nums[0];
for(auto it : nums){
if(it - index > k){
ans++;
index = it;
}
}
return ans... | ALGO | 0.99997 | 5.724031 |
9ed140b8-108d-48d8-b856-0ee07944671f | YTGhost/PAT | Advanced-Level-Practice/1050 String Subtraction.cpp | #include <iostream>
#include <unordered_set>
using namespace std;
int main()
{
string s1, s2;
getline(cin, s1);
getline(cin, s2);
unordered_set<char> s;
for(auto c : s2)
s.insert(c);
string res = "";
for(auto c : s1)
if(!s.count(c)) res += c;
cout << res << endl;
ret... | ALGO | 0.999662 | 3.543476 |
d90968f9-60be-43fd-9c0b-40b9197368c8 | FMonitor/SZUOJ | 数据结构/树/DS二叉树高度.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node {
char data;
Node* lchild;
Node* rchild;
};
int maxdeg = 0;
void buildPreOrder(Node*& fa, string dat, int& index, int deg) {
if (index >= dat.size()) {
return;
}
if (dat[index] == '0') {
fa = NULL;
} else {
fa =... | ALGO | 0.999708 | 4.454569 |
8ffca1f3-44fd-4900-a5ab-eca6507c922a | iluvatar1/2023-II-ProgCPP | 2023-11-10-ODE-IVP-Libs/odeint.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <boost/numeric/odeint.hpp>
typedef std::vector<double> state_t; // alias for state type
void initial_conditions(state_t & y);
void print(const state_t & y, double time);
void fderiv(const state_t & y, state_t & dydt, double t);
int ma... | ALGO | 0.999964 | 5.988279 |
f5b4f3a4-dc41-42be-91c6-991c2a8c4fcf | MartinAyush/CPP-Workspace | DSA/Heap/heapAdvance.cpp | #include<bits/stdc++.h>
using namespace std;
// priority queue uses heap
// main purpose of heapify is to rearrange array so that
// head is the largest or smallest element in the array
// heapify works best when head is changed
// O(log(n))
void minHeapify(vector<int> &a, int n, int i){
int node = i;
int lef... | ALGO | 0.999853 | 4.255423 |
f76d85f5-94d5-49de-b013-b6c3fdf07a56 | ani37/PoncaPrimitiveWithPolyscope | deps/libig/include/igl/knn.cpp | #include "knn.h"
#include "sort.h"
#include "parallel_for.h"
#include <cmath>
#include <queue>
#include <set>
#include <algorithm>
namespace igl {
template <typename DerivedP, typename IndexType,
typename DerivedCH, typename DerivedCN, typename DerivedW,
typename DerivedI>
IGL_INLINE void knn(const Eigen::Mat... | ALGO | 0.99994 | 6.377276 |
4a4f0ee6-dedf-4526-839e-3fed474a4c52 | osom8979/external | opencv-4.1.0/modules/imgproc/src/samplers.cpp | #include "precomp.hpp"
namespace cv
{
static const uchar*
adjustRect( const uchar* src, size_t src_step, int pix_size,
Size src_size, Size win_size,
Point ip, Rect* pRect )
{
Rect rect;
if( ip.x >= 0 )
{
src += ip.x*pix_size;
rect.x = 0;
}
else
{
... | ALGO | 0.985608 | 5.681817 |
3b06f07c-2f80-46cd-9e16-b3fe0954d839 | Syricoff/bmstu | Семестр1/ВП/Суриков_НС_ИУК4-11Б_2023_ЛР6_ВП/Задание_3.cpp | #include <iostream>
// Структура для описания комплексного числа
struct ComplexNumber {
double real; // действительная часть
double imag; // мнимая часть
};
// Функция для умножения комплексных чисел
ComplexNumber multiplyComplex(ComplexNumber num1, ComplexNumber num2) {
ComplexNumber result;
result.rea... | ALGO | 0.995411 | 4.872612 |
f967feaf-3a60-4dc8-a041-d9197e74f201 | markrenChina/learn | leetcode/coding_interviews/isSymmetric28.cpp | //
// Created by Ushop on 2022/7/20.
//
#include "../leetcode-utils.hpp"
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
private:
bool _isSymmetric(TreeNode *left, TreeNode *right) {
if (!left && !right)... | ALGO | 0.999803 | 6.435007 |
28d5c376-31c7-4421-a189-515df4a35274 | nguyenson2003/ontapk63 | season 3 - ctdlgt/T3/B03 - 19-09-2023/nqson_oanh_bai.cpp | #include <iostream>
#include <queue>
#include <string>
using namespace std;
main(){
int n;cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
queue<int> bo_bai;
for(int i=0;i<n;i++){
bo_bai.push(a[i]);
}
while(!bo_bai.empty()){
//step 1
int la_duoi_day=bo_bai.front();
bo_bai.pop();
bo_bai.push(la_... | ALGO | 0.999984 | 3.481619 |
0280e280-5634-47ed-88c5-c7e282fcfb21 | Azhut/University | C++/1656_CentralMatrix/main.cpp | #include <iostream>
using namespace std;
void distFromCenter(int** arr, int n, int size){
int temp, bad;
for (int j = 0; j < n-1; ++j) {
if ( (arr[j][0] - size/2) + (arr[j+1][0] - size/2) < (arr[j][1] - size/2) + (arr[j + 1][1]- size/2 )) {
temp = arr[j][0];
arr[j]... | ALGO | 0.999898 | 3.008112 |
69a66cc4-b653-468c-87cb-27974388b3cb | arnavjaiswal2803/DSA | 0120-triangle/0120-triangle.cpp | class Solution {
public:
int minimumTotal(vector<vector<int>>& triangle) {
int n = triangle.size();
vector<int> prev(n);
for (int row = n - 1; row >= 0; row--) {
vector<int> curr(row + 1);
for (int col = 0; col <= row; col++) {
curr[col] = triangle[ro... | ALGO | 0.999952 | 6.663373 |
734eda77-1a8a-4fb7-b684-9a79289e241c | PranshVaishnav/DSA-Implementation-Question | Tree/Search_in_BST.cpp | // No duplicates present
// Inorder traversal gives sorted Elements.
// Catelon Number binary search tree possible
#include <iostream>
using namespace std;
// structure of node class
/*
10
/ \
5 40
/ \ \
1 7 50
*/
class Node
{
public:
int data;
Node *left;
N... | ALGO | 0.999976 | 5.44308 |
36851174-fe33-4374-a392-a31f33ad857d | zaburo-ch/icpc_practice | aoj0224.cpp | #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <set>
#include <math.h>
#include <utility>
#include <stack>
#include <string.h>
#include <complex>
using namespace std;
const int INF = 1<<29;
const double EPS = 1... | ALGO | 0.99896 | 3.842987 |
c6c67ac3-e326-4529-b30b-c894dea00bda | deepak427/Leet-Code | 0793-swap-adjacent-in-lr-string/0793-swap-adjacent-in-lr-string.cpp | class Solution {
public:
bool canTransform(string start, string end) {
int i=0, j=0;
while(i<start.size() && j<end.size()) {
while(start[i]=='X') i++;
while(end[j]=='X') j++;
if(start[i]!=end[j]) return false;
if(star... | ALGO | 0.999184 | 5.411783 |
e9f669f8-672e-4509-a236-73f11003b5cf | thegamer1907/Code_Analysis | Implementation/1644.cpp | #include<iostream>
using namespace std;
main()
{
string s;
long long m,n,x=0,i,dem;
cin>>s;
for(i=0;i<s.length();i++){
dem=0;
if(s[i]=='0'){
while(s[i]=='0'){
dem++;
i++;
}
i--;
}
if(s[i]=... | ALGO | 0.999645 | 3.324493 |
2a61d264-070a-4126-8473-fe21aec1051a | MhammedAhmmed/LeetCode-Solutions | 0135-candy/0135-candy.cpp | class Solution {
public:
int candy(vector<int>& ratings) {
int n = ratings.size();
vector<int> candies(n);
priority_queue<pair<int, int>, vector<pair<int, int>>,
greater<pair<int, int>>>
pq;
for (int i = 0; i < n; i++) {
pq.push({ratin... | ALGO | 0.999996 | 6.234072 |
11db061e-f97c-48ab-b729-97bc81ff6650 | nguyentuss/Competitive-Programming | CP/OnlineJudge/CodeForce/CodeForce/2018A.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma,popcnt")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vecto... | ALGO | 0.997726 | 4.940279 |
30af75f9-b054-457c-8875-48966370f803 | Arfeiger/Embedded-Software | Exercise3a3/Exercise3a3/Blink/Sketch.cpp | /*
author : Mechenane Khalef
Date : 22/10/2019
version : 1.0
description : Display the digits from the temperature .
*/
#include <Arduino.h>
#define ANALOGPIN 0
#define SIZEOFTable 32
#define TIMES 3
#define DELAYS 2000
//Define pins to the leds
#define APIN 2
#define BPIN 8
#define CPIN 6
#define ... | TOOL | 0.93113 | 3.242249 |
80785843-e467-4681-a141-5ebfb9e0ac26 | notYnoj/Programming-Questions-in-CPP | CSES 150/Backtracking/Chessboard_and_Queens.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<char>> board(8, vector<char>(8, '.'));
//check if safe
bool is_safe(int row, int col) {
for (int i = 0; i < 8; ++i) {
//rows and cols
if (board[i][col] == 'Q' || board[row][i] == 'Q') {
return false;
}
//diagonal... | ALGO | 0.999829 | 5.821423 |
1bed47b4-48ec-4fab-b212-ded6a0975fa2 | MakeContributions/DSA | algorithms/CPlusPlus/Arrays/next-permutation.cpp | //c++ program to find the next greatest permutation of given number.
//Sample input 1 :
//nums =[1,2,3]
//sample output 1:
// nums =[1,3,2]
//sample input 2:
//nums =[3,2,1]
//sample output:
//nums =[1,2,3]
//time complexity:O(n).
//space complexity:O(1),because we are doing in place.
#include<bits/stdc++.h>
using name... | ALGO | 0.999981 | 4.829518 |
f4d4db4e-05e6-4e00-b35b-d9b51f9d15c8 | grhvaring/labsim | lab_01/src/ex_1.1a.cpp | /******************************************************************
Exercise 1.1a: Generate a large sequence (M=10^5) of pseudo-random
numbers distributed uniformly in [0,1]. Then divide it in N=100
blocks each of lenght L, calculate the average values of these
blocks as well as the squares of the average values, a... | ALGO | 0.895777 | 4.251946 |
30a2105d-cde9-40c2-91aa-e8c301e92f06 | rammiah/OnlineJudge | etc/669.cpp | struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
// 二叉树节点删除,不需要delete
void del(TreeNode *&node) {
if (node->left == nullptr && node->right == nullptr) {
node = nullptr;
} else if (no... | ALGO | 0.999994 | 6.470421 |
67905395-b588-401e-ba48-fa0b59e168bf | leggedrobotics/ocs2 | ocs2_robotic_examples/ocs2_legged_robot/src/gait/LegLogic.cpp | #include "ocs2_legged_robot/gait/LegLogic.h"
#include "ocs2_legged_robot/gait/MotionPhaseDefinition.h"
namespace {
inline ocs2::scalar_t timingNaN() {
return std::numeric_limits<ocs2::scalar_t>::quiet_NaN();
}
inline bool hasStartTime(const ocs2::legged_robot::ContactTiming& timing) {
return !std::isnan(timing.... | ALGO | 0.990987 | 4.691751 |
5dcf8aeb-8776-4d19-9f2f-a8e5f71c23cf | arpit5104/DSA | 0021-merge-two-sorted-lists/0021-merge-two-sorted-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLis... | ALGO | 0.99985 | 5.6201 |
bd4fd2bb-aebc-4c92-a56f-6ff8c987032f | MFHamilton/clonigFinal | 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.998733 | 6.76775 |
92d4723a-00e7-4a39-96a5-281712c36351 | syuu1228/bhyve | contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp | #define DEBUG_TYPE "loop-unroll"
#include "llvm/Transforms/Utils/UnrollLoop.h"
#include "llvm/BasicBlock.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopIterator.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm... | ALGO | 0.941665 | 7.31198 |
f0c582f0-0aad-44a0-bf4a-47097c39048b | amalenar/Oops_c- | class_objects.cpp | #include <iostream>
#include <cmath>
using namespace std;
class rectangle{
private:
float length,breadth,area;
public:
void setValues(float l,float b){
length=l;
breadth=b;
}
float calcArea(){
area=length*breadth;
return area;
... | ALGO | 0.982909 | 4.107644 |
033b8beb-0766-443c-83c6-cd6ea6086d78 | komaljot/Practice-GFG | Medium/Median in a row-wise sorted Matrix/median-in-a-rowwise-sorted-matrix.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 lessthaneqto(vector<int>&R,int mid){
int cnt=0;
int low=0;
int high=R.size()-1;
while(low<=high){
int m=(low+h... | ALGO | 0.999944 | 5.714993 |
b212d465-1082-4a9e-a84b-9d8fab2e26fa | sonianurag02/Leetcode | 1371. Find the Longest Substring Containing Vowels in Even Counts.cpp | // ---------------------------------------- Approach - 1 -------------------------------------------
class Solution {
public:
int findTheLongestSubstring(string s) {
unordered_map<string, int> mp;
vector<int> state(5, 0);
string currState = "00000";
mp[currState] = -1;
in... | ALGO | 0.999324 | 6.005648 |
b02b9def-7e24-4012-bdb0-e597925f5aa3 | e1810/kyopro | ac/arc057/arc057_a/13670408.cpp | #pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>... | ALGO | 0.999852 | 3.054551 |
2063d964-3b40-4438-9077-9d0a6b5d535b | GJLaughlin/CarND-Path-Planning-Project | src/Eigen-3.3/doc/examples/TemplateKeyword_flexible.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
template <typename Derived1, typename Derived2>
void copyUpperTriangularPart(MatrixBase<Derived1>& dst, const MatrixBase<Derived2>& src)
{
/* Note the 'template' keywords in the following line! */
dst.template triangularView<Upper>() = src.template... | TOOL | 0.981191 | 5.804369 |
de88da50-1d1c-413d-a417-ab329aa0e760 | hs094/CP | AtCoder/AtCoder Regular Contest 144/C_-_K_Derangement.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
#define ar array
#define ll long long
#define ld long double
#define sza(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()
#define forn(i, n) for (in... | ALGO | 0.999811 | 3.783915 |
e2b771fe-41a7-4e76-b1f7-9065f1ac33e5 | RahulScripted/DSA | Pointers/DoublePointer.cpp | // Store Address of a single pointer or we can say double pointer
#include<iostream>
using namespace std;
int main(){
int num= 90;
int *n = #
cout<<"Address : "<<n<<" and value : "<<*n<<" stored by single pointer"<<endl;
int **ptr = &n;
cout<<"Address : "<<ptr<<" and value : "<<*ptr<<" stored by do... | ALGO | 0.996769 | 4.009886 |
b46f56fc-14c3-4eb8-bb33-b2d0a1a050ed | mohdzafeer/DSA | Leet6.cpp | // #include <iostream>
// using namespace std;
// int reversearray(int arr[], int n)
// {
// int s = 0;
// int e = n - 1;
// while (s < e)
// {
// swap(arr[s], arr[e]);
// s++;
// e--;
// }
// }
// int printarray(int arr[], int n)
// {
// for (int i = 0; i < n; i++)
// ... | ALGO | 0.99817 | 5.343646 |
c18e9481-0ae6-4e65-976c-a00b69e78952 | takamtd/deepmimic | bullet3/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp | #include "btContactConstraint.h"
#include "BulletDynamics/Dynamics/btRigidBody.h"
#include "LinearMath/btVector3.h"
#include "btJacobianEntry.h"
#include "btContactSolverInfo.h"
#include "LinearMath/btMinMax.h"
#include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
btContactConstraint::btContactConstraint(b... | ALGO | 0.991651 | 3.107421 |
1b9cd77f-7eee-40db-8d06-034bf3538105 | phorn1/subscale_latex | vs_project/SUBSCALE_GPU-master/SubscaleGPU/DoubleHashing/DoubleHash.cpp | #include "DoubleHash.h"
#include <stdexcept>
//
// Generic hash function
template<typename keyT>
template<uint nRounds, uint rShift, uint mulOp>
uint DoubleHash<keyT>::hash(const keyT key)
{
keyT x = key;
for (uint j = nRounds; j > 0; --j) {
x = ((x >> rShift) ^ x) * mulOp + j;
}
return (uint)... | ALGO | 0.998111 | 6.383245 |
ce46e12e-5ba3-4363-9f3f-0311b4c8cd12 | g-gisbert/Inpainting-Holes-In-Folded-Fabric-Meshes | deps/libIGL/include/igl/project_isometrically_to_plane.cpp | template <
typename DerivedV,
typename DerivedF,
typename DerivedU,
typename DerivedUF,
typename Scalar>
IGL_INLINE void igl::project_isometrically_to_plane(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedU> & U,
Eigen::PlainObjectBase<Deriv... | ALGO | 0.982665 | 5.699068 |
a6913ba9-4348-49e4-850e-d4d74390827e | urbeena/datastructure2 | recursion 3.cpp | //decimal number to binary number
#include<stdio.h>
int binary(int);
int main()
{
int n, b;
printf("enter the number ");
scanf("%d", &n);
binary(n);
return 0;
}
int binary(int n)
{
if(n==0 )
return 0;
if(n==1) {
printf("1");
return 1;
}
else
{
binary(n/2);
printf("%d",n%2... | ALGO | 0.999917 | 3.976045 |
ee769418-853d-4d2a-b1a4-c37dbe6e2b71 | Endocoin/Endocoin | src/zerocoin/Params.cpp | /**
* @file Params.cpp
*
* @brief Parameter class for Zerocoin.
*
* @author Ian Miers, Christina Garman and Matthew Green
* @date June 2013
*
* @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green
* @license This project is released under the MIT license.
**/
#include "Zeroco... | TOOL | 0.884522 | 6.621742 |
869fbbac-d779-4c3b-840e-949d9a886845 | nicyun/DependencyParsingExperiment | src/Predictor.cpp | #include <cassert>
#include <cstring>
#include "Predictor.hpp"
using namespace std;
Predictor::Predictor(Model * pm) : pModel(pm)
{
}
bool Predictor::_decode(
const double f[maxLen][maxLen][2][2],
int s, int t, int d, int c,
const vector<vector<double> > & g,
std::vector<int> & father)
{
if(!c){
for(int... | ALGO | 0.999293 | 4.785622 |
aacbdc39-1a37-4f4b-a9b7-d59fe71c478a | fvcci/Competitive_Programming | Contest/Another_Contest/Score10/C2P2_Poutine.cpp | // https://dmoj.ca/problem/acc2p2
// 02/2021
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <cstring>
#include <array>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <b... | ALGO | 0.999897 | 4.709291 |
91f35c3e-c614-4a3a-b5f3-8dfbe4f48da6 | Hany-Kim/MyAlgo | Minco/Level4/lv29_2_최소이동_네비게이션.cpp | #include <iostream>
using namespace std;
int A, B;
int m[6][6] = {
0,0,1,0,1,1,
1,0,0,1,0,0,
0,0,0,0,1,0,
1,0,0,0,0,0,
1,0,0,0,0,0,
0,0,0,0,0,0
};
int pathCnt;
void input() {
cin >> A >> B;
}
void dfs(int now) {
cout << now << " ";
for (int to = 0; to < 6; to++) {
if (m[now][to] == 1) {
dfs(to);
}... | ALGO | 0.999954 | 4.121485 |
9f502829-7d32-4354-aca9-7597a6d2fec8 | DoomHammer/ohMediaPlayer | OpenHome/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.999208 | 7.17864 |
94a21afe-9a6a-4b08-b673-d106e9544d8d | TheParadox20/competitive_programming | homeworkSumPoint/C++/algC.cpp | #include <iostream>
using namespace std;
int main(){
//display welcoming statement
cout<<"Welcome to the Homework Point Sum program!"<<endl;
//initialize the variables assignments and score to be used in the loop
double assignments=0;
double score =0;
while (true)
/*
the while loop c... | TOOL | 0.97012 | 3.325842 |
1a3d96db-7439-4e27-a761-cf696a805204 | davidchai21/leetcode-solutions | 479 Largest Palindrome Product/LargestPalindromeProduct.cpp | class Solution {
public:
int largestPalindrome(int n) {
if (n==1) return 9;
int upper=pow(10,n)-1;
int lower=pow(10,n-1);
for (int i=upper;i>=lower;i--)
{
long t=buildPalindrome(i);
for (long j=upper;j*j>=t;j--) {
if (t%j==0 && t/j<=upp... | ALGO | 0.999769 | 6.003784 |
f6a1905a-2c9a-447f-8701-360d7f712b8a | CodeBySushant/SolvedLeetcode | leetcode-main/leetcode-main/solution/3100-3199/3104.Find Longest Self-Contained Substring/Solution.cpp | class Solution {
public:
int maxSubstringLength(string s) {
vector<int> first(26, -1);
vector<int> last(26);
int n = s.length();
for (int i = 0; i < n; ++i) {
int j = s[i] - 'a';
if (first[j] == -1) {
first[j] = i;
}
las... | ALGO | 0.999978 | 5.375196 |
a8a7da3b-6406-417b-b5f0-cb0fbc34be77 | itsAbhinavBansal/DSAProblems | Search in Rotated Sorted Array.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int left=0,right=nums.size()-1;
while(left<=right){
int mid = (left+right)/2;
if(nums[mid]==target)return mid;
if(nums[left]<=nums[mid]){
if(nums[left]<=target && target<=nums[mid... | ALGO | 0.999908 | 6.219175 |
57d6de3a-8eca-4cdf-92e1-9e7e6c5ad7c3 | sgNicola/ACsim | autoware/src/universe/autoware.universe/common/interpolation/test/src/test_interpolation_utils.cpp | #include "interpolation/interpolation_utils.hpp"
#include <gtest/gtest.h>
#include <vector>
constexpr double epsilon = 1e-6;
TEST(interpolation_utils, isIncreasing)
{
// empty
const std::vector<double> empty_vec;
EXPECT_THROW(interpolation_utils::isIncreasing(empty_vec), std::invalid_argument);
// increase... | TEST | 0.952835 | 7.227461 |
f17627f6-5ce9-48b7-afb9-f14c0947c025 | SebastianK1999/OpenGL-models | 05-Bubbles/src/Main/SpheresInstances.cpp | #include "SpheresInstances.hpp"
void SpheresInstances::move(float dt){
for(int i = 0; i < sizeInstances; i++){
this->pos[i][1] += this->scale[i][1]*8*dt;
this->scale[i][0] *= 1.0+1e-3;
this->scale[i][1] *= 1.0+1e-3;
this->scale[i][2] *= 1.0+1e-3;
if(this->pos[i][1] - this->s... | TOOL | 0.877727 | 3.896929 |
b2b5d1c1-edc1-45bb-b9c2-7ffed5cdad96 | farhad-mahmud/Competitive-Programming | CP 2025/prefsum.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define gcd(x,y) __gcd(x,y)
#define lcm(x,y) ((x/gcd(x,y)) * y)
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define yes cout << "YES\n";
#define no cout << "NO\n";
#define all(x) (x.begin(),x.end()) ;
co... | ALGO | 0.99991 | 4.884355 |
1db21410-04fe-44fd-8132-f295cf15ec80 | st107036/programming-c-2022-autumn | 2022.10.26-Homework-2/Task4/Source.cpp | #include<iostream>
int main(int argc, char* argv[])
{
int a = 0;
int b = 0;
int c = 0;
int d = 0;
std::cin >> a >> b >> c >> d;
if (a == 0 and b == 0)
{
std::cout << "INF";
}
else
{
if (a == 0 or b % a != 0 or c * (-b / a) + d == 0)
{
std::cout << "NO";
}
else
{
std::cout << -b / a << std::... | ALGO | 0.999851 | 3.716629 |
6ed430e1-8545-4670-ada4-c8e5619d494b | kunalbandooni/Codeforces-problem_set | 1715A - Crossmarket.cpp | #include <iostream>
using namespace std;
int main(){
int test;
cin>>test;
while(test--){
int n, m;
cin>>n>>m;
if(n == 1 and m == 1)
cout<<0;
else{
int ans = n-1 + m-1 + min(n,m);
cout<<ans;
}
cout<<endl;
... | ALGO | 0.999962 | 4.767331 |
4d09c0e7-ed48-4f90-93db-b7dc5951a1fe | wpivex/TP2021_Shared | Utility/TrapezoidController.cpp | #include "TrapezoidController.h"
/*
A trapezoidal object allows you to approach the targetValue from any starting value.
The direction is dtermined by starting value (from first tick() call)
rampUp is determined by numRampUpFrames, which linearly interpolates from 0 to maxSpeed over the number of frames (so over time,... | ALGO | 0.966532 | 5.538635 |
34797e76-19d7-48fd-b68b-e24f526fd06f | viktorPijanec/Projekt-R | src/pimavilo_mapper.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <getopt.h>
#include <cstdlib>
#include <algorithm>
#include "bioparser/fasta_parser.hpp"
#include "bioparser/fastq_parser.hpp"
#include <cstddef>
#include <cstdlib>
#include "pimavilo/Align.h"
#include "pimavilo/Minimizers.hpp"
#include... | DATA | 0.965361 | 5.139169 |
7b4967d4-977f-4c24-a4cd-2253c37120a8 | MooYongArin/grader-algoritm-design | 04-graph/pandemic/pandemic.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int r, c, t;
cin >> r >> c >> t;
int arr[r][c], infected = 0;
queue<pair<int, int>> q;
for (int i = 0; i < r; i++)
{
for (int j = 0; j < c; j++)
{
cin >> arr[i][j];
if(arr[i][j] == 1) { q.push({i, ... | ALGO | 0.99996 | 4.801596 |
a908955a-a0f6-4e99-a065-de7c17b51c03 | MohitBaid/CodeChef | Long Challenge/SEPT17/SEACO.cpp | #include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;
int main()
{
int T; cin>>T;
while(T--)
{
vector < pair <int,int> > s;
int n,m,i,j; cin>>n>>m;
long long int B[m+2],C[m+2],D[m+2];
long long int A[n+2];
for(i=0;i<=m+1;i++) B[i]=0,C[i]=0,D[i]=0;
for(i=0;i<=n+1;i++) A[i]=0;
for(i=1;i<=m... | ALGO | 0.999805 | 3.349481 |
fcb1d289-d2d2-42f9-aaaa-b3ca93a7b604 | abovethe-clouds/ACM | c++/数据结构/二叉树/P3373.cpp | #include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
#define endl "\n"
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
const int maxn=1e6+5;
ll m,n,q,arr[maxn];
struct point
{
ll data,lazy_tag_add,lazy_tag_x;
}tree[4*maxn];
i... | ALGO | 0.999799 | 4.615552 |
a790b5f3-d0a4-4231-851c-cf22d53a3fb4 | re1yun/Algorithm_Study | SWEA/D3/1216. [SW 문제해결 기본] 3일차 - 회문2/1216. [SW 문제해결 기본] 3일차 - 회문2.cpp | #include <iostream>
using namespace std;
int main(){
int T = 10;
for(int test = 1; test <= T; test++){
int answer = 0;
// init
// normalMap: normal map, transMap: transposed map, nDpMap: normal map's dp, tDpMap: trans map's dp
char normalMap[100][100];
char transMap[100... | ALGO | 0.999816 | 3.843516 |
b4814028-2775-483a-9b61-653065eada03 | newpolaris/Mikudayo | 3rdParty/bullet3-2.86.1/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp | #if defined (_WIN32) || defined (__i386__)
#define BT_USE_SSE_IN_API
#endif
#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
#include "btConvexPolyhedron.h"
#include "LinearMath/btConvexHullComputer.h"
#include <new>
#include "LinearMath/btGeometryUtil.h"
#include "LinearMath/btGrahamScan2dConvexHu... | ALGO | 0.984252 | 7.026882 |
63765fd5-eed4-42e4-bcbc-275421e53370 | Lewuathe/mlir-hello | thirdparty/llvm-project/llvm/lib/CodeGen/IfConversion.cpp | #include "BranchFolding.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SparseSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/Co... | ALGO | 0.990049 | 5.487949 |
7f332efc-6227-49ce-9731-715ad0a661b4 | ishandutta2007/codeforces | kristevalex/normal/1567/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false); \
cin.tie(nullptr); \
cout.tie(nullptr)
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pai... | ALGO | 0.999854 | 4.311517 |
d2c612d7-2689-4f71-bfa4-5df9cf68cb99 | Jbernardiss/codeStylometryResearch | data/dataset-v2/Snuke/Snuke-c1-2022-worldFinals.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < (t); ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define fi first
#define se seco... | ALGO | 0.999898 | 3.720547 |
69e1129e-fb27-4930-9ef6-63dd5250624f | ishandutta2007/codeforces | rush_d_cat/normal/1092/B.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int N=200000+10;
int n,a[N];
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
sort(a+1,a+1+n);
int ans=0;
for(int i=1;i<=n;i+=2){
ans+=a[i+1]-a[i];
}
cout<<ans<<endl;
} | ALGO | 0.999864 | 3.62767 |
db73d703-9ca7-4945-8e94-d8ea45fd36d3 | Sachin10-05/Introduction_to_cpp_coding_ninja | Operators & For Loop/Check Number Sequence.cpp | /*
Problem
-------
You are given S, a sequence of n integers i.e. S = s1, s2, ..., sn. Compute if it is possible to split S into two parts :
s1, s2, ..., si and si+1, si+2, ….., sn (0 <= i <= n) in such a way that the first part is strictly decreasing while the second is strictly increasing one.
Note : We say that x ... | ALGO | 0.999974 | 4.684248 |
98b5c6c5-9be8-4abf-b10c-2d558eeb2687 | shuaills/myECE408 | mini-dnn/third_party/eigen/unsupported/doc/examples/MatrixPower.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
Matrix3d A;
A << cos(1), -sin(1), 0,
sin(1), cos(1), 0,
0 , 0 , 1;
std::cout << "The matrix A is:\n" << A << "\n\n"
"The matrix power A^(pi/4) is:\n"... | ALGO | 0.999768 | 3.790203 |
6ed16b52-21bb-4cc3-9474-357d8d5af967 | Rtk10000/DIAS-Summer-Internship | C++/D0-Branes/D0-BranesNis2/eigen/bench/bench_norm.cpp | #include <typeinfo>
#include <iostream>
#include <Eigen/Core>
#include "BenchTimer.h"
using namespace Eigen;
using namespace std;
template<typename T>
EIGEN_DONT_INLINE typename T::Scalar sqsumNorm(T& v)
{
return v.norm();
}
template<typename T>
EIGEN_DONT_INLINE typename T::Scalar stableNorm(T& v)
{
return v.sta... | TEST | 0.951843 | 6.694365 |
3b7d89a6-d8fd-4f7c-9892-6cc99d931efa | trdln/First-Main-folder-of-PP1-2 | PROgrammer/c.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
//freopen("input.txt", "r", stdin);
vector <int> v;
int a;
cin >> a;
while(a--){
int b;
cin >> b;
v.push_back(b);
}
int cnt=0; int mx=INT_MIN;
for(int i=a-1;i>=0;--i){
if(mx<v[i]){cnt++;mx=... | ALGO | 0.999872 | 3.766913 |
81658ca7-96fe-46f0-bdda-3766438cc6bf | enryu100/ICT398Project_BMK-Squared | Source Code/godotVS/core/math/bsp_tree.cpp | /*************************************************************************/
/* bsp_tree.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... | ALGO | 0.983364 | 5.799776 |
066ad48b-55ed-4094-8761-748d4b5fed4c | ishandutta2007/codeforces | tadijasebez/normal/283/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ldb double
const int N=200050;
int a[N],add[N];
int main(){
int q,n=1;
ldb sum=0;
scanf("%i",&q);
while(q--){
int t,x,y;
scanf("%i",&t);
if(t==1){
scanf("%i %i",&x,&y);
x=min(x,n);
add[x]+=y;
sum+=y*x;
}else if(t==2){
scanf("%i",&x);
a[... | ALGO | 0.998467 | 3.427656 |
807f0435-f0fb-4c35-af65-dbdb439f2e5f | PSR0001/CPP-OOP | console_io_flag_self.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main(){
cout.fill('*');
cout.setf(ios::left,ios::adjustfield);
cout.width(10);
cout<<"VALUE";
cout.setf(ios::right,ios::adjustfield);
cout.width(10);
cout<<"SORT OF VALUE";
cout.fill('.');
cout.precision(40);
cout.setf(ios::showpoint);
cout.set... | ALGO | 0.999172 | 3.252056 |
1878b7a7-5a63-4bdc-9f26-0d4fab714fbf | HONGYANGGAN/leetcode | solution/0500-0599/0507.Perfect Number/Solution.cpp | class Solution {
public:
bool checkPerfectNumber(int num) {
if (num == 1) return false;
int s = 1;
for (int i = 2; i * i <= num; ++i) {
if (num % i == 0) {
s += i;
if (i != num / i) s += num / i;
}
}
return s == num;
... | ALGO | 0.999891 | 6.035422 |
c182d64b-90f3-46a6-9307-aaa9a081bfb9 | Aidoshq/pp_1 | lab works/j.cpp | #include <bits/stdc++.h>
using namespace std;
int main () {
int n;
cin>>n;
map<string , int> a;
for(int i=0; i<n; i++){
string s;
cin>>s;
int k;
cin>>k;
a[s]+=k;
}
map <string,int> :: iterator f=a.begin();
for(;f!=a.end(); f++){
cout<<f->first<<"... | ALGO | 0.999227 | 3.546175 |
690f3b22-717b-472e-9a41-3c2e4745fd19 | VuThiMinhThu2004/DSA | WEEK8/Prim.cpp | #include "bits/stdc++.h"
using namespace std;
typedef pair<int, int> ii;
const int maxn = 1005;
int n, m;
vector<ii> adj[maxn];
bool taken[maxn];
void input() {
cin >> n >> m;
for (int i = 1; i <= m; i++) {
int u,v,w; cin >> u >> v >> w;
adj[u].push_back({v,w});
adj[v].push_back({u,w}... | ALGO | 0.999942 | 4.478741 |
762f0436-5fc3-4c28-b0f3-5c453fab07fe | ishandutta2007/codeforces | scott_wu/normal/172/B.cpp | #include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
int main()
{
int last[100100];
for (int i = 0; i < 100100; i++)
last[i] = -1;
int a, b, m, r;
int num = 0;
cin >> a >> b >> m >> r;
... | ALGO | 0.999975 | 3.355004 |
4550135e-8581-466a-b734-c21eb68f1963 | ishandutta2007/codeforces | nikarabika/normal/653/C.cpp | //sobskdrbhvk
#include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
typedef long double LD;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
#define PB push_back
#define MP make_pair
#define L first
#define R second
#define sz(x) ((int)(x).size())
#define smax(x, y) ((x) = max((x), (y)))
#defi... | ALGO | 0.999972 | 3.863289 |
497bfbae-e354-44df-83ae-f0d33798f0d3 | sharmista2shastry/Data-Structures-and-Algorithms | Trees/CountNodes.cpp | /************************************************************
Following is the structure for the TreeNode class
template <typename T>
class TreeNode {
public:
T data;
vector<TreeNode<T>*> children;
TreeNode(T data) {
this->data = data;
}
... | ALGO | 0.999971 | 5.244608 |
3fc5a5ed-f6dc-4eaa-a0b7-f7af2e99f88b | DuyTaDinh/Code.ptit.TaDuy | DSA C++/DSA06003.cpp | #include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define pb push_back
const int MAXN = 1e5 + 5;
const ll mod = (ll)1e9 + 7;
int main() {
SPEED; int t; cin >> t;
while (t--) {
int n;
cin>>n;
int a[n];
for(auto &i: a) cin>>i;
... | ALGO | 0.999788 | 3.865258 |
30c56653-35a2-49de-9196-3f49d3c818e5 | bazelment/boost | algorithm/string/example/trim_example.cpp | // Boost string_algo library example file ---------------------------------//
// See http://www.boost.org for updates, documentation, and revision history.
#include <string>
#include <iostream>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/classification.hpp>
using namespace std;
usi... | TOOL | 0.954879 | 6.979093 |
09947a2d-26db-424b-9652-3fcac7d505f7 | Justpenz233/ConformableMechanism | Engine/ThirdParty/libigl/include/igl/copyleft/cgal/coplanar.cpp | #include "coplanar.h"
#include "row_to_point.h"
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Point_3.h>
template <typename DerivedV>
IGL_INLINE bool igl::copyleft::cgal::coplanar(
const Eigen::MatrixBase<DerivedV> & V)
{
// 3 points in 3D are always coplanar
if(V.rows() < 4){ re... | ALGO | 0.996519 | 5.946558 |
55cdd973-9263-4096-b0b4-67dc2ce3be70 | absela/CP-bootcamp | bootcamp-day02/ArrayDivision.cpp | #include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;
bool issub(const vector<int>& arr, int n, int k, long long maxSum) {
int count = 0;
long long sum = 0;
for (int i = 0; i < n; i++) {
if (arr[i] > maxSum)
return false;
su... | ALGO | 0.999983 | 5.272808 |
f6f5d954-3630-4a7b-9308-bd1817396d8f | gracexiao1029/ComputerGraphics | computer-graphics-meshes/libigl/include/igl/comb_frame_field.cpp | #ifdef WIN32
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#include "comb_frame_field.h"
#include "local_basis.h"
#include "PI.h"
template <typename DerivedV, typename DerivedF, typename DerivedP>
IGL_INLINE void igl::comb_frame_field(const Eigen::MatrixBase<DerivedV> &V,
c... | ALGO | 0.98545 | 6.126972 |
f0e8335c-607c-41e2-b3aa-4c6ae8f49e84 | vaibhavbichave/Leetcode | 0198-house-robber/0198-house-robber.cpp | class Solution {
public:
int rob(vector<int>& nums) {
int n = nums.size();
int prev = 0, curr = 0, next = 0;
for (int i = 0; i < n; i++) {
next = max(prev + nums[i], curr);
prev = curr;
curr = next;
}
return curr;
}
}; | ALGO | 0.999891 | 5.956679 |
daebb0c0-5d2c-431b-b469-fa4ae818bacf | jhbaek04/mfem-4.6 | miniapps/navier/navier_kovasznay.cpp | #include "navier_solver.hpp"
#include <fstream>
using namespace mfem;
using namespace navier;
struct s_NavierContext
{
int ser_ref_levels = 1;
int order = 6;
double kinvis = 1.0 / 40.0;
double t_final = 10 * 0.001;
double dt = 0.001;
double reference_pressure = 0.0;
double reynolds = 1.0 / kinvis... | ALGO | 0.982904 | 5.349883 |
263e4b7a-47a2-4ef3-8f4e-0b08935774dd | metehkaya/Algo-Archive | Problems/CodeSignal/Arcade/The_Core/002.Largest_Number.cpp | int solution(int n) {
return pow(10,n)-1;
}
| ALGO | 0.999195 | 3.202549 |
5a8a7f61-1aeb-430f-bf29-3deeeb76da3e | sgc109/leetcode-solutions | 0523-continuous-subarray-sum/0523-continuous-subarray-sum.cpp | /*
23 2 4 6 7
23 25 29 35 42
5 1 5 5 0
23 2 6 4 7
23 25 31 35 42
5 1 1 5 0
23 2 6 4 7
23 25 31 35 42
10 12 5 9 3
psum[i] = sum(nums[0]..nums[i])
sum(nums[i]..nums[j]) = psum[j] - psum[i - 1]
*/
class Solution {
// [23,2,4,6,7], k = 6
// ^
public:
bool checkSubarraySum(vector<int>& nums, int k) {
... | ALGO | 0.99991 | 5.454484 |
1b5a9a8f-f7e7-4350-b7e6-7eb99a95789e | sarvex/leetcode-beef | solution/0200-0299/0265.Paint House II/Solution.cpp | class Solution {
public:
int minCostII(vector<vector<int>>& costs) {
int n = costs.size(), k = costs[0].size();
vector<int> f = costs[0];
for (int i = 1; i < n; ++i) {
vector<int> g = costs[i];
for (int j = 0; j < k; ++j) {
int t = INT_MAX;
... | ALGO | 0.999915 | 5.789414 |
e0903acf-61aa-46cf-bce4-18104ab947e6 | ishandutta2007/codeforces | tle/normal/1119/D.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
#include <assert.h>
using na... | ALGO | 0.999919 | 3.540261 |
935933bd-8367-4118-96d5-26cae3fa55af | PreviousAlone/Nnngram | TMessagesProj/jni/secureid_ocr.cpp | #include <jni.h>
#include <android/bitmap.h>
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>
#include <android/log.h>
#include <vector>
#include <utility>
#include <string>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libyuv.h>
#inc... | ALGO | 0.987741 | 4.946466 |
082bbfa2-3716-407b-8f83-e4c302ee0e1b | UCASV/AA23 | 03 - Dynamic Programming/01_Fibonacci.cpp | #include <iostream>
using namespace std;
/*
Implementación con DP para obtener el n-ésimo término
de la Sucesión de Fibonacci.
*/
int fibonacci(int n){
//Se crea la estructura de datos
int A[n+1]; //Para Fibonacci es suficiente un arreglo
//Se colocan los casos base
A[0] = 1;
A[1] = 1... | ALGO | 0.999896 | 4.850038 |
f0f458f9-ec9c-4ba0-81b3-af041813f486 | its-Quasi/quasi-notebook | strings/hash.cpp | typedef pair<ll, ll> pii;
const long long base = 1777771;
const long long mod1 = 999727999;
const long long mod2 = 1070777777;
struct Hash {
vector<pii> hs, pot;
Hash(string s) {
hs.resize(sz(s) + 1);
pot.resize(sz(s) + 1);
pot[0] = pii(1, 1);
for (int i = 1; i <= sz(s); i++) {
hs[i].first = ... | ALGO | 0.999918 | 4.451097 |
69ec33b5-8c59-4d19-8f59-3bda0e3b12d3 | ishandutta2007/codeforces | egor.lifar/normal/424/A.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <string.h>
#include <sstream>
#include <queue>
#include <map>
#include <set>
#include <assert.h>
using namespace std;
int n;
string s;
int a, b;
int main() {
cin >> n;
cin >> s;
for (i... | ALGO | 0.999975 | 3.156276 |
6f454d67-301b-45a4-a7de-fa0034bcf91b | Cesar-96/BeeCrowdSolutions | BEGINNER/1151 - Easy Fibonacci.cpp | #include <iostream>
#include<vector>
using namespace std;
int fibo(int x)
{
if(x==1)
{
return 0;
}
else if(x==2)
{
return 1;
}
else {
return fibo(x-1)+fibo(x-2);
}
}
void fibo1(int x)
{
vector<int> vector1;
vec... | ALGO | 0.999946 | 4.606088 |
b42f7389-9ddb-46d3-a760-a77a1397c84a | kchan139/hcmut-archive | Sem241/Data Structures and Algorithms/LABS/LAB 3/11_height_and_traversal.cpp | // STUDENT ANSWER BEGIN
// You can define other functions here to help you.
int heightHelper (Node * root)
{
if (!root) return 0;
int l = heightHelper (root->pLeft);
int r = heightHelper (root->pRight);
return (l > r)? l + 1 : r + 1;
}
void preHelper (Node * root)
{
if (!root) return;
... | ALGO | 0.999874 | 6.495434 |
821801a9-9cc1-46b5-bce0-77fdda90af30 | w1049/Gobang | AIPlayer.cpp | #include "AIPlayer.h"
typedef std::pair<int, ChessPiece> prc;
typedef std::vector<prc> vprc;
namespace AI {
const int SCORE[11] = {100, 60, 60, 50, 60, 16, 12, 13, 5, 3, 0};
const int E_SCORE[11] = {100000, 10000, 1000, 1000, 100, 100, 10, 10, 1, 0};
const int NUM_OF_TYPE[10] = {5, 4, 4, 4, 3, 3, 3, 2, 2, 2};
const i... | ALGO | 0.998083 | 4.581225 |
c943dbde-6d44-4161-b46f-37ccfbe3c29c | r2ba7/LeetCode-Solutions | Remove Linked List Elements.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* removeEleme... | ALGO | 0.999959 | 5.848591 |
21b9cf10-5481-4193-b071-a57d5ad4ae0d | RajAdwaita/cazz | towers.cpp |
#include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i, n) for (i = 0; i < n; i++)
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define ll long long int
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", s)
#define... | ALGO | 0.999891 | 4.508797 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.