uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c43841de-55f0-42b2-9cb5-dadd0ccf2998 | O-Pasut/mobile_homework2 | 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 |
aa7619fc-920c-46be-90a4-3c8330de0df5 | VidyaBipin/CPPrograms-cpp-c | GFG/nth_fibonacci_number.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
long long int nthFibonacci(long long n){
int a = 0, b = 1, c, i;
if(n == 0){
return a;
}
for(i = 2; i <= n; i++){
c = (a + b) % 1000000007;
a = b;
b = c;
... | ALGO | 0.99991 | 4.872726 |
35f17a5d-ade9-47a4-96f8-8205eac88dc2 | fYmious/tasks | 3.cpp | #include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
// проинициализировали переменную result, в которой будет храниться максимум
// проинициализировали переменную curr, в которой будут храниться входные числа
int result, curr;
cin >> curr;
if (curr == 0) cout << "maximum ... | ALGO | 0.997901 | 4.274423 |
d2a55ea4-74c7-4403-a065-075843db1d16 | ajaymd/ikk | Strings/Print_Matrix_In_Spiral_Order/solutions/optimal_solution.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAX_N = 100000;
// ------------------------ START ------------------------
int directions[4][2] =
{
// {row, col}
{0, 1}, // go right
{1, 0}, // go down
{0, -1}, // go left
{-1, 0} // go up.
};
bool should_turn(int cur_row, int cur_col, int rows, i... | ALGO | 0.999976 | 4.928056 |
8ecd9e54-8366-44b8-b344-5ebecd4ae0b8 | sudhanshutech/DSA | Search algos/binarySearch_searchPivot.cpp | #include<iostream>
using namespace std;
int getPivot(int arr[], int n){
int s = 0;
int e = n-1;
int mid = s + ((e-s)/2);
while(s<e){
if(arr[mid]>=arr[0]){
s= mid+1;
}
else {
e = mid;
}
mid = s + ((e-s)/2);
}
return s;
}
i... | ALGO | 0.999928 | 5.393054 |
301ed6d1-f453-4c36-b0fd-e27f8f88c0fd | alittlekitten/AlgorithmStack | Baekjoon/Cpp/Brute_Force/B3_13225_Divisors.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// 13225 Divisors
// 브루트포스
int n, input;
cin >> n;
while (n--) {
int ans = 0;
cin >> input;
for (int i = 1; i <= input; ++i) {
if (input % i == 0) ++ans;
}
cout << input << " "... | ALGO | 0.999527 | 4.214938 |
0520bdcc-bdc5-484b-8322-b1cb83aa6997 | RohitJV/spoj-solutions | BRIDGE.cpp | #include <iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
using namespace std;
#define pb push_back
#define mp make_pair
int a[1005],b[1005],n,t,x,dp[1005][1005];
int main()
{
scanf("%d",&t);
while(t--)
{
vector < pair<int,int> > v1,v2,v;
scanf("%d",&n);
for(int i=0;i<n;... | ALGO | 0.999959 | 3.541869 |
0f6ac43d-6f76-45e7-bf1f-bb73bfce46e9 | libcg/algav-briandais | src/hybridtrie.cpp | #include "hybridtrie.h"
#include <iostream>
#include <algorithm>
using namespace std;
HybridTrie::HybridTrie() :
m_left(NULL),
m_child(NULL),
m_right(NULL),
m_key(false),
m_char('\0')
{}
HybridTrie::HybridTrie(const HybridTrie &t) :
m_left(NULL),
m_child(NULL),
m_right(NULL),
m_ke... | ALGO | 0.998917 | 5.704962 |
5838eac9-3630-4e6a-a9ad-38a6bf5895f2 | snklp1/cmpt_codes | q34.cpp | //factorial for really big numbers
#include<iostream>
using namespace std;
#define MAX 500
int multiply(int x, int res[], int res_size);
void factorial(int n)
{
int res[MAX];
res[0] = 1;
int res_size = 1;
for (int x=2; x<=n; x++)
res_size = multiply(x, res, res_size);
for (int i=res_... | ALGO | 0.999884 | 4.728972 |
01a4c69b-35e5-4f0f-8ae2-ece475c9c6f2 | Esraamabrouk2022/Codeforces | B - Serval and Inversion Magic/main.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void fast()
{
ios_base::sync_with_stdio(NULL);
cin.tie(0);
cout.tie(0);
}
int main()
{
fast();
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
string s;
cin>>s;
int l=0,r=n-1;
//1... | ALGO | 0.999974 | 4.371862 |
a5963804-851f-4843-a482-8d4506fc00ec | ntxq/PS-Baekjoon | 18000~18999/18186.cpp | #include <algorithm>
#include <iostream>
#include <limits>
#include <numeric>
#include <vector>
long long buyCombined(std::vector<int>& required, long long N, long long B,
long long C) {
long long acc = 0;
int prevSingle = 0;
int prevDouble = 0;
for (int i = 0; i < N; ++i) {
... | ALGO | 0.999894 | 4.82646 |
1e2c1f59-5591-403d-8dc0-8635ebd7b774 | CJSBinder-User/CJSBinder | experiment/correctness_efficiency/cjsbinder/COUNT_BINARY_DIGIT_NUMBERS_SMALLER_N/COUNT_BINARY_DIGIT_NUMBERS_SMALLER_N_GLUECODE.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include "include/libplatform/libplatform.h"
#include "include/v8.h"
#include "CQuesHeader.h"
using namespace v8;
void Print(const FunctionCallbackInfo<Value>& args){
v8::Isolate* isolate = args.GetIsolate();
v8::Str... | ALGO | 0.996038 | 5.114688 |
a4bdffa6-9d0d-4a5e-80a0-c27b510c9d3d | KwanPitsinee/TOI | toi13_timerswitch.cpp | //LANG : C++
#include<bits/stdc++.h>
using namespace std;
queue<int> a[2];
int main(){
int n;
string st;
cin>>n>>st;
int cnt=0;
for(auto e:st){
a[0].push(e);
a[1].push(e);
}
while(1){
int b=a[1].front();
a[1].pop();
a[1].push(b);
cnt++;
if(a[0]==a[1]){
cout<<cnt;
break;
... | ALGO | 0.999971 | 3.464368 |
673b2232-7088-4da7-9b76-a523eaa4864d | shreyansh28801/StriverCpSheet | String/KMP Tutorial/1_KMP_PatternMatching.cpp | /*
we will aplly kmp 1st on this problem on this problem => https://www.pepcoding.com/resources/data-structures-and-algorithms-in-java-interview-prep/text-processing/kmp-pattern-searching-official/ojquestion
To solve this problem we will solve one prblem name lps(longest prefix which is also a proper suffix) Problem L... | ALGO | 0.999975 | 5.393805 |
46f74352-a89a-44fe-9409-4068a71483b5 | zslwyuan/gmsh-doc | contrib/eigen/doc/examples/class_CwiseUnaryOp_ptrfun.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
// define function to be applied coefficient-wise
double ramp(double x)
{
if (x > 0)
return x;
else
return 0;
}
int main(int, char**)
{
Matrix4d m1 = Matrix4d::Random();
cout << m1 << endl << "becomes: " << endl << ... | ALGO | 0.958059 | 4.120226 |
c77ad5a3-43c2-4cca-bfc5-050480e6e716 | SHREY247/Hackerrank_Problemsolving | ExtraLongFactorials.cpp | //Problem Link: https://www.hackerrank.com/challenges/extra-long-factorials/problem?isFullScreen=true
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
int multiply(int number, int resultArray[], int resultArraySize) {
int carry = 0, mulRes;
//Fir... | ALGO | 0.999983 | 5.958985 |
f03aa3a0-a503-46ee-9505-12a429d50aed | PaulTheLionHeart/manpwin | BigMatrix.cpp | /*
BIGMATRIX.CPP a program to do matrix manipulations on Bignum
Written in Microsoft Visual 'C++' by Paul de Leeuw.
This program is written in "standard" C. Hardware dependant code
(console drivers & serial I/O) is in separate machine libraries.
*/
#include "BigMatrix.h"
/***********************... | ALGO | 0.999329 | 4.711654 |
084bc92b-c47f-4ccf-87fe-651c58ba31a3 | Vijay-CPP/Striver-A2Z-DSA-Sheet | Strings/05_isoMorphicString.cpp | #include <bits/stdc++.h>
using namespace std;
#define v vector
class Solution
{
public:
bool isIsomorphic(string s, string t)
{
unordered_map<char, int> m1, m2;
for (int i = 0; i < s.length(); i++)
{
if (m1[s[i]] != m2[t[i]])
return false;
m1[s... | ALGO | 0.999995 | 5.664142 |
d865fede-a7a5-4687-b593-abc35477e21b | p0ndja/POSN | otog/bee/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
while(1) {
int year; scanf("%d",&year); if(year == -1) return 0; //End of Input = -1
int soldier = 0, worker = 1, queen = 1, lastSoldier = 0, lastWorker = 0;
for(int i = 0; i < year; i++) { //Loop Year
lastSoldier = soldier; lastWorker = worker;
so... | ALGO | 0.999 | 3.455076 |
4656c29a-86ba-4eb8-92e9-9d81be440cfa | faterazer/LeetCode | 1802. Maximum Value at a Given Index in a Bounded Array/Solution.cpp | #include <cmath>
using namespace std;
class Solution {
public:
/**
* Time complexity: O(lg(maxSum))
* Space complexity: O(1)
*/
int maxValue_MK1(int n, int index, int maxSum)
{
int left = 1, right = maxSum;
while (left < right) {
int mid = left + ((right + 1 - lef... | ALGO | 0.999992 | 5.318274 |
bd1dc6bf-a334-43a1-8007-0a6d2acce113 | ruchika0201/Design-Analysis-of-Algorithms-Practicals | Bellman Ford Algo/33143_08.cpp | #include<iostream>
#define MAX 10
using namespace std;
typedef struct edge
{
int src;
int dest;
int wt;
}edge;
void bellman_ford(int nv,edge e[],int src_graph,int ne)
{
int u,v,weight,i,j=0;
int dis[MAX];
for(i=0;i<nv;i++)
{
dis[i]=999;
}
dis[src_graph]=0;
for(i=0;i<nv-1;i++)
{
for(j=... | ALGO | 0.999907 | 3.853012 |
8cbb8908-11d7-494e-a1d6-5360c0fa87e4 | lcnzg/lammps-pi | src/KOKKOS/min_linesearch_kokkos.cpp | /* ----------------------------------------------------------------------
Contributing author: Stan Moore (SNL)
------------------------------------------------------------------------- */
#include "min_linesearch_kokkos.h"
#include "atom_kokkos.h"
#include "atom_masks.h"
#include "error.h"
#include "fix_minimize_... | ALGO | 0.999753 | 5.363842 |
91e9e4ae-b94e-45f6-b4e4-39b27a80f2f2 | ErdemOzgen/Cpp-Learning-Archive | DiscoveringModernCpp/c++11/reduction_unroll_nesting_example.cpp | #include <cmath>
#include <cassert>
#include <iostream>
#include <chrono>
using namespace std::chrono;
template <typename T>
class vector
{
void check_size(int that_size) const { assert(my_size == that_size); }
void check_index(int i) const { assert(i >= 0 && i < my_size); }
public:
typedef T value_t... | ALGO | 0.98546 | 5.567793 |
63846dfc-af64-4608-b1d8-37c76928a08c | fratajczak/ChessDiagramOCR | src/main.cpp | #include "fen.hpp"
#include "geometry.hpp"
#include "normalize.hpp"
#include "parameters.hpp"
#include "partition.hpp"
#include "predict.hpp"
#include <getopt.h>
#include <iostream>
#include <opencv2/highgui.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <queue>
#include <stdlib.h>
#inclu... | TOOL | 0.89109 | 5.287697 |
771ad680-a2b3-4e03-88ea-8b84074dccd3 | TAMAGHNO123/C-_-Programmes | 2D Array/diagonal_sum.cpp | #include<bits/stdc++.h>
using namespace std;
void sumDiagonals(int arr[][3],int n) {
int diagArray = 0, antiDiag = 0;
for (int i = 0; i < n; ++i)
{
diagArray = diagArray + arr[i][i];
antiDiag = antiDiag + arr[i][n-1-i];
}
cout<< "Sum of primary diagonal : "<< diagArray << endl;
... | ALGO | 0.999893 | 4.425778 |
ee38caf6-64b5-4ae4-a207-3d728349d1ea | crdroidx/android_packages_inputmethods_LatinIME | native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp | #include "dictionary/structure/v4/ver4_patricia_trie_policy.h"
#include <array>
#include <vector>
#include "suggest/core/dicnode/dic_node.h"
#include "suggest/core/dicnode/dic_node_vector.h"
#include "dictionary/interface/ngram_listener.h"
#include "dictionary/property/ngram_context.h"
#include "dictionary/property/n... | ALGO | 0.855738 | 7.694741 |
f3c81d1b-9a12-4a49-93b5-dc74e178faad | silverthreadk/leetcode | Cpp/1089_Duplicate_Zeros.cpp | class Solution {
public:
void duplicateZeros(vector<int>& arr) {
vector<int> duplicate(arr.size(), 0);
for(int i=0, j=0; j<arr.size(); ++i, ++j){
duplicate[j] = arr[i];
if(!arr[i] && j+1<arr.size()){
++j;
duplicate[j] = 0;
... | ALGO | 0.999921 | 6.323088 |
9f4982bd-4bc9-4248-9fe6-3ffab06ebdc3 | ishandutta2007/codeforces | hongzy/normal/1307/B.cpp | #include <bits/stdc++.h>
#define debug(...) fprintf(stderr, __VA_ARGS__);
#define rep(i, j, k) for(int i = j; i <= k; ++ i)
#define per(i, j, k) for(int i = j; i >= k; -- i)
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
typedef double db;
typ... | ALGO | 0.999968 | 3.62501 |
0d3e52a7-9ebf-4754-ae29-2b5a7cd287d3 | KomiMoe/Arkari | libc/src/math/generic/asin.cpp | #include "src/math/asin.h"
#include "asin_utils.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PolyEval.h"
#include "src/__support/FPUtil/double_double.h"
#include "src/__support/FPUtil/dyadic_float.h"
#include "src/__support/FPUtil/multiply_add.h"
... | ALGO | 0.996929 | 7.258981 |
48115ae0-11ae-4edd-980f-58e547d6b9fc | MScIng/OpenSees_16_03 | SRC/material/nD/J2BeamFiber2d.cpp | // $Revision: 1.3 $
// $Date: 2002-12-05 22:49:09 $
// $Source: /usr/local/cvs/OpenSees/SRC/material/nD/J2BeamFiber2d.cpp,v $
// Written: MHS
// Created: Aug 2001
//
// Description: Elastic isotropic model where stress
// components 22, 33, 13, and 23 are condensed out.
#include <J2BeamFiber2d.h>
#include... | ALGO | 0.963413 | 5.475604 |
56589621-45e7-443e-a627-d520bff914bd | josephleekl/scalar_emt_analysis | src/EmtFlowtimeC3Fit.cpp | #include <LatAnalyze/Core/OptParser.hpp>
#include <LatAnalyze/Functional/CompiledModel.hpp>
#include <LatAnalyze/Io/Io.hpp>
#include <LatAnalyze/Statistics/MatSample.hpp>
#include <LatAnalyze/Core/Math.hpp>
#include <LatAnalyze/Numerical/MinuitMinimizer.hpp>
#include <LatAnalyze/Numerical/NloptMinimizer.hpp>
#include <... | ALGO | 0.989901 | 6.260092 |
2a7ad9bb-71fc-4e35-9729-ccb79d91bc48 | Dup4/competitive-programming | codeforces/contest/1256/c.cpp | #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define fi first
#define se second
#define endl "\n"
using namespace std;
using db = double;
using ll = long long;
using ull = unsigned long long... | ALGO | 0.999964 | 4.273515 |
b74b1721-b08f-48c2-9d56-704ed71c8ae6 | CJSBinder-User/CJSBinder | experiment/correctness_efficiency/groundtruth/cpp/MINIMUM_PRODUCT_SUBSET_ARRAY.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( int a [ ], int n ) {
if ( n == 1 ) return a [ 0 ];
int max_neg = INT_MIN;
int min_pos = INT_MAX;
int count_neg = 0, count_zero = 0;
int pr... | ALGO | 0.999708 | 5.210726 |
2a99a2e4-0013-4d6c-8f02-2a6e7f2bc453 | Mrcsy8/CP | CSES/Graph_Algorithms/Building_Roads/template.cpp | #include <bits/stdc++.h>
using namespace std;
#define forsn(i, s, n) for (int i = int(s); i < int(n); i++)
#define dforsn(i, s, n) for (int i = int(n) - 1; i >= int(s); i--)
#define forn(i, n) forsn(i, 0, n)
#define dforn(i, n) dforsn(i, 0, n)
#define pb push_back
#define pf push_front
#define mp make_pair
#define fs... | ALGO | 0.999972 | 3.804014 |
2bea9fa9-e02b-4be3-84a8-c1278c9d2692 | cotepractice/CodingTest | yujung/백준/가운데를 말해요.cpp | #include<iostream>
#include<queue>
#define max 100001
using namespace std;
priority_queue<int, vector<int>, less<int>> max_heap;
priority_queue<int, vector<int>, greater<int>> min_heap;
int arr[max];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, val;
cin >> n;
while (n--) {
... | ALGO | 0.999984 | 4.600162 |
69c7f497-4cdf-43f6-9528-9c6a1e83ba78 | huyenmi16/Language-C | tam giác vuông trái rỗng.cpp | #include <stdio.h>
int main(){
int a;
scanf("%d",&a);
int m=1;
for(int i=0;i<a;i++){
for(int j=0;j<m;j++){
if(i==j||j==0||i==a-1)printf("*");
else printf(".");
}
printf("\n");
m++;
}
} | ALGO | 0.999816 | 3.121547 |
0437802c-5a21-412a-82ef-173e9b06535f | Williamarvin/Marine_automate | moos-ivp/ivp/src/lib_dep_behaviors/AOF_AvoidObstacle.cpp | /*****************************************************************/
/* NAME: Michael Benjamin */
/* ORGN: Dept of Mechanical Engineering, MIT, Cambridge MA */
/* FILE: AOF_AvoidObstacle.cpp */
/* DATE: Aug 2nd, 2006 ... | ALGO | 0.999122 | 6.29565 |
50c75523-4a26-4646-9b87-45a69b50b008 | SamuelKhoo2003/YR1-Coding | Imperial Term 2/T2 Mid-Term/mt1.cpp | #include <iostream>
struct SomeStruct{
int a;
int b;
int f(SomeStruct s2){
return (a+s2.b) + (b*s2.a);
}
};
int main(){
SomeStruct s1;
SomeStruct s2;
int a;
int b;
int n;
a=2;
b = 3;
s1.a =4;
s1.b = 5;
std::cin >> n;
s2.a=n;
s2.b = 6;
std::cout << s2.f(s1) << std::endl;
} | ALGO | 0.989972 | 3.894532 |
0a4c599b-205b-4efd-8342-8872d529adcb | ishandutta2007/codeforces | abc864197532/normal/1422/A.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
#define lli long long int
#define fop(i,m,n) for (int i=(m);i<(n);i++)
#define FOP(i,m,n) for (int i=(m)-1;i>=(n);--i)
#define test(x) cout << #x << ' ' << x << endl;
#define printv(a) {\
for ... | ALGO | 0.999934 | 4.334809 |
917ebc1e-8837-448a-b35d-11da43aff8db | Shamsullo/DS_Algorithm | DataStructure/classRational/calcRational.cpp | #include <iostream>
#include <sstream>
#include <string>
#include "Rational.h"
using namespace std;
bool parseExpr(const string& line, Rational& r1, char& op, Rational& r2);
void computeAndShow(const Rational& r1, char op, const Rational& r2);
void showResult(const Rational& r);
int main()
{
cout << boolalpha;
... | ALGO | 0.994879 | 5.867527 |
4b11664a-dd29-446b-9ebb-ce0bb77090f5 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc015/A/1936345.cpp | #include <algorithm>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::cerr;
using std::string;
using std::to_string;
using std:... | ALGO | 0.999879 | 3.754207 |
01da7efc-18f8-42b2-8d22-537be33cb9d2 | rollingball-3/realman_mpc | ocs2_ros2/ocs2_oc/src/precondition/Ruzi.cpp | #include "ocs2_oc/precondition/Ruzi.h"
#include <atomic>
#include <functional>
#include <numeric>
namespace ocs2 {
namespace precondition {
// Internal helper functions
namespace {
scalar_t limitScaling(const scalar_t& v) {
if (v < 1e-4) {
return 1.0;
} else if (v > 1e+4) {
return 1e+4;
} else {
r... | ALGO | 0.998585 | 7.210814 |
002df823-4edd-416d-a647-e53712163359 | RumRaisins/ProjectEuler | ProjectEuler/ProjectEuler/32_chuan.cpp | #include <stdio.h>
#include <math.h>
#include <inttypes.h>
#include<iostream>
int32_t canAdd[100000] = { 0 };
int32_t HowManyDigs(int32_t i, int32_t j) {
int32_t digs = 0;
digs += (int32_t)floor(log10(i)) + 1;
digs += (int32_t)floor(log10(j)) + 1;
digs += (int32_t)floor(log10(i * j)) + 1;
return digs;
}
bool Prog... | ALGO | 0.999759 | 5.461682 |
f793203d-e29b-4840-97a8-7af7aca65fa7 | ValeriiKoniushenko/TheFlower | dependencies/boost_1_80_0/libs/graph/example/topo-sort-file-dep2.cpp | using namespace boost;
namespace std
{
template < typename T >
std::istream& operator>>(std::istream& in, std::pair< T, T >& p)
{
in >> p.first >> p.second;
return in;
}
}
typedef adjacency_list< listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
directe... | ALGO | 0.999536 | 5.506413 |
4108a511-2041-411d-8d09-636a60a7704c | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Gemma/top0-100/sum-of-special-evenly-spaced-elements-in-array-Solution.solve/177781_DoS_Exec_Code_Overflow.cpp | void GfxImageColorMap::getGrayLine(Guchar *in, Guchar *out, int length) {
int i, j;
Guchar *inp, *tmp_line;
switch (colorSpace->getMode()) {
case csIndexed:
case csSeparation:
tmp_line = (Guchar *) gmalloc (length * nComps2);
for (i = 0; i < length; i++) {
for (j = 0; j < nComps2; j++) {
... | ALGO | 0.998468 | 4.106157 |
d2afe775-3b22-4c76-8274-12a9c871ba88 | Riki-Coddee/Data-Structure-Algorithm | Algorithm/countInversion.cpp | #include<iostream>
using namespace std;
long long merge(int arr[], int l, int mid, int r){
int n1 = mid - l+1;
int n2 = r - mid;
int a[n1];
int b[n2];
for (int i = 0; i < n1; i++)
{
a[i] = arr[l+i];
}
for (int i = 0; i < n2; i++)
{
b[i] = arr[(mid+1)+i];
}
... | ALGO | 0.999991 | 4.777086 |
e56ba22c-d5a8-4aa3-b334-cad0f03ae6b6 | wsn1226/FEM-Cloth | extern/libigl/python/py_doc.cpp | const char *__doc_igl_active_set = R"igl_Qu8mg5v7(// Known Bugs: rows of [Aeq;Aieq] **must** be linearly independent. Should be
// using QR decomposition otherwise:
// http://www.okstate.edu/sas/v8/sashtml/ormp/chap5/sect32.htm
//
// ACTIVE_SET Minimize quadratic energy
//
// 0.5*Z'*A*Z + Z'*B + C with co... | ALGO | 0.994608 | 4.658619 |
79b09f2a-e63f-41fb-a4cc-7ea288ad71b2 | LSNXUV/C-- | GPLT/exam/L2/1-10/7-family-lowtime.cpp | // #include <bits/stdc++.h>
#include <iostream>
#include <set>
#include <vector>
#include <tuple>
using namespace std;
int N,k,c;
double house,area;
set<int> rens; //洢ʱͥ
struct cmp{
bool operator()(const tuple<double,set<int>,double,double>& f1,const tuple<double,set<int>,double,double>& f2) const {
if(get<... | ALGO | 0.99948 | 3.317818 |
3cb07b66-851b-4f36-85c3-3aa7113c4269 | sigvebs/VMC | QD/QD_Orbital.cpp | /*
* File: QD_Orbital.cpp
* Author: sigve
*
* Created on 1. mars 2012, 09:30
*/
#include "QD_Orbital.h"
/*******************************************************************
*
* NAME : QD_Orbital( double** r)
*
* DESCRIPTION : Constructor.
*
*/
QD_Orbital::QD_Orbital(int dim, doub... | ALGO | 0.999418 | 5.026328 |
38a0cb79-8173-4cbd-a923-00e43efa819b | SaiPrathapstar/CPP-codes | InfixTOpostfix.cpp | #include<iostream>
#include<stack>
using namespace std;
// defines the Boolean function for operator, operand, equalOrhigher precedence and the string conversion function.
bool IsOperator(char);
bool IsOperand(char);
bool eqlOrhigher(char, char);
string convert(string);
int main()
{
string infix_... | ALGO | 0.999234 | 4.592381 |
4aaa89b0-57cb-4c31-92bc-feea564727c3 | algorithm004-03/algorithm004-03 | Week 06/id_508/LeetCode_200_508.cpp | class Solution {
public:
int numIslands(vector<vector<char>>& grid) {
int k = 0;
int res = 0;
deque<pair<int,int>> que;
for(int i = 0; i< grid.size() ; i++ ) {
for (int j = 0; j < grid[0].size(); j++) {
if(grid[i][j] == '1') {
k++;
... | ALGO | 0.999944 | 6.432408 |
8198d32c-9ed6-48a2-b2e5-1948affd95e4 | ishandutta2007/codeforces | dragonslayerintraining/normal/1096/C.cpp | #include <cstdio>
int gcd(int a,int b){
return b?gcd(b,a%b):a;
}
int solve(int ang){
int g=gcd(ang,180);
int num=ang/g,den=180/g;
if(den-num==1) return den*2;
return den;
}
int main(){
int T;
scanf("%d",&T);
while(T-->0){
int ang;
scanf("%d",&ang);
printf("%d\n",solve(ang));
}
return ... | ALGO | 0.999379 | 3.991544 |
dce698ca-183f-42db-b9a6-71b0e6445ad8 | raginigit6604/GeeksForgeeksPOTD | Day 21/rotateandDelete.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int rotateDelete(vector<int>& arr) {
int n = arr.size();
int x = 1; // This will track the step number
while (n > 1) {
// Rotate the array to the right by one (simulated by moving the last elem... | ALGO | 0.999958 | 7.292766 |
286aebd5-acaf-44b4-bb72-c19887f23261 | ishandutta2007/codeforces | obsidian/normal/1400/D.cpp | #pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
using namespace std;
typedef long long LL;
typede... | ALGO | 0.999936 | 3.391591 |
83fad465-a0c4-458d-8387-14e004660bae | ishandutta2007/codeforces | igorbunov/normal/1466/A.cpp | #include <algorithm>
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <stdio.h>
#include <iomanip>
#include <clocale>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
using namespace std;
//309810X... | ALGO | 0.999357 | 4.25513 |
51189431-3794-47a8-bf82-b415c6ed318d | alexandraback/datacollection | solutions_2751486_0/C++/tracyzhu/a.cpp | #include <stdio.h>
#include <iostream>
#include <memory.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <map>
#include <set>
using namespace std;
typedef __int64 LL;
int cal(string a) {
int cnt = 0,Max = 0;
for(int i = 0;i < a.length();i++){
if(a[i] == 'a' || a[i] == 'e' || ... | ALGO | 0.999684 | 4.122541 |
7a4636c9-2b1c-4449-998f-b04176392b15 | liuguojun/OnlineJudge | POJ/2080/2194842_AC_234MS_60K.cpp | #include <stdio.h>
void main() {
int m1[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int m2[12]={31,29,31,30,31,30,31,31,30,31,30,31};
char week[7][10]={"Saturday","Sunday","Monday",
"Tuesday","Wednesday","Thursday","Friday"};
int days, weekday;
scanf("%d",&days);
while(days != -1){
... | ALGO | 0.999488 | 3.250776 |
d74323c4-d4b8-4829-a6e0-3ec83614535d | calmhandtitan/algorepo | dp/Coin_ways.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAXV 100000
/*
Given n denominations of coins, tell
the number of ways of paying any amount V,
using different combinations of coin denominations
Each query can be answered in O(1) after preprocessing
*/
long long ways[MAXV];
int Count_ways(int *coins, int n)
{... | ALGO | 0.999795 | 4.440371 |
f31e4b82-0d57-4d35-8833-b9294e2aefc6 | PutinCoinPUT/putincoinsource | boost_1_58_0/libs/math/example/find_mean_and_sd_normal.cpp | // find_mean_and_sd_normal.cpp
// Example of finding mean or sd for normal distribution.
// Note that this file contains Quickbook mark-up as well as code
// and comments, don't change any of the special comment mark-ups!
//[normal_std
/*`
First we need some includes to access the normal distribution,
the algorithms... | ALGO | 0.999834 | 5.874496 |
6fe7732f-218a-445c-bfb3-dc2762056da5 | RenanTashiro/URI | code/Iniciante/p-level-1/1185.cpp | /*
Nome: Acima da Diagonal Secundária
ID: 1185
Resposta: Accepted
Linguagem: C++
Tempo: 0.000s
Tamanho: 721 Bytes
Submissao: 13/01/15 08:06:33
*/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int selecao_colunas = 11;
char operacao;
cin >> operacao;
float m... | ALGO | 0.999375 | 3.424244 |
8ed144b7-2183-4909-8c41-bdb86a0792e9 | actium/codeforces | 1900/20/1925a.cpp | #include <iostream>
#include <string>
void answer(const std::string& x)
{
std::cout << x << '\n';
}
void solve(size_t n, size_t k)
{
std::string s;
for (size_t i = 0; i < n; ++i) {
for (size_t j = 0; j < k; ++j)
s.push_back('a' + j);
}
answer(s);
}
void test_case()
{
size... | ALGO | 0.998048 | 3.946284 |
48014650-0cce-4f63-8cb5-9f50c932a524 | SE-OOP/Assignment04 | 201816040208/Ex09_23/DeckOfCards.cpp | #include"deckofcards.h"
#include<cstdlib>
#include<ctime>
#include<iostream>
DeckOfCards::DeckOfCards()
{
int i;
for(i = 0; i < 52; i++) //初始52次
{
Card a(i%13, i/13);
deck.push_back(a);
}
}
void DeckOfCards::shuffle()
{
srand(time(0));
int i;
for(i = 0; i < 52; ++i)
{... | TOOL | 0.947153 | 4.348957 |
dc8cda09-5762-4b06-967e-34e8447a7d19 | lnxdx/SPOJ | M3TILE - LATGACH3 (Bitmask).cpp | // ITNOG
// O(n.2^3) Bitmask DP by lnxdx, Mashhad, 2018
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define bit(a , b) (((a)>>(b))&1)
#define bt(x) __builtin_popcount(x)
const int MAXN = 33;
const int MAXM = (1 << 3) + 13;
ll dp[MAXN][MAXM];
void solve(int n)
{
memset(dp, 0, sizeof dp);
dp... | ALGO | 0.999422 | 4.611924 |
46cac5d4-4766-4440-a014-9380bc0981e6 | mako-tutor/llvm | libc/src/math/generic/f16addf.cpp | #include "src/math/f16addf.h"
#include "src/__support/FPUtil/generic/add_sub.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float16, f16addf, (float x, float y)) {
return fputil::generic::add<float16>(x, y);
}
} // namespace LIBC_NAM... | ALGO | 0.992312 | 6.895594 |
f3a086f1-9ff5-4209-8049-218357c8e4b2 | xtf0214/CPP | Contest/Nowcoder/58604/G1.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 5, mod = 1e9 + 7;
ll dp[N], s6[N];
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
string s;
cin >> s;
int n = s.size();
s = " " + s;
for (int i = 1; i <= n; i++) {
if (s[i] == '1')
... | ALGO | 0.999873 | 4.747844 |
5589acd7-3909-4e5d-b075-842d15f749f3 | xizhonghua/zju_geo_sim_sdk | 3rd/official/mesquite-2.2.0/src/MappingFunction/Linear/LinearPyramid.cpp | /** \file LinearPyramid.cpp
* \brief LinearPyramid implementation
* \author Jason Kraftcheck
*/
#include "Mesquite.hpp"
#include "LinearPyramid.hpp"
#include "MsqError.hpp"
namespace MESQUITE_NS {
static const char* nonlinear_error
= "Attempt to use LinearTriangle mapping function for a nonlinear element\n";... | TOOL | 0.95689 | 7.220065 |
6951d32d-3a73-4278-b764-2b305abb214e | ROCm/rocSPARSE | clients/samples/example_gebsrmv.cpp | #include "rocsparse/rocsparse.h"
#include <hip/hip_runtime_api.h>
#include <iostream>
#define HIP_CHECK(stat) \
{ \
if(stat != hipSuccess) ... | ALGO | 0.986722 | 4.405168 |
5cd071ff-ab6d-4f17-81b3-c5c4da5d8ec2 | GrapixLeGrand/Lustrine | thirdparty/Bullet3/bullet3/src/LinearMath/btPolarDecomposition.cpp | #include "btPolarDecomposition.h"
#include "btMinMax.h"
namespace
{
btScalar abs_column_sum(const btMatrix3x3& a, int i)
{
return btFabs(a[0][i]) + btFabs(a[1][i]) + btFabs(a[2][i]);
}
btScalar abs_row_sum(const btMatrix3x3& a, int i)
{
return btFabs(a[i][0]) + btFabs(a[i][1]) + btFabs(a[i][2]);
}
btScalar p1_norm... | ALGO | 0.999484 | 6.729849 |
646d7b32-dfb6-4a9a-850f-993262c44eac | OpenHUTB/engine_bak | Engine/Source/ThirdParty/ICU/icu4c-53_1/source/i18n/stsearch.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_COLLATION && !UCONFIG_NO_BREAK_ITERATION
#include "unicode/stsearch.h"
#include "usrchimp.h"
#include "cmemory.h"
U_NAMESPACE_BEGIN
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(StringSearch)
// public constructors and destructors -----------------------------------
StringSearch::... | TOOL | 0.970372 | 6.293441 |
90dae056-d6a6-490b-bcc1-5fbc7728a736 | Rafael-Machado01/brain | Fema/Algoritimos/C++/codes/Lista 3 ( Enquanto )/catorze.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main() {
float s,p,sn;
cout << "Digite o valor de salário :";
cin >> s;
while(s != -1) {
cout << "Digite o valor do percentual de aumento :";
cin >> p;
sn = s + s * p / 100.0;
cout << "O novo salário é: " << sn << endl;
... | TOOL | 0.949973 | 3.560883 |
1e5935fc-1a52-4a59-894d-ca40e8019069 | rajnishrajvansh/LeetCode_Solutions | 2254-check-if-every-row-and-column-contains-all-numbers/2254-check-if-every-row-and-column-contains-all-numbers.cpp | class Solution {
public:
bool checkValid(vector<vector<int>>& matrix) {
int n=matrix.size();
for(int i=0;i<n;i++){
vector<bool> rowvisited(n,false);
vector<bool> colvisited(n,false);
for(int j=0;j<n;j++){
int rowVal=matrix[i][j]-1;
... | ALGO | 0.999981 | 6.155421 |
950e5862-295c-43f8-87b0-ae75e836a9a3 | fmvazquez/Competitive-Programming | SelectivoIOI/FindingCentroid/main.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> adj;
vector<int> num_children;
int num_nodes, num_con, half;
int centroid, temp;
int measure(int x, int father)
{
int children = 1;
// cout << x << endl;
for (auto n : adj[x]) {
if (n == father) continue;
children += measu... | ALGO | 0.999874 | 4.722771 |
8d674860-f484-432c-a2f7-186bba5fb65b | raincross7/code-similarity | codes/train_code/problem185/problem185_279.cpp | #ifdef ConanYu
#include "local.hpp"
#else
#pragma GCC optimize("-O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void Main();
#define debug(...) do { } while(0)
int main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
Main();
}
#endif
const int N = 105;
int a[N << 1];
void Main(... | ALGO | 0.999881 | 4.399647 |
4618dca3-91ce-4e4a-82bf-5528ef9d839d | VA-run23/Data-Structures-And-Algorithms | Before Linked List-Done/changeCase1.cpp | //done
//Each call to transform iterates through the entire string, performing a constant amount of work for each character.
//Since each transform call runs in linear time, the overall time complexity remains O(n).
#include<algorithm>
#include<iostream>
#include<string>
using namespace std;
int main(){
string s... | ALGO | 0.994996 | 5.105512 |
3a0e1ee9-4314-4bec-8ec2-6a375117536f | KevinRojas1499/CSES-Problem-Set | Dynamic Programming/BookShop.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
ll n, x;
cin>>n>>x;
vector<ll> h(n),s(n);
for(int i = 0; i<n;i++){
cin>>h[i];
}
for(int i = 0; i<n;i++){
cin>>s[i];
}
vector<ll> dp(x+1);
for(int i = 0; i< n; i++){
for(int j = x; j>= h[i]; j--){
dp[j] = max(dp[j], s[i]+... | ALGO | 0.999936 | 3.905453 |
0a34db35-1a86-4094-a938-17547f42a8cb | Pritz69/GFG_POTD | Hard/Vertex Cover/vertex-cover.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 vertexCover(int n, vector<pair<int, int>> &edges) {
int ans=18;
for(int bit=0;bit<(1<<n);bit++){
... | ALGO | 0.999955 | 6.414875 |
23c10ce2-8521-4ff2-9bfc-6bba036feed0 | Anton-Tarazi/CSESProblemSet | GraphAlgorithms/RoundTrip.cpp | #include <bits/stdc++.h>
using namespace std;
int dfs(int node, int step, vector<vector<int>> &graph, vector<int> &visited) {
if (visited[node] != 0) {
int delta = step - visited[node];
if (delta >= 3) {
cout << delta + 1 << "\n";
cout << node << " ";
return de... | ALGO | 0.999956 | 4.562423 |
6d41dc74-315d-4f6b-ab3a-cb940c8cd26d | hirakuuuu/kyopro | others/typical90/6/9.cpp | #include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define inr(l, x, r) (l <= x && x < r)
#define ll long long
#define ld long double
// using mint = modint1000000007;
// u... | ALGO | 0.999795 | 4.813225 |
ddbdcba9-0743-45cc-b282-af68df128728 | Shikhar1808/Learning-Cpp | schedulingAlgos/bankersAlgo.cpp | #include <iostream>
using namespace std;
const int P = 5;
const int R = 3;
bool isSafe(int processes[], int avail[], int maxm[][R], int allot[][R]){
int need[P][R];
for(int i=0; i<P; i++){
for(int j=0; j<R; j++){
need[i][j] = maxm[i][j] - allot[i][j];
}
}
bool finish[P] = ... | ALGO | 0.999979 | 4.75152 |
516d595b-7591-4737-a946-83f7a0a337a8 | boddicheg/competitive | leetcode/200-299/278_first_bad_version.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
#define watch(x) std::cout << (#x) << " is " << (x) << std::endl
template<typename T>
void print(const T &container)
{
std::cout << "[ ";
for (const auto &e : container)
std::cout << e << " ";
std::co... | ALGO | 0.999757 | 5.394932 |
21ae9964-8aa5-4a6b-99ec-b31ba6a55a8b | ishandutta2007/codeforces | chelly/normal/781/A.cpp | #include<bits/stdc++.h>
using namespace std;
const int N(211111);
vector<int> adj[N];
int stmp[N], color[N], tim, ans;
void dfs(int v, int fa) {
tim++;
stmp[color[v]] = tim;
stmp[color[fa]] = tim;
int cur(0);
for(int y : adj[v]) {
if(y != fa) {
cur++;
while(cur == color[v] || cur == color[fa]) {
cur++;... | ALGO | 0.999943 | 4.570922 |
a84f7cdc-3185-4080-a851-152c6dc4546a | meem-5971/Contest-and-Upsolve | CC 115 div 3/Decorating_Christmas_Tree.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve(){
ll n,x,y;
cin>>n>>x>>y;
ll r=y/3;
ll xl,l;
if(x>=r){
xl=x-r;
l=r;
}
else{
xl=0;
l=x;
}
ll d=xl/2;
if(d+l>=n){
cout<<"YES"<<'\n';
}
el... | ALGO | 0.999889 | 3.832221 |
42a6b054-5003-459e-beb3-20b5ddee684b | shruti380/DSA-SOLUTION | 3396-valid-word/valid-word.cpp | class Solution {
public:
bool isVowel(char ch){
return ch=='a'||ch=='A'||ch=='e'||ch=='E'||ch=='i'||ch=='I'||ch=='o'||ch=='O'||ch=='u'||ch=='U';
}
bool isConsonant(char ch){
// Check if it's an alphabetic character AND not a vowel
return ((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')) ... | ALGO | 0.999499 | 6.320608 |
810a3953-49d6-4dac-813d-b33d17d6eca8 | UMKC-CS201/CS201R-FinalReview | CS201R-FinalReview/Examples.cpp | #include "Examples.h"
void examplesSorts() {
// select sort
int a[7] = { 5, 6, 3, 8, 7, 1, 2 };
selectSort(a, 7);
printList(a, 7);
// insertion sort
int b[7] = { 5, 6, 3, 8, 7, 1, 2 };
insertSort(b, 7);
printList(b, 7);
// insertion sort
int c[7] = { 5, 6, 3, 8, 7, 1, 2 };
... | TOOL | 0.916309 | 3.677943 |
23177374-1322-4c16-a854-5c73cd78be01 | hzfsls/leetcode-supercrawl | data/0931.minimum-falling-path-sum/code_snippets/sol.cpp | class Solution {
public:
int minFallingPathSum(vector<vector<int>>& matrix) {
}
}; | ALGO | 0.999978 | 6.365981 |
23fc0982-197d-471a-a122-a5f013ce5407 | Mehrab-Mahi/Codeforces | 903C.cpp | #include<bits/stdc++.h>
#define optimize ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define pb push_back
using namespace std;
int main()
{
optimize;
int n,p=0,mx=0,m=0,pos;
cin>>n;
int a[n];
for(int i = 0;i<n;i++){
cin>>a[i];
}
sort(a,... | ALGO | 0.999967 | 3.635658 |
0b140336-f7d8-416e-a2b4-b6ccad137add | iamdey/tracktion_engine | modules/tracktion_engine/3rd_party/airwindows/DeRez/DeRezProc.cpp | #ifndef __DeRez_H
#include "DeRez.h"
#endif
void DeRez::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
ove... | ALGO | 0.99666 | 3.500028 |
89c12999-a776-4681-bd70-5f2e120c5fce | jain2308/SOC | week4/coincombinations2.cpp | #include "bits/stdc++.h"
using namespace std;
// Typedefs and macros
#define ll long long
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define endl '\n'
#define rep(i, a, b) for (int i = a; i < b; ++i)
#define in(v,n) rep(i, 0, n) { cin >> v[i]; }
#define out(v,n) rep(i, 0, n) { cout << ... | ALGO | 0.999993 | 4.767023 |
d3b16cfa-a19d-4cfe-bfda-2ba6800f270b | PhoengZ/DataStructure | pop_many_package_round2/main.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <stack>
#include "stack.h"
#include "student.h"
using namespace std;
int main() {
CP::stack<int> s;
char c;
scanf("%c", &c);
while (c != 'q') {
if (c == 'a' || c == 'm' || c == 'r') {
// add data
int n;
scanf("%d", &n);
... | ALGO | 0.973135 | 4.050824 |
0a03ec69-c4c8-4957-877c-aaa5c6c80328 | JiungChoi/nav2 | nav2_mppi_controller/src/path_handler.cpp | #include "nav2_mppi_controller/tools/path_handler.hpp"
#include "nav2_mppi_controller/tools/utils.hpp"
#include "nav2_costmap_2d/costmap_2d_ros.hpp"
namespace mppi
{
void PathHandler::initialize(
rclcpp_lifecycle::LifecycleNode::WeakPtr parent, const std::string & name,
std::shared_ptr<nav2_costmap_2d::Costmap2DR... | ALGO | 0.853936 | 5.696064 |
70d83bec-86f4-40de-9237-21e48b9c1ef6 | sumangroup/cpp | callbyreference.cpp | #include<iostream>
using namespace std;
void callbyreference(int *a,int *b);
int main(){
int a=10,b=20;
cout<<"Befroe function call:"<<endl;
cout<<"a: "<<a<<endl;
cout<<"b: "<<b<<endl;
callbyreference(&a,&b);
cout<<"After function call:"<<endl;
cout<<"a: "<<a<<endl;
cout<<"b: "<<b<<end... | TOOL | 0.981673 | 4.412508 |
c6b15c0d-e84d-4cc3-8f96-6ade7dd90123 | Jian-Zhe/Competitive-programing | cpp/group/w5-knapsackDP/CowPoetry.cpp | #include <bits/stdc++.h>
#define _ cin.tie(0) -> sync_with_stdio(0);
using namespace std;
using ll = long long int;
const ll mod = 1000000007;
int syllables[5001];
int rhyme[5001];
ll dp[5001];
int r[5002];
inline ll qpow(ll x, ll y, ll n) {
ll res = 1;
while(y > 0) {
if(y & 1) {
res *... | ALGO | 0.999974 | 4.199857 |
68df8666-55a4-40d1-8f53-5c84adb7433b | harsh7598/RSL_Internship | 04.09.23/Que30.cpp | #include <iostream>
#include <vector>
// Function to perform heapify-up (for both min and max heaps)
void heapifyUp(std::vector<int>& heap, int index) {
while (index > 0) {
int parentIndex = (index - 1) / 2;
// For min heap, swap if the child is smaller than the parent
// For max heap, swa... | ALGO | 0.999974 | 6.714562 |
2b8ae1ae-c058-4148-9c23-e051648961d9 | MissLiDailyStruggle/C_plus_plus | 计算字符串的距离.cpp | //ӣhttps://www.nowcoder.com/questionTerminal/3959837097c7413a961a135d7104c314
//Դţ
//Levenshtein 룬ֳƱ༭룬ַָ֮䣬һתһٱ༭ɵı༭һַ滻
//һַһַɾһַ༭㷨ɶѧLevenshteinģֽLevenshtein Distance
#include <iostream>
#include <vector>
#include<algorithm>
#include <string>
using namespace std;
int calStringDistance(string str1, string str2)
{
int n... | ALGO | 0.999959 | 4.778921 |
882ba922-8c03-415a-a927-8e5f03cdda3a | yutachaan/kyoupuro | atcoder/abc/51-100/072/b.cpp | #include <bits/stdc++.h>
using namespace std;
// <----- alias ----->
using ll = long long;
const int inf = INT_MAX / 2;
const ll infl = 1LL << 60;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using pii = pair<int, int>;
using mii = map<int, int>;
using msi = map<string, int>;
using si... | ALGO | 0.999982 | 4.23973 |
a024cd9a-5f7a-4c81-9603-a995edd7a935 | alexandru-andronache/adventofcode | 2017/day13/tests/TestClass.cpp | #include "TestClass.h"
#include "../test.h"
namespace aoc2017_day13 {
TEST_F(Tests2017Day13, part_1_test) {
ASSERT_EQ(part_1("../2017/day13/input_test.in"), 24);
}
TEST_F(Tests2017Day13, part_1_real_test) {
ASSERT_EQ(part_1("../2017/day13/input.in"), 2384);
}
TEST_F(Tests2017Day13... | TEST | 0.952556 | 6.740808 |
2e718f55-53aa-4dd4-80dd-c0a93d50b603 | yzzupgo/MFTCG | Data/abc123_b/Zhtoshi/wa/25153147.cpp | #include <bits/stdc++.h>
#include <string>
#define rep(i, n) for (long long i = 0; i < n; i++)
using namespace std;
int main() {
vector<pair<int,int>> data(5);
rep(i,5){
cin >> data.at(i).second;
data.at(i).first = data.at(i).second%10 +1;
}
sort(data.begin(), data.end());
... | ALGO | 0.998898 | 3.767928 |
9e141331-f264-4efb-bd14-ca595a244615 | dev-jungbin/2019-SWU-cppBasic | 190502/ConsoleApplication3/ConsoleApplication3.cpp | #include "pch.h"
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double r, s, A;
const double PI = 3.14159;
cout << "Enter the length from the center to a vertex: ";
cin >> r;
s = r * sin(PI / 180 * 72) / sin(PI / 180 * 54);
A = 5*(pow(s,2))/(4*tan(PI / 5));
cout << "The area of the pent... | ALGO | 0.997897 | 4.014525 |
cf09ef85-eb8c-48a2-bc88-5031a50eb94b | Mosina916/OCT24_Cpp | Trees4/bst.cpp | #include<iostream>
#include<queue>
using namespace std;
class node{
public:
int d;
node*left;
node*right;
node(int data){
d=data;
right=NULL;
left=NULL;
}
};
void preorderprint(node*root){
if(root==NULL){
return;
}
cout<<root->d<<" ";//8
preorderprint(root->left);//lst
preorderprint(root->right);//r... | ALGO | 0.999875 | 3.935268 |
8b5c7cb2-fc6a-4198-b4bd-fcbcef99d4b8 | khushisinha20/Data-Structures-and-Algorithms | Matrix/reconstruct_a_2_row_binary_matrix.cpp | //leetcode.com/problems/reconstruct-a-2-row-binary-matrix/submissions/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> reconstructMatrix(int upper, int lower, vector<int>& colsum) {
int sum_of_columns = accumulate(colsum.begin(), colsum.end(), 0);
if (upp... | ALGO | 0.999989 | 5.633974 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.