uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ae355d70-994c-4a2c-ad42-4c7249eb6bf7 | Kanu-Priya-Sehrawat/100_CodeDays | 29_June/Nearly sorted algo(Approach - 2).cpp | #include <bits/stdc++.h>
using namespace std;
void sort(int arr[], int n, int k){
int size;
size = (n==k)?k:k+1;
priority_queue<int, vector<int>, greater<int>> pq(arr, arr+size);
int index = 0;
for(int i=k+1; i<n; i++){
arr[index++] = pq.top();
pq.pop();
pq.push(arr... | ALGO | 0.999963 | 4.334787 |
bf91e88e-d834-4184-9bde-28fe8dca8c9d | esl000/CustomUE4VolumeRaymarching | Engine/Source/ThirdParty/IntelTBB/IntelTBB-2019u8/examples/GettingStarted/sub_string_finder/sub_string_finder_pretty.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <algorithm> //std::max
#include "tbb/parallel_for.h"
#include "tbb/blocked_range.h"
static const std::size_t N = 9;
class SubStringFinder {
const std::string &str;
std::vector<std::size_t> &max_array;
std::vector<std... | ALGO | 0.999927 | 3.761151 |
0f6944c8-dbc4-403d-81d1-96a0b564c433 | qsnake/trilinos | packages/mesquite/src/QualityImprover/VertexMover/Relaxation/SmartLaplacianSmoother.cpp |
#include "SmartLaplacianSmoother.hpp"
#include "PatchData.hpp"
#include "MsqVertex.hpp"
#include "MsqMeshEntity.hpp"
namespace MESQUITE_NS {
size_t SmartLaplacianSmoother::num_inverted( PatchData& pd, MsqError& err )
{
size_t result = 0;
int inverted, junk;
for (size_t i = 0; i < pd.num_elements(); ++i) {
... | ALGO | 0.99745 | 5.722142 |
504775cf-6362-4f82-8ec2-434868ce6bb3 | makio93/competitive-atcoder | abc214/abc214_a/main0-2.cpp | // バチャ本番,自力AC2
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m,... | ALGO | 0.996777 | 4.435027 |
73b76a62-0cf9-47fc-886f-052a10ac9dd1 | marescialloNino/heston-calibration | heston.cpp | #include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <random>
#include <chrono>
#include "heston.h"
#include "metropolis.h"
double heston_monte_carlo_pricer(
double S0, double K, double T, double r,
double kappa, double theta, double sigma, double rho, double v0, unsigned seed,
... | ALGO | 0.999932 | 7.18649 |
53d25a9f-88a0-433f-bfd5-7f6c7e825207 | thienchidh/ListBaiTapCoBan_C-_-_DeBai | 495_.cpp | /* Bài 495: Tính tích 2 đa thức */
#include<bits/stdc++.h>
using namespace std;
int main() {
return 0;
}
| ALGO | 0.99986 | 3.831936 |
7af2733b-02d3-4fb9-86de-26b3dfc80166 | prasant8717/leetcode | cpp_code/SnapshotArray.cpp | class SnapshotArray {
public:
vector<vector<pair<int, int>>> vs;
int sz;
SnapshotArray(int length) {
vs.resize(length);
sz = 0;
}
void set(int index, int val) {
vs[index].emplace_back(sz, val);
}
int snap() {
int res = sz;
sz ++;
retu... | ALGO | 0.975819 | 6.11346 |
db98d7e4-ccf1-4704-830d-5d7d4c5b02aa | kennychu0510/data_structures | queue.cpp | #include <iostream>
#include <string>
using namespace std;
struct QueueNode
{
float value;
QueueNode *next;
};
class Queue
{
public:
QueueNode *head = NULL;
void insert(float value)
{
QueueNode *newNode = new QueueNode;
if (!newNode)
return;
cout << "[Adding " << value << " to queue]" <... | ALGO | 0.951842 | 4.464866 |
39350822-4962-41d4-aa81-811e19d69f1e | stmddo1994/DataStructuresFall2021 | Midterm/Midterm/Midterm3400Arrays.cpp | #include "Midterm3400Arrays.h"
//default constructor
CSIS3400Arrays::CSIS3400Arrays()
{
size = 10;
intArray = new int[size];
}
// constructor
CSIS3400Arrays::CSIS3400Arrays(int bufSize)
{
size = bufSize;
intArray = new int[size];
}
//destructor
CSIS3400Arrays::~CSIS3400Arrays()
{
if (intArray)
{
delete[] in... | ALGO | 0.994482 | 4.734656 |
0530391a-f738-4f32-a107-da32e6c74bd8 | ndlongvn/Applied-algorithms-and-Data-structures-and-algorithms | TTUD_B16/CheckTSP.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 1002
int n, A[N], C[N][N], m;
vector<int> adj[N];
bool visited[N];
void input(){
cin>>n;
for(int i=1; i<=n; i++) cin>>A[i];
for(int i=1; i<=n; i++){
for(int j=1; j<=n; j++){
cin>> C[i][j];
}
}
cin>>m;
for(int i=1;... | ALGO | 0.999838 | 3.822206 |
37942607-6f92-4c36-b6ef-d76a8a1aab78 | kuno4n/TopCoder | src/485-div1-250/AfraidOfEven.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
using namespace std;
#define SZ(x) ((int)x.size())
#define MSET(x,a) memset((x), (a), ... | ALGO | 0.999865 | 4.046993 |
b048e817-0ea2-48de-a891-8d13bd13f99b | johnnysn/uriel-numeric | uriel-numeric/source/method/ode/UniformizationMethod.cpp | #include "pch.h"
#include <math.h>
#include "method/ode/UniformizationMethod.h"
UniformizationMethod::UniformizationMethod() {
rushLarsenMethod = new RushLarsenMethod();
}
UniformizationMethod::~UniformizationMethod() {
delete rushLarsenMethod;
}
void UniformizationMethod::step(double* Y_new_, Model* model, doubl... | ALGO | 0.999976 | 4.813258 |
7e9aec72-30e6-4553-99e4-a9eed99b8791 | heesangh/spmm-llm-optimization | optim1/test/denseLM.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include "main.h"
#include <Eigen/LevenbergMarquardt>
using namespace std;
using namespace Eigen;
template <typename Scalar>
struct DenseLM : DenseFunctor<Scalar> {
typedef DenseFunctor<Scalar> Base;
typedef typename Base::JacobianType JacobianType;
type... | TEST | 0.989345 | 6.007935 |
2043a290-e3ef-4a2a-b610-1b8915d7292a | Its-Aman-Yadav/Basics-of-CPP-Coding-Ninjas | Character Array and 2D Array/Highest Occuring Character.cpp | /*For a given a string(str), find and return the highest occurring character.
Example:
Input String: "abcdeapapqarr"
Expected Output: 'a'
Since 'a' has appeared four times in the string which happens to be the highest frequency character, the answer would be 'a'.
If there are two characters in the input string with t... | ALGO | 0.999861 | 5.028248 |
b8887d6c-2bf4-40bd-bb78-7d89ad277229 | VitorLucioOliveira/PAA | Listas/Lista DP/LPS.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
vector<vector<int>> buildLPSMatrix(string &s)
{
int n = s.size();
vector<vector<int>> dp(n, vector<int>(n, 0));
for (int i = 0; i < n; i++)
dp[i][i] = 1;
for (int cl = 2; cl <= n; cl++)
{
... | ALGO | 0.999976 | 5.368628 |
1c846c50-ee26-40c6-9c08-8880064b970a | JANHVI15CMD/DSA | lecture282.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
for(int row=0;row<2*n-1;row++){
int cond=0;
if(row<n){
cond=row;
}
else{
cond= n-(row%n)-2;
}
for(int col=0;col<=cond;col++){
cout<<"*";
}
... | ALGO | 0.999972 | 3.196551 |
57507bea-20f0-4de6-add3-1ec1a83c291f | Lesords/ACM | 洛谷oj/题单/【数据结构1-1】线性表/P1449 后缀表达式.cpp | #include<iostream>//ac
#include<stack>
#include<string>
using namespace std;
int main() {
stack<int> sta;
string s;
cin>>s;
for(int i = 0;i < s.size()-1;i++) {
int tmp = 0,op1,op2;//tmpΪ
while(s[i]>='0'&&s[i]<='9') {//Ϊ͵ʱ
tmp = tmp*10+s[i]-'0';
i++;
}
if(s[i]=='.') sta.push(tmp);//.ʱ
else {//ͷ
op... | ALGO | 0.999823 | 3.322753 |
ee0072b4-d288-4d91-92e0-86519d031b41 | asenisa12/sdpKN22019 | week5/stackQueue.cpp | #include <stack>
#include <iostream>
using namespace std;
// Task1
class Queue
{
stack<int> s1, s2;
public:
//adds element at the end
void enQueue(int x)
{
while(!s1.empty())
{
s2.push(s1.top());
s1.pop();
}
s1.push(x);
while(!s2.empty(... | ALGO | 0.996001 | 4.799498 |
bc4426a5-7183-4b82-b826-9c4dd24b08fe | NaolJK/Leetcode | 1379-find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/1379-find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* getTargetCopy(TreeNode* original, TreeNode* cloned, TreeNode* target) {
... | ALGO | 0.999816 | 5.46757 |
5eb4381c-733f-49ea-a338-f56967982fbb | ellynhan/challenge100-codingtest-study | hall_of_fame/wi-seong-cheol/BOJ/0x1B MST/2463.cpp | //
// 2463.cpp
// main
//
// Created by wi_seong on 2/23/24.
//
/*
[Input]
6 7
1 2 10
2 3 2
4 3 5
6 3 15
3 5 4
4 5 3
2 6 6
[Output]
256
*/
// 시간복잡도: O(nlogn)
// 최악시간: 500,000
// 난이도: Platinum 5
// Timer: 1h
// Url: https://www.acmicpc.net/problem/2463
#include <iostream>
#include <vector>
#include <alg... | ALGO | 0.999985 | 5.136966 |
454e3cae-8723-4ff2-b382-1878504cfe5e | ReginaLaurentino/Primer-Cuatrimestre-if-simple | TP 2 EJERCICIO 9.cpp | /* Hacer un programa para ingresar tres nmeros y listar el mximo de ellos
*/
#include<iostream>
using namespace std;
int main () {
int a, b, c, mayor;
cout << " Ingresar primer numero: ";
cin >> a;
cout << " Ingresar segundo numero: ";
cin >> b;
cout << " Ingresar tercer numero: ";
cin >> c;
if (a> b) {
mayor ... | ALGO | 0.986905 | 3.675384 |
6e65393c-cfdc-4443-ae9b-56727be32851 | abhi0a11/code-playground | phase 2/Binary tree/sumTree.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
pair<bool,int> isSumTreeFast(node* root){
//base case
if(root == NU... | ALGO | 0.999931 | 4.70939 |
72e4e928-c111-45ab-8e9c-8aa2c13ef2a4 | unzela/Problem-solving | Basics/6.Reverse a number.cpp | #include <climits>
#include <iostream>
using namespace std;
int reverse(int n) {
int ans = 0;
bool isNegative = false;
if (n <= INT_MIN) {
return 0;
}
if (n < 0) {
isNegative = true;
n = -n;
}
while (n > 0) {
if (ans > INT_MAX / 10) {
return 0;
}
int rem = n % 10;
ans... | ALGO | 0.999576 | 5.340662 |
e9db663b-7ed0-4c46-9a78-ac34905b3e09 | yeon-kyu/algorithm_exercise | 프로그래머스/탐욕법_체육복.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(int n, vector<int> lost, vector<int> reserve) {
int answer = 0;
int lost_s = lost.size();
answer += n - lost_s;
for (int i = 0; i < lost_s; i++) {
vector<int>::iterator it;
it = find(reserve.begin()... | ALGO | 0.999568 | 4.222574 |
171ee681-12c9-47b8-b3cc-df76fb79c462 | Shishank93774/LeetCode-Solutions | 3288-length-of-the-longest-increasing-path/3288-length-of-the-longest-increasing-path.cpp | class Solution {
int getLis(vector<vector<int>>& arr){
int n = arr.size();
if(n == 0) return 0;
sort(arr.begin(), arr.end(), [](vector<int> &v1, vector<int> &v2){
return v1[0] == v2[0]? v1[1]>v2[1]: v1[0]<v2[0];
});
vector<int> lis;
lis.push_back(arr[0][1]... | ALGO | 0.999837 | 5.173947 |
abeb9f5e-71c7-44d1-9c98-a26b089eed9b | SAT-STEP/SAT-STEP | cadical-rs/cadical/test/api/morenmore.cpp | #include "../../src/cadical.hpp"
#include <iostream>
#include <cassert>
using namespace std;
int main () {
CaDiCaL::Solver solver;
const int n = 100;
for (int i = 1; i < n; i++) {
for (int j = 1; j < i; j++) solver.add (-j);
solver.add (i), solver.add (0);
}
int res = solver.solve ();
assert (res ==... | ALGO | 0.996167 | 3.329949 |
148a6af8-4a9d-4c03-abe8-6561126b7195 | karthik798/Cpp-Programs | NLA/problems/smallest_possbile_sum.cpp | #include <iostream>
#include <vector>
#include <algorithm>
int main() {
std::vector<int> arr = {6,8,5,4,2,3}; // replace with your array
std::sort(arr.begin(), arr.end());
std::string num1, num2;
for (int i = 0; i < arr.size(); i++) {
if (i % 2 == 0)
num1 += std::to_string(arr[i]);... | ALGO | 0.999864 | 5.980812 |
bf5dda7b-7aa6-4efc-a074-ded22e7d45f7 | ishandutta2007/codeforces | nebuchadnezzar/normal/689/C.cpp | #include "bits/stdc++.h"
#define puba push_back
#define mapa make_pair
#define ff first
#define ss second
#define bend(_x) (_x).begin(), (_x).end()
#define szof(_x) ((int) (_x).size())
#define TASK_NAME ""
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
ll m;
int main() {
//freopen(TASK_NA... | ALGO | 0.999986 | 4.484397 |
2359cc34-41fc-4108-8983-ed7ced741af7 | HoYoungChun/Algorithm_PS | Dynamic_Programming/BOJ_1932.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int p[501][501];
int dp[501][501];
int main(void) {
int n;
cin >> n;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= i; j++)
cin >> p[i][j];
dp[1][1] = p[1][1];
for (int i = 2; i <= n; i++) {
dp[i][1] = dp[i - 1][1] + p[i][1];
for (int j = ... | ALGO | 0.999971 | 3.517842 |
5a36e5a0-21d8-4b75-b3b6-9b623b3a5950 | mewhz/OJ_problem | 牛客网/Icebound and Sequence.cpp | //https://ac.nowcoder.com/acm/contest/903/B
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll q,n,p;
ll pow(ll a,ll b,ll c){
ll ans = 1,base = a;
base = base%c;
if(b==0){
return 1%c;
}
while(b){
if(b&1)
ans = (ans*base)%c;
b = b>>1;
base = (base*base)%c;
}
return ans;
}
ll dengb(l... | ALGO | 0.999942 | 4.069127 |
b6a7e753-b584-472a-9d78-8b47e9b6fa54 | hazem324/todo | 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.9988 | 6.76073 |
6dfab9fa-d87c-41f3-a923-40138e0571fd | Sai-Nandan-Desetti/Learn-Cpp | Quizzes/07_Control Flow and Error Handling/Number Triangle 2/main.cpp | /**
* @file main.cpp
* @author DSN
* @brief Print the given triangle
* @version 0.3
* @date 2023-07-03
*
*/
/**
* @mainpage
* Print the following:
@verbatim
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
@endverbatim
*/
#include <iostream>
/* Version 0.2:
- Row x: Print ... | ALGO | 0.998193 | 6.142979 |
f253caaa-faf8-40c9-9ec4-d69b80edb0ba | gcmillar/ToM-Eyetracker | pupil/pupil_src/shared_modules/pupil_detectors/Tests/ProjectionTest/projectionTest.cpp | #include <iostream>
#include "../../singleeyefitter/projection.h"
#include "geometry/Ellipse.h"
#include "geometry/Conic.h"
#include "common/types.h"
int main()
{
using namespace singleeyefitter;
std::cout << "Start Test" << std::endl;
const Ellipse ellipse(30.0, 1.0, 1, 0.9, 0);
double circle_radius... | TEST | 0.959546 | 5.015945 |
c859b3d7-e32d-47ba-86ad-fe565c9042df | alexsotocx/competitive-programming | UVA/514 - Rails.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<stack>
#include<stack>
using namespace std;
int store[1003],n;
bool vi[1002];
int main()
{
bool xd = false;
while(scanf("%d",&n) && n)
{
bool founds = false;
while(!founds)
{
for(int i=0; i<n && !founds; i++)... | ALGO | 0.99978 | 3.301783 |
29ad77bf-5f2e-45fb-85bc-93f74da81a8c | mohilthummar/task_app | 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 |
37330b07-7482-48d5-89f7-4c92dacc0fa1 | capstone-engine/llvm-capstone | libcxx/test/std/containers/associative/set/find.pass.cpp | // <set>
// class set
// iterator find(const key_type& k);
// const_iterator find(const key_type& k) const;
#include <set>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.h"
int main(int, char**)
{
{
typedef int V;
typedef std::set<int> M;
... | TEST | 0.872126 | 4.237936 |
121059b2-d797-4343-a9fd-627a760e2f0d | raincross7/code-similarity | codes/train_code/problem011/problem011_400.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(register int i=a;i<=b;++i)
#define rpd(i,a,b) for(register int i=a;i>=b;--i)
#define rep1(i,x) for(register int i=head[x];i;i=nxt[i])
typedef long long ll;
//const int N=+5;
using namespace std;
inline int read(){
int x=0,f=1;char ch=getchar();
while(!isdigit(ch)){... | ALGO | 0.999927 | 3.71623 |
8e191d46-bcf8-413b-aec9-18a3c92537f8 | PedroAngeli/Competitive-Programming | Solutions/Codeforces/Contests/Codeforces Round #595 (Div. 3)/a.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int q;
cin >> q;
while(q--){
int n;
cin >> n;
vector <int> s(n);
int ans = 1;
for(int i=0;i<n;i++)
cin >> s[i];
sort(s.begin(),s.end());
for(int i=0;i<n-1;i++)
if(abs(s[i] - s[i+1]) <= 1){
ans = 2;... | ALGO | 0.999624 | 3.554621 |
d2e5dc86-f89a-4abd-be7e-d869f47453dd | codelibra/comp-programming | microsoft/82.cpp | //shivi..coding is adictive!!
//print all anagrams together
#include<shiviheaders.h>
using namespace std;
struct Node
{
string str;
int index;
};
bool criteria(Node a,Node b)
{
return lexicographical_compare(a.str.begin(),a.str.end(),b.str.begin(),b.str.end());
}
int main()
{
string arr[10];
Node arr2[10];
i... | ALGO | 0.999949 | 4.180073 |
34ecb706-ef14-4d9e-8f8d-3d6d1ed9a458 | HorgerC/Final-Project-3 | Floor.cpp | #include "Floor.h"
#include <algorithm>
using namespace std;
int Floor::tick(int currentTime) {
int exploded[MAX_PEOPLE_PER_FLOOR];
int index = 0;
for (int i = 0; i < numPeople; i++)
{
if (people[i].tick(currentTime))
{
exploded[index] = i;
index++;
}
... | ALGO | 0.94844 | 4.696943 |
7dec0df3-62f9-4635-89c6-4e5817cd3c6e | MustangYM/ShelbyObfuscator | lldb/source/Utility/Args.cpp | #include "lldb/Utility/Args.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StringList.h"
#include "llvm/ADT/StringSwitch.h"
using namespace lldb;
using namespace lldb_private;
// A helper function for argument parsing.
// Parses the ... | TOOL | 0.95179 | 7.458389 |
6ffa09d0-1806-45b9-a243-af8b91da7013 | ShenaoChen/Algorithm | code/acm/cf#776v3G.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const int N = 2e5 + 5;
int d[N];
int cnt1[N], cnt2[N];
vector<int> g[N];
int s, t;
void bfs(){
queue<int> q;
q.push(s);
while(!q.empty()){
int u = q.front();
q.p... | ALGO | 0.999935 | 4.891622 |
8071e4e8-57ae-4afa-818b-00468e30a2e9 | KaterynaKovalKI407/RMD_KI-407_Labs | 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 |
11c26878-37d5-4dae-85c0-bc402c27bb24 | bobser223/learning_c_cpp | OOP/l001/MaxFinder.cpp | //
// Created by Volodymyr Avvakumov on 27.08.2024.
//
#include <iostream>
#include "FigureList.cpp"
using namespace std;
class MaxFinder{
string file;
FigureList fl;
vector<shared_ptr<Figure>> figures;
public:
MaxFinder(string a_file){
file = a_file;
FigureList fl2(file);
fl... | ALGO | 0.961417 | 5.192266 |
ff997492-9633-46c4-b6c0-b56dc2495565 | lavanyasureshkannan/Leetcode-problems-cpp | strings/767. Reorganize String.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<unordered_map>
using namespace std;
/*
"aab" => "aba"
1. To keep track of the character frequencies => unordered_map
2. data structure to keep track of how often it occurs => priority_queue
*/
string reorganizeString(string s)
{
string resul... | ALGO | 0.999991 | 6.10306 |
b9b8642d-aab6-4ca3-bd7c-cc780c4db71a | Rishabh2743/-striver-DSA-sheet-arsh-goyal | 2442-count-number-of-distinct-integers-after-reverse-operations/2442-count-number-of-distinct-integers-after-reverse-operations.cpp | class Solution {
public:
int rev(int n){
int r=0;
while(n!=0){
int temp=n%10;
r=r*10 + temp;
n=n/10;
}
return r;
}
int countDistinctIntegers(vector<int>& nums) {
set<int>s;
for(int i=0;i<nums.size();i++){
s.inser... | ALGO | 0.999885 | 6.113893 |
de59e0a4-54c9-42d8-86b0-b9209b6de481 | nguyentheminh04/NguyenTheMinh_monC | Chapter 05/Programming Challenges/Challenges_14.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int so_sinh_vien;
// Yêu cầu người dùng nhập số lượng sinh viên trong lớp
cout << "Nhập số lượng sinh viên trong lớp (từ 1 đến 25): ";
cin >> so_sinh_vien;
// Kiểm tra tính hợp lệ của số lượng sinh viên
while (so_sinh_vie... | ALGO | 0.999351 | 4.925931 |
a7ed1027-f7c3-4a07-9ea8-df0fb98cb78a | cakuang1/codeforces | codeforces/bitmasks/binarytable.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = (ll)-4e18;
// encode a 10‐vector of counts c[0..9], each ∈[0,2], into
// mask = sum_{d=0..9} c[d]*3^d
static int pow3[10];
constexpr int M = 59049; // 3^10
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
// pr... | ALGO | 0.999756 | 4.756 |
60ef51a0-a135-43c0-a03c-fd151a9b4665 | alexandraback/datacollection | solutions_5658282861527040_0/C++/SAS/B.cpp | #include<stdio.h>
#include<stdlib.h>
int main(){
int T;
scanf("%d",&T);
for(int ca = 1; ca <= T; ca++){
int A,B,K;
scanf("%d %d %d",&A,&B,&K);
int ans = 0;
for(int i=0;i<A;i++){
for(int j=0;j<B;j++){
if((i & j) < K){
ans ++;
}
}
}
printf("Case #%d: %d\n",ca, ans);
}
return 0;
}
| ALGO | 0.998629 | 3.729286 |
d9769842-7abb-4934-903a-ebf835ec1270 | rajprem4214/LeetCode | 814-binary-tree-pruning/814-binary-tree-pruning.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.999837 | 6.015546 |
cd402e72-0786-4727-ba03-ce050adcdee3 | Ex-Rockstar/patterns | triangleupsidedownstarspaced.cpp | #include<iostream>
using namespace std;
int main() {
int n=7;
int i =1;
// cin>>n;
while(i<=n){
int space=i-1;
while (space){
cout<<" ";
space=space-1;
}
int star=n-i+1;
while (star){
cout<<"*";
star-=1;
}
cout<<endl;
i+=1;
}
return 0;
}
| ALGO | 0.999937 | 3.616958 |
d8b45471-cd46-4793-9bec-273796234ec8 | phlndrwd/EATSM | src/Tools/Strings.cpp | #include "Strings.h"
#include <algorithm>
#include "Constants.h"
double Strings::StringToNumber( const std::string& string ) {
double number = strtod( string.c_str( ), nullptr );
return number;
}
const Types::StringVector Strings::StringToWords( const std::string& inputString, const char wordTerminationCha... | TOOL | 0.931046 | 6.27318 |
a6a62efd-e144-4e3c-a560-2918f868982a | TanmayBorse/DSA_CPP | DSA/recursiveMinMax.cpp | /*This is a C++ program which uses Recursive function to find the max and min elements in an array.
a> Run this program for different input values and validate the logic.
b> Modify the code to accept any number of inputs and find the maximum and minimum.
c> Write a logic to display the times of execution findMax, f... | ALGO | 0.99997 | 6.03124 |
f146de60-7c39-4b7c-9d97-ea471a276814 | adityasinghz/data-structures | 300-longest-increasing-subsequence/longest-increasing-subsequence.cpp | class Solution {
public:
int LIS(int prev , int indx , vector<int>&nums, vector<vector<int>>&dp){
if(indx == nums.size()) return 0;
if(dp[indx][prev+1]!=-1) return dp[indx][prev+1];
int len = LIS(prev, indx +1, nums,dp);
if(prev==-1 || nums[indx] > nums[prev]){
len = max(len,1+ ... | ALGO | 0.999993 | 6.145979 |
be15150d-b4dd-4fdd-b454-499132b1ce95 | segnindenin/qrcodearoun | 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.9988 | 6.76073 |
fe39d6ba-1a35-4ab0-8926-2e148bce37bb | parul-jain5102/Dynamic-Programming | DP3.cpp | //counting stars
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define fi first
#define se second
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<PII> VPII;
typedef vector<VI> VVI;
typedef map<int,int> MPII;
typedef... | ALGO | 0.999956 | 3.471213 |
0a44765c-1199-43b9-8f37-18ec4e4eb310 | SanthanCH/Competitive-Programming | Maximum_Difference_Between_Increasing_Elements/Maximum_Difference_Between_Increasing_Elements.cpp | class Solution {
public:
int maximumDifference(vector<int>& nums) {
int mi=nums[0],mx=nums[0],k=0;
for(int i=1;i<nums.size();i++){
if(mi>nums[i])
{
mi=nums[i];
mx=0;
}
mx=max(mx,nums[i]);
k=max(k,mx-mi);
}... | ALGO | 0.999974 | 5.477727 |
6f7e7551-d597-4a8f-a9fa-bd52298d973e | VishaalSudarsan/LeetCode | Min Stack.cpp | class MinStack {
vector<int> MinStack_vec;
int MinElem;
public:
MinStack()
{
MinElem = INT_MAX;
}
void push(int val)
{
MinStack_vec.push_back(val);
if(val < MinElem)
MinElem = val;
}
void pop()
{
if(MinStack_vec.back() == M... | ALGO | 0.999807 | 6.599965 |
b6294bba-33ec-40b4-a9a0-16797c2c5425 | 4n-d3er-git/guicooode | 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 |
0a628571-d6d7-42e6-b821-916cbe895cc8 | ChandlerNgo/CP | CSCE430 Lab #10/C.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string command;
cin >> command;
ll shares = 0;
ld shareMoney = 0;
while(command != "die"){
if(command == "buy" || command == "se... | ALGO | 0.999591 | 4.111165 |
20acdd08-6913-41f4-80f4-2c5ae5c37711 | raincross7/code-similarity | codes/train_code/problem410/problem410_307.cpp | #include<bits/stdc++.h>
using namespace std;
/// Macros ---------------------
#define ll long long
#define sz(a) (int)a.size()
#define int long long
#define pb push_back
#define vi vector<int>
#define f first
#define s second
#define ii pair<int,int>
#define lb lower_bound
#define up upper_bound
#define rep(i,x,y) for(... | ALGO | 0.999983 | 3.663517 |
ff4897a8-2b7b-40ba-94e6-a26bde888066 | SightVanish/MyLeetcode | JZ7.cpp | /*
* @Author: your name
* @Date: 2021-09-12 11:56:47
* @LastEditTime: 2021-09-12 11:56:48
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /剑指offer/JZ7.cpp
*/
class Solution {
public:
int Fibonacci(int n) {
if (n<=1) return n;
else return Fibona... | ALGO | 0.999757 | 4.588416 |
970d812c-c21f-4e40-8714-738f255a761d | misskalyani/Basic-CPP-Programming | Swap.cpp | #include<iostream>
using namespace std;
void swap(int a,int b)
{
int temp;
temp=a;
a=b;
b=temp;
cout<<"After Swapping :: \n ";
cout<<"\na = "<<a;
cout<<"\nb = "<<b;
}
int main()
{
int a,b;
cout<<"Enter First Number :: ";
cin>>a;
cout<<"Enter Second Number :: ";
cin>>b;
swap(a,b);
}
//Swapping Hot Nahi Bec... | ALGO | 0.999108 | 3.964126 |
cccf4d42-cec4-4795-935e-25ad99cc2794 | plenilune3/problem_solving_cpp | beakjoon/BaaaaaaaarkingDog/Tree/4256_트리.cpp | #include <iostream>
using namespace std;
class node
{
public:
char data;
node *left, *right;
node(char _data)
{
(*this).data = _data;
(*this).left = NULL;
(*this).right = NULL;
}
};
class tree
{
private:
void _insert(node *root, char data, char left_data, char right_d... | ALGO | 0.999804 | 3.999305 |
86f5349f-ae10-41f4-84bb-f045d1269071 | Vaibhav6200/DSA_Practice | Stacks and Queues/easy/Next_Min_Index.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> nextMinIndex(int arr[], int n){
vector<int> result(n);
stack<int> st;
st.push(-1);
for(int i=n-1; i>=0; i--){
while(st.top()!=-1 && arr[st.top()] >= arr[i])
st.pop();
result[i] = st.top();
st.push(i);
}
... | ALGO | 0.999967 | 4.870871 |
b9c47062-70c8-4ca5-be83-42f99274fbea | Mizdere/Lab-5 | nested.cpp | #include <iostream>
using namespace std;
int main()
{
int numStudents, numDays;
float numHoursProg, numHoursBio, totalProg, totalBio, averageProg, averageBio;
int student, day;
cout << "This program will find the average number of hours a day"
<< " that a student spent programming and studyin... | ALGO | 0.998201 | 3.53197 |
141a24f5-acd1-4236-8cd7-fbc33e2ce501 | freedeveloper-c/p7zip | CPP/7zip/Crypto/ZipCrypto.cpp | // Crypto/ZipCrypto.cpp
#include "StdAfx.h"
#include "../../../C/7zCrc.h"
#include "../Common/StreamUtils.h"
#include "RandGen.h"
#include "ZipCrypto.h"
namespace NCrypto {
namespace NZip {
#define UPDATE_KEYS(b) { \
key0 = CRC_UPDATE_BYTE(key0, b); \
key1 = (key1 + (key0 & 0xFF)) * 0x8088405 + 1; \
key2 = ... | ALGO | 0.985487 | 5.874854 |
cd702629-c588-4cff-88d1-c8c03c17bdc6 | ishandutta2007/codeforces | hyperbolic/normal/1344/A.cpp | #include <stdio.h>
#include <algorithm>
int x[200010],y[200010];
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
int a;
scanf("%d",&a);
for(int i=1;i<=a;i++) scanf("%d",&x[i]);
for(int i=1;i<=a;i++) y[i] = (((x[i]%a) + a)%a + i)%a;
std::sort(y+1,y+a+1);
for(int i=1;i<a;i++)
{
if(y[i]==y[i+1])
... | ALGO | 0.999872 | 3.651644 |
ea241e43-1e3d-476e-b2ae-03b16528657e | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Gemma/top0-100/number-of-pairs-of-interchangeable-rectangles-Solution.interchangeableRectangles/177832_nan.cpp | walk_string(fz_context *ctx, int uni, int remove, editable_str *str)
{
int rune;
if (str->utf8 == NULL)
return;
do
{
char *s = &str->utf8[str->pos];
size_t len;
int n = fz_chartorune(&rune, s);
if (rune == uni)
{
/* Match. Skip over that one. */
str->pos += n... | TOOL | 0.99704 | 5.831207 |
4fab173a-ced2-4fe7-9cc2-19b480bd8a30 | ishandutta2007/codeforces | izban/normal/241/A.cpp | #include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <set>
#include <queue>
#include <sstream>
#include <deque>
#include <memory.h>
#include <cassert>
#include <ctime>
using namespace std;
#define ll long long
#pragma comment(linker,... | ALGO | 0.999884 | 3.352909 |
9fa89c3c-3c0d-4baf-b90c-ebc4982961f3 | CodeFusioner/code-c | f.cpp | /**
* C program to find diameter, circumference and area of a circle using functions
*/
#include <stdio.h>
#include <math.h> // Used for constant PI referred as M_PI
/* Function declaration */
double getDiameter(double radius);
double getCircumference(double radius);
double getArea(double radius);
int main()
{
... | ALGO | 0.999748 | 5.340202 |
48b6fa92-5e8a-413c-85ff-8d64d696c558 | Prajagithub/FlutterApp | classApp/Stateless/row_scenario/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.996788 | 6.76775 |
44c22fee-1e37-42a8-9d93-6439fbad9602 | huntmcke32/huntmcke32 | CS 142/cs142midterm question 4.cpp | #include <iostream>
#include <vector>
using namespace std;
void ShowVector(const vector<int>& mulVec);
void InvertVector(vector<int>& mulVec);
int main() {
int vectorSize;
int multiplier;
cout << "Please enter the size of the vector: " << endl;
cin >> vectorSize;
cout << "Please input the multipli... | ALGO | 0.99948 | 4.2473 |
62a73419-4d52-40c7-bc73-1382211c4103 | sajida-dev/2024-LeetCode-Problems | 1-two-sum/two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> index;
for(int i=0; i<nums.size(); i++)
{
for(int j=0; j<nums.size(); j++)
{
if(i!=j)
{
if(nums[i]+nums[j]==target)
... | ALGO | 0.999682 | 6.110576 |
d58cb6a6-dd93-4c67-a33c-d164e9bd64b7 | sdmg15/coin-pipeline | src/wallet/fees.cpp | #include <wallet/fees.h>
#include <wallet/coincontrol.h>
#include <wallet/wallet.h>
#include <anon.h>
CAmount GetRequiredFee(const CWallet& wallet, unsigned int nTxBytes)
{
return GetRequiredFeeRate(wallet).GetFee(nTxBytes);
}
CAmount GetMinimumFee(const CWallet& wallet, unsigned int nTxBytes, const CCoinControl... | ALGO | 0.99419 | 7.021567 |
985505ee-1896-445f-af0d-539351987906 | riuri/adventofcode | 2023/05/1.cpp | #include <iostream>
#include <functional>
#include <string>
#include <limits>
#include <map>
using namespace std;
class DstRange {
public:
unsigned dst, range;
DstRange(unsigned _dst, unsigned _range): dst(_dst), range(_range) {}
DstRange() : dst(0), range(0) {}
};
class RangeMap {
map<unsigned, DstRange, gr... | ALGO | 0.999904 | 5.009045 |
48cfccf1-e690-4afd-8dab-58f12d61b0de | ishandutta2007/codeforces | gs18115/normal/1051/F.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<time.h>
#include<algorithm>
using namespace std;
typedef long long LL;
typedef pair<LL,LL>PL;
const LL INF=1e18;
const LL MAXV=1e5+10;
LL dis[45][MAXV];
bool qin[MAXV];
LL V,E;
vector<PL>adj[MAXV];
queue<LL>Q;
void SPFA(LL rt,LL num)
{
fill(dis[num],dis[n... | ALGO | 0.999985 | 4.688889 |
a0821c47-1779-4b31-bc5d-7c7bd88ca4a5 | ishandutta2007/codeforces | akulyat/normal/1513/E.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O3", "unroll-all-loops")
#pragma GCC target ("sse4.2")
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
ifstream in;
ofstream out;
const long long kk... | ALGO | 0.999986 | 3.952375 |
a9f98eff-7a22-436e-9510-dd4e905bc5a8 | ngderek24/CS32_Projects | Project_1/Game.cpp | #include "Game.h"
#include "globals.h"
#include "Arena.h"
#include "Player.h"
#include "History.h"
#include <iostream>
#include <string>
using namespace std;
bool charToDir(char ch, int& dir);
bool recommendMove(const Arena& a, int r, int c, int& bestDir);
int computeDanger(const Arena& a, int r, int c);
////////////... | ALGO | 0.944635 | 5.921825 |
4c3a3bbd-2c94-4029-bb60-56428643d31d | juan-gonzalezg/Algoritmos-y-Estructuras-de-Datos | Lista Simplemente Enlazada/ejercicioListaSimplementeEnlazadas_9.cpp | //9) Rotar los elementos de una lista k posiciones hacia la izquierda.
#include <iostream>
using namespace std;
struct Nodo{
int dato;
Nodo *prox;
};
int longitudLista(Nodo *inicio){
int longitud=0;
while(inicio!=NULL){
longitud++;
}
return longitud;
}
void rotarIzquierda(Nodo **inicio,int k... | ALGO | 0.999767 | 3.69924 |
c882a666-297c-4b84-a334-5dcd15ec25dc | bfidlers/AoC | 2023_AoC/day07/day7_part1.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <algorithm>
using namespace std;
map<char, int> cardValue = {
{'2', 1},
{'3', 2},
{'4', 3},
{'5', 4},
{'6', 5},
{'7', 6},
{'8', 7},
{'9', 8},
{'T', 9},
{'J', 10},
{'Q', 11},
{'... | ALGO | 0.999541 | 4.91188 |
8a9c4c00-5357-41f9-8ed8-0063e7bf569d | Fleker/gem5 | src/systemc/tests/systemc/misc/unit/data/datawidth_signed/promote/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.983157 | 5.296924 |
74a6560a-b126-4822-a649-0347b0f927e2 | wugy11/openjdk1.7 | hotspot/src/share/vm/opto/divnode.cpp | #include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "opto/addnode.hpp"
#include "opto/connode.hpp"
#include "opto/divnode.hpp"
#include "opto/machnode.hpp"
#include "opto/matcher.hpp"
#include "opto/mulnode.hpp"
#include "opto/phaseX.hpp"
#include "opto/subnode.hpp"
// Portions of code courtesy... | ALGO | 0.997778 | 4.774904 |
88450140-b845-4110-9fe8-1a27e919a986 | luckyhappycat/leetcode | 剑指offer/offer10_solution1.cpp | #include <iostream>
using namespace std;
class Solution {
public:
int fib(int n) {
if (n<2) {
return n;
}
int f0 = 0, f1 = 1;
for(int i=2; i<=n; i++) {
int temp = f1;
f1 = f0 + f1;
f0 = temp;
}
return f1;
}
};
int ... | ALGO | 0.999925 | 5.892831 |
d55bd43e-2aa9-445d-bb80-38790517886e | JobayerAhmmed/CP | UVa/10370.cpp | #include<iostream>
#include<iomanip> // std :: fixed; std :: setprecision;
using namespace std;
int main(void)
{
int testCase;
int people;
int sum;
int average;
int counter;
double percentage;
cin >> testCase;
for(int i = 0; i < testCase; i++) {
cin >> people;
int m... | ALGO | 0.997923 | 4.276343 |
2537e807-50de-47a5-bcca-c5de98781cd2 | eezyl/code_zyl | codeforces/CF_327_A_3.cpp | //********************************************************
//
// File : main.cpp
// Author : eezyl
// Synopsis: codeforces
// Address : https://codeforces.com/problemset/problem/327/A
// Date : 2019/04/17 (upload date)
//
//********************************************************
//#define L... | ALGO | 0.999962 | 3.718851 |
da0a12d7-8402-48c1-9228-49d4db755668 | GiacomoLorenzon/algorithms-and-parallel-computing | exercises-algorithms/Ex18/main_reduce.cpp | #include <iostream>
#include <random>
#include <mpi.h>
#include <string>
double square(double x); // return x*x
double dboard(unsigned darts, unsigned seed); // implement Pi approximation through darts random sampling
double approximate_pi(unsigned long iterations, unsigned darts);
int main(int argc, char *argv[]... | ALGO | 0.999909 | 5.653002 |
697bede0-4238-4bcf-9fff-ce707ac7b067 | AdminAbhi/MyCodeLib | Google-Coding-Competitions/Kickstart/2021/Round F/2.cpp | //=============================================================================
// @abhi_admin linkedin.com/in/adminabhi Email: <EMAIL>
//=============================================================================
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typ... | ALGO | 0.999819 | 4.66713 |
92a20a8f-b905-4377-8d7a-fc4200eaa82a | sarvex/leetcode-clojurescript | solution/2500-2599/2550.Count Collisions of Monkeys on a Polygon/Solution.cpp | class Solution {
public:
int monkeyMove(int n) {
const int mod = 1e9 + 7;
return (qmi(2, n, mod) - 2 + mod) % mod;
}
long qmi(long a, long k, long p) {
long res = 1;
while (k != 0) {
if ((k & 1) == 1) {
res = res * a % p;
}
... | ALGO | 0.999986 | 5.756225 |
6e8ee35b-8ca9-48cd-9745-ed63580f9e5f | bigOK666/primer_Cpp | chapter10/exercise10_31.cpp | #include<string>
#include<vector>
#include<iterator>
#include<fstream>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
istream_iterator<int> in_iter(cin), eof;
vector<int> v_i;
vector<int> v_uniq_i;
copy(in_iter, eof, back_inserter(v_i));
sort(v_i.begin(), v_i.end());
unique_copy(v_i.... | ALGO | 0.999675 | 4.671975 |
6fdd0397-8bf4-4e76-91b8-dbc4fdcb9429 | Yasirraiyan/Leet-Code-SolvIing-Problem | Leetcode 2553 Separate Digits In an Array/Solution.cpp | #include<vector>
class Solution {
public:
vector<int> separatedigit(int n)
{
vector<int>reserve;
if (n == 0)
{
reserve.push_back(0);
}
while(n>0)
{
int rem=n%10;
reserve.push_back(rem);
n=n/10;
}
// n=n/10;
std::reverse(reserve.begin(), res... | ALGO | 0.999975 | 5.836593 |
e8e77cfd-5a6e-40b0-9cc5-6d9e24966345 | yuv-raj-25/cpp-dsa | .history/factorial_20230921221729.cpp | #include <iostream>
using namespace std;
int factorial(int n){
if(n==0){
return 0;
}
else{
return
}
}
int main(){
int n = 5;
int factorial;
return 0;
} | ALGO | 0.999692 | 3.642869 |
156eaa73-9d97-434d-ab4e-421d4badd2a5 | FelixWinchester/_SeminarDz2 | #DZ №1.4.cpp | #include <iostream>
#include <string>
#include <fstream>
using namespace std;
int frog(int n, int k) {
if (n == k) {
return 1;
}
else if (n > k) {
return 0;
}
else
return frog(n + 3, k) + frog(n + 5, k);
}
int main() {
int x;
cin >> x;
cout << frog(0, x);
}... | ALGO | 0.999974 | 4.156657 |
fe4721f2-d76d-4624-b803-a744bf2f3e71 | ishandutta2007/codeforces | burnoutag7/normal/1141/G.cpp | #include<bits/stdc++.h>
using namespace std;
int n,k,d[200005],e[200005],cs;
vector<pair<int,int>> g[200005];
void dfs(int x,int p,int pc){
int c=0;
for(auto &[y,z]:g[x])if(y!=p){
c++;
c+=c==pc;
e[z]=c;
dfs(y,x,c);
}
}
int main(){
ios::sync_with_stdio(false);
cin.... | ALGO | 0.999998 | 4.395239 |
f517b799-12f7-4604-bb20-272b45fe3974 | mesadb/mesadb.github.io | mesa/cstore/src/Operators/NLJoin.cpp | #include "NLJoin.h"
#include "../common/BlockWithPos.h"
NLJoin::NLJoin(Operator *left_, int predColIndex1_, Operator *right_, int predColIndex2_) : l_src(left_), l_predcol(predColIndex1_), r_src(right_), r_predcol(predColIndex2_) {
init();
}
void NLJoin::init() {
// set both blocks dirty
m_isLBlockConsumed =... | ALGO | 0.98249 | 3.693823 |
4eefb20c-32ed-444b-8c94-11eb45d84f85 | asaashraf/CSCI1300-CS1-Students | Fundamental Data Types/vending_machine_v1.cpp | #include <iostream>
/*
Algorithm:
input: money to buy stamps, number of stamps
output: change in dollars and cents
1. Ask user to input a whole number for the dollar amount inserted into the machine
a. Save in the variable initial_money
2. Ask user to input a whole number for the number of stamps wished to purch... | ALGO | 0.984522 | 4.156871 |
e1bdc840-5131-4caa-ba96-6673480f1f11 | UmerSoftwares/Spark-E1 | firmware/Marlin-2.1.x/Marlin/src/module/planner_bezier.cpp | /**
* planner_bezier.cpp
*
* Compute and buffer movement commands for bezier curves
*/
#include "../inc/MarlinConfig.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#include "planner.h"
#include "motion.h"
#include "temperature.h"
#include "../MarlinCore.h"
#include "../gcode/queue.h"
// See the meaning in the documentat... | ALGO | 0.99956 | 7.909719 |
08ee2570-a2d8-49a2-9810-3a2f545c85b2 | PSCurlin/gem5-resources | src/deprecated/parsec/disk-image/parsec/parsec-benchmark/pkgs/libs/tbblib/src/src/test/test_halt.cpp | #include <cstdio>
#include <cstdlib>
#include <cassert>
#include <utility>
#include "tbb/task.h"
#include "tbb/task_scheduler_init.h"
#include "tbb/tick_count.h"
#include "tbb/parallel_for.h"
#include "tbb/blocked_range.h"
#include "tbb/mutex.h"
#include "tbb/spin_mutex.h"
#include "tbb/queuing_mutex.h"
#include "harne... | TEST | 0.978325 | 6.155344 |
f85e6a3d-9865-4f47-9892-4c4c26b7209f | PedroAngeli/Competitive-Programming | Solutions/Codeforces/CF-D1/534.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
#define s second
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using ld = long double;
using ll = long long;
using pii = pair <int,int>;
using pll = pair <ll,ll>;
using vi = vector <int>;
using vll = vector <ll>;
... | ALGO | 0.999953 | 3.864728 |
0c82ed5f-8db7-4ba0-b670-7a3eb064e259 | chbaker0/programming-problems | uhunt/673-parentheses-balance/solution.cpp | #include <iostream>
#include <string>
#include <vector>
static std::string str;
static std::vector<char> stack;
bool is_valid() {
stack.clear();
for (char c : str) {
if (c == '(' || c == '[') {
stack.push_back(c);
continue;
}
char match;
if (c == ')')
match = '(';
else if (... | ALGO | 0.999816 | 6.699497 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.