uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4935cff9-fe22-4a7b-8d8f-c3b79ae16d7d | sepnic/tmallgenie_open | thirdparty/liteplayer/thirdparty/codecs/pvaac/sbr_reset_dec.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#ifdef LITEPLAYER_CONFIG_AAC_PLUS
#include "sbr_dec.h"
#include "pv_log2.h"
#include "fxp_mul32.h"
#include "sbr_reset_dec.h"
#include ... | TOOL | 0.971402 | 5.964618 |
cb02000f-6f46-4d4f-9ec6-6e6cc90b1eea | btsutskiridze/data-structures | Linked-list implementation.cpp | #include <iostream>
#include <string>
using namespace std;
class Node {
public:
int val;
Node* next;
Node(int Val = 0, Node *Next = 0) :val(Val), next(Next) {}
};
void push_back(int val, Node *head) {
Node* temp = new Node(val);
Node* ptr = head;
while (ptr->next!= 0) {
ptr = ptr->next;
}
ptr->next = tem... | ALGO | 0.998011 | 4.344184 |
b754d2a2-a59e-432f-9375-69f06e85269e | JJungs-lee/problem-solving | BOJ/10866_덱.cpp | #include <iostream>
#include <string>
#include <deque>
using namespace std;
int main(){
int testCase;
int num;
string str;
cin >> testCase;
deque<int> deq;
while(testCase--){
cin >> str;
if(str == "push_front") {
cin >> num;
deq.push_front(num);
} else if(str == "push_back") {
cin >> num;
... | ALGO | 0.999416 | 4.386529 |
eeec72f9-21e8-4940-9963-eb6a26da8345 | jianningzhuang/CS2040C-Data_Structures_and_Algorithms | Week 1/quick_sort.cpp | #include <iostream>
using namespace std;
void print_array(int arr[], int len){
for (int i = 0; i < len; i++){
cout << arr[i] << " ";
}
cout << endl;
}
int partition(int arr[], int start, int end){
int pivot = arr[start];
int m = start; //left and right initially empty
for (int k = start + 1; k <= end;... | ALGO | 0.99996 | 5.56856 |
24e70271-5881-4123-9edd-6118668f420f | raincross7/code-similarity | codes/train_code/problem155/problem155_496.cpp | #pragma region header
#define _GLIBCXX_DEBUG
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>... | ALGO | 0.999985 | 4.647337 |
af973a75-7282-4d6d-9473-520275946dbf | venkataramanan-p/contest | Gunasundari/fifth.cpp | //program to find frequency of each elements in a string
#include<stdio.h>
#include<conio.h>
int main()
{
char s[]={'a','a','a','a','a','a'};
int i,j,k,count=0,n;
for(j=0;s[j];j++)
n=j;
for(i=0;i<n;i++)
{
count=1;
if(s[i])
{
for(j=i+1;j<n;j++)
{
if(s[i]==s[j])
{
count++;
s[j]='... | ALGO | 0.999422 | 3.011548 |
c8f8d768-aaaa-487f-9a97-ea041dbca7cd | NafiHasan/HabiJabi | C++/CSEDU/CSEDU 2022/Assignment/Algo 1 lab 2/johnsons.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 405
const int inf = 1e9;
vector<pair<int, int>> edge[N];
vector<int> h(N, 0);
vector<vector<int>> d(N, vector<int> (N, inf));
class PQ {
private:
pair<int, int> HP[2005];
int sz = -1;
int parent(int i) {
return (i - 1) / 2;
}
int left(int i) {
return ((2... | ALGO | 0.999977 | 3.913616 |
aee33d39-1735-4316-8f11-378328dda340 | prakash-ydv/DSA-Practice | STL/vector/sortin_in_vector.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
// crerate vector and add some elements
vector <int> arr;
arr.push_back(3);
arr.push_back(31);
arr.push_back(13);
arr.push_back(311);
arr.push_back(113);
arr.push_back(131);
cout<<"befor... | ALGO | 0.998259 | 4.442304 |
9c941565-53a5-4616-866f-0c226c122789 | Akira794/Math_Algorithm_ws | books/mathalgo/chp2/prb224.cpp | #include <iostream>
using namespace std;
int32_t N, A[129];
int32_t main()
{
int32_t sum = 0;
cout << "N(1<=N<=128)を代入"<<endl;
cin >> N;
for(uint32_t i = 1u; i <=N; i++)
{
cin >> A[i];
}
for(uint32_t i = 1u; i <=N; i++)
{
sum += A[i];
}
cout << "sum % 100=" << sum % 100 << endl;
re... | ALGO | 0.997404 | 4.114988 |
defeb6be-1a24-4338-99ef-b71b58cfd6b2 | AlexGliesch/competitive-programming | competitions/4a Maratona UFFS/C - A Camara Secreta.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <ciso646>
#include <cstring>
#define MOD(x) ((x) % ((ll)pow(10LL, 9LL)+7LL))
using namespace std;
typedef long long ll;
ll dp[2510][2510];
ll binom(ll n, ll k) {
if (k == 0 or k == n) return 1;
if (dp[n][k] == -1... | ALGO | 0.999688 | 4.47904 |
64cb891c-5fa8-4e82-aaa1-77aa481e0eab | aryashsaxena/leetcode_problems | maximize-the-confusion-of-an-exam/maximize-the-confusion-of-an-exam.cpp | class Solution {
public:
int maxConsecutiveAnswers(string s, int k) {
int i=0,j=0;
int mx=0,count=0;
int K=k;
while(j<s.size()){
if(s[j]=='F') count++;
if(count>k){
while(count>k && i<s.size()){
if(s[i]=='F') count--;
... | ALGO | 0.9999 | 6.330512 |
da96690c-c8bd-4e10-9305-0eb9bdd58a98 | jriegel/FreeCAD | src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cpp | #include "NETGENPlugin_Mesher.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMESHDS_Mesh.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "StdMeshers_FaceSide.hxx"
#include "StdMeshers_MaxElementArea.hxx"
#incl... | TOOL | 0.853348 | 6.576319 |
6d3f8d6b-b5f3-48a5-bcc9-bc42bdccea9b | raincross7/code-similarity | codes/train_code/problem355/problem355_191.cpp | #include<bits/stdc++.h>
using namespace std;
int res[100005],n;
string s;
int main(){
cin>>n>>s;
for(int i=0;i<2;i++)
for(int j=0;j<2;j++){
res[0]=i;
res[1]=j;
bool flag=true;
for(int k=2;k<n;k++)
res[k]=(s[k-1]!='o')^res[k-1]^res[k-2];
for(int k=0;k<n;k++){
int a=(k-1+n)%n,b=(k+1+n)%n;
... | ALGO | 0.9999 | 3.502461 |
d1ba08e6-307d-4ea9-aa6d-86339fa71213 | Jiwan/RADS | thirdparty/boost/libs/polygon/doc/tutorial/minkowski.cpp | #include <iostream>
#include <boost/polygon/polygon.hpp>
typedef boost::polygon::point_data<int> point;
typedef boost::polygon::polygon_set_data<int> polygon_set;
typedef boost::polygon::polygon_with_holes_data<int> polygon;
typedef std::pair<point, point> edge;
using namespace boost::polygon::operators;
void convolv... | ALGO | 0.999608 | 6.183134 |
d94f8c98-012a-457c-bce5-3f4ff5e7e100 | allem40306/Competitive-Programming | uva/Volume107/uva10763.cpp | #include <bits/stdc++.h>
using namespace std;
struct node{
int x,y;
node(){};
node(int x,int y):x(x),y(y){}
bool operator <(const node&b)const{
if(x!=b.x)return x<b.x;
return y<b.y;
}
bool operator ==(const node&b)const{
return x==b.x&&y==b.y;
}
};
int main(){
int... | ALGO | 0.999953 | 4.3702 |
c9c5cdb1-7262-4220-8690-794f4357d1f9 | Little-Blueberries/myDSAResult | DSA/Test/test_17/BTree.cpp | #include "BTree.hpp"
#include "stdc++.hpp"
using namespace std;
// Constructor khởi tạo nút của một cây
BNode::BNode(bool _isLeaf, int _t) {
// Sao chép mức độ tối thiểu và thuộc tính lá
this->t = _t;
this->isLeaf = _isLeaf;
// Phân bổ bộ nhớ cho mảng khóa và mảng nút con
// Số lượng khóa tối đa là 2t-1, số lượ... | ALGO | 0.99977 | 4.509411 |
e52d7f60-c4c3-4aab-abbb-67f241ec448a | RuairidhScott-Brown/Lid-Driven-Cavity-Solver | src/SolverCG.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <mpi.h>
#include <omp.h>
#include <cmath>
using namespace std;
#include <cblas.h>
#include "../include/SolverCG.h"
#define IDX(I,J) ((I)*m_Nx + (J))
/**
* @brief Construct a new SolverCG:SolverCG object.
*
* @param pNx Numbe... | ALGO | 0.999852 | 4.29931 |
c3c61121-c8fe-4fa2-8b7e-5373b2f8aef2 | noko206/AtCoder | abc/251-300/267/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _REP(i,n) REPI(i,0,n)
#define REPI(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,REPI,_REP,)(__VA_ARGS__)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
typedef... | ALGO | 0.999994 | 3.716623 |
16024a14-79e3-4437-ae95-68341d0257e2 | jswistak/AlgorithmicTasks | Kosmiczna lamigowka/main.cpp | #include <iostream>
#include <math.h>
#include <vector>
#include <queue>
using namespace std;
unsigned long long ile, a, b, c;
unsigned long long x;
long long pierwsza[1000100];
int wierzcholkow = 1;
int tab[200][200][200];
long long odleglosc;
struct pol{
int a;
int b;
int c;
int dist;
};
int odl;... | ALGO | 0.999654 | 3.833733 |
2f5cba37-87c6-4be4-90fb-302334b57872 | LiuqianGongyp/MPSI_BF_ElGamal | MPSIP2/tel.cpp |
#include "pch.h"
#include "tel.h"
using namespace std;
using namespace NTL;
void TElSetup(int l, ZZ* P, ZZ* Q, ZZ* G)
{
switch (l) {
case 12:
*P = 2207;
*Q = 1103;
*G = 1425;
break;
case 16:
*P = 57803;
*Q = 28901;
*G = 43052;
break;
case 25:
*P = 17842883;
*Q = 8921441;
*G = 9372126;
brea... | ALGO | 0.998642 | 3.559559 |
ea8d1911-96ac-437c-b961-0a0ff6090ea4 | yaqoobcs/evosnns | Evosnn/Ga.cpp | #include "stdafx.h"
#include "Ga.h"
#include "UtilityFunctions.h"
#include <string>
#include <algorithm>
#include <ctime>
using namespace std;
Ga::Ga(void)
{
history.clear();
keepGen0Elites.clear();
signalSiquence.clear();
correctIndecies.clear();
}
void Ga::run(vector<Individual>& pop, int genNo)
{
string sign... | ALGO | 0.999889 | 3.81535 |
0e79f9a9-1d04-4a51-89ae-6c2d08251936 | ishandutta2007/codeforces | superpear/normal/603/C.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <set>
#include <utility>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int,int> PII;
typedef pair<int,PII> PIII;
#define LL long long
#def... | ALGO | 0.999985 | 3.807958 |
cf569244-21e4-4b71-88fe-a04e2ce2c853 | pentsinh/winlike-file-system- | DISK_C/BORLANDC/TVISION/DOCDEMOS/TVGUID19.CPP | /*---------------------------------------------------------*/
/* */
/* Turbo Vision 1.0 */
/* TVGUID19.CPP Demo Source File */
/* */
/*-------... | ALGO | 0.999188 | 5.956979 |
b7272015-11f4-4211-bf3f-d24d8d8efd48 | yousef-mohsen/Competitive-Programming-Problems | Codeforces/A. The Elder Trolls IV: Oblivon/A. The Elder Trolls IV: Oblivon/main.cpp | //
// main.cpp
// A. The Elder Trolls IV: Oblivon
//
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
ios::sync_with_stdio(0); cin.tie(0);
long long x, y, z, k;
long long ans = 0;
cin>>x>>y>>z>>k;
long long x1 = min(x,min(y,z));
long long z1 = max (max(x,... | ALGO | 0.999734 | 3.921525 |
37e0e40e-75ae-49fa-9ee4-ea50bd1da50d | northmachine/pat_test | a1129_ans.cpp | #include <bits/stdc++.h>
using namespace std;
int book[50010];
struct node{
int value,cnt;
bool operator < (const node &a)const{
return (cnt!=a.cnt)?cnt>a.cnt:value<a.value;
}
};
int main(){
int n,k,num;
scanf("%d %d",&n,&k);
set<node> s;
for(int i=0;i<n;i++){
scanf("%d",&num);
if(i!=0){
printf("%d:",nu... | ALGO | 0.999881 | 3.171376 |
c6aacb82-1e1e-4d68-a139-00a3e9b3513c | ddowling/SecurityTools | ntpcheck/ntpcheck.cpp | #include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <getopt.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#ifndef S... | TOOL | 0.883297 | 4.745801 |
f8d66835-8753-4eef-b742-be8b47583f20 | RobaaedAfred/Beecrowd-Problems | 1011.cpp |
#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
double pi=3.14159,R,v;
cin>>R;
v=(4/3.0)*pi*R*R*R;
cout<<"VOLUME = "<<fixed<<setprecision(3)<<v<<endl;
return 0;
}
| ALGO | 0.997232 | 4.71144 |
dac90774-f411-495d-81c9-55e1db4b0e84 | darkshadoww/Heuristics-CodeForces-GYM | 100866/D.cpp | #include<bits/stdc++.h>
using namespace std;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg... | ALGO | 0.988778 | 3.414833 |
16125c7c-dde0-453c-8e37-ae4be85b8933 | kusumpriya19/Data_Structures_Algorithms | Distance from the Source (Bellman-Ford Algorithm) - GFG/distance-from-the-source-bellman-ford-algorithm.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
public:
/* Function to implement Dijkstra
* adj: vector of vectors which represents the graph
* S: source vertex to start traversing graph with
* V: number ... | ALGO | 0.999964 | 4.54493 |
c3f7aa6e-5ce3-4fc2-8782-f2eef421ef15 | ZhongZeng/Leetcode | lc256ptHs.cpp |
/*
Leetcode 256. Paint House
Companies
Linkedin
Related Topics
Dynamic Programming
Similar Questions
House Robber, House Robber II, Paint House II, Paint Fence
Next challenges: Paint House II, Paint Fence
Test Cases:
[[1,2,3],[2,1,3],[9,10,8]]
[[1,2,3]]
[]
Runtime: 6 ms
Your runtime beats 8.09 % of cpp submiss... | ALGO | 0.999966 | 6.050123 |
36d57de5-f2ad-45c1-b5a2-9a19f91aedd5 | LarsIsGaming/Ender3Marlin | Marlin/src/gcode/bedlevel/abl/G29.cpp | /**
* G29.cpp - Auto Bed Leveling
*/
#include "../../../inc/MarlinConfig.h"
#if HAS_ABL_NOT_UBL
#include "../../gcode.h"
#include "../../../feature/bedlevel/bedlevel.h"
#include "../../../module/motion.h"
#include "../../../module/planner.h"
#include "../../../module/stepper.h"
#include "../../../module/probe.h"
#... | ALGO | 0.976081 | 7.785545 |
87fe8903-b09c-4b2b-9d9a-a29827177d0f | Pyeongtaek-Algorithm-Study/Baekjoon | Greedy/1339번 - 단어 수학/solve.cpp | #include <iostream>
#include <map>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
map<char, int> m;
int N;
vector<string> str;
bool cmp(pair<char, int>& a, pair<char, int>& b) {
return a.second > b.second;
}
int main()
{
cin >> N;
for(int i = 0; i < N; i+... | ALGO | 0.999795 | 4.248319 |
79147552-b109-4fce-9ed9-b6a0238bd57c | johnsusi/adventofcode | 2019/day18/main.cpp | #include <fstream>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <string>
using Position = std::pair<int, int>;
const auto left = Position{-1, 0};
const auto right = Position{1, 0};
const auto up = Position{0, -1};
const auto down = Position{0, 1};
template <typename T>... | ALGO | 0.999547 | 5.970847 |
5a33599b-14ee-4465-a2e7-79c95288f2df | P41NT/Competitive-Programming | Codeforces/1997B_MakeThreeRegions/B. Make Three Regions.cpp | #include <bits/stdc++.h>
using namespace std;
namespace __DEBUG_UTIL__
{
using namespace std;
/* Primitive Datatypes Print */
void print(const char *x) { cerr << x; }
void print(bool x) { cerr << (x ? "T" : "F"); }
void print(char x) { cerr << '\'' << x << '\''; }
void print(signed short int x... | ALGO | 0.999559 | 4.594526 |
0ee2448d-2d38-4e22-af17-986b00f23fc2 | Sputnoy/Conways-Game-of-Life | life.cpp | const int x_size = 250;
const int y_size = 250;
int neighbours;
int counter = 0;
int space[2][y_size][x_size];
void clear_space(){
for (int l = 0; l < 2; l++){
for (int i = 0; i < y_size; i++){
for(int i2 = 0; i2 < x_size; i2++){
space[l][i][i2] = 0;
}
}
}
}
void print_space(){
for (int i3 = 0; i3 <... | ALGO | 0.98687 | 3.474419 |
4d6db2c7-6c02-4c14-8f3a-7698d44c6989 | nxphuc/LeetCode | algorithms/0188-best-time-to-buy-and-sell-stock-iv.cpp | // Title: Best Time to Buy and Sell Stock IV
// Source: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv
// Difficulty: Hard
// Tags: Array, Dynamic Programming
// Author: nxphuc
// Time Complexity: O(N*K))
// Space Complexity: O(N*K)
// Note:
/**
* You are given an integer array prices where prices[... | ALGO | 0.999907 | 6.426337 |
130e6318-dce9-4274-88d7-5bec0a0936c7 | shjii/Map-Tool | Myprojects/2DLibCore/sCollision.cpp | #include "sCollision.h"
bool sCollision::RectInpt(RECT rt, POINT pt)
{
return (pt.x >= rt.left &&
pt.x <= rt.left + rt.right &&
pt.y >= rt.top &&
pt.y <= rt.top + rt.bottom);
}
bool sCollision::Rect2Rect(RECT rtDesk, RECT rtSrc)
{
POINT cDesk, cSrc, Radius, DeskRadius, SrcRadius;
cDesk.x = (rtDesk.left +... | ALGO | 0.980746 | 4.797773 |
7ace8e38-0ab0-4107-8935-03e381eee93a | cryptogenicbonds/CryptoBullion-CBX | src/kernel.cpp | #include <boost/assign/list_of.hpp>
#include "kernel.h"
#include "txdb.h"
using namespace std;
extern int nStakeMaxAge;
extern int nStakeTargetSpacing;
// Modifier interval: time to elapse before new modifier is computed
// Set to 6-hour for production network and 20-minute for test network
unsigned int nModifierIn... | ALGO | 0.996227 | 6.172916 |
7ced3e27-b19a-40ce-8e93-ce21532d487c | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4389_16.cpp | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 20;
int n;
string a, b;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
cin >> a >> b;
std::vector<int> v;
int t = 0;
for (int... | ALGO | 0.999996 | 4.6182 |
03f3a15c-5a96-492f-9de3-c0120342ced2 | ishandutta2007/codeforces | jdurie/normal/1284/B.cpp | #pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
vector<ll> firs, las;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll ... | ALGO | 0.999866 | 3.738363 |
6b1a8b08-7ae1-4045-a71e-81d3647aaa0e | harshdigi/Leetcode | 17-letter-combinations-of-a-phone-number/17-letter-combinations-of-a-phone-number.cpp | class Solution {
public:
unordered_map<char,string> mapping =
{ {'2', "abc"},
{'3',"def" },
{'4', "ghi" } ,
{'5', "jkl"},
{'6', "mno" } ,
{'7', "pqrs"},
{'8', "tuv"} ,
{'9', "wxyz" }};
void letterCombinationsRec(string input, string output, v... | ALGO | 0.999941 | 6.807604 |
e65c0843-24e1-4abf-8b4e-da5c9a5b646e | Ishika2745/Transparity | 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 |
69e1d642-1d68-4fed-85ba-199bc270bc24 | yT094/cpp_primer_5th_solutions | chapters/10/ex10_33.cpp | //
// ex10_32.cpp
// Exercise 10.32
//
// Created by yG620 on 20/9/13
//
// @Brief > Write a program that takes the names of an input file and
// two output files. The input file should hold integers. Using an
// istream_iterator read the input file. Using ostream_iterators, write
// the odd numbers into the ... | TOOL | 0.880956 | 5.10471 |
0917bf06-450d-489b-a34c-46962b7522e0 | JulioSugaya/mks-tinybee-marlin | Marlin/src/libs/heatshrink/heatshrink_decoder.cpp | #include "../../inc/MarlinConfigPre.h"
#if ENABLED(BINARY_FILE_TRANSFER)
/**
* libs/heatshrink/heatshrink_decoder.cpp
*/
#include "heatshrink_decoder.h"
#include <stdlib.h>
#include <string.h>
#pragma GCC optimize ("O3")
/* States for the polling state machine. */
typedef enum {
HSDS_TAG_BIT, /* ... | ALGO | 0.920021 | 4.962111 |
b383f707-17d8-4688-87e4-81441f44a3e4 | mairaallacerda/Pratica1-AEDSII | Problema2/src/main.cpp | #include <iostream>
#include <vector>
#include "Node.h"
#include "Tree.h"
void atualizarAltura(Node* &raiz, const std::string& operacao, int valor) {
if (operacao == "inserir") {
raiz = inserir(raiz, valor);
} else if (operacao == "remover") {
raiz = remover(raiz, valor);
}
std::cout <<... | ALGO | 0.999546 | 5.8697 |
51cc399e-9744-4af6-9301-ec9fbd08c2bb | aralab-unr/CoSM-ICP | external_libraries/pcl_1_9/doc/tutorials/content/sources/iros2011/src/test_segmentation.cpp | #include "solution/segmentation.h"
#include <string>
#include <sstream>
#include <pcl/console/parse.h>
#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>
int
main (int argc, char ** argv)
{
if (argc < 2)
{
pcl::console::print_info ("Syntax is: %s input.pcd <options>\n", argv[0]);
p... | ALGO | 0.912659 | 6.917626 |
79aad58b-528d-48c9-9625-07476d9132bc | TejasKumar555/leetcode | 714-best-time-to-buy-and-sell-stock-with-transaction-fee/best-time-to-buy-and-sell-stock-with-transaction-fee.cpp | class Solution {
public:
int func(int ind,int buy,int f,vector<int>&a,vector<vector<long>>&dp)
{
if(ind==a.size())
return 0;
if(dp[ind][buy]!=-1)
return dp[ind][buy];
long profit=0;
if(buy)
{
profit=max(-a[ind]+func(ind+1,0,f,a,dp),0+func(in... | ALGO | 0.999935 | 5.123711 |
a4d90221-d62a-48f8-a457-8a1d43886843 | sara-1129/-My-DSA-Portfolio | Difficulty: Easy/Floor in a Sorted Array/floor-in-a-sorted-array.cpp | class Solution {
public:
int findFloor(vector<int>& arr, int x) {
// code here
int n = arr.size();
int idx = -1;
for(int i = n - 1; i >= 0; i--)
{
if(arr[i] <= x)
{
idx = i;
break;
}
}
return idx;
... | ALGO | 0.999984 | 5.83866 |
5db5428f-aec1-4933-a3b8-24efebcc0cd8 | Mokuroh54/Comp_Prog | Codeforces Gym/104598/H_Model_Evaluation.cpp | /*
___
(o,o)
< . >
--"-"---
Rowlet is orz
_ _ _
>(.)__ >(.)__ >(.)__
(___/ (___/ (___/
I am dum duck
*/
#include <bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define pb push_back
#define ll long long
#define ld long double
#define ull unsigned ll
#define endl "\n"
#define... | ALGO | 0.999709 | 3.969346 |
d9e16839-9f65-46d2-9c64-09d449e5da72 | IDKOS1/google_maps_in_flutter | 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.99887 | 6.783439 |
14cd3f4e-9815-484b-bac7-40eaf7d5670d | ishiimehta/CPP-Data-Structures | LinkedList/Move_last_to_front.cpp | /*
* Move_last_to_front.cpp
*
* Created on: 28-Aug-2021
* Author: mehta
*/
// Program to move last element to front in a Linked List.
#include<iostream>
using namespace std;
struct Node{
int data;
struct Node *next;
}*start=NULL;
void create(int arr[], int n){
struct Node *last,*t;
start ... | ALGO | 0.999825 | 5.085185 |
b40e3b81-f94c-43be-a2df-255558e1791b | hailo-ai/tappas | core/hailo/libs/postprocesses/detection/scrfd.cpp | #include <algorithm>
#include <cmath>
#include <iterator>
#include <string>
#include <tuple>
#include <vector>
#include "common/math.hpp"
#include "common/tensors.hpp"
#include "common/nms.hpp"
#include "json_config.hpp"
#include "scrfd.hpp"
#include "xtensor/xarray.hpp"
#include "xtensor/xio.hpp"
#include "xtensor/xp... | DATA | 0.968804 | 5.151355 |
eb82496b-f850-4f5c-992c-89f149a62cbb | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt4/Codenet/p00367/590419455/response_5.cpp | #include <iostream>
#include <map>
#include <vector>
using namespace std;
typedef long long int ll;
int calc(int hour, int minute) { return 60 * hour + minute; }
int main() {
int N;
scanf("%d", &N);
map<int, int> MORNING, LUNCH, DINNER;
vector<int> morn_start(N), morn_end(N), lunch_start(N), lunch_end(N), din... | ALGO | 0.998298 | 3.536285 |
bb6a8504-2ae7-4078-8693-77e0fe9ab903 | chubillkelvin/leetcode | solutions/c++/problems/[1302_Medium] Deepest Leaves Sum.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.999897 | 6.618406 |
3c1e4f67-7c58-4bcc-bcf8-3e45e68509e8 | FullSailGameStudies/PG2LectureCode2502 | Week 2/Day04/Day04/Day04.cpp | // Day04.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
#include <vector>
#include <string_view>
#include "Console.h"
#include "Input.h"
std::string toUpper(const std::string& original)
{
std::string copy = original;
for (auto& c : cop... | ALGO | 0.998466 | 3.387253 |
5c9621be-ed49-43c4-a34f-276248d48849 | Sparksidy/DigipenProject-201703 | CS350/CS350_aji.suprana_3/CS350Framework/AssignmentFiles/BspTree.cpp | BspTreeQueryData::BspTreeQueryData()
{
mDepth = 0;
}
void BspTree::SplitTriangle(const Plane& plane, const Triangle& tri, TriangleList& coplanarFront, TriangleList& coplanarBack, TriangleList& front, TriangleList& back, float epsilon)
{
/******Student:Assignment4******/
Warn("Assignment4: Required function un-im... | ALGO | 0.859215 | 5.539382 |
abb81d94-34ea-4730-90b2-956e017b796a | MostafaAshraf98/Problem-Solving | STLs/Conformity.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 10e8;
#define endl '\n';
const int N = (int) 10e4;
//https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2261
//ACCEPTED
in... | ALGO | 0.999133 | 4.294356 |
e2d53063-b923-4ff1-b09f-b75bd7c3e7f1 | taut0logy/Arduino_ | _vscode.ino.hex/sketch/A_Codeforces_Checking.cpp | #line 1 "C:\\Users\\LENOVO\\OneDrive\\Documents\\C\\_VScode\\A_Codeforces_Checking.cpp"
#include <bits/stdc++.h>
using namespace std;
#define f(i, a, b, x) for (long long i = a; i < b; i += x)
#define fr(i, a, b, x) for (long long i = a; i >= b; i -= x)
#define ff(x, m) for (auto x : m)
#define pb push_back
#define pf ... | ALGO | 0.999058 | 3.723979 |
c750a0ac-866b-42e1-93b5-bf70f0e34776 | hasnain-cyber/competitive-programming | codeforces/MinOrSum.cpp | #include <math.h>
#include <iostream>
typedef int i16;
typedef long int i32;
typedef long long int i64;
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
i64 arr[n];
for (int i = 0; i < n; i++) cin >> arr[i];
int ans = arr[0];
... | ALGO | 0.999888 | 5.106511 |
81b7249c-6937-447e-b1a7-49a736b6ef1f | victor110406/BOJ_Programmers.Cpp | 프로그래머스/lv1/12982. 예산/예산.cpp | #include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> d, int budget) {
int answer = 0;
sort(d.begin(), d.end());
for (int i = 0; i < d.size(); i++)
{
if (budget - d[i] < 0) {
break;
}
... | ALGO | 0.999702 | 4.944608 |
0753aa79-47a8-4339-98b5-cddd9f59f30b | waingram/code-embeddings | test_data/C++/Averages-Arithmetic-mean/averages-arithmetic-mean-2.cpp | #include <vector>
#include <algorithm>
double mean(const std::vector<double>& numbers)
{
if (numbers.empty())
return 0;
return std::accumulate(numbers.begin(), numbers.end(), 0.0) / numbers.size();
}
| ALGO | 0.9964 | 6.139956 |
0205b821-95e6-4b9c-b865-42be2adca14d | lorq8189/kalman | eigen-3.4.0/test/sparseLM.cpp | #include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template <typename Scalar>
struct sparseGaussianTest : SparseFunctor<Scalar, int>
{
typedef Matrix<Scalar,Dynamic,1> VectorType;
typedef SparseFunctor<Scalar,int> Base;
typedef typename Base::JacobianType JacobianT... | TEST | 0.94477 | 6.154785 |
df321fef-7f65-4eef-b2ad-3106dc3e649d | mquang279/DSA | 17. Backtracking/sinh09.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, k, cnt;
int a[20], b[20];
void Try(int i){
if (i == k){
cnt++;
for (int j = 0; j < k; j++){
if (a[j] != b[j]) return;
}
cout << cnt;
return;
}
for (int j = n + i - k + 1; j >= b... | ALGO | 0.999928 | 3.803406 |
0e42db9e-0858-4b0f-a0bf-c6c16606928e | RoshanDangi2110/Cryptography | lab3/diffe-helman.cpp | //WAP to implement Diffe-Hellman key exchange algorithm.
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
// Returns true if n is a prime number, false otherwise
bool is_prime(int n) {
if (n <= 1) {
return false;
}
if (n <= 3) {
return true;
}... | ALGO | 0.999952 | 5.067389 |
73bda963-8118-445a-92af-a6f24af6b4fb | YilK/Programming_exercise | Codeup/《算法笔记》3.2小节/1934.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
int a[1000];
for(int i=0;i<n;i++)
cin>>a[i];
int res=-1;
int num;
cin>>num;
for(int i=0;i<n;i++)
if(a[i]==num)
res=i;
cout<<res<<endl;
}
return 0;
}
| ALGO | 0.999763 | 3.586951 |
f8cc77d5-0aa6-4ef4-84d5-02df94fb8507 | wcysai/Calabash | 2019牛客暑期多校训练营(第四场)/K.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
char s[maxn];
int sum[maxn];
int cnt[maxn][3];
int main(){
scanf("%s",s+1);
int n = strlen(s+1);
cnt[0][0] = 1;
for (int i=1;i<=n;i++){
sum[i] = sum[i-1] + s[i] - '0';
sum[i] %= 3;
for (int j=0;j<3;j++){
... | ALGO | 0.999942 | 3.697875 |
e631de30-f7e6-4d8f-bc0a-613593dd5f21 | NaveenDvlpr/Competitive-Programming | starters 130/canMakePalindrome.cpp | #include<bits/stdc++.h>
using namespace std;
bool canBePalindrome(string str, int k) {
cout << str << " " << k << endl;
int n = str.length();
if(n <= 1) return true;
if(k < 0) return false;
bool ans = false;
for(int i = n-1; i > 0; i--) {
if(str[i] == str[0])
ans |= canBePalindrome(str.substr(1,i-1),k-(n-1-i... | ALGO | 0.999997 | 4.571272 |
d75a0e9f-feba-4366-a9f6-3eb36f25bd93 | agkeshav/Codechef-Solutions | Hackerman.cpp | #include <iostream>
using namespace std;
bool isPrime(int n)
{
if (n <= 1)
return false;
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return true;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;cin>>t;
while(t--){
int ... | ALGO | 0.99996 | 4.241345 |
12640e1b-e2af-4c96-b373-7159a52dc9e0 | cmmmli/atcoder | ABC/077/b.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <cmath>
#include <map>
#include <set>
#include <ctype.h>
#include <numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;
const int INF = 1e9;
int dx4[4] = { 0, -1, 1... | ALGO | 0.999781 | 3.614526 |
37e0c577-f547-4a53-b6fe-71b2f63addad | ishandutta2007/codeforces | far_from_noob/normal/1183/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define dd double
#define endl "\n"
#define fo(i,n) for(int i=0;i<n;i++)
ll mod=1000000007;
vector<int>v[200005];queue<int>s;
ll n,k,t,m,p,q,x,flag=0,ans=0,waiting=0;
ll po(ll k ,ll n,ll ans,ll temp,ll ans1){
if(n==0)return ans;
while(temp<=n){
... | ALGO | 0.999931 | 3.951915 |
deaff0a0-9806-420a-ac88-8cf997c45e07 | FromTheo/NeetCode | [C++] Trees/level_order_traversal_of_binary_tree.cpp | #include <iostream>
#include <vector>
#include <deque>
using namespace std;
/* -------- Subject --------
Given a binary tree root, return the level order traversal of it as a nested list,
where each sublist contains the values of nodes at a particular level in the tree, from left to right. */
struct TreeNode ... | ALGO | 0.999988 | 5.84189 |
931e68c8-9cbd-4907-9bb3-21b68a1bb92f | starplatinum3/data-struct-code-cpp | 1018 Public Bike Management (30)(30 分).cpp | //1018 Public Bike Management (30)30 ֣
//https://blog.csdn.net/CV_Jason/article/details/81385228
/*
** @Brief:No.1018 of PAT advanced level.
** @Author:Jason.Lee
** @Date:2018-8-03
*/
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
// ֵ
const int inf = 99999999;
int cmax, n, sp, m;
/... | ALGO | 0.999991 | 3.51735 |
a2848f11-2b92-42c5-9b3b-2862d04d0001 | kkpan11/apple-llvm-project | clang/lib/ExtractAPI/ExtractAPIConsumer.cpp | #include "clang/AST/ASTConcept.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "clang/Basic/DiagnosticFrontend.h"
#include "clang/Basic/FileEntry.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Targe... | TOOL | 0.852232 | 5.605792 |
72c1d4c1-3dce-4ebc-b179-ea86f57fe2e2 | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8_formatted_macrosremoved/Qumeric/5304486_5697460110360576_Qumeric.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MAX = 1e6 + 777;
int isfine1(ll r, ll p) {
if (false)
cerr << "ISFINE1: " << r << ' ' << p << endl;
ll x = 0;
while (++x < MAX) {
if (p * 10 >= x * r * 9 && p * 10 <= x * r * 11) {
if (false)
... | ALGO | 0.999509 | 3.769223 |
dde8ca24-f0a8-4535-9b20-da587af4a948 | fielaazhari/flutter_Fiela-Junita-Azhari | 21_Flutter State Management (Provider)/praktikum/task1_setstate/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.998526 | 6.783439 |
b3ba3e59-40a1-4f05-b6fe-040ffc1dd851 | DiablosGit/BMS_HW | FTCMS_V2.2/Datasheets/LTSketchbook/Part Number/3000/3300/3335/DC2343A/printf.cpp | //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Includes
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include <string.h>
#include <stdarg.h>
#include "Linduino.h"
#include... | TOOL | 0.878702 | 6.636215 |
69aab480-b3f3-482a-9025-74d651e633ce | Arifulit/Competative-Programming | b.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;
while(t--){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
unordered_map<long long,long long>mp;
long long ans=0;
for(int i=0;i<n-1;i++){
... | ALGO | 0.999875 | 3.981035 |
62af1004-dc13-4541-a3bb-d12ab71e62d6 | Husainbw786/LeetCode | 0491-non-decreasing-subsequences/0491-non-decreasing-subsequences.cpp | class Solution {
public:
vector<int>temp;
void solve(int i,int n,vector<int>nums,set<vector<int>>&st)
{
if(i == nums.size())
{
if(temp.size() >= 2)
{
st.insert(temp);
}
return;
}
// pick the element
if... | ALGO | 0.999994 | 6.128698 |
a71aa0f9-bcce-4818-9e00-1eea0f8e788f | terrydeng666/Algotrithm | Algorithm/sort/selectionsort.cpp | #include <bits/stdc++.h>
int main(void) {
int a[]={30,5,3,7,4,8,10,20,11,25,13};
for(int i=0;i<10;i++) {
int min=a[i];
for(int j=i+1;j<11;j++) {
if(a[j]<min) {
int temp=min;
min=a[j];
a[j]=temp;
}
}
a[i]=min;... | ALGO | 0.999915 | 3.353845 |
85e5a0f4-2f54-4261-91e5-dd43d3fcab8f | BlackbirdBlina/EDB1 | Unidade 1/Exercício6/main.cpp | #include <iostream>
#include "multi.hpp"
using namespace std;
int main(){
int x = 5;
int y = 6;
cout << multi(x, y) << endl;
return 0;
}
| TOOL | 0.977058 | 4.702386 |
6e8fbf1e-6c04-4557-8aa1-45b28eb6c537 | nateshmbhat/algorithms | DataStructures/Array/1D/min len unsorted sub array which on sorting sorts whole array/main.cpp | // https://www.geeksforgeeks.org/minimum-length-unsorted-subarray-sorting-which-makes-the-complete-array-sorted/
// Examples:
// 1) If the input array is [10, 12, 20, 30, 25, 40, 32, 31, 35, 50, 60], your program should be able to find that the subarray lies between the indexes 3 and 8.
// 2) If the input array is [0... | ALGO | 0.999806 | 4.000037 |
b404bb3e-a7ef-46aa-81e3-5238e937e0aa | HumanChwan/CSES | Dynamic_Programming/Money_Sums.cpp | #include <bits/stdc++.h>
#if ONLINE_JUDGE
#define DEBUG(...)
#else
#define DEBUG(kek) cout << "DEBUG: [ " << #kek << " = " << kek << " ]\n"
#endif
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define ff first
#define ss second
#define vt(...) vector<__VA_ARGS__>
#define sz(...) (int)... | ALGO | 0.99994 | 3.706334 |
476cafb1-543b-43f7-b683-a704aeb08ebb | torus-folk/torus | src/pow.cpp | #include <pow.h>
#include <arith_uint256.h>
#include <chain.h>
#include <primitives/block.h>
#include <uint256.h>
#include <bignum.h>
#include <chainparams.h>
#include <util.h>
// torus: find last block index up to pindex
const CBlockIndex *GetLastBlockIndex(const CBlockIndex *pindex, bool fProofOfStake) {
while... | ALGO | 0.99671 | 7.495801 |
20a6b97c-1a3f-42d3-9f1e-98066ebc586c | pratham-0094/DSA-and-CP | Day-015/deleting_from_linked_list.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
struct Node
{
int data;
struct Node *next;
} *first = NULL, *last = NULL;
void Insert(int x)
{
struct Node *t = new Node;
t->data = x;
t->next = NULL;
if (first == NULL)
{
first = last = t;
}
else
{
l... | ALGO | 0.999897 | 4.564512 |
b22efa86-375a-4a78-ae01-c7e564f51ac9 | govind2707/recurrsion | PrimeRecursion.cpp | #include<bits/stdc++.h>
using namespace std;
bool prime(int n,int i)
{
if(n==1)
return false;
if(i*i>n)
return true;
if(n%i==0)
return false;
prime(n,i+1);
}
int main()
{
int num;
cout<<"enter number";
cin>>num;
if(prime(num,2))
cout<<"prime";
else
cout<<"not prime";
}
| ALGO | 0.99976 | 3.566223 |
c17af071-04ba-433a-b2e6-0f2bcb80ff12 | iah-herrera/AED | 04-Recur/fibonacci.cpp | # include <cassert>
/*DEFINICION MATEMATICA
fib: N --> N / fib(n)= { n sii 0<= n <= 1
{ fib(n-2) + fib(n-1) sii n>1 e.o.c
*/
//DECLARACION
unsigned fib(unsigned n);
int main(){
assert(fib(0)== 0);
assert(fib(3)== 2);
assert(fib(4)== 3);
assert(fib(5)== 5);
assert(... | ALGO | 0.996815 | 4.836943 |
6b1869a8-b69d-4253-b39f-5d8f2c50682a | sezalmittal987/black-ravens-notes | 22 feb/stackClass.cpp | #include<iostream>
using namespace std;
// our own implementation of stack
class stack{
private: // access modifiers
int a[100000]; // storing the stack values
int sz = 0; // size of the stack
public :
// push, pop, empty, top
void push(int x){
a[sz] = x;
sz++;
}
... | ALGO | 0.991166 | 4.560116 |
9e31eed8-47d4-4f68-abbf-b093486040a6 | jvergara2506/ICPC_problems | moon.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
ll n; cin>>n; vector<ll>v(n);
for (auto& i:v) cin>>i;
cout<<n/2<<endl;
} | ALGO | 0.999224 | 3.499586 |
aab5e870-c356-4eff-b911-b9d4660f615b | VishalSingh1703/Placement | MATH/Easy/1200. Minimum Absolute Difference.cpp | https://leetcode.com/problems/minimum-absolute-difference/
class Solution {
public:
vector<vector<int>> minimumAbsDifference(vector<int>& arr) {
sort(arr.begin(), arr.end());
int m = INT_MAX;
for(int i = 1; i<arr.size(); i++)
{
m = min(m, arr[i] - arr[i-1]);
}
... | ALGO | 0.999964 | 6.121842 |
205392bc-9aca-4df2-a20f-1e8f6d26afca | SSAFYnity/Job-Preparation-Challenge-3rd | Programmers/퍼즐게임챌린지/퍼즐게임챌린지_조연주.cpp | #include <string>
#include <vector>
using namespace std;
typedef long long ll;
int solution(vector<int> diffs, vector<int> times, long long limit) {
int answer = 0;
int len = diffs.size();
int start = 1;
int end = 100000;
// binary search
while(start <= end){
int mid = (start + end... | ALGO | 0.999971 | 5.143194 |
8dab5147-373c-419e-b79a-e7da018a8caa | ishandutta2007/codeforces | -is-this-fft-/normal/1142/B.cpp | #include <iostream>
#include <vector>
using namespace std;
const int maxn = 1 << 19;
const int maxlg = 20;
int perm [maxn];
int arr [maxn];
int prev_val [maxn];
int last_seen [maxn];
vector<int> children [maxn];
int jmp [maxn][maxlg];
void build (int vertex, int parent) {
jmp[vertex][0] = parent;
for (int i = 1... | ALGO | 0.999975 | 4.114334 |
28607f90-785e-46ed-bf25-2c95748d6735 | DannyChee1/Ds-and-Algs | Convex Hull.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef array<int, 3> E;
const int MM = 2003;
int K, N, M, st, ed, dis[MM][202]; vector<E> adj[MM];
int main(){
cin >> K >> N >> M;
for(int i=1, u, v, t, h; i<=M; i++){
cin >> u >> v >> t >> h;
adj[u].push_back({v, t, h}); adj[v... | ALGO | 0.999952 | 3.92332 |
8b68e235-b2af-4be7-bf20-f33c8bccead2 | YuxuanHe/Leetcode | Implement Trie (Prefix Tree).cpp | class TrieNode {
public:
vector<TrieNode*> children;
bool isEnd;
char content;
// Initialize your data structure here.
TrieNode() {
content = ' ';
isEnd = false;
};
TrieNode(char ch) {
content = ch;
isEnd = false;
}
};
class Trie {
public:
Trie() {
... | ALGO | 0.999833 | 6.198495 |
6383f7c0-295d-4671-a638-2cfd89ef8341 | Rohit312003/My-code | Coin_Combinations_II.cpp | #include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <vector>
using namespace std;
typedef long long int ll;
#define MOD 1000000007;
const int N = 1e5 + 10;
const int INF = 1e9 + 10;
vector<int> vis(N, 0);
int mdd = 1e9 + 7;
vector<int> dist(N,... | ALGO | 0.99996 | 4.399685 |
d301da27-8d63-4dd9-b82c-00e687009682 | raghuvanshraj/Competitive-Programming-Archive | Codeforces/1256/1256E.cpp | /**
* author: vulkan
* created: 23.04.2020 07:43:32 PM
**/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define MOD 1000000007
#define MAX 1000000000
#define MIN -1000000000
#define SET_ARR(arr,n,val) for (int i = 0; i < n; ++i) arr[i] = val
#define SET_ARR2D(arr,n,m,val) for (int i = 0; ... | ALGO | 0.99999 | 3.923192 |
8aacb7c2-2c67-4af0-b0f1-2d5fec2a6bab | Mujahid-Bilal/SOFA | Sofa/framework/Core/src/sofa/core/behavior/CRSMultiMatrixAccessor.cpp | #include <sofa/core/behavior/CRSMultiMatrixAccessor.h>
#include <sofa/core/behavior/BaseMechanicalState.h>
#include <sofa/core/BaseMapping.h>
namespace sofa::core::behavior
{
using sofa::core::behavior::BaseMechanicalState;
void CRSMultiMatrixAccessor::addMechanicalMapping(sofa::core::BaseMapping* mapping)
{
con... | TOOL | 0.918258 | 6.011965 |
bc74054e-dc42-4218-8619-784700a1dce9 | P79N6A/Codes-1 | 2015.6~2015.9/Sum of Different Primes.cpp | #include<iostream>
#include<cctype>
#include<cstdio>
#include<cstring>
#include<string>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<stack>
#include<queue>
using namespace std;
#define pr(x) cout << "#x = " << (x) << '\n';
typedef long long ll;
const int INF = 0x3f3f3f3f, M... | ALGO | 0.999522 | 3.604474 |
b6d4f214-63d3-4cf0-89d3-31ddec81d0ca | faddoulelias/LinqConsole | Server/src/LinqServer.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <ctime>
#include <map>
#include "./headers/LinqServer.hpp"
std::vector<std::string> words = {
"Boule",
"Bouquet",
"Bourgeon",
"Bouton",
"Brindille",
"Buisson",
"Champi... | WEB | 0.87862 | 3.241874 |
995e427a-bd98-4d80-8439-25cfdfd7d3a8 | shinter61/competition | ABC_218/F.cpp | /*
* author: shinter_pres
* created: 11.09.2021 21:54:17
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
cin.tie(0);
ios_base::sync_with_stdio(false);
int n, m;
cin >> n >> m;
vector<pair<int, int>> edges(m);
rep(i, m) {
int ... | ALGO | 0.9999 | 4.474482 |
04d24b43-86c1-4037-be75-8777b0463dcd | bluesea0/Leetcode | noi2727.仙岛求药/noi2727.仙岛求药.cpp | #include <iostream>
#include<vector>
#include<queue>
#include<unordered_map>
#include<algorithm>
using namespace std;
//2021101210:22:41
int bfs(vector<vector<char>>& graph,int x,int y){
int m=graph.size(),n=graph[0].size();
queue<pair<int,int>> q;
q.push(make_pair(x,y));
int count=0;
int dirX[]={0,0,-1,1},dirY[]=... | ALGO | 0.999864 | 4.259458 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.