uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
33e8e71a-609d-4c4d-9995-390334cb0969 | Prashant-thakur77/c-language | sum_2_matrix.cpp | #include<stdio.h>
using namespace std;
int main(){
int rows,cols;
printf("enter the no of rows");
scanf("%d",&rows);
printf("enter the no of columns");
scanf("%d",&cols);
int matrix1[rows][cols],matrix2[rows][cols],result[rows][cols];
for(int i=0;i<rows;i++){
for(int j=0;j<cols;j++){
printf("el... | ALGO | 0.997628 | 3.259173 |
214a2813-322c-4955-93a8-48c5978ad51e | sidhant-khamankar/DSA_Ka_14 | Topic_wise_LeetCode_C++/tree_medium/173_binary_search_tree_iterator-linkedin.cpp | /*
* @lc app=leetcode id=173 lang=cpp
*
* [173] Binary Search Tree Iterator
*/
// @lc code=start
/**
* 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)... | ALGO | 0.99994 | 6.689057 |
e2ba44be-d607-4855-ba55-3faeb335efe4 | TRrajputDEV/DataStructureAlgorithm | Patterns/pattern5.cpp | #include<iostream>
using namespace std;
/* pattern:
1
2 2
3 3 3
4 4 4 4 */
int main()
{
int row = 1;
int n;
cout<<" enter the number: ";
cin>>n;
while (row<=n)
{
/* code */
int col =1;
while (col<=row)// (col<=n for square prinnting)
{
... | ALGO | 0.999916 | 3.88423 |
e923ee85-b4a8-4176-b751-e63d2c448cf2 | thong3le/leetcode | cpp/_370_range_addition.cpp | /*
* Author: Thong Le
* Date:
*
* LeetCode 370 - Range Addition
*
* Solution Approach:
*
*
*
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_map>
using namespace std;
class Solution {
public:
int func() {
return 0;
}
};
int main() {
return 0;
... | TOOL | 0.99119 | 4.781257 |
54ecfc84-9720-4e92-be89-3d43e9d751eb | ihrifatNITRO/Time-Passing-Problem-Solving | Merge_VS_Quick.cpp | /* In the name of ALLAH */
#include<bits/stdc++.h>
// MAXIMUM and MINIMUM elements
#define mx_ari(a) *max_element(a , a+sizeof(a)/4)
#define mn_ari(a) *min_element(a , a+sizeof(a)/4)
#define mx_arl(a) *max_element(a , a+sizeof(a)/8)
#define mn_arl(a) *min_element(a , a+sizeof(a)/8)
#define mx_v... | ALGO | 0.999299 | 3.928079 |
8290149c-8c6e-418f-940e-a2cab82c90b3 | IuliiaChvanova/cpp-search-server | search-server/string_processing.cpp | #include "string_processing.h"
std::vector<std::string> SplitIntoWords(const std::string& text) {
std::vector<std::string> words;
std::string word;
for (const char c : text) {
if (c == ' ') {
if (!word.empty()) {
words.push_back(word);
word.clear();
... | ALGO | 0.951501 | 4.232275 |
39bd8200-5f67-4f12-9c31-ed7a14917f17 | guan78001/hello | opencl_samples/OpenCL_Samples/OpenCL_Samples/reduction.cpp |
#define __CL_ENABLE_EXCEPTIONS
#if defined(__APPLE__) || defined(__MACOSX)
#include <OpenCL/cl.hpp>
#else
#include <CL/cl.hpp>
#endif
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
#define KERNEL_CODE(...) #__VA_ARGS__
std::string reduce_str = KERNE... | ALGO | 0.999285 | 3.75818 |
8932a6e4-8029-4232-b031-44b81333d180 | kuno4n/POJ | src/POJ_3468.cpp |
#include <cstdio>
#include <cstdlib>
#include <stdlib.h>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <numeric>
//#include "cout.h"
using namespace std;
#defi... | ALGO | 0.999333 | 3.844152 |
262d2dd6-5fc5-4781-ae30-ecd5271b792a | iotaap/iotaap-os | src/libs_3rd_party/micro-sdcard/mySD.cpp | /*
Implementation Notes
In order to handle multi-directory path traversal, functionality that
requires this ability is implemented as callback functions.
Individual methods call the `walkPath` function which performs the actual
directory traversal (swapping between two different directory/file handles
a... | TOOL | 0.905167 | 5.615953 |
1acc4a48-1959-4c52-91e8-edd5e8430250 | Gnaroshi/practice-algorithm-solvedac | With_Levels/Bronze/Bronze_2/27542.cpp | // problem: 絶対階差数列 (Sequence of Absolute Differences)
// id: 27542
// time taken:
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> a(n), b(n);
for (auto &i : a)
cin >> i;
copy(a.begin(), a.end(... | ALGO | 0.999888 | 3.931759 |
7aad6483-b9c0-4e8c-8139-59f9306e8c4b | Proyecto-Athenas/athenas-reforged | src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp | /* ScriptData
SDName: Boss_High_King_Maulgar
SD%Complete: 90
SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing
SDCategory: Gruul's Lair
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "gruuls_lair.h"
enum HighKingMaulgar
{
SAY_AGGRO = 0... | ALGO | 0.965879 | 5.636367 |
49cd6df4-e0d5-4c58-9ad5-d2727c9ca9f9 | 6Farkas9/LeetCode100 | Second_Time/7_linked_list/t33/main.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
vector<int> head_int = {5, 6, 2, 7, 9, 3, 1, 6, 8, 10, 23};
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ... | ALGO | 0.999978 | 5.214767 |
f5983046-80f9-44fe-9e48-76e1dc59f622 | jxx-sx/BOJ_Study | solved/3747.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
int n, m;
int scc[2001];
vector<int> edges[2001];
vector<int> edges_r[2001];
bool is_visit[2001];
bool is_visit_r[2001];
int scc_cnt;
stack<int> st;
void dfs(int x) {
is_visit[x] = true;
for (auto a : edges[x])
if (!is_visit[a... | ALGO | 0.999926 | 4.291106 |
c444df57-6746-4628-abed-d51c57b6c9d4 | DoubleMindy/PolarCodes | src/Test_AwgnBer.cpp | #include "../include/BpskAwgnChannel.h"
#include <iostream>
int mainasd() {
BaseChannel * channelPtr = new BpskAwgnChannel();
std::vector<int> input = { 0 };
std::vector<double> output;
std::vector<double> snr_array = { -0.25, 0.25, 0.75};
std::size_t N = 100000;
for (std::size_t j = 0; j < snr_array.size()... | TOOL | 0.872047 | 4.084967 |
bfa0d1e9-560c-48f5-b406-67a328a8daf5 | AnalyticalEli/CS1-Labs-Github-Clone | Notes 2C Ahmed/Notes 2C Ahmed/Class 3A Example.cpp | // Hypotenuse Calculator (Notes)
#include <iostream>
#include <cmath>
using namespace std;
// Function Prototype
double calcHypotenuse(double x, double y);
// Main Function
int main()
{
double a, b;
cout << "This program calculates the hypotenuse of any right triangle \ngiven the two legs.\n\n" << endl;
cout <... | TOOL | 0.998868 | 3.905838 |
2040a17a-4b49-4165-b94a-d5df9c3e0def | nylttpgg09/FluoTest | stm32/Drivers/CMSIS/NN/Examples/IAR/iar_nn_examples/NN-example-gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.916257 | 7.457812 |
0b1d98d3-8078-4fdd-943c-362ca433c7dd | 0point1Zishan/XPSC | Week 4/Day 7/T_Fedor_and_New_Game.cpp | #include<bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define nline "\n"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define int lon... | ALGO | 0.999907 | 4.244577 |
d8bae2d4-a404-40a2-81c2-b4746dfb0b43 | dika-Paul/C- | test.cpp | #include<bits/stdc++.h>
using namespace std;
class A
{
public:
void go();
};
class B : public A
{
};
void go(A temp);
int main()
{
char* str = "aaaaaa";
cout << strlen(str);
return 0;
} | ALGO | 0.977415 | 3.466549 |
4046e44a-b603-4c9f-b481-bf80cf534c9d | davidxk/DecryptNaN | xor_encrypt/make_sample.cpp | #include "CipherGen.h"
int main()
{
string plain;
getline(cin, plain);
CipherGen cg;
TestCase tc=cg.genCase(plain);
tc.print();
return 0;
}
| ALGO | 0.942614 | 3.263722 |
2ebdd971-aea3-4daa-a8fc-17111b8bf18c | vishnupsatish/codeforces-practice | 1374e1.cpp | /**
* author: vishnus
* created: 2022-04-28
**/
#include <bits/stdc++.h>
using namespace std;
// Idea: we should take some amount 1 1s and the rest should be the
// k - (number of 1 1s taken) 1 0s and 0 1s. Use sorting and prefix sum arrays.
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n... | ALGO | 0.999909 | 4.214812 |
ac8ba3ea-97f7-48dc-92a7-4b36068eb667 | aquamon/DataStructureAndAlgorithms | HEAPS/HeapSort.cpp | // https://practice.geeksforgeeks.org/problems/heap-sort/1
//{ Driver Code Starts
// C++ program for implementation of Heap Sort
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// The functions should be written in a way that array become sorted
// in increasing order when heapSort() is called.
... | ALGO | 0.999947 | 6.033314 |
3ba36d4b-7fff-41ae-a009-f1183eae3876 | Rober11pg/Estructura | Parcial I/Recursividad/FactoresNumero.cpp | /* Ver los factores de un número mediante recursividad
Nombre: Roberto Jiménez
Código: 7048*/
#include<iostream>
#define NUM 10
using namespace std;
int main(){
system("color f0");
int n;
int IngresarNumero(int limInf, int limSup);
void FactoresNumeros();
n... | ALGO | 0.994628 | 3.247196 |
97bed1f4-42a5-4def-87ec-7377144425c8 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3390_3.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, flag = 0;
cin >> n >> m;
char c;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> c;
if (c == 'B' || c == 'W' || c == 'G')
continue;
else
flag = 1;
}
}
if (flag == 0)
cout << ... | ALGO | 0.990004 | 4.263103 |
b7a8eb3d-9c4e-43b8-864c-df55127ec89c | bwbre/kattis | 1.0-1.9/1.2/ovissa/ovissa.cpp | /*
Brendan
kattis - 1.2
name: Ovissa
count number of 'u' inputted
l - 100,000*/
#include <iostream>
using namespace std;
int main() {
string input;
int count = 0;
cin >> input;
for (int i = 0; i < input.length(); i++) {
if (input[i] == 'u') {
count++;
}
}
cout <... | ALGO | 0.999061 | 4.802088 |
73808fdc-7379-4a00-9c00-2ffca380765a | Amel-CYDF/BOJ | BOJ_2887.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<vpii> vvpii;
typedef vector<vpll> vvpl... | ALGO | 0.999108 | 3.423654 |
6171ac29-7243-4936-97f8-f618d0de2a8f | NotDec/NotDec-llvm2c | lib/notdec-llvm2c/CompoundConditionBuilder.cpp | #include <clang/AST/OperationKinds.h>
#include <clang/Basic/Specifiers.h>
#include "notdec-llvm2c/CFG.h"
#include "notdec-llvm2c/CompoundConditionBuilder.h"
#include "notdec-llvm2c/PostOrderCFGView.h"
#include "notdec-llvm2c/Utils.h"
namespace notdec::llvm2c {
void CompoundConditionBuilder::execute() {
bool change... | TOOL | 0.91559 | 7.134841 |
2d26baea-3d02-488e-a832-3507be20fb29 | jmarshall23/Doom3BFG | neo/renderer/GLMatrix.cpp | #pragma hdrstop
#include "precompiled.h"
#include "RenderCommon.h"
/*
==========================================================================================
OLD MATRIX MATH
==========================================================================================
*/
/*
======================
R_AxisToModelMatri... | ALGO | 0.926603 | 4.598633 |
0d884d20-f3a0-4bc2-b636-b05ac899b5ad | SiddheshWaje04/CS254--CSE220001076 | Lab5/Q-1/main.cpp | #include <iostream>
#include <vector>
using namespace std;
// Function to perform DFS to find the size of the region
int dfs(vector<vector<int>>& matrix, int row, int col, int rows, int cols) {
if (row < 0 || col < 0 || row >= rows || col >= cols || matrix[row][col] == 0)
return 0;
// Marking current ... | ALGO | 0.999968 | 7.404367 |
8fb4fddd-c965-42db-9805-c1aebb280213 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3581_11.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& x) {
bool fu = 0;
char c;
for (c = getchar(); c <= 32; c = getchar())
;
if (c == '-') fu = 1, c = getchar();
for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
if (fu) x = -x;
};
template <class T>
inline void rea... | ALGO | 0.999955 | 4.250316 |
8acf4f36-f5f8-48c1-bd20-6f8ec1d3c73b | tommyliu/visionPJ1 | Appear.cpp | //
// k-Fan matching and training code, as described in the paper:
//
// Crandall, Felzenszwalb, Huttenlocher, "Spatial
// Priors for Part-based Recognition using Statistical Models," CVPR 2005.
//
//
// Author: David Crandall, 2003-2005
// <EMAIL>
//
// Please do not redistribute this code.
/... | ALGO | 0.998023 | 5.684962 |
7d3c9f76-c88a-4cd0-ac43-418913095fde | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_70_15.cpp | #include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const int maxn = 1e6 + 5;
bool b[maxn];
int a[maxn];
int main() {
ios::sync_with_stdio(false);
int n, m, k;
cin >> n >> m >> k;
memset(b, true, sizeof(b));
for (int i = 0; i < m; i++) {
int x;
cin >> x;
... | ALGO | 0.999957 | 3.672471 |
64244f4c-b7ae-42ad-9c74-95f793a0533f | divya144/Computer_organization | cache_simulator/code1.cpp | //Objective:Hit rate using directive method and 4-way set associative
#include<bits/stdc++.h>
using namespace std;
long long int hextodec(string str1)
{
long long int ans=0;
for(int i=str1.length()-1;i>=0;i--)
{
if(str1[i]>='0'&&str1[i]<='9')
{
int temp=(int)(str1[i]-'0');
... | ALGO | 0.97514 | 3.240418 |
4d0b259d-8102-4ef1-8726-b4825b156fa6 | KevinD03/Mass-spring-simulation | extern/libigl/python/py_igl/copyleft/comiso/py_nrosy.cpp | m.def("nrosy", []
(
const Eigen::MatrixXd& V,
const Eigen::MatrixXi& F,
const Eigen::MatrixXi& b,
const Eigen::MatrixXd& bc,
const Eigen::MatrixXi& b_soft,
const Eigen::MatrixXd& w_soft,
const Eigen::MatrixXd& bc_soft,
const int N,
const double soft,
Eigen::MatrixXd& R,
Eigen::MatrixXd& S
)
{
as... | ALGO | 0.998822 | 3.756689 |
c9f69647-24fc-4422-96ec-77e44cc4719f | MrWhitezz/Coding-during-Learning | C++/ProblemSolving/Term3/Week1/A/test.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
vector<vector<pair<int, ll>>> edge;
vector<ll> dist;
vector<bool> is_in_S;
// class cmp
// {
// public:
// bool operator() (int x, int y){
// return dist[x] > dist[y];
// }
// };
// priority_queue<int, vector<int>, cmp> Q;
priority_q... | ALGO | 0.999981 | 4.345566 |
478e304b-0b49-4d74-98c0-9589a2219902 | NUC-NCE/algorithm-codes | codes - ac/Gym/102062E/19692067_AC_124ms_4kB.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
struct Data{
ll x;
int d;
int bs;
};
map<ll,bool> maps;
ll p2[62];
ll init(){
p2[0] = 1;
for(int i=1;i<=60;i++){
p2[i] = p2[i-1]*2LL;
}
}
void deal(int ii){
int d;
ll x;
maps.clear();
scanf("%d%lld",&d,&x)... | ALGO | 0.999745 | 3.554729 |
9cc5ef70-8662-4814-a37e-cedbfeda3faf | kunalbandale/C_CPP_DSA | CPP/matrixAddition.cpp | #include<iostream>
using namespace std;
int main() {
int a[2][3] = {{1,2,3},{4,5,6}};
int b[2][3] = {{7,8,9},{10,11,12}};
int c[2][3];
// Addition
for(int i=0;i<2;i++) {
for(int j=0;j<3;j++) {
c[i][j] = a[i][j] + b[i][j];
}
}
// displaying the elements
for(int i=0;i<2;i++) {
... | ALGO | 0.98951 | 3.491382 |
1f852d74-f76b-42c2-9a4d-e627b80a01f8 | CoderBDK/CP-99 | 01_a_minimize.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--) {
int a,b;
cin>>a>>b;
cout<<abs(a - b) << endl;
}
return 0;
}
| ALGO | 0.999209 | 3.956706 |
77481b17-a80c-4cdc-9269-0bae48b3ce4e | asshejan/Codeforces-Solutions | E_WET.cpp | #include <bits/stdc++.h>
using namespace std;
#define en "\n"
#define ll long long
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll n;
cin >> n;
ll sum = 0, mn = LLONG_MAX;
ll a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
sum += a[i]... | ALGO | 0.999981 | 4.674279 |
4c88f2a8-e951-40fe-970e-15736359925b | ABCnutter/Deploy | mmdeploy/mmdeploy-master/mmdeploy-master/csrc/mmdeploy/backend_ops/ncnn/ops/topk/topk.cpp | #include <math.h>
#include <functional>
#include "../ncnn_ops_definer.h"
namespace mmdeploy {
using namespace ncnn;
DEFINE_LAYER_CREATOR(TopK)
DEFINE_NCNN_OPS(TopK, TopK)
TopK::TopK() {
one_blob_only = false;
support_inplace = false;
}
int TopK::load_param(const ParamDict& pd) {
axis = pd.get(0, -1);
largest... | ALGO | 0.99941 | 6.556192 |
290438ce-058b-4444-938e-de13b1271041 | spring/spring | rts/System/Matrix44f.cpp | #include "System/Matrix44f.h"
#include "System/SpringMath.h"
#include <memory.h>
#include <algorithm>
CR_BIND(CMatrix44f, )
CR_REG_METADATA(CMatrix44f, CR_MEMBER(m))
CMatrix44f::CMatrix44f(const CMatrix44f& mat)
{
memcpy(&m[0], &mat.m[0], sizeof(CMatrix44f));
}
CMatrix44f::CMatrix44f(const float3 pos, const float... | ALGO | 0.97066 | 6.747056 |
8a6b20a3-20a6-413b-8683-4c5add512868 | lemn09/DSA-CN | 001-DSA/009. Stacks and Queues/Linked List Stack.cpp | #include<iostream>
using namespace std;
template <typename T>
class node{
public:
T data;
node<T> *next;
node(T data){
this->next= NULL;
this->data =data;
}
};
template <typename T>
class Stack{
node<T> *head;
int counter; //maintains the stack size
public:
S... | TOOL | 0.969933 | 4.817998 |
7a52f725-9d2f-48b7-a686-2c2064670377 | ldriever/PCSC_ODE_Solver | source-files/backward_euler.cpp | //
// Created by Leonhard Driever on 08.12.21.
//
#include "backward_euler.h"
#include "setup.h"
BackwardEuler::BackwardEuler(SetUp &user_setup) : ODE (user_setup) {y_short_term.conservativeResize(method_length);}
double BackwardEuler::OneStep(double t) {
double residual = 1;
double cut_off = 0.01;
doub... | ALGO | 0.999777 | 5.615238 |
a6802f6a-e6c5-403c-b797-1b275afeef2b | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3213_3.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int a, b, x;
cin >> a >> b >> x;
cout << b / x - (a - 1) / x << endl;
}
| ALGO | 0.998704 | 3.851373 |
064597ce-328f-4f27-9579-11a30ff828c2 | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Secure/62acb7753b0e3c0d3ab3c15057b0a65222313334-18.cpp | i64 fmtutil_hlp_get_cul_p(dbuf *f, i64 *ppos)
{
i64 x1, x2;
x1 = dbuf_getu16le_p(f, ppos);
if(x1%2 == 0) {
// If it's even, divide by two.
return x1>>1;
}
// If it's odd, divide by two, and add 32768 times the value of
// the next two bytes.
x2 = dbuf_getu16le_p(f, ppos);
return (x1>>1) | (x2<<15);
} | TOOL | 0.879849 | 4.252737 |
a07df019-9fdf-46c4-86e7-e9acadcfba3a | solovboy/misis2024s-21-02-solovev-i-s | prj.lab/lab03/lab03.cpp | #include <iostream>
#include <vector>
#include <string>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
cv::Mat drawContrastHistogram(const cv::Mat& image, const double& left, const double& right) {
cv::Mat histogramImage(256, 256, CV_8UC1, cv::Scalar(230));
std::vecto... | TOOL | 0.964011 | 5.271023 |
e99b4d59-e624-4a23-88fd-0b09fcb2327b | ucsb-cs16-m19/code-from-class | 08-05/const.cpp | #include <iostream>
using namespace std;
int valuePlus1(const int *value) {
// *value = *value + 1; // COMPILER ERROR!
return *value + 1;
}
int main(int argc, char *argv[])
{
// constant variables can't change
const double PI = 3.1415926535;
cout << PI << endl;
// PI = 4; // compiler error! ... | ALGO | 0.963409 | 3.642731 |
5e4eff28-1797-46fe-aba2-780d33d9c540 | richard-stern/MyEngine | aieBootstrap/dependencies/imgui/extra_fonts/binary_to_compressed_c.cpp | // ImGui - binary_to_compressed_c.cpp
// Helper tool to turn a file into a C array.
// The data is first compressed with stb_compress() to reduce source code size.
// Then encoded in Base85 to fit in a string so we can fit roughly 4 bytes of compressed data into 5 bytes of source code (suggested by @mmalex)
// (If we u... | TOOL | 0.984957 | 6.107502 |
062951b4-8788-49fa-92ca-54a025887b56 | amanzano05/Data_structures-Algorithms | palidrome.cpp | #include <iostream>
#include <ctype.h>
using namespace std;
class Solution {
public:
bool isPalindrome(string s) {
int i=0;
int j=s.length()-1;
while(j>i){
if (isalnum(s[i]) && isalnum(s[j])){
if (tolower(s[i])!=tolower(s[j])) {
return false;
... | ALGO | 0.998224 | 5.297048 |
ae364d58-1a3f-47b2-aaf4-393d42d4deed | itsrohityadav767/100-Days-Coding-Challenge | RohityadavDay_24.cpp | //WAP to print pyramid using star.
#include<iostream>
using namespace std;
int main(){
int num;
cout<<" Enter the number ";
cin>>num;
cout<< num;
for(int i=1;i<=num;i++){
for(int j=i;j<=i;j++){
cout<<"*";
}
}
return 0;
} | ALGO | 0.99679 | 3.347399 |
98dad009-6777-4bcb-b370-1263c0f599f3 | sudhirskp/ds-in-c | CN-Lab/lab01.cpp | #include <iostream>
#include <string>
using namespace std;
// Function for bit stuffing
void bitStuffing(const string &input, string &stuffed) {
int count = 0;
for (char ch : input) {
stuffed += ch;
if (ch == '1') {
count++;
if (count == 5) {
stuffed +... | ALGO | 0.999258 | 6.540312 |
12db2335-a786-4e89-8b64-907d4759aa56 | skyjake/Doomsday-Engine | doomsday/libs/core/src/data/pathtreenode.cpp | /** @file pathtreenode.cpp PathTree::Node implementation.
*
* @authors Copyright © 2003-2017 Jaakko Keränen <<EMAIL>>
* @authors Copyright © 2006-2013 Daniel Swanson <<EMAIL>>
*
* @par License
* LGPL: http://www.gnu.org/licenses/lgpl.html
*
* <small>This program is free software; you can redistribute it and/or ... | TOOL | 0.885239 | 6.205888 |
899adf3e-36e9-40e4-a848-a6412217f477 | neelima-singh07/DSA | add num LL.cpp | ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
ListNode* dummyhead=new ListNode(-1);
ListNode* curr=dummyhead;
ListNode* temp1=l1;
ListNode* temp2=l2;
int carry=0;
while(temp1!=NULL || temp2!=NULL){
int sum=carry;
if(temp1) sum+=temp1->val;
... | ALGO | 0.999764 | 4.996026 |
5510f931-f3b9-4e74-871f-b44c9f8551c5 | saduvenkatesh/DSA-PYTHON | sorting/quicksort.cpp | #include<iostream>
using namespace std;
int partition(int arr[], int st, int end){
int piv=arr[st];
int i=st+1, j=end;
while(i<=j){
while(i<=end && arr[i]<=piv) i++;
while(arr[j]>piv) j--;
if(i<j)
swap(arr[i], arr[j]);
}
swap(arr[st],arr[j]);
return j;
}
vo... | ALGO | 0.999952 | 5.067673 |
9c4dac59-0a7a-478e-9ab3-cf619b947288 | ryuat/algorithm-2 | 자료구조/10845.cpp | #include <iostream>
#include <string>
using namespace std;
struct queue{
int begin, end;
int arr[100000];
queue(){
begin = 0;
end = 0;
}
bool empty(){
if(begin == end){
return true;
}else{
return false;
}
}
void push... | ALGO | 0.993028 | 4.451129 |
cc16d5e0-b170-4d25-ae5f-0c1e2c7d1e4b | rohitshakya/CodeBucket | 1. Placements/7. Stack_Queue/3. MedianofaRunningStream.cpp | /*
* Author : Rohit Shakya
* Date : July-2020
* Compiler : g++ 4.9.2
* Flags : -std=c++14
* Time complexity : O(nlogn)
* Title : stream of running integers
*/
#include<bits/stdc++.h>
using namespace std;
void printMedians(double arr[], int n)
{
// max heap to store the smaller half elements
priority_... | ALGO | 0.999974 | 5.395173 |
f7dd1990-e805-444c-b2d4-82d66f8da040 | LeetAnkit/LeetCode-Solutions | 7-reverse-integer/reverse-integer.cpp | class Solution {
public:
int reverse(int x) {
long ans=0;
while( x !=0){
ans = ans*10+ x % 10;
x=x/10;
}
if ( ans > INT_MAX || ans <INT_MIN){
return 0;
}
return ans;
}
}; | ALGO | 0.999972 | 5.918276 |
657d63c7-b27b-4963-a8ef-54eb755b91f3 | dumppool/GameProgrammingGems | GameProgrammingGemsV游戏编程精粹5光盘代码/第5章 图形图像/5.09/maze.cpp | /*___________________
|
| Include Files
|__________________*/
#include <windows.h>
#include <winbase.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "list.h"
#include "random.h"
#include "maze.h"
/*___________________
|
| Type defintions
|__________________*/
struct NodeIn... | ALGO | 0.932862 | 5.821672 |
ef13379b-6790-41ad-98a4-8964f9775d5d | wyukai/coding | array/findNumbersWithSum.cpp | //
// Created by wangkai on 2019/9/15.
//
/*
* 和为S的两个数字
* 输入一个递增排序的数组和一个数字S,在数组中查找两个数,使得他们的和正好是S,如果有多对数字的和等于S,输出两个数的乘积最小的。
* 思路:
* 双指针法,定义两个指针left,right(标识)指向有序数组的第一位和最后一位,判断其和与S的关系,== 及找到这样的一对数;大于,--right;
* 小于,++left。
*
* 注意边界情况,若数字的长度小于2,则不存在这样一对数。
*/
#include <iostream>
#include <vector>
using namespace... | ALGO | 0.999967 | 4.168434 |
25827eff-a87e-4510-a2d8-bb22c0964c52 | ishandutta2007/codeforces | stilwell/normal/653/F.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define sa_size 2000005
#define sa_maxlen 255
int lg[sa_size];
void get_lg(int n){int i;for(i=1;i<=n;++i)lg[i]=lg[i-1]+(1<<lg[i-1]+1==i);}
struct suffix_array
{
char str[sa_size];
int sa[sa_size],rank[sa_size],trank[... | ALGO | 0.999893 | 3.496852 |
002375f6-f26c-4b87-861b-9682f080fa2b | mrron313/Programming | LeetCode/BinaryTreeLevel.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include <algorithm>
using namespace std;
vector<vector<int> > ans;
typedef struct TreeNode{
int val ;
TreeNode *left;
TreeNode *right;
};
TreeNode *create_node(int value){
TreeNode *n = (TreeNode *)malloc(sizeof(TreeNode));
n->val = value;... | ALGO | 0.999921 | 4.218638 |
13b5c66c-9aa0-465d-8b13-eec69b7fecae | neer1304/SPOJ | Aggresive_cows_spoj.cpp | /*
F(x) = 1 if it is possible to arrange the cows in stalls such that the distance between any two cows is at
least x
F(x) = 0 otherwise
F(0)=1 trivially since the distance between any two cows is at least 0. Also, since we have at least two
cows, the best we can do is push them towards the stalls at the end ... | ALGO | 0.99999 | 3.695473 |
21bb5cc0-e154-4433-a2d8-7a37f19dbd75 | utkarshnath/Lauchpad-June | Lecture-8/primeCheck.cpp | #include<iostream>
using namespace std;
bool isPrime(int n){
for(int i=2;i<n;i++){
if(n%i==0){
//cout<<"Not prime"<<endl;
return false;
}
}
//cout<<"Prime"<<endl;
return true;
}
void allPrime(int n){
for(int i=2;i<=n;i++){
if(isPrime(i)==true){
... | ALGO | 0.998836 | 4.02627 |
c49640d3-0b0b-462b-9879-34ccfea81425 | karadoc/Civ4-MMod | CvGameCoreDLL/CvFractal.cpp | // fractal.cpp
#include "CvGameCoreDLL.h"
#include "CvFractal.h"
#include "CvRandom.h"
#include "CvGameCoreUtils.h"
#include "CvGameCoreUtils.h"
#include "FProfiler.h"
#define FLOAT_PRECISION (1000)
// Public Functions...
CvFractal::CvFractal()
{
reset();
}
CvFractal::~CvFractal()
{
uninit();
}
void CvFractal:... | ALGO | 0.976734 | 4.842839 |
b04a4a83-f5e9-44f8-b7d9-159d6522470a | mrhat05/ashersLeetCode | Difficulty: Medium/Minimum Platforms/minimum-platforms.cpp | class Solution {
public:
// Function to find the minimum number of platforms required at the
// railway station such that no train waits.
int findPlatform(vector<int>& arr, vector<int>& dep) {
sort(arr.begin(), arr.end());
sort(dep.begin(), dep.end());
int n=arr.size();
... | ALGO | 0.999922 | 5.866204 |
19ab0343-69bf-43cf-80e7-747bf4e3acca | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/August/smallestKmp_20200809135829.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999978 | 4.094095 |
198b306a-b1f6-4b57-b6a8-35a40f132401 | ushmita4/Leetcode-Daily-Challenge-2022 | 01. January/pairsofsongswithtotalduration60.cpp | class Solution {
public:
int numPairsDivisibleBy60(vector<int>& time) {
int ans = 0, cnt[60] = {0};
for (int i = 0; i < time.size(); i ++) cnt[time[i] % 60] += 1;
for (int i = 1; i< 30; i ++) ans += cnt[i] * cnt[60 - i];
return ans + cnt[0] * (cnt[0] - 1) / 2 + cnt[30] * (cnt[30] - 1... | ALGO | 0.999775 | 5.687014 |
b0c1ee79-e77c-47a4-8c50-e614119ac2fd | Thirza-12/100-days-of-code-challenge | Day1.cpp | class Solution {
public:
int subtractProductAndSum(int n) {
// Subtract the product and sum of digits of an integer
int lastdigit=0;
int multiplication=1;
int sum=0;
while(n!=0)
{
lastdigit=n%10;
multiplication=multiplication*lastdigit;
sum=sum+lastdigit;
... | ALGO | 0.999959 | 6.525247 |
0cd5e37c-c916-4ec5-9ae0-cf256077a614 | mdmahafuzur47/youKnowWho-Problems | PH/Data_Stracture/assignment04/Perfect_Binary_Tree.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int val)
{
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node *input_tree()
{
int val;
cin >> val;
Node *root;
if (val == -1)
... | ALGO | 0.99994 | 4.533789 |
08f95c6a-7e21-4efd-a84e-599f8abc513b | jiangxu05/notes | 题/PTA题目集/天梯赛/字符串+二维数组/6翻了.cpp | //“666”是一种网络用语,大概是表示某人很厉害、我们很佩服的意思。最近又衍生出另一个数字“9”,意思是“6翻了”,实在太厉害的意思。如果你以为这就是厉害的最高境界,那就错啦 —— 目前的最高境界是数字“27”,因为这是 3 个 “9”!
//本题就请你编写程序,将那些过时的、只会用一连串“6666……6”表达仰慕的句子,翻译成最新的高级表达。
//输入格式:
//输入在一行中给出一句话,即一个非空字符串,由不超过 1000 个英文字母、数字和空格组成,以回车结束。
//输出格式:
//从左到右扫描输入的句子:如果句子中有超过 3 个连续的 6,则将这串连续的 6 替换成 9;但如果有超过 9 个连续的 6,则将这串连续的 6 替... | ALGO | 0.999566 | 5.605323 |
8d2baffc-0d2b-47cb-8442-1e9b46521558 | Origami2001/Coding-Dairy | 104.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.999534 | 6.419076 |
910aa18c-cdd3-43c6-80a6-efa7cca333bd | ishandutta2007/codeforces | dorijanlendvaj/normal/747/A.cpp | //DUEL
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define x first
#define y second
#define pii pair<int,int>
#define pb push_back
#define eb emplace_back
#pragma GCC optimize("unroll-loops")
#define shandom_ruffle(a, b) shuffle(a, b, rng)
#define vi vector<int>
#define vl vector<ll>
#define popcn... | ALGO | 0.999877 | 3.813755 |
8b70128d-4e58-4d72-a48e-7fb29612f460 | AymanHazem/myDSA | Data structure/LinkedList.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int data { }; // Holds the data for the node
Node* next { }; // Pointer to the next node in the list
// Constructor to initialize node with data and set next to nullptr
Node(int data) : data(data) {}
};
class LinkedList
{
Node *... | ALGO | 0.9987 | 5.075351 |
69fec70a-bf29-434f-b5cc-5ce64ccf6700 | vfolunin/archives-solutions | LeetCode/2498.cpp | class Solution {
bool can(vector<int> pos, int dist) {
int minPos = pos.front(), maxPos = pos.back();
vector<int> isRemoved(pos.size());
for (int curPos = minPos; curPos < maxPos; ) {
int nextIndex = upper_bound(pos.begin(), pos.end(), curPos + dist) - pos.begin() - 1;
... | ALGO | 0.999981 | 5.118827 |
67544e46-3f31-4c65-a23a-0df6ee4660aa | interactivevislab/TrianglePlugin-UE5 | TrianglePlugin/Source/libigl-static/include/decimate.cpp | IGL_INLINE bool igl::decimate(
const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const size_t max_m,
Eigen::MatrixXd & U,
Eigen::MatrixXi & G,
Eigen::VectorXi & J,
Eigen::VectorXi & I)
{
// Original number of faces
const int orig_m = F.rows();
// Tracking number of faces
int m = F.rows();
ty... | ALGO | 0.999776 | 6.091033 |
3f4b95b8-cc97-440e-8259-66c605f2c48f | IlyaShum/Laba_2 | Задание 1/C++.cpp | #include <iostream>
using namespace std;
int main() {
int N;
cout << "Введите число N: ";
cin >> N; // считывание значения, введенного пользователем, в переменную N.
for (int i = 0; i < N; i++) {
char pattern = 'A' + N - 1;// задание начального символа для каждой строки. Символ выбирается из а... | ALGO | 0.999801 | 4.709736 |
7007d222-36aa-4651-9133-d3968f001c57 | gettls/study_ps_repository | gettls/2주차/강의실.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <queue>
#include <stack>
#include <map>
using namespace std;
#pragma warning (disable:4996)
int main() {
int n;
cin >> n;
vector<pair<long long, long long>> v;
for (int i = 0; i < n; i++) {
long long a, b, c;
cin >> a >> b >>... | ALGO | 0.99991 | 4.039274 |
c6427a0f-da24-4f9c-842b-d718edb75bfa | wincle626/LibrePilot | ground/gcs/src/libs/eigen/bench/bench_gemm.cpp |
// g++-4.4 bench_gemm.cpp -I .. -O2 -DNDEBUG -lrt -fopenmp && OMP_NUM_THREADS=2 ./a.out
// icpc bench_gemm.cpp -I .. -O3 -DNDEBUG -lrt -openmp && OMP_NUM_THREADS=2 ./a.out
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
// #define... | TOOL | 0.989037 | 5.97908 |
2711098f-422e-42b3-bcfe-3c47de51eb18 | himanshugupta09/LEETCODE_SOLUTIONS | Heap_Priority Queue/the-skyline-problem.cpp | class Solution {
public:
vector<vector<int>> getSkyline(vector<vector<int>>& buildings) {
priority_queue<vector<int>>pq;
map<int,vector<pair<int,int>>>m;
vector<vector<int>>ans;
int count =0, width = 0;
for(auto i : buildings){
m[i[0]].push_back({i[2],i[1]});
... | ALGO | 0.999961 | 6.241495 |
5fa098e8-fc94-4acc-ab41-1100444040a4 | PootieT/explain-then-translate | CodeGenMirror/data/transcoder_evaluation_gfg_fixed/cpp/MAXIMUM_NUMBER_CHOCOLATES_DISTRIBUTED_EQUALLY_AMONG_K_STUDENTS.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( int arr [ ], int n, int k ) {
unordered_map < int, int > um;
int sum [ n ], curr_rem;
int maxSum = 0;
sum [ 0 ] = arr [ 0 ];
for ( int i =... | ALGO | 0.99935 | 5.31735 |
dcc17b42-5495-46ac-9568-71db63cc4358 | morsalins/Algorithms-and-Data-Structures | Longest Increasing Subsequence/LIS (n^2).cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX 100
int LIS (int); // parameter : size of the input array.
int A[] = {3, 2, 5, 4, 7, 8, 6, 10};
int dp[MAX+5];
int main()
{
cout << LIS(8) << endl; // Sending the size of array A as parameter.
return 0;
}
int LIS (int ... | ALGO | 0.999941 | 4.319731 |
182d18f2-a74b-4e12-b660-2114f02b9c0b | kabetani-yusei/atcoder_all_contest | solved-212-232/abc229/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
// using mint = modint998244353;
#define ll long long
#define ull unsigned long long
const ll inf = 1e18;
const int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
#define bsearch(a,x) d... | ALGO | 0.99997 | 4.036648 |
406bbba6-a35a-49e3-a7e8-6093a9d91c71 | Pranta-Saha/codeforces-solved | 831A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cerr.tie(nullptr);
int n,i,j,tmp,tmp2;
cin>>n>>tmp;
for(i=1;i<n;i++)
{
cin>>tmp2;
if(tmp==tmp2)
{
... | ALGO | 0.999972 | 3.382515 |
bca6d5f5-cc7e-49fd-969c-321723d6dd13 | Lali67/Cpp_Snippet | 07-PR1 Hausübungen/2019-W03/2019-W03-Exercises/2019-W03-Exercises/2019-W03-Exercises_3_15.cpp | /* 2019-W02-Exercise_3_15.cpp :
Exercise 3.15
(*) Wie Beispiel 2, allerdings fr beliebige reelle Zahlen. Z.B.:
Eingabe 17.23
Ausgabe: eins-sieben-komma-zwei-drei.
Dniel Szke (11913915)
24.10.2019
*/
#include <iostream>
//#include <cmath>
//#include <exception>
using namespace std;
inline bool IsEnabledChar(s... | TOOL | 0.990937 | 5.000375 |
333881e3-9207-48f5-a30b-16aed4c2c899 | Archerls/R200_after_win10_fixed | calibration2.cpp | #include <stdafx.h>
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
#include <fstream>
#define board_row 12
#define board_col 11
//#define image_try
using namespace cv;
using namespace std;
void ma... | TOOL | 0.907786 | 3.759926 |
f2a8099e-85ab-490e-a5fa-e284069fa5cc | ShivaPatel8305/Leetcode-Problems | 12-integer-to-roman/integer-to-roman.cpp | //Approach 1 :
//time complexity - O(1) since the algorithm always iterates through a constant number of values (13 in this case).
//O(1) since the amount of extra space used is constant (the size of the storeIntRoman vector, which is also 13 in this case
class Solution {
public:
string intToRoman(int num) {
... | ALGO | 0.999922 | 7.010544 |
4e59516e-dae5-4f44-aef7-d7edcbd0a741 | WangQiuc/aoapc-bac-tg | ch1/exercise/1/10905.cpp | // UVa 10905 Children's Game
// wangqc
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
const int maxn = 55;
string s[maxn];
inline bool cmp(string a, string b) { return a+b > b+a; }
int main()
{
int n;
while(cin >> n && n)
{
for(int i = 0; i < n; i++)
cin... | ALGO | 0.999881 | 3.699152 |
f1bbdf84-023f-4feb-9690-d924f30cd2b1 | iBreaker/cpp-primer | chapter-07/ex07_01.cpp |
#include <iostream>
#include <string>
using namespace std;
struct Sales_data
{
string bookNo;
unsigned int units_sold = 0;
double revenue = 0.0;
};
int main()
{
Sales_data total;
if(cin >> total.bookNo >> total.units_sold >> total.revenue)
{
Sales_data trans;
while(cin >> tr... | ALGO | 0.852607 | 3.92666 |
701819af-fbff-40de-a3a4-5403e2d1b140 | stormbreaker07/CodingQuestions | problem set 3/codefocesless1399pro11.cpp | #include <bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{long long int x,y,num;
cin>>x>>y;
num=abs(x)+abs(y);
if(x==0 && y==0)
{cout<<"0"<<" "<<"0"<<" "<<"0"<<" "<<"0";}
else if(x>0 && y>0)
{cout<<"0"<<" "<<num<<" "<<num<<" "<<"0";}
else if(x>0 && y<0)
{cout<<"0"<<" "<<-num<<... | ALGO | 0.999939 | 3.266631 |
e3cfd480-0a2a-4e4e-a30a-c619ca7d6859 | rugvedwagh/DataStructures | BFS.cpp | #include <bits/stdc++.h>
using namespace std;
class graph
{
private:
int v;
vector<vector<int>> adj;
public:
graph(int v)
{
this->v = v;
this->adj = vector<vector<int>>(v);
}
void add(int u, int v)
{
adj[u].push_back(v);
}
void bfs(int s)
{
que... | ALGO | 0.99998 | 5.94033 |
6223cf48-5b8e-48cc-b6fa-1eaabc6b60ff | youngthe/GreedyAlgorithm | ATM.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
int temp;
int time = 0;
int temptime = 0;
int i, j;
cin >> n;
int p[n];
for(i=0;i<n;i++)
cin >> p[i];
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(p[i] > p[j]){
temp=p[j];
p[j]=p[i];
p[i] = temp;
}
}
}
for(i=0;i<n;i++)... | ALGO | 0.999943 | 3.283036 |
2b23feb3-975d-4ec6-9e2c-70ada93be376 | piyush7833/Cpp-codes | others/stocks.cpp | #include<iostream>
using namespace std;
int main(){
int n;
int p;
int q ;
p=0;
char d;
cout<<"Enter size of your array ";
cin>>n;
int array[n];
cout<<"Enter values of your array ";
for(int i=0;i<n;i++){
cin>>array[i];
}
// d = 'a';
int i;
for(i=0;i<n;i++){
if(i==0 && array[i]<array[i+1]){
d='b';
... | ALGO | 0.999821 | 3.551449 |
7a90f8e3-4757-483e-bf9d-170cc18f72e5 | Strikeskids/bookcode | zzz-old/hungarian.cpp | /* [hungarian.cpp] */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double Double;
const ll INF = 1LL << 60;
struct Hungarian {
// Finds potentials >= 0 such that x_i + y_j = e_ij
// Note labels are always >= 0 and < MAXC
// Hence slack < 2 * MAXC - 1
// Note unmatched LT[.] are a... | ALGO | 0.999912 | 3.879191 |
8422edc9-da53-4e3d-93a9-9dbb864b8e10 | Sumu154/Algorithms | F_Greedy Algorithm/1_Fractional_knapsack.cpp | #include<bits/stdc++.h>
using namespace std;
/*
problem: given n products with profits.
can take fractional value
what is maximum profit
3 8
3 30
4 50
5 60
output -> 98
*/
int main()
{
int n, cap;
cin >> n >> cap;
vector<int> wt(n), val(n);
for(int i=0 ; i<n ; i++){
cin >>... | ALGO | 0.999994 | 4.386189 |
a60bf549-e9be-4f38-b093-b26dfb6469db | zhazhahao/2021zs-ys | OPENPOSE/openpose-master/src/openpose/face/faceExtractorCaffe.cpp | #include <openpose/face/faceExtractorCaffe.hpp>
#ifdef USE_CAFFE
#include <caffe/blob.hpp>
#endif
#include <openpose/face/faceParameters.hpp>
#include <openpose/gpu/cuda.hpp>
#include <openpose/net/maximumCaffe.hpp>
#include <openpose/net/netCaffe.hpp>
#include <openpose/net/resizeAndMergeCaffe.hpp>
#include <openp... | TOOL | 0.910268 | 6.502146 |
1d086d0a-6361-4c5b-84fd-d0cafea06a74 | lucasschott/distributed-blockchain | boost/libs/math/example/nc_chi_sq_example.cpp | // Caution: this file contains Quickbook markup as well as code
// and comments, don't change any of the special comment markups!
//[nccs_eg
/*`
This example computes a table of the power of the [chi][super 2]
test at the 5% significance level, for various degrees of freedom
and non-centrality parameters. The table... | ALGO | 0.948102 | 5.453393 |
4e3a81a5-3aed-4172-849e-1488dbbf7c84 | v2v3v4/xray-csky | SDK/sources/MagicSoftware/FreeMagic/Source/Curve2D/MgcCurve2.cpp | #include "MgcCurve2.h"
using namespace Mgc;
//----------------------------------------------------------------------------
Curve2::Curve2 (Real fTMin, Real fTMax)
{
m_fTMin = fTMin;
m_fTMax = fTMax;
}
//----------------------------------------------------------------------------
Curve2::~Curve2 ()
{
}
//------... | ALGO | 0.966667 | 4.887339 |
c465dddd-fba9-4593-bc15-dcf9515f7dfc | ishandutta2007/codeforces | piob/normal/131/B.cpp | #include <cstdlib>
#include <cstdio>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <functional>
#define FWD(a,b,c) for(int a=(b); a<(c); ++a)
#define BCK(a,b,c) for(int a=(b); a>(c); --a)
#define FE(a,b) for(typeof((b).end()) a=(b).begin(); a!=(b).end(); ++a)
#define... | ALGO | 0.999676 | 3.585062 |
aab6a038-5302-4dbe-8a00-2f90900e735b | forfel-norfel/rocket-build | source/llvm-15.0.6/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp | #define DEBUG_TYPE "gisel-known-bits"
using namespace llvm;
char llvm::GISelKnownBitsAnalysis::ID = 0;
INITIALIZE_PASS(GISelKnownBitsAnalysis, DEBUG_TYPE,
"Analysis for ComputingKnownBits", false, true)
GISelKnownBits::GISelKnownBits(MachineFunction &MF, unsigned MaxDepth)
: MF(MF), MRI(MF.getRe... | ALGO | 0.990042 | 7.863186 |
e906046b-3843-40c2-bb08-9c1b9914118f | anmolsinghgit/LeetCode-Online-Judge | Algorithms/minimum-size-subarray-sum.cpp | // 209. Minimum Size Subarray Sum
// https://leetcode.com/problems/minimum-size-subarray-sum/
// https://discuss.leetcode.com/topic/18583/accepted-clean-java-o-n-solution-two-pointers
// https://discuss.leetcode.com/topic/30941/here-is-a-10-line-template-that-can-solve-most-substring-problems
#include <iostream>
#inclu... | ALGO | 0.999924 | 6.288179 |
710cc8de-db0a-4171-b71f-f8fa30fbf513 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/agc027/A/4183305.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int N, x;
cin >> N >> x;
vector<int>a(N);
for (int &i:a) cin >> i;
sort(a.begin(), a.end());
int ans = 0;
for (int i = 0; i < N; i++) {
if (x >=a.at(i)) {
ans++;
x-=... | ALGO | 0.999983 | 4.284751 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.