uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
5583e3e7-1679-4f4d-b299-0371a7e54ec5 | roy-herzlichkeit/_drills_on_cpp_ | codeforces/1797B.cpp | #include <bits/stdc++.h>
#define MOD 1e9+7
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using vi = vector<int>;
using vll = vector<ll>;
static inline void fast_io() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
}
static inline unsigned long long spl... | ALGO | 0.999966 | 4.863902 |
dfe3a359-9320-4486-8e6b-c13f34db173b | ztwater/LeetCode | Solutions/BiWeeklyContest10/1213 Intersection of Three Sorted Arrays/01.cpp | //1213 Intersection of Three Sorted Arrays
class Solution {
public:
vector<int> arraysIntersection(vector<int>& arr1, vector<int>& arr2, vector<int>& arr3) {
int size1 = arr1.size();
int size2 = arr2.size();
int size3 = arr3.size();
vector<int> res;
int s1 = 0, s2 = 0, s3 = 0... | ALGO | 0.999974 | 5.454539 |
727279a9-3046-44a8-beba-807f91494824 | kinaphar/AtCoder | ABC/ABC226/b-answer-re.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
// 追加2, 以降 cin の入力元が 'input.txt' になる
// std::ifstream in("input.txt");
// std::cin.rdbuf(in.rdbuf());
// ...
int N;
cin >> N;
set<vector<int>> st;
rep(i, N) {
int L... | ALGO | 0.998733 | 3.594618 |
69d8fa5e-507f-4f60-9be4-d30f27715f94 | JESSE-max1/30DaysofCoding | day 1/sort012's.cpp | #include <bits/stdc++,h>
using namespace std;
void sort012(vector<int>&nums)
{
int lo = 0;
int mid = 0;
int high = nums.size()-1;
whike(mid <= high){
switch(nums[mid]){
case 0:
swap(nums[low++],nums[mid++]);
break;
case 1:
... | ALGO | 0.999908 | 4.431527 |
be13fce2-7f2a-4916-90b4-67006ea66fd8 | sunny2028/DS-IN-CPP | Data Structure practice/binary tree/reverselevelorder.cpp | #include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node* left;
struct node* right;
};
void reverseLevelOrder(node *root)
{
queue<node*>q;
stack<int>s;
q.push(root);
while(!q.empty())
{
node *temp=q.front();
q.pop();
s.push(temp->data);
if(temp->right)
q.push(temp->rig... | ALGO | 0.999991 | 4.958442 |
ecb671df-96ab-4c47-bac6-4de999753fee | snob15zp/Scaner_PC3 | ConsoleApplication2/C/main.cpp | #include <chrono>
#include <fstream>
#include <iostream>
#include <string.h>
#include <vector>
//matlab main begin
extern "C" {
/* Include Files */
// #include "main.h"
#include "main_scanner.h"
#include "main_scanner_terminate.h"
#include "rt_nonfinite.h"
}
/* Function Declarations */
static void argInit_1x1650001_re... | ALGO | 0.957047 | 3.875861 |
e67ee81a-3791-43bd-b93d-84ea811749d3 | paraggoyal28/cp | codeforces/1703F.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long int
ll findIndex(vector<pair<ll, ll>> &withIndex, ll x)
{
ll st = 0;
ll res = -1;
ll end = withIndex.size() - 1;
while (st <= end)
{
ll mid = st + (end - st) / 2;
if (withIndex[mid].... | ALGO | 0.999902 | 5.088692 |
8ebecc54-ffd7-4f56-ad19-8e4b1abdf42d | Adiihub/DSA-Summer-Internship | Lecture 13/find_Nth_root.cpp | #include<bits/stdc++.h>
using namespace std;
// n=1 && m==10^9
// x^1==10^9
int power(int x,int n){
// 3^3==3*3*3
int p=1;
for(int i=0;i<n;i++){
p=p*x;
}
return p;
}
//Optimized code
int findNthRoot(int n,int m){
long lo=1,hi=m;
while(lo<=hi){
long mid=(lo+hi)/2;
... | ALGO | 0.99998 | 4.939731 |
0aade187-26ad-44a9-8f41-597bca1292a1 | Keybinhoainam/codecpp | lap trinh va thi dau/Untitled1.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int T;
cin>>T;
while(T--)
{
ll n;
cin>>n;
ll m=5,m1,kq=0;
while(1)
{
m1=m;
while(m%5==0)
{
m/=5;
kq++;
}
if(kq==n)break;
m+=5;
}
cout<<m<<endl;
}
}
| ALGO | 0.99995 | 4.055331 |
6f058ebe-74ca-475a-9799-e936832de670 | HPhuonghub/code-cpp | code c++/9.cpp | #include <bits/stdc++.h>
using namespace std;
int n,m,st,en,a[1005];
bool check[1005];
vector<int> List[1005];
bool DFS(int u){
check[u]=true;
for(int v : List[u]){
if(!check[v]){
a[v] = u;
if(DFS(v)) return true;
}
else if(v != a[v]){
st=v; en=u;
return true;
}
}
return false;
}
int main(){
in... | ALGO | 0.99997 | 4.545772 |
c91b0a4f-5795-4080-a7d8-b2daf6e4cfd1 | pavellevap/code_antiplagiat | final_test/18/u22091_140_C_1002181.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdli... | ALGO | 0.999976 | 3.367585 |
1ba68742-3c22-4714-bdc3-6aa4b41047d7 | muhammadoginh/FFT | src/lib/fft.cpp | #include "fft.hpp"
#include <algorithm>
namespace fft
{
namespace helper
{
static double constexpr pi = 3.14159265358979323846;
/*
* ceiling(log2(x))
*
* @return ceiling(log2(x))
*
* @param x: log argument
*/
int upper_log2(const int x... | ALGO | 0.999967 | 5.581686 |
235225ab-0866-4dce-ae5a-9515d82d2820 | ZhillerDev/FunnyLearningPath | Algo/offer/offer59.cpp | #include <bits/stdc++.h>
using namespace std;
void main()
{
return;
}
// 滑动窗口最小值
| ALGO | 0.999688 | 3.629324 |
4cd011dd-248e-4927-846f-eda4b6c2398c | nadernamini/cloth-sim-opengl | ext/nanogui/ext/eigen/bench/sparse_cholesky.cpp | // #define EIGEN_TAUCS_SUPPORT
// #define EIGEN_CHOLMOD_SUPPORT
#include <iostream>
#include <Eigen/Sparse>
// g++ -DSIZE=10000 -DDENSITY=0.001 sparse_cholesky.cpp -I.. -DDENSEMATRI -O3 -g0 -DNDEBUG -DNBTRIES=1 -I /home/gael/Coding/LinearAlgebra/taucs_full/src/ -I/home/gael/Coding/LinearAlgebra/taucs_full/build/lin... | ALGO | 0.99639 | 4.147974 |
9018b4a9-81d6-4025-b91e-666e4dd972a6 | ch4/TH3D_E2P | Firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Digital PinName array
const PinName digitalPin[] = {
PA_0, // Digital pin 0
PA_1, // Digital pin 1
PA_2, // Digital pin 2
PA_3, // Digital pin 3
PA_4, // Digital pin 4
PA_5, // Digital pin 5
PA_6, // Digital pin 6
PA_7, // Dig... | CONFIG | 0.906958 | 6.350003 |
c9a247a0-161c-4f7b-b9a6-7839be5e5083 | echox0/SSQCbook-Base-Luogu | Part1/Chapter5/P2550.cpp | #include <iostream>
using namespace std;
int main() {
int n, a[10], num[10] = {0};
cin >> n;
for (int i = 1; i <= 7; i++) // 创建一个数组存下中奖号码
cin >> a[i];
while (n--) { // 用for也可以
int ans = 0;
for (int i = 1; i <= 7; i++) {
int x;
cin >> x;
... | ALGO | 0.999481 | 3.136533 |
ca486c51-e6f7-4c5e-a3d3-13271e419e67 | Beast921/codes | backtracking/pathsInBinaryMatrix.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution{
public:
vector<string> v;
vector<pair<char, pair<int, int>>> dir = {{'U', {-1,0}}, {'R', {0,1}}, {'D', {1,0}}, {'L', {0,-1}}};
void paths(vector<vector<int>> &m, int n, vector<bool> vis, string s, int i, int j){
if(i==n-1 && j==n-1)... | ALGO | 0.999869 | 5.402926 |
190d0832-68fb-470b-926b-8f9764b2d20b | rewatlok/Prepare-for-ICPC | Theory/String algorithms/Trie/Bitwise Trie.cpp | class Bitwise_trie {
public:
struct TrieNode {
int count;
TrieNode* children[2];
TrieNode* parent;
TrieNode() : count(0), parent(nullptr) {
children[0] = nullptr;
children[1] = nullptr;
}
};
Bitwise_trie() {
root = new TrieNode();
... | ALGO | 0.999302 | 5.767887 |
caa8f00d-c67f-4ffc-ab05-5ba2edf888c7 | brt23/VINS-Mono-Opoencv4 | vins_estimator/src/initial/solve_5pts.cpp | #include "solve_5pts.h"
namespace cv {
void decomposeEssentialMat( InputArray _E, OutputArray _R1, OutputArray _R2, OutputArray _t )
{
Mat E = _E.getMat().reshape(1, 3);
CV_Assert(E.cols == 3 && E.rows == 3);
Mat D, U, Vt;
SVD::compute(E, D, U, Vt);
if (determinant(U)... | ALGO | 0.999763 | 6.156259 |
5572dde9-4a1d-4fd4-a109-ebfe73c3175a | blueboxd/libcxx | test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare>
// requires ShuffleIterator<Iter>
// && CopyConstructible<Compare>
// void
// stable_sort(Iter first, Iter last, Compare comp);
#include <algorithm>
#include <functional>
#include <vector>
#include <ra... | TEST | 0.995852 | 6.713372 |
b046ef36-12aa-47f1-a5c7-52bc012ee909 | apanoo/apworks | client/deps/FreeImage/Source/OpenEXR/Imath/ImathMatrixAlgo.cpp | //----------------------------------------------------------------------------
//
// Implementation of non-template items declared in ImathMatrixAlgo.h
//
//----------------------------------------------------------------------------
#include "ImathMatrixAlgo.h"
#include <cmath>
#include <algorithm>
#if defined(OPENE... | ALGO | 0.999795 | 6.941531 |
76638de1-c830-481f-b3d9-443c1b382da5 | aakashmaity/code-with-akash | 79-word-search/word-search.cpp | class Solution {
public:
bool helper(vector<vector<char>>& board, string word, vector<vector<int>> &vis,int i,int j,int m,int n, int k)
{
if (k >= word.size())
return true;
if(i<0 || i>=n || j<0 || j>=m)
return false;
if(vis[i][j]==1)
return false;
... | ALGO | 0.999878 | 6.061408 |
d6ca8649-8512-4d55-a934-89b8e058d467 | yama11111/GameAwards2023 | Engine/Utillity/Math/Lerp.cpp | #include "Lerp.h"
#include "Vector4.h"
#include <math.h>
#include <cassert>
using YMath::Ease;
using YMath::BezierEase;
using YMath::Vector2;
using YMath::Vector3;
using YMath::Vector4;
#pragma region
template<typename T>
T YMath::Lerp(const T& a, const T& b, const float t)
{
return static_cast<T>(a + t * (b - a))... | ALGO | 0.982377 | 6.315159 |
6d7a7169-4fb4-4851-b909-c1d47e55b798 | AmjadMohamed/Problem-Solving | LeetCode/sort-the-people/Accepted/12-21-2022, 6_47_34 PM/Solution.cpp | // https://leetcode.com/problems/sort-the-people
class Solution {
public:
vector<string> sortPeople(vector<string>& names, vector<int>& heights) {
map<int,string>mp;
for(int i = 0 ; i < names.size() ; i ++)
{
mp[heights[i]] = names[i];
}
vector<string> v;
... | ALGO | 0.999981 | 6.349354 |
fc18fa9d-59ad-438b-b985-371f272cd807 | ishandutta2007/codeforces | rubikun/normal/1182/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=200005,INF=1<<30;
int main(){
std::ifstream in("text.txt");
std::cin.rdbuf(in.rdbuf());
cin.tie(0);
ios::sync_with_stdio(false);
int N;cin>>N;
if(N%2) ... | ALGO | 0.999968 | 3.886642 |
e4ae796b-183d-4c61-9cfe-339b14a8b30c | devpawann/Flutter-Clean-Arch-Form-Validator | 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 |
56baf69d-9abf-4001-9d4c-54c91fe88eb0 | montserzamorano/PracticasSCD | practica1/obligatorios/fumadores.cpp | // *********************************************************************
// SCD. Práctica 1.
//
// Problema de los fumadores.
// Montserrat Rodriguez Zamorano
// *********************************************************************
#include <iostream>
#include <cassert>
#include <pthread.h>
#include <semaphore.h>
#inc... | ALGO | 0.991107 | 4.029286 |
5679acd8-85f9-4aff-a3c5-a4e3f19abfa2 | loveleon/algorithm-1 | leetcode/leetcode-master/algorithms/cpp/decodeString/DecodeString.cpp | // Source : https://leetcode.com/problems/decode-string/
// Author : Hao Chen
// Date : 2016-09-08
/***************************************************************************************
*
* Given an encoded string, return it's decoded string.
*
* The encoding rule is: k[encoded_string], where the encoded_str... | ALGO | 0.999408 | 6.740535 |
fa7855f8-150f-4eec-9773-89e22c29895d | MASHRAFI47/Data-Structures | Leetcode/Stack-Queue/adjacentDuplicates.cpp | //https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/description/
class Solution {
public:
string removeDuplicates(string s) {
stack<char> st;
for(int i = 0; i < s.size(); i++) {
if(st.empty()) {
st.push(s[i]);
}
else ... | ALGO | 0.999918 | 6.694404 |
363c7feb-a767-4c8e-8e90-cb8ce92b7643 | hsiangchengfun/Gpe_Practice | Must_Do/10517.cpp | //Hartals
#include<iostream>
#include<vector>
#include<set>
#define ll long long
using namespace std;
int main(){
cin.tie(0);
cin.sync_with_stdio(0);
ll T,N,P;
cin>>T;
while(T--){
vector<ll> h;
cin>>N>>P;
h.resize(P);
for(ll i=0;i<P;i++){
cin>>h[i];
}
set<ll> s;
for(ll i=1;i<=N;i++){
for(l... | ALGO | 0.999564 | 3.73666 |
8790dccd-88ef-44d4-aec5-52fcb252e1ec | abu-naser/Encrypted-MPI-Communication | encrypted-mvapich2-2.3/cryptopp/blake2.cpp | // blake2.cpp - written and placed in the public domain by Jeffrey Walton and Zooko
// Wilcox-O'Hearn. Based on Aumasson, Neves, Wilcox-O'Hearn and Winnerlein's
// reference BLAKE2 implementation at http://github.com/BLAKE2/BLAKE2.
#include "pch.h"
#include "config.h"
#include "cryptlib.h"
#i... | ALGO | 0.988839 | 7.384447 |
be633a72-09e9-43e2-9eac-a486f2e95213 | SkAravindh/GeomAlgo | codes/Geom_Support.cpp | #include "Geom_Support.h"
Vector3 getNormal(const Triangle *t) {
Point *p0 = t->getCorners(0);
Point *p1 = t->getCorners(1);
Point *p2 = t->getCorners(2);
Vector3 vertex0 = Vector3(p0->x(), p0->y(), p0->z());
Vector3 vertex1 = Vector3(p1->x(), p1->y(), p1->z());
Vector3 vertex2 = Vector3(p2->... | ALGO | 0.996795 | 4.808055 |
cd319103-0e9f-4f0b-b773-60c508daeddc | gghati/Advance-Datastructure | express_tree/Etree.cpp | /*
* Etree.cpp
*
* Created on: 20-Jan-2020
* Author: f10
*/
#include "Etree.h"
#include <bits/stdc++.h>
using namespace std;
Node::Node(char x) {
data=x;
left=right=NULL;
}
// RECURSIVE TRANSVERSAL
void Etree::inorder_rec(Node *t)
{
if(t==NULL)
return;
else
{
inorder_rec(t->left);
cout<<t->dat... | ALGO | 0.99993 | 4.627031 |
12521213-6dff-4791-afb1-964f5bfcdd4f | nadasafan/islami | 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 |
b6f91abe-ed52-41e7-8f4b-f7731a8d4fff | vietne329/DataStructuresAndAlgorithms | 60.KiemTraDayNgoacDung.cpp | #include <iostream>
#include <stack>
using namespace std;
string str;
int KiemTra(char ch){
if(ch==')'||ch=='(') return 1;
if(ch=='{'||ch=='}') return 2;
if(ch==']'||ch=='[') return 3;
}
void Process(){
stack<char> MyS;
for(int i=0;i<str.length();i++){
if(str[i]=='('||str[i]=='['||str[i]=='{'){
MyS.push(str[i... | ALGO | 0.9995 | 4.247127 |
51a1868c-20a2-43f9-87ca-0b0719214ced | joelkojmapwr/aisd-lista5 | propagateInfo.cpp | #include "common.hpp"
#include "Graph.hpp"
#include <stack>
#include <algorithm>
int n;
struct Node {
int id;
int complexity;
std::vector<Node*> children;
};
void printOrderAndCost(Node* root) {
if (!root || root->id == -1) return;
// std::cout << "Node: " << root->id << ", Cost: " << root->compl... | ALGO | 0.999598 | 4.134625 |
799060f6-dd74-4a01-b2eb-554d3e4c996a | gptHarshit/project-C- | number_g_g.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main() {
// Initialize random number generator
srand(time(0));
int numberToGuess = rand() % 100 + 1; // random number between 1 and 100
int userGuess;
int attempts = 0;
cout << "Welcome to the Number Guessing Gam... | TOOL | 0.903961 | 5.135623 |
5202cfc7-35b9-4bd3-9dec-5b76f28810b6 | hakaman2020/AdventOfCode2022 | day04/day04_part1.cpp | #include <iostream>
#include <fstream>
#include <sstream>
void find_ranges(std::string input, int range[4])
{
std::istringstream inputline;
std::string line;
inputline.str(input.c_str());
std::getline(inputline, line, '-');
range[0] = std::stoi(line);
std::getline(inputline, line, ',');
range[1] = std::stoi(lin... | ALGO | 0.996727 | 4.081407 |
4c5be0dd-615b-4d77-a6b4-6d7824c10cd1 | anjali26sharma/Dynamic-Programming | Longest common subarray(substring).cpp | https://leetcode.com/problems/maximum-length-of-repeated-subarray/
class Solution {
public:
int helper(vector<int>& nums1, vector<int>& nums2, int n , int m, vector<vector<int>> &t)
{
for(int i =0; i<n+1; i++)
for(int j =0; j< m+1; j++)
{
if(i==0 || j==0)
... | ALGO | 0.999974 | 6.520015 |
e50ca6c6-3523-47ae-b543-78810971d742 | AHMADHASSANRAFIQUE/pflab5 | t4.cpp | #include<iostream>
#include<cmath>
using namespace std;
void perp(float dist,float angle);
main(){
float dist, angle;
cout<< "Enter the distance from the base of the tree (in feet): ";
cin>>dist;
cout<< "Enter the angle of elevation (in degrees): ";
cin>>angle;
perp(dist, angle);
}
void perp(float dist, floa... | TOOL | 0.996424 | 4.203724 |
c7df0f9a-3b6a-45eb-9fc1-dc77611b42e7 | ishandutta2007/codeforces | far_from_noob/normal/771/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define dd double
#define endl "\n"
#define pb push_back
#define mp make_pair
#define fo(i,n) for(int i=0;i<n;i++)
ll mod=1000000007;
ll n,k,t,m,q,flag=0;
ll po(ll k ,ll n,ll ans,ll temp,ll ans1){
if(n==0)return ans;
while(temp<=n){
ans*=... | ALGO | 0.999996 | 4.287353 |
0ca0f85c-328e-45c7-bfe4-68f67fc92bdd | PRO100BYTE/KHSU-contest | 4.cpp | #include<bits/stdc++.h>
using namespace std;
template<class T, T Q=2> constexpr T inf = numeric_limits<T>::max() / Q - 1;
template<class T,class S=T>inline bool umin(T&m,S&&x){return x<m?m=x,1:0;}
template<class T,class S=T>inline bool umax(T&m,S&&x){return m<x?m=x,1:0;}
auto operator<<(ostream&o,auto&&v)->enable_if_t<... | ALGO | 0.999977 | 3.989152 |
140b8251-8fe5-4d01-abac-7764de8ba405 | rafaelgo2/prog_comp | ct01/C.cpp | #include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
int g[1010][1010];
int INF = 99999999;
int main(){ _
while (true){
int n, e;
cin >> n >> e;
if (n == 0 && e == 0) break;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
g[i][j] = INF;
int x, ... | ALGO | 0.999797 | 3.731911 |
a2e4cb32-084b-4fd8-886b-ab84c07da936 | zensen6/BOJ_350_solved-completed_code-partII | 2075_acm.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool comp(int a, int b){
return a>=b;
}
int main(){
int N;
cin>>N;
int x;
vector<int> v;
for(int i=1;i<=N;i++){
cin>>x;
v.push_back(x);
}
sort(v.begin(),v.end());
for(int i=N+1;i<=N*N;i++){
cin>>x;
int j=0;
... | ALGO | 0.999992 | 3.436728 |
7e85c51f-c84e-47ab-86a9-b7b69fbecf26 | Yosuamuliawan19/algorithm-bank | Leetcode_submissions/problems/merge_sorted_array/solution.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int idx = 0;
for (int i=nums1.size()-nums2.size(); i<nums1.size(); i++){
nums1[i] = nums2[idx++];
}
sort(nums1.begin(), nums1.end());
}
}; | ALGO | 0.999924 | 5.365539 |
a99f8c1b-c223-4218-b5db-7359e8bf90ec | brownPenguin43/LCdaily | LinkedList/reverseLL.cpp | // https://leetcode.com/problems/reverse-linked-list/submissions/1408814820/
public:
ListNode* reverseList(ListNode* head) {
ListNode*prev=NULL;
ListNode*curr=head;
while(curr!=NULL){
ListNode*forward=curr->next;
curr->next=prev;
head=curr;
... | ALGO | 0.99808 | 5.020352 |
03d6db9f-6c18-48b8-93b7-bb53fa843826 | salah-mohamed0404/Programming-basics-with-C- | N_180/main.cpp | #include <iostream>
using namespace std;
int main()
{
string s;
cin>>s;
for(int i=s.size()-1; i>=0; i--){
if(s[i]=='6')
cout<<"9";
else if(s[i]=='9')
cout<<"6";
else
cout<<s[i];
}
return 0;
}
| ALGO | 0.998213 | 4.109101 |
775c5160-670b-4e48-bd0f-ff626591325f | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Gemma/top0-100/decode-ways-ii-Solution.numDecodings/177773_DoS_Exec_Code_Overflow_Mem._Corr..cpp | create_surface_from_thumbnail_data (guchar *data,
gint width,
gint height,
gint rowstride)
{
guchar *cairo_pixels;
cairo_surface_t *surface;
static cairo_user_data_key_t key;
int j;
cairo_pixels = (guchar *)g_malloc (4 * width * height);
surface = cairo_image_surface_... | ALGO | 0.998818 | 3.568963 |
2b4dd447-8e4a-4631-87eb-97666ee0fe71 | dantrag/moleqcage | CGAL-4.7/examples/Generator/name_pairs.cpp | #include "CGAL/Combination_enumerator.h"
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<string> names;
names.push_back("Sun"); names.push_back("Shannon");
names.push_back("Hurley"); names.push_back("Sawyer");
names.push_back("Kate"); names.push_back("Claire");
na... | ALGO | 0.997124 | 4.168341 |
d4ec608c-98b4-4b54-97d6-06e408b81d72 | sarvex/leetcode-ruby | solution/1600-1699/1600.Throne Inheritance/Solution.cpp | class ThroneInheritance {
public:
unordered_map<string, vector<string>> g;
unordered_set<string> dead;
string king;
vector<string> ans;
ThroneInheritance(string kingName) {
king = kingName;
}
void birth(string parentName, string childName) {
g[parentName].push_back(childNam... | ALGO | 0.999901 | 5.87433 |
b3fbf375-7cb9-4764-823f-7e67494184bb | Li-Ruiqi777/LeetCode_Solutions | .leetcode/45.跳跃游戏-ii.cpp | /*
* @lc app=leetcode.cn id=45 lang=cpp
*
* [45] 跳跃游戏 II
*/
#include <vector>
#include <math.h>
using namespace std;
// @lc code=start
class Solution {
public:
int jump(vector<int>& nums) {
int curDistance = 0;
int nextDistance = 0;
int ans = 0;
for(int i=0;i<nums.size();++i)
... | ALGO | 0.999913 | 6.270582 |
ef36fa12-e8cc-400a-851b-f4bb508a8bac | GenmCai/2019-ACM-Summer-Code | Day2(.5) 二叉树+搜索/Xor-tree.cpp | #include<iostream>
#include<cstring>
#include<sstream>
#include<string>
#include<cstdio>
#include<cctype>
#include<vector>
#include<queue>
#include<cmath>
#include<stack>
#include<list>
#include<set>
#include<map>
#include<algorithm>
#define fi first
#define se second
#define MP make_pair
#define P pair<int,int>
#defin... | ALGO | 0.999828 | 3.518095 |
78be6191-3b9c-4ea5-9d15-d062cc5778a1 | lorenzo-rovigatti/poresize | src/System.cpp | /*
* System.cpp
*
* Created on: May 20, 2019
* Author: lorenzo
*/
#include "System.h"
#include <glm/gtx/component_wise.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <algorithm>
#include <iostream>
#include <fstream>
System::System(double rc) :
particle_radius(... | TOOL | 0.887571 | 3.990159 |
d4510c6a-35b7-4a44-9c12-650fd0d2a044 | ishandutta2007/codeforces | errichto/normal/409/A.cpp | #include<cstdio>
#include<vector>
#include<algorithm>
#include<set>
#include<cstring>
#include<assert.h>
using namespace std;
#define FOR(i,a,b) for(int i = a; i <= b; ++i)
#define FORD(i,a,b) for(int i = a; i >= b; --i)
#define RI(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define max... | ALGO | 0.999972 | 3.690866 |
9f7c2435-3e22-43b1-b923-0c391ac318d9 | JaiSharma09/DSA | UnionAndIntersection.cpp | #include<iostream>
using namespace std;
int main(){
int n;
int m;
cout<<"Enter number of elements of array 1"<<endl;
cin>>n;
cout<<"Enter number of elements of array 1"<<endl;
cin>>m;
int arr1[n];
int arr2[m];
cout<<"Enter elements of array 1"<<endl;
for(int i =0;i<n; i++){
... | ALGO | 0.99827 | 3.154668 |
59e2f636-a694-4e56-a890-02ca277916c9 | chowdhuryamit/DsaAllTopic | stack/nextSmallestElement.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int arr[]={8,6,2,4,3};
vector<int>ans;
stack<int>st;
st.push(-1);
for (int i = 4; i >=0; i--)
{
while(st.top()>=arr[i]){
st.pop();
}
ans.push_back(st.top());
st.push(arr[i]);
}
reverse(ans... | ALGO | 0.999979 | 4.277272 |
deba2e23-a482-44d6-a487-50f4ed782c7b | MohamedMamdouh18/Problem-Solving | Code Forces Problems/Level E/Advertising Agency/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define llm LONG_LONG_MAX
#define el "\n"
#define se second
#define fi first
#define siz(ans) sizeof(ans) / sizeof(ans[0])
#define ll long long
#define all(a) a.begin(),a.end()
#define IOS ios_base::sync_with_stdio(0);cin.ti... | ALGO | 0.999925 | 4.58291 |
af2c163b-b9d8-4a45-bb63-3567be8e2ca7 | CARMUKYO/Ethrift | 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 |
1bf8dcae-0864-40c8-8b7f-96036d6b6fe7 | ZhenyingZhu/ClassicAlgorithms | src/CPP/src/pratice/MoveZeroes.cpp | #include <iostream>
#include <vector>
using namespace std;
// [Source]: https://leetcode.com/problems/move-zeroes/?tab=Description#/description
// http://www.1point3acres.com/bbs/thread-227472-1-1.html
class Solution {
public:
void moveZeroes(vector<int>& nums) {
int pt = 0;
for (int i = 0; i < (... | ALGO | 0.998656 | 6.461746 |
05ff805b-bbac-4369-ab67-19532d8fe231 | lazybones1/Algorithms | 백준알고리즘/단계별로 풀어보기/6. 1차원 배열/P_Number_2577.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int A, B, C;
cin>>A>>B>>C;
int mul = A*B*C;
int arr[10] = {0};
while(mul>10){
arr[mul%10]++;
mul/=10;
}
arr[mul]++;
for(int i = 0; i<10; i++){
cout<<arr[i]<<endl;
}
}
| ALGO | 0.999947 | 4.154857 |
559a94ad-1230-46dc-acf4-e9cbb0c9554a | KevinIsYi/100-Days-Of-Code | CP/Codeforces/Mini Contest/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
template <typename T>
T ceil(T a, T b) {
return (a + b - 1) / b;
}
template <typename T>
T gcd(T a, T b) {
return b ? gcd(b, a % b) : a;
... | ALGO | 0.999889 | 4.066465 |
662021d8-2d43-43ed-8724-f96978705513 | rishabhdev0/DSA-LeetCode | 141-linked-list-cycle/linked-list-cycle.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
ListNode *slow=head;
ListNode *prev=0;
ListNode *fast=head;
while(f... | ALGO | 0.999706 | 5.169228 |
995dd2bf-e919-4f6c-bf64-06d4c94bcd2e | iyungui/TIL-codetree | 241103/학점 계산기/credit-calculator.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int n;
cin >> n;
double sum = 0;
double arr[100];
for(int i = 0; i <= n; i++) {
cin >> arr[i];
sum += arr[i];
}
double avg = sum / n;
cout << fixed;
cout.precision(1);
cout << avg << end... | ALGO | 0.999201 | 4.468109 |
c4d2d8b2-26a3-445b-97af-ad27d8ebbd8a | yuruofeifei/Interview | leetcode/MinimumWindowSubstring.cpp | class Solution {
public:
bool contains(int *target, int *src) {
for (int i = 0; i < 256; i++) {
if (target[i] > src[i]) {
return false;
}
}
return true;
}
string minWindow(string S, string T) {
int start = -1, end = -1;
int minL... | ALGO | 0.999995 | 6.522761 |
e0f28af7-695b-4fd1-8867-c1ba111b8a3a | puck15h/data-struct | primos/Função para determinar se número é primo/primos.cpp | #include <iostream>
#include <cmath>
//By Tiago A. Fontenele
//23/11/2020
bool primo(int p){
int i = 0;
int raiz_aprox = 0;
int resto = 0;
int qtd_div = 0;
raiz_aprox = sqrt(p);
if(p == 1){
return false;
}
for(i = 2; i <= raiz_aprox; i++){
resto = p % i;
if(resto == 0){
qtd_div ++;
}
if(qtd_div > ... | ALGO | 0.999818 | 4.368491 |
578e7f19-a0ec-442d-a938-d108ba309c3a | Wangtk311/CG-BallsAndDominoes | CG-BallsAndDominoes/Precompiled-PhysX/physx/source/geomutils/src/gjk/GuGJKSimplex.cpp | #include "GuGJKSimplex.h"
namespace physx
{
namespace Gu
{
using namespace aos;
static Vec3V getClosestPtPointTriangle(Vec3V* PX_RESTRICT Q, const BoolVArg bIsOutside4, PxU32* indices, PxU32& size)
{
FloatV bestSqDist = FMax();
PxU32 _indices[3] = {0, 1, 2};
Vec3V closestPt = V3Zero();
if(BAllEqTTTT... | ALGO | 0.999528 | 5.722179 |
d7ee1a33-44e3-4cfa-8eb4-a36fb88022f1 | PKua007/rampack | src/utils/Config.cpp | //
// Created by Piotr Kubala on 12/12/2020.
//
#include "Config.h"
#include "Utils.h"
#include "Exceptions.h"
#include <istream>
#include <set>
#include <ostream>
Config Config::parse(std::istream &in, char delim, bool allowRedefinition) {
Expects(delim != '#' && delim != ';');
Config result;
std::size... | CONFIG | 0.978286 | 6.194652 |
57ea9825-bff6-41ef-a4ba-680d7cbf82bb | amol-ctr/cpp-code | fib_series_using_recursion.cpp | #include<iostream>
using namespace std;
int fib(int n){
if(n==0){
return 0;
}
if(n==1){
return 1;
}
else{
return fib(n-1)+fib(n-2);
}
}
int main(){
cout<<fib(6)<<endl;
return 0;
} | ALGO | 0.999829 | 4.281133 |
58fafdbe-7233-4ba5-85b9-926129431af5 | thuyle2000/2205_LTC | d09_struct_book_array_max.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
demo lap trinh mang cau truc.
chuong trinh quan ly danh muc sach:
- moi quyen sach la 1 struct, bao gom : maso, ten, tacgia, don gia
- tim sach co don gia cao nhat
*/
void QLSach();
int main() {
QLSach();
}
//b1. dinh nghia mau cau truc mo ta 1 quyen... | TOOL | 0.932239 | 3.483403 |
c2ef9203-155b-4f9c-8376-d7003437657e | rsletten/ender3_pro_th3d_skr_mini_v2 | Firmware/buildroot/share/PlatformIO/variants/MARLIN_CREALITY_STM32F401RC/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Digital PinName array
const PinName digitalPin[] = {
PA_0, // Digital pin 0
PA_1, // Digital pin 1
PA_2, // Digital pin 2
PA_3, // Digital pin 3
PA_4, // Digital pin 4
PA_5, // Digital pin 5
PA_6, // Digital pin 6
PA_7, // Dig... | CONFIG | 0.906958 | 6.350003 |
74d76cfc-7429-4cda-a5fb-0bd8cdeb6066 | 18-VK/Coding__ninjas-DSA-CPP | Tree/Generic tree/problems/Structural_identical.cpp | #include <iostream>
#include "Print_and_take_input.cpp"
using namespace std;
bool identical(treeNode *root1, treeNode *root2)
{
if (root1 == NULL || root2 == NULL)
{
return false;
}
if (root1->data != root2->data)
{
return false;
}
if (root1->children.size() != root2->childre... | ALGO | 0.999596 | 4.664386 |
ff7b9f52-a178-48f7-b256-757577e54456 | Mrsandman327/windows-book-code-c- | The C++ Standard Library - A Tutorial and Reference/cont/set1.cpp | #include <iostream>
#include <set>
#include <algorithm>
#include <iterator>
using namespace std;
int main()
{
/* type of the collection:
* - no duplicates
* - elements are integral values
* - descending order
*/
typedef set<int, greater<int> > IntSet;
IntSet coll1; // empty set c... | ALGO | 0.992315 | 5.169905 |
7f6ef0ed-e4b3-46d7-8e77-6096e04e32d9 | acidentally/cplusplus | CodeForces Problems/CF_1194C.cpp | /*Good luck for those who are trying your best
May the most glorious victory come*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define vi vector<int>
#define vvi vector< vector<int> >
#define endl '\n'
string s, p, t;
void solve() {
cin >> s >> t >> p;
in... | ALGO | 0.999885 | 4.633138 |
7a479d58-76d0-44f9-b33b-8630b3547469 | devi5040/CPP-Simple-Programs | Hackerank-solution/preprocessor.cpp | #define INF 10000000
#define FUNCTION(name, operator) \
void name(int ¤t, int candidate) { !(current operator candidate) ? current = candidate : false; }
#define foreach(v, i) for (int i = 0; i < v.size(); i++)
#define io(v) cin >> v
#define toStr(S) #S
#include <iostream>
#include <vector>
using namespace st... | ALGO | 0.999967 | 4.60323 |
64937967-a2fa-4268-ab13-bdeedd437d08 | ishandutta2007/codeforces | rush_d_cat/normal/828/B.cpp | #include <iostream>
#include <cstring>
using namespace std;
int n, m;
char s[102][102];
int main() {
scanf("%d %d", &n, &m);
for(int i=1;i<=n;i++) {
scanf("%s", s[i]+1);
}
int min_x = 102, max_x = 0, min_y = 102, max_y = 0;
int cnt = 0;
for(int i=1;i<=n;i++) {
for(int j=1;j<=m;j... | ALGO | 0.999577 | 3.855975 |
58ec85e5-0629-4623-af5a-7eaa8bf9b8fe | tanmoy4171/LeetCode | 0486-predict-the-winner/0486-predict-the-winner.cpp | class Solution {
int dp[21][21]; //dp array
bool checkWin(int ans,int total){
return ans>=total-ans;
}
int maxScore(vector<int>&A,int total,int i,int j){
if(i>j)
return 0;
if(dp[i][j]!=-1)
return dp[i][j];
dp[i][j]=total-min(maxScore(A,total-A[i],i... | ALGO | 0.99999 | 5.686445 |
e3349fd7-e96f-4a3a-896f-7161a7bfb87a | dafinoer/dqu | 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.998859 | 6.785645 |
b1f16f52-1256-4902-8884-3f30e94b048b | ROKORORI/codetree-TILs | 240109/달에서 무게 구하기/weight-on-the-moon.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int a;
double b, c;
a = 13;
b = 0.165000;
c = a * b;
cout << fixed;
cout.precision(6);
cout << a << " * " << b << " = " << c;
return 0;
} | TOOL | 0.994871 | 3.829732 |
aec90214-e2a9-4c90-8677-8fd150ec3a9f | pkuxxy/LeetCode | Third_time/Reverse Integer.cpp | class Solution {
public:
int reverse(int x) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int ret = 0;
while(x)
{
ret *= 10;
ret += x%10;
x /= 10;
}
return ret;
}
}; | ALGO | 0.999901 | 5.765934 |
63555756-09e4-4647-8c56-f0cef845ffe0 | SenjuroKanez/projects | helloworld/m.cpp | #include <iostream>
using namespace std;
int main()
{
cout<<"Hello mudafaka!";
int ar[5] = {2, 4, 6, 8, 10};
int sum = 0;
for (int i = 0; i < 5; i++)
{
if ( ar[i] % 4 == 0)
{
sum += ar[i];
}
else
{
sum -= ar[i];
}
}
... | ALGO | 0.999136 | 3.500057 |
e9205474-f81b-4d00-b231-9cd2770d9a45 | wisest30/ps | leetcode/2800.cpp | class Solution {
public:
bool h(string& a, string& b, int len) {
for(auto i = 0; i < len; ++i)
if(a[(int)a.size() + i - len] != b[i])
return false;
return true;
}
string f(string a, string b, string c) {
string ret = a;
for(auto s : {b, c}) {
... | ALGO | 0.999983 | 5.267766 |
63eecf54-d3b2-4976-a579-506c484a7ea6 | vg15o2/leetcode | 2503-longest-subarray-with-maximum-bitwise-and/2503-longest-subarray-with-maximum-bitwise-and.cpp | class Solution {
public:
int longestSubarray(vector<int>& nums) {
int ans = 0;
int maxIndex = 0;
int sameNumLength = 0;
for (int i = 0; i < nums.size(); ++i)
if (nums[i] == nums[maxIndex]) {
ans = max(ans, ++sameNumLength);
} else if (nums[i] > nums[maxIndex]) {
maxIndex ... | ALGO | 0.999808 | 5.949639 |
a4ca9d10-e48f-4bd8-a43b-39ffa6a563c9 | divyang9575/CP | implementation/Number_Steps.cpp | #include<bits/stdc++.h>
using namespace std;
#define PI 3.1415926535897932384626433832795
#define endl '\n'
#define int long long int
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define pb push_back
#define pi pair<int,int>
#define ff first
#define ss second
#define fo(i,s,e) for(int i=s; i<=e; i++)
#defi... | ALGO | 0.999968 | 5.074781 |
cf82bb3c-9971-4302-9d0d-53f4ac7ecb5e | shivamk2745/CP | makeIt25.cpp | #include <bits/stdc++.h>
using namespace std;
string m[]={"00","25","50","75"};
int helper(string& s,string& m){
int ans=0;
int t=s.size()-1;
while(t>=0 && s[t]!=m[1]){
t--;
ans++;
}
if(t<0) return INT_MAX;
t--;
while(t>=0 && s[t]!=m[0]){
t--;
ans++;
}
... | ALGO | 0.999644 | 4.403062 |
d9c4edb0-2093-4de1-8caf-7724c2b95d94 | muriloguizelin/algos | Codeforces/Round 174/B.cpp | /**
* author: Murilo Guizelin
* date: 2025-02-18
* hour: 11:05:21
* Link:
*/
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n, m;
cin >> n >> m;
vector<vector<int>> grid(n, vector<int>(m));
map<int, int> color_cost;
for (int i = 0; i < n; i++) {
for (int j = 0; ... | ALGO | 0.999897 | 6.215632 |
c11f6b8a-adfb-4fd8-8b7a-245beaad01aa | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/May/ModularEquation_20210516172456.cpp | // #include<bits/stdc++.h>
// #include<iostream>
// using namespace std;
// int Modulo(int m,int a ,int b){
// return (m % a) %b;
// }
// int main(){
// int t;
// cin >> t;
// while(t--){
// int n,m;
// cin >> n >> m;
// set< pair<int,int> > freq,guess;
// for(int i = 1... | ALGO | 0.99982 | 4.593198 |
37dce81f-13e3-4ebd-ba11-d6995980bbf9 | SBMcodes/college_c_programs | mergeSort.cpp | #include<stdio.h>
void merge(int arr[],int start,int mid,int end){
int n1 = mid - start + 1;
int n2 = end - mid;
int arr1[n1],arr2[n2];
for(int i=0;i<n1;i++){
arr1[i] = arr[start+i];
}
for(int j=0;j<n2;j++){
arr2[j] = arr[mid+1+j];
}
int i=0,j=0,k=start;
while(i<n1 && j<n2){
if(arr1[i]<arr2[j]... | ALGO | 0.999991 | 4.292692 |
fd06a01a-e982-4cdb-8927-e04f3d8e7f1c | PixysOS/system_core-old | init/interface_utils.cpp | #include "interface_utils.h"
#include <fstream>
#include <sstream>
#include <android-base/strings.h>
#include <hidl-util/FqInstance.h>
using android::FqInstance;
using android::FQName;
using android::base::Error;
namespace android {
namespace init {
namespace {
std::string FQNamesToString(const std::set<FQName>& ... | TOOL | 0.872532 | 7.580553 |
67971cef-4db4-4697-bf5b-6dbccd567807 | avlab1108/elastic_network | core/utils/eigens.cpp | #include "eigens.h"
eigens::eigens(const linearization_matrix& matrix) :
matrix_(matrix),
values_(matrix.get_size(), arma::fill::zeros),
vectors_(matrix.get_size(), matrix.get_size(), arma::fill::zeros)
{
arma::eig_sym(values_, vectors_, matrix_.get_matrix());
}
const arma::vec& eigens::get_values() const
{
... | ALGO | 0.982662 | 4.6609 |
c9836e89-2737-4940-9b8b-b0e0dc6cb926 | iammohssin/cpplearnings | rectangle area greater or smaller.cpp | #include <iostream>
using namespace std;
int main(){
double width1st, length1st, width2nd, length2nd;
double area1, area2;
cout <<"Enter 1st Rectangle width:"<<endl;
cin >>width1st;
cout <<"Enter 1st Rectangle length:"<<endl;
cin >>length1st;
cout <<"Enter 2nd Rectangle width:"<<endl;
... | ALGO | 0.995868 | 3.585032 |
e49a8945-758b-438d-a70a-048ea7d5bbd3 | 403712387/abstract | src/module/base/FaceTrackModule/src/OpencvExtra/tracking/samples/tutorial_introduction_to_tracker.cpp | #include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <cstring>
#include "trackingSample.h"
using namespace std;
using namespace cv;
int TotoriaIntroduction( int argc, char** argv ){
// show help
//! [help]
... | ALGO | 0.967718 | 5.378814 |
b465b9db-ba24-4bef-80c0-9eb33390dea0 | Bijay-Shre-stha/cpp_oop | Practice/templateSSum.cpp | #include <iostream>
using namespace std;
template <class T>
T sum(T a, T b)
{
return a + b;
}
int main()
{
cout << " sum of int " << sum(10, 20)<<endl;
cout << " sum of float " << sum(10.5, 20.5);
return 0;
} | ALGO | 0.959644 | 4.702463 |
2a16f7bb-fcee-4a46-98e5-ed38ffdff026 | MarcoVitoC/compnest | Codeforces/2024/July/AliceBobAndCandies.cpp | #include <bits/stdc++.h>
#define ll long long
#define all(x) x.begin(), x.end()
using namespace std;
void solve() {
int n, ai;
cin >> n;
deque<int> d;
for (int i=0; i<n; i++) {
cin >> ai;
d.push_back(ai);
}
int moves = 1, a = d.front(), prevA = d.front(), b = 0, prevB = 0;
... | ALGO | 0.999739 | 3.836343 |
e2ada3b9-fa0a-4529-8393-23112f7c1016 | colinroche/CplusplusTestCases | Arrays/Vectors/twoDimensionalVaryingSizeArray.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n, q;
cin >> n >> q;
vector<vector<int>> a(n);
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999699 | 3.84173 |
8a3a9b22-3528-4997-9269-9a41cf3e3799 | son-of-mountain/problem-solving | codeforces/.history/icpc_mansoura/session4/Challenge-Adhoc-3_20240909084931.cpp | #include<bits/stdc++.h>
using namespace std;
#define sonic ios_base::sync_with_stdio(false) ; cin.tie(NULL) ; cout.tie(NULL);
// stopped at 1:04:37
int main(){
sonic ;
int v,n,q ; cin >> n >> q;
int l,r;
int arr[n]={};
int update[n]={};
for(int i=1 ; i <= n ; i++)
cin >> arr[i]... | ALGO | 0.998204 | 4.048341 |
3fe9a998-0041-409d-b593-bde6f6b3c5a6 | Vijaypath/programs- | uniqe.cpp | #include<iostream>
using namespace std;
int main()
{
int n,x;
cin>>n;
int a[100];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
x=a[0];
for(int i=1;i<n;i++)
{
if(a[i]==x)
{
cout<<"duplicates element are"<<" "<<a[i]<<endl;
x++;
}
else
cout<<x;
break;
}
}
| ALGO | 0.999453 | 3.051214 |
4718e5d9-876a-4c74-af7b-aec6c8b91d7b | ratnakar5938/90dayDSA | day 24/array_missing_m2.cpp | #include <iostream>
using namespace std;
template <class T>
class Array
{
int size;
public:
T *A;
int length;
Array(int n)
{
size = n;
A = new int[size];
length = 0;
}
~Array()
{
delete[] A;
}
void add(int);
void display();
void insert... | ALGO | 0.999671 | 4.821874 |
25a8ac90-f9bc-486f-b81b-1dfe5009dd52 | oms83/Important-Codes-CPP | DeleteWithFile.cpp | #include<iostream>
#include<fstream>
#include<vector>
#include<string>
using namespace std;
void LoadDataFromFileToVector(string FileName, vector <string> &vData)
{
fstream MyFile;
MyFile.open(FileName, ios::in);
if(MyFile.is_open())
{
string Line;
while(getline(MyFile, Line))
{... | TOOL | 0.947109 | 3.987814 |
9db8c0af-8a62-4737-a4f9-bb8fa008c89c | AshishKhatkar/ICPC-Practice | Ashish/TopCoder/Div1A/CircleGame.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007
using namespace std;
class CircleGame {
public:
int cardsLeft(string);
};
int CircleGame::cardsLeft(string deck) {
string rem = "";
map<char, int> mp;
mp['A'] = 1;
mp['2'] = 2;
mp['3'] = 3;
mp['4'] = 4;
mp['5'] = 5;
... | ALGO | 0.99931 | 4.881021 |
0bca961a-3ca3-4522-aa2b-e542b0230e3f | bikegirl/cosc2325.notes | lectures/05_simulation/code/inv_feedback2.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int s_time = 0; // nanoseconds
bool inverter(bool input) {
s_time += 2;
return !input;
}
int main(void) {
cout << "Inverter Feedback Simulator" << endl;
bool wire = true; // initial value on the wire
// simulation loop
for (... | ALGO | 0.999802 | 4.92888 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.