uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
168f3341-f203-4f3f-b654-818026dced56 | wannabeSE/The_BookShelf | 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.998693 | 6.797273 |
7bcad7e9-1f66-4f10-9450-159df0d4ca0a | GWW/RNASequel | src/transcriptome.cpp | #include "transcriptome.hpp"
#include "build_transcriptome.hpp"
#include "junction.hpp"
#include "fasta_index.hpp"
#include "tokenizer.hpp"
#include <boost/program_options.hpp>
#include <string>
#include <iostream>
#include <unordered_set>
#include "gtf.hpp"
#include "seed_iterator.hpp"
#include "reader.hpp"
#include "... | DATA | 0.990994 | 3.189157 |
3e7afeba-7177-4f7a-9076-1ef2a7c36504 | Maniac198/Competitve-Programming | A_Doremy_s_IQ.cpp | #include <bits/stdc++.h>
using namespace std;
#define yes {cout<<"YES"<<endl;}
#define no {cout<<"NO"<<endl;}
#define ll long long
#define endl '\n';
#define all(x) x.begin(),x.end()
#define rep(i,b,e) for(__typeof(e) i=b-(b>e); i != (e)-(b>e);i+=1-2*(b>e))
int lcm(int a,int b) ... | ALGO | 0.999705 | 3.790293 |
4101c7da-7c8c-4359-80be-c56c3664573a | Tejender1521/Codeforces-Problem-Set | Do Not Be Distracted!.cpp | #include <bits/stdc++.h>
using namespace std;
int numerize(char x)
{
if (48 <= int(x) && int(x) <= 57)
return int(x - '0');
if (97 <= int(x) && int(x) <= 122)
return int(x - 96);
if (65 <= int(x) && int(x) <= 90)
return int(x - 64);
return -1;
}
int main()
{
ios_base::syn... | ALGO | 0.999966 | 5.064647 |
f2ecad64-320e-4ee3-b338-c3661e4943e4 | Aatiqur-Rahman/OJProblem | CC/January long/AA.cpp | #include <bits/stdc++.h>
#define ll long long
#define w(t) int t;cin >>t ;while(t--)
#define pb(x) push_back(x)
#define in(x) insert(x)
#define MAXN 10000001
#define memset(x) memset(arr,x,sizeof(arr)
using namespace std;
/** Data Structure */
vector <int> v;
set <int> s;
unordered_set <int> us;
int arr[MAXN];
void f... | ALGO | 0.999825 | 4.610575 |
a9c52fb1-6cb4-4242-8f7c-4f6595e23f6f | itz-Pratham/A2Z-DSA-Sheet-Solution | Step_13/Lec_1/Iterative Preorder Traversal of Binary Tree.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.999974 | 6.377666 |
c769982f-3edf-48e7-b7bc-5fda07d04753 | kuntalojha/LeetCode-And-GFG | 1295-find-numbers-with-even-number-of-digits/1295-find-numbers-with-even-number-of-digits.cpp | class Solution {
public:
int findNumbers(vector<int>& nums) {
int even=0;
for(int i=0; i<nums.size();i++)
{
int count=0;
for(int j=nums[i];j>0;j=j/10)
{
count++;
}
if(count%2==0)
{
even++;... | ALGO | 0.999787 | 5.680123 |
3c65ac32-c914-4dca-a497-2f8bdf4a33ba | kcalbCube/PVC-16 | include/boost_1_78_0/libs/graph/example/two_graphs_common_spanning_trees.cpp | // Two Graphs Common Spanning Trees Algorithm
// Based on academic article of Mint, Read and Tarjan
// Efficient Algorithm for Common Spanning Tree Problem
// Electron. Lett., 28 April 1983, Volume 19, Issue 9, p.346-347
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/two_graphs_commo... | ALGO | 0.999974 | 6.397917 |
36b167d4-ef2c-400c-9330-a675dfcc79b3 | seclab-ucr/IncreLux | KLEE/z3/src/test/polynorm.cpp | #include "ast/rewriter/th_rewriter.h"
#include "parsers/smt2/smt2parser.h"
#include "ast/arith_decl_plugin.h"
#include "ast/reg_decl_plugins.h"
#include "ast/rewriter/arith_rewriter.h"
#include "ast/ast_pp.h"
static expr_ref parse_fml(ast_manager& m, char const* str) {
expr_ref result(m);
cmd_context ctx(false... | TOOL | 0.930612 | 5.134686 |
d8262c7b-320a-446f-be97-50914cc3c6ba | Adityasinghvats/CPP---code | 34graphs/03bfs.cpp | #include<bits/stdc++.h>
using namespace std;
//TC O(v+e)
//SC O(v) , max size of queue = no of vertices
//bfs is great to find shortest path
//djikstra is bfs for weighted graphs in a way
//number of levels between start and end is shortest path
vector<list<int>> undirected_unweighted_graph;
unordered_set<int> visited;... | ALGO | 0.999973 | 4.709029 |
454b0609-3b76-44dc-83f4-0bb3ca85754d | Captain-Tim/leetcode | 0211. Design Add and Search Words Data Structure/Design Add and Search Words Data Structure.cpp | class WordDictionary {
private:
struct TrieNode
{
const int alphabet_size = 26;
vector<TrieNode*> children;
bool is_end_of_word;
TrieNode()
: children(alphabet_size, nullptr)
, is_end_of_word(false)
{
};
};
const char dot = '.';
TrieNod... | ALGO | 0.999206 | 6.422615 |
44bd0fc6-7bbf-4c0b-a332-f83eda1160a3 | EmonSpeedy/ICPC-preparation-purpose- | Day-3/timus-1068.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// UNDONE
int n, ans; cin >> n;
if(n > 0){
ans = (n*(n+1))/2;
}
else if(n < 0){
ans = 1 - (n*(n-1))/2;
}
else{
cout << 1<<'\n';
return 0;
}
cout << ans << '\n';
return 0;
} | ALGO | 0.999949 | 4.769426 |
67541a74-7c5f-4ddb-add7-6ad6a5ab3992 | harryboi17/Tough-Questions | removeContinousFromString.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define loop(i,s,e) for(ll i = s; s<e ? i < e : i >= e; s<e ? i++ : i--)
#define forrr(i,s,e) for(ll i = s; i >= e; i--)
#define forr(i,s,e) for(ll i = s; i < e; i++)
#define vi vector<int>
#define vl vector<ll>
#define vvl vector<vl>
#define pll pair<ll, ... | ALGO | 0.999942 | 3.771834 |
d6a86eb7-7c6d-4403-8918-cf4e6d1929c4 | onkar-03/Striver-A2Z-DSA-Sheet | 03. Solve Problems On Arrays/01. Easy/12. Max Consecutive Ones.cpp | #include <bits/stdc++.h>
using namespace std;
/*
* Approach: Brute Force
* - Traverse the array while maintaining a `streak` counter to count the current number of consecutive 1's.
* - Use a variable `maxi` to store the maximum streak encountered during traversal.
* - If a 0 is encountered, reset the `streak` coun... | ALGO | 0.999993 | 7.311501 |
91dd7acd-33b7-4523-94a7-c42f252c2000 | MaximumTrainer/MaximumTrainer_Archived | src/ANT/libs/software/serial/WinDevice.cpp | #include "types.h"
#if defined(DSI_TYPES_WINDOWS)
#include "WinDevice.h"
#include "macros.h"
#include <tchar.h>
#include <ctype.h>
#include <setupapi.h>
#include <cfgmgr32.h>
#include <stdlib.h>
// Prototypes for functions found in the SetupAPI dll.
typedef BOOL (WINAPI* SetupAPI_CallClassInstaller_t)(DI_FUNCTION,H... | TOOL | 0.873315 | 5.232514 |
bf00306a-263a-492a-9c49-57b4491319d1 | Frazanhibriz/Data-structures | TP_MODUL6/TP_MODUL6/DLL.cpp | //
// DLL.cpp
// TP_MODUL6
//
// Created by Falah Razan Hibrizi on 21/10/24.
//
#include "DLL.h"
bool isEmpty(list L) {
return (first(L) == NULL);
}
void createList(list &L) {
first(L) = NULL;
last(L) = NULL;
}
void createNewElmt(infotype X, address &P) {
P = new elmtList;
if (P != NULL) {
... | ALGO | 0.989494 | 3.234768 |
3f58f980-e9f8-4c44-88ef-17d781df62fa | S-I-P/CppAmbiguities | Function-Overloading/libraryFunctions/1_resolution_1.cpp | #include <iostream>
#include <vector>
using namespace std;
void plus (vector <int> *n1, vector <int> *n2)
{
//code
}
int main()
{
unsigned int i;
vector<int> n1, n2;
for (i = 1; i < 5; ++i)
{
n1.push_back (i);
}
for (i = 9; i > 5; --i)
{
n2.push_back (i);
}
::p... | ALGO | 0.99512 | 3.309191 |
4dae06d4-9ef7-446f-b4db-2292b7f70971 | sarath78421/machine-learn | PINTER_T.CPP | #include<iostream.h>
#include<conio.h>
/*
//pointer to object
class CIR
{
int r;
float ar;
void cal();
public:
void get(int x)
{
r=x;
}
void disp()
{
cal();
cout<<"area="<<ar;
}
};
void CIR::cal()
{
ar=3.14*r*r;
}
void main()
{
CIR obj;
clrscr();
int n;
cout<<"enter radius=";
cin>>n;
obj.get(n);... | TOOL | 0.878622 | 4.348555 |
60349170-acbf-46a2-9b08-981cf536e12d | xshinhe/PSiNad | src/kernels/src/Kernel_Iterative_Adapt.cpp | #include "kids/Kernel_Iterative_Adapt.h"
#include <unistd.h>
#include <algorithm>
#include <chrono>
#include "kids/hash_fnv1a.h"
#include "kids/macro_utils.h"
#include "kids/vars_list.h"
#define FMTF(X) \
" " << std::setiosflags(std::ios::fixed) /*scientific ... | ALGO | 0.995323 | 4.431619 |
dfeff06e-143a-4a43-998d-b1a07341036b | ishandutta2007/codeforces | fairywinx/normal/804/A.cpp | // #define GLIBCXX_DEBUG
#include <iostream>
#include <vector>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <ctime>
#include <queue>
#include <assert.h>
#include <iomanip>
#include <deque>
#include <map>
// #include <cmath>
#include <bitset>
#include <algorithm>
#define int long long
// ... | ALGO | 0.999692 | 3.655971 |
063f6716-a165-4ee6-8568-ed39f0593099 | Xuding0829/CompetitiveProgramming | Src/Luogu/P1328.cpp | #include <cstdio>
#include <iostream>
using namespace std;
const int map[5][5] = {
0, 0, 1, 1, 0,
1, 0, 0, 1, 0,
0, 1, 0, 0, 1,
0, 0, 1, 0, 1,
1, 1, 0, 0, 0};
int n, na, nb, a[201], b[201], ah = -1, bh = -1, ansa, ansb;
int main()
{
cin >> n >> na >> nb;
for (int i = 0; i < na; i++)
... | ALGO | 0.999953 | 3.565004 |
62b9aa59-7fda-4084-8f20-fbbfcd0253ae | raincross7/code-similarity | codes/train_code/problem158/problem158_225.cpp | #include <iostream>
#include <string>
using namespace std;
int main(void){
int X, Y;
cin >> X >> Y;
int ans = X + (Y / 2);
cout << ans << endl;
}
| ALGO | 0.999179 | 3.247022 |
2c20f257-f249-43a5-8171-5b349946abff | misaelmateus/problem-solving | Codeforces/734-E.cpp | // Author : Misael Mateus
// Submission date: 2016-11-18 14:51:18
#include<bits/stdc++.h>
#define MAXN 2000001
using namespace std;
vector<int> gr[MAXN], gr1[MAXN];
int n, n1;
int color[MAXN];
int ans;
int dfs(int i){
int val1 = 0, val2 = 0;
for(int j = 0; j < gr1[i].size(); j++){
int next = gr1[... | ALGO | 0.999454 | 4.268352 |
08114816-352e-4389-9e43-e7f3cc5364b3 | KrisJarvis/100-Day-Coding | 2331-evaluate-boolean-binary-tree/2331-evaluate-boolean-binary-tree.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.999971 | 6.269102 |
066904ad-1d71-4473-929a-f7443b2203bf | arka8464/Leetcode | 0036-valid-sudoku/0036-valid-sudoku.cpp | class Solution {
public:
bool isValidSudoku(vector<vector<char>>& board) {
vector<set<int>> row(9),col(9), subMat(9);
//we create a vector of sets so that we can keep track of the row , col and submatrix and repreatation of the elements
for(int i=0;i<9;i++)
{
for(int j=0;j... | ALGO | 0.999419 | 6.458073 |
d5fd607f-feb0-46eb-a81c-0211fabd151c | tar3q-az1z/Codeforces-solutions | 2009C.cpp | // @Author: Mars_Coder
// @date: 10-10-2024 Thu 11:26 AM
// https://codeforces.com/problemset/problem/2009/C
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using i64 = long long int;
using uInt = unsigned int;
using... | ALGO | 0.999931 | 4.324733 |
ee53bb6a-2e54-4dbf-991b-2843ab10d520 | hztttt/Synergistic_Optimization | lammps_DeepSPIN/src/KOKKOS/angle_charmm_kokkos.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Stan Moore (SNL)
------------------------------------------------------------------------- */
#include "angle_charmm_kokkos.h"
#include "atom_kokkos.h"
#include "atom_masks.h"
#include "comm.h"
#incl... | ALGO | 0.948597 | 7.106877 |
4ef678ad-1dde-42e0-969b-274a1ff752f9 | islammerajul/Student-Management-System | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.99887 | 6.783439 |
35b306ce-77bc-4cc9-8e2c-d610075654ca | karan12-cyber/C_codes | lodddu array.cpp | #include <stdio.h>
int linearSearch(int arr[], int n, int key) {
for (int i = 0; i < n; i++) {
if (arr[i] == key) {
return i; // Key found, return the index
}
}
return -1; // Key not found
}
int main() {
int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int n = sizeof(arr)... | ALGO | 0.998977 | 5.000343 |
35247eb4-020f-439d-8422-cd1be6f9950c | wjyaxxx/Algorithm-exercise-code | PTA/2020真题/d.cpp | #include <bits/stdc++.h>
using namespace std;
int n,m;
int g[220][220];
bool st[220];
int V[220];
void cinquick()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int main()
{
cinquick();
cin>>n>>m;
for(int i=1;i<=m;i++){
int u,v,w;
cin>>u>>v>>w;... | ALGO | 0.999914 | 4.084938 |
8bb24f3d-a63c-4b00-b607-bd32ba6d4aea | JimeNayeli/Estructura_Datos_7167 | ParcialN_1/Trabajo_Grupo6/Operadores Sobrecargados/Jorge Nasimba/main.cpp | #include <iostream>
#include "Vector.h"
using namespace std;
/***********************************************************************
* Universidad de las Fuerzas Armadas ESPE
* Volumen de un cono
* Autor: Jorge Nasimba
* Fecha de creacion: Miercoles, Noviembre 3, 2021 11:10:27 AM
* Fecha de modificacion: Mierc... | TOOL | 0.920994 | 3.616485 |
89e904d4-58a4-4cf7-9972-c2bafe16e07c | vbonnici/grafe-sim | analysis/data/p04001/s526526119.cpp | #include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ ";
for(auto v:V)os << v << " "; return os << "]";
}
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ ";
for(auto s:S) os<<s<<" "; return os<<"}";
}
template<class L, class... | ALGO | 0.999864 | 3.950334 |
7cab58dc-c3e8-4319-894b-ec9804babdd8 | NightFury742/Cp-DSA | CodeForces/800/339A.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
string s;
cin>>s;
vector<char> final;
multiset<char> s_str;
for(auto &val:s){
s_str.insert(val);
}
s_str.erase('+');
for(auto &val:s_str){
final.push_back(val);
... | ALGO | 0.999959 | 4.424063 |
4f060824-d783-47f0-8002-61fcdd32bff1 | TuiTenVan/CTDL-GT | 01002.cpp | #include<bits/stdc++.h>
using namespace std;
int n, k, a[1000], ok;
//void xuat(){
// for(int i = 1; i <= k; i++){
// cout << a[i] << ' ';
// }
//}
void sinh(){
int i = k;
while(i > 0 && a[i] == n - k + i){
i--;
}
if(i > 0){
a[i]++;
for(int j = i + 1; j <= k ; j++){
a[j] = a[i] + j - i;
}
for(int i... | ALGO | 0.99981 | 3.17417 |
f744cf01-194a-4e25-b522-dff0e50fd8a4 | alamin147/competitive-programming | leetcode/combination-sum-ii.cpp | class Solution {
public:
void find(int ind, int target, vector<int>& candidates,
vector<vector<int>>& ans, vector<int>& temp) {
if (target == 0) {
ans.push_back(temp);
return;
}
for (int i = ind; i < candidates.size(); i++) {
if (i > ind && c... | ALGO | 0.999994 | 6.353213 |
cab86ddd-6739-4ada-8bbd-addcec85a58d | tap/TapTools | Core/DSP/extensions/FilterLib/source/TTHighpassButterworth1.cpp | /** @file
*
* @ingroup dspFilterLib
*
* @brief #TTHighpassButterworth1 is a second-order Butterworth highpass filter.
*
* @details Butterworth filters have maximum flat frequency response in the pass band.
* Filter equations from: @n
* @n
* Second-order IIR Filters will support cascade implementations @n
* By... | TOOL | 0.926789 | 5.20031 |
261be8c2-798f-4f6a-9270-b7f8b8a11d8b | sumit-raghukant-soni/Leetcode_Solutions | 1765-merge-in-between-linked-lists/1765-merge-in-between-linked-lists.cpp | class Solution {
public:
ListNode* mergeInBetween(ListNode* list1, int a, int b, ListNode* list2) {
ListNode *curr = list1, *a1=NULL, *b1=list2;
int i = 0;
while(b1->next != NULL) b1 = b1->next;
while(i != b+1 && curr){
if(i == a-1)
a1 = curr;
... | ALGO | 0.999987 | 5.097499 |
891da15e-bbb9-4860-87e6-f92bd0486f09 | TzuChieh/Photon-v2 | Engine/Engine/Source/Core/Intersection/BruteForceIntersector.cpp | #include "Core/Intersection/BruteForceIntersector.h"
#include "Core/Intersection/Intersectable.h"
#include "Core/HitProbe.h"
#include "Core/Ray.h"
#include "Math/Geometry/TAABB3D.h"
#include <Common/primitive_type.h>
#include <limits>
namespace ph
{
void BruteForceIntersector::update(TSpanView<const Intersectable*>... | ALGO | 0.996281 | 7.721503 |
ca7a73a3-1141-4821-a75a-37ea9485b4d1 | Sajalsk/Striver-SDE_Sheet | Tree/Striver/Module1/Maxwidth.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
class TreeNode {
public:
T data;
vector <TreeNode*> children;
TreeNode(T data) {
this->data=data;
}
class Solution {
public:
int widthOfBinaryTree(TreeNode* root) {
int start,end,dif,res=1;
... | ALGO | 0.998929 | 5.536184 |
46a130ec-c853-4580-a278-0430c16fe750 | HolicKW/codetree-TILs | 250322/우리는 하나/we-are-the-one.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>
#define MAX 8
using namespace std;
int arr[MAX][MAX];
bool visited[MAX][MAX];
queue<pair<int,int>> q;
vector<pair<int,int>> dir_num;
vector<pair<int,int>> dir;
int n,k,u,d;
int res,ans;
int dx[4] = {0,0,1,-1... | ALGO | 0.998314 | 4.423489 |
3c5a6ebf-e75e-4af0-8995-9ae8fc14bc0e | Felipe-Rodrigues357/conhecimentos-de-programacao | C++/operador_ternario.cpp | #include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int num =10;
/*if(num>10)
cout<<"Numero maior que 10"<<endl;
else
cout<<"Numero menor que 10"<<endl;*/
num > 10 ? cout<<"Maior" : cout<<"Menor ou Igual";
return 0;
}
/*
Operador Ternrio
<condio>?<operao1>:<operao2> */ | ALGO | 0.996395 | 3.094002 |
2ab05eb1-b5ff-4918-aa37-048a32fe9f8e | mouyuanyap/Cpp_DS_LeetCode | LeetCode_Q3_LongestSubString_BruteForce.cpp | #include <iostream>
#include <map>
using namespace std;
int main(){
string s = "jbpnbwwd";
int longestLength = 1;
if(s.length() == 0){return 0;}
for (int i = 0; i<s.length()-1; ++i){
int length = 1;
map<char,int> str;
str[s[i]] = i;
for(int j = i+1; j< s.length(); ++... | ALGO | 0.999981 | 3.759931 |
ca95f545-8ef4-4339-adc9-9a42f829d984 | lmcarroll/carroll-cop3330-ch08-ex14 | ch08-ex14.cpp | #include "std_lib_facilities.h";
//The 'const' means that the parameter cannot be altered within the function. This could be used to prevent
//inexperienced coders from reworking the code to edit a parameter that should not be changed. It is not
//done very often because most functions serve the purpose of altering pa... | TOOL | 0.969012 | 4.726034 |
502f7b25-ad79-4f7d-9162-af9ec0753583 | Sensrdt/Leet-Code-Sol | May 30 Days/K Closest Points to Origin.cpp | class Solution {
public:
vector<vector<int>> kClosest(vector<vector<int>>& points, int K) {
int n = points.size();
int x1 = 0, x2 = 0, y1 = 0, y2 = 0;
multimap<int, int> mp;
vector<vector<int>> ans;
for (int i=0; i<n; i++){
// euclidean distance form... | ALGO | 0.999997 | 6.264715 |
60c80c6f-cbd1-4c3e-a153-09962b76065b | adeliamara/estrutura-de-dados-ii | livro07-dsw/Arvore01rotacao.cpp | #include <queue>
#include <iostream>
using namespace std;
template<class T>
class ArvoreNo {
public:
T el;
ArvoreNo<T> *left, *right;
ArvoreNo() {
left = right = 0;
}
ArvoreNo(T e, ArvoreNo<T> *l = 0, ArvoreNo<T> *r = 0) {
el = e;
left = l;
right = r;
}
};
temp... | ALGO | 0.999528 | 4.688712 |
b415fcea-1e80-4ce8-b6b8-79785e91062f | maurya384/CourseraAlgorithm | course3_week4.cpp | // change integer value to long long int for large values
#include<bits/stdc++.h>
using namespace std;
int w[100];
int v[100];
int main()
{
//faster I/O
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,cap,x;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>w[i]>>v[i];
}
cin>>cap... | ALGO | 0.999971 | 3.859709 |
bef818ce-47a6-4ba0-bfa1-61d3643e4bd4 | delahee/hae_gp2_2019 | mt_case/Box2D/Box2D/Collision/b2CollidePolygon.cpp | #include "Box2D/Collision/b2Collision.h"
#include "Box2D/Collision/Shapes/b2PolygonShape.h"
// Find the max separation between poly1 and poly2 using edge normals from poly1.
static float32 b2FindMaxSeparation(int32* edgeIndex,
const b2PolygonShape* poly1, const b2Transform& xf1,
const b2PolygonShape*... | ALGO | 0.999757 | 6.833144 |
c672c964-6340-4236-9064-d280cb6bdef0 | Kevin923/cpp_learningnotes | other/recursion.cpp | #include <iostream>
#include <vector>
using namespace std;
//二叉树
struct TreeNode{
int val;
TreeNode* left;
TreeNode* right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x):val(x),left(NULL),right(NULL){}
};
void traversal(TreeNode* cur, vector<int>& vec) {
if (cur == NULL... | ALGO | 0.999947 | 4.299847 |
78af19f0-bb27-4ddb-a5c3-14ed1a6cb38b | UtkarshMidha/Leetcode | Random Daily Solved Questions/1930. Unique Length-3 Palindromic Subsequences.cpp | class Solution {
public:
int countPalindromicSubsequence(string s) {
unordered_set<char> letters;
for (char c : s) {
letters.insert(c);
}
int ans = 0;
for (char letter : letters) {
int i = -1;
int j = 0;
fo... | ALGO | 0.999956 | 6.578225 |
260332f6-499f-4939-ac6d-02d37c1c6000 | crkaushik93/model-predictive-control | src/Eigen-3.3/unsupported/test/NumericalDiff.cpp | #include <stdio.h>
#include "main.h"
#include <unsupported/Eigen/NumericalDiff>
// Generic functor
template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
struct Functor
{
typedef _Scalar Scalar;
enum {
InputsAtCompileTime = NX,
ValuesAtCompileTime = NY
};
typedef Matrix<Scalar,InputsAtCompileT... | TEST | 0.979545 | 6.185318 |
36eddb56-7f9a-4301-8356-fe1305394d6f | ch0rtas/IS-Analisis_y_Diseno_de_Algoritmos | Actividad_08/HashSinColision/AgendaSinColision.cpp | /*
* Actividad 8 - Hahs Sin Colisión
*
* Autor: Manuel Martínez Ramón
* Fecha: 2025.03.25
* Curso: INSO 2 - Análisis y Diseño de Algoritmos
*/
#include "Agenda.h"
#include "assertdomjudge.h"
#include "iostream"
using namespace std;
/**
* Constructor de la clase Agenda.
* Inicializa las estructuras de datos ne... | ALGO | 0.988846 | 5.832062 |
f1a1dbcb-bc47-498f-9613-e203539cbed5 | GaetanDeflandre/M3DA | subdivision_Deflandre/src/p3d/algebra/Matrix4.cpp | #include "Matrix4.h"
#include "Tools.h"
#include "Vector4.h"
#include "Vector3.h"
#include "Quaternion.h"
#include "Matrix3.h"
#include <iostream>
#include <cmath>
#include <string>
#include <iomanip>
/*!
*
* @file
*
* @brief
* @author F. Aubert
*
*/
using namespace p3d;
using namespace std;
float Matrix4::_mf[16];... | TOOL | 0.934807 | 6.221019 |
e93912bd-8d57-4cfc-ba97-e5baf318bfe4 | Azson/machineLearning | py3/leetcodeCN/competition/2020/2020_12_8-3.cpp | # include <cstdio>
# include <string>
# include <vector>
# include <algorithm>
using namespace std;
class Solution {
public:
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
* @param n int整型 节点个数
* @param u int整型vector
* @param v int整型vector
* @return int整型
*/
const static i... | ALGO | 0.999775 | 5.046351 |
bb35f765-d06b-4f4e-be4f-f82ab1ded963 | zixfy/cpp-leetcode | [2778]特殊元素平方和.cpp | //给你一个下标从 1 开始、长度为 n 的整数数组 nums 。
//
// 对 nums 中的元素 nums[i] 而言,如果 n 能够被 i 整除,即 n % i == 0 ,则认为 num[i] 是一个 特殊元素 。
//
// 返回 nums 中所有 特殊元素 的 平方和 。
//
//
//
// 示例 1:
//
// 输入:nums = [1,2,3,4]
//输出:21
//解释:nums 中共有 3 个特殊元素:nums[1] ,因为 4 被 1 整除;nums[2] ,因为 4 被 2 整除;以及 nums[4] ,因为 4
// 被 4 整除。
//因此,nums 中所有元素的平方和等于 nums... | ALGO | 0.999798 | 6.022646 |
8fdcc60b-73b9-4ad0-be5b-221f03bca9d7 | thefarazxr/DAA_LAB2022 | DAAcodes/quicksort.cpp | #include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
void swap(int &x,int&y)
{
int temp=x;
x=y;
y=temp;
}
int partition(int arr[],int low,int high)
{
int pivot=arr[high];
int i=low-1;
for(int j=low;j<high;j++)
{
if(arr[j]<pivot)
{
... | ALGO | 0.999027 | 4.312437 |
1a54b58a-f152-4073-a0e5-a071f26a69f5 | Kamna16/LeetCodeProgress | 1002-maximum-width-ramp/1002-maximum-width-ramp.cpp | class Solution {
public:
int maxWidthRamp(vector<int>& arr) {
int n = arr.size();
int maxi = 0;
int max_right[n];
max_right[n-1] = arr[n-1];
for(int i=n-2;i>=0;i--)
{
max_right[i] = max(max_right[i+1] ,arr[i]);
}
int i=0;
int j=0;
... | ALGO | 0.999957 | 5.905991 |
e0da921a-bf33-4c9d-b2d2-4e7f79a7e8f1 | sarvex/leetcode-solidity | solution/0300-0399/0342.Power of Four/Solution.cpp | class Solution {
public:
bool isPowerOfFour(int n) {
return n > 0 && (n & (n - 1)) == 0 && (n & 0xaaaaaaaa) == 0;
}
}; | ALGO | 0.999625 | 6.111789 |
0d8c415a-ccea-4d84-8258-0c3eed4d49bf | Mr-Python-in-China/LuoguProblem | Luogu_P_2801.cpp | #include <bits/extc++.h>
using namespace std;
namespace pbds = __gnu_pbds;
using ui = unsigned int;
using uli = unsigned long long int;
using li = long long int;
template <typename T> struct decompose {
struct block {
using vit = typename vector<T>::const_iterator;
size_t const invl, invr;
vector<T> data;... | ALGO | 0.999947 | 5.196558 |
758c9a33-092b-443d-961c-9c3e31de0c68 | Rylynnn/Arithmetic | Math/博弈论/CF832A.cpp | /*************************************************************************
> File Name: CF832A.cpp
> Author: Rylynnn
> Mail: <EMAIL>
> Created Time: 2017年08月05日 星期六 19时43分49秒
************************************************************************/
#include <bits/stdc++.h>
#define ll long long
using na... | ALGO | 0.999824 | 3.594931 |
0b2bc7aa-35c7-4b01-a1be-a33f09a5819e | sudo-Terry/Baekjoon | Baekjoon/pr11779.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
#define MAX 1010
#define INF 987654321
int m, n, k;
int startNode, endNode, cost;
int origin, destination;
int dist[MAX];
int route[MAX];
vector<int> routeV;
vector<pair<int, int>> adj[MAX + 1];
int dx[] = { 0, 1, 0, -1 };... | ALGO | 0.999993 | 4.383524 |
92b72075-375d-4f8d-8be2-f6dfe076f337 | hlk-1135/Algorithm | Algorithm-design-analysis/最大子段和.cpp | /*
6
-2 11 -4 13 -5 -2
*/
#include<stdio.h>
int a[100]={0};
void show(int begin,int end,int sum)
{//ӶԼsumֵ
for(int i=begin;i<=end;i++) {
printf("%d ",a[i]);
}
printf("\n");
printf("%d\n",sum);
}
void MaxSum1(int n,int *a)
{//3forѭ
int sum=0;
int i,j,k,begin,end;
for(i=0;i<n;i++) {
for(j=i;j<n;j++) {
in... | ALGO | 0.999967 | 3.500612 |
5b20f7f1-d380-4936-aa75-eb0b7ce732cc | itzuditsharma/Leetcode | 0001-two-sum/0001-two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
int i = 0;
int j = nums.size() -1;
vector<pair<int, int>> pairs;
for(int i = 0; i < nums.size(); i++){
pairs.push_back({nums[i], i});
}
sort(pairs.begin(), pairs.end());
... | ALGO | 0.999947 | 6.405769 |
6f4f4aaa-491a-4a46-aea2-d31963bd8a20 | BruceLeesungho/Algorithm | 11505.cpp | #define _CRT_SECURE_WARNINGS
#include <stdio.h>
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
using namespace std;
long Tree[3000000];
int N, M, K;
void changeVal(int index, long val);
long GetMul(int s, int e);
int main(void)
{
cin >> N >> M >> K;
int dob = 1;
int cnt_k = 0;
while (d... | ALGO | 0.999967 | 4.167204 |
6b93c0e2-4f4a-43a5-8b1c-e1fc2ffb4bd1 | fire855/android_frameworks_av-mtk | media/libstagefright/codecs/mp3dec/src/pvmp3_dct_6.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_dct6.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
---------------------------... | ALGO | 0.997891 | 6.347672 |
7e4bc44b-a00b-48b8-b023-ab5090e1f79e | Shashank727663/CSES-Graphs-Practice-problems- | Graphs/disting_routes.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <queue>
using namespace std;
typedef long long int lli;
vector<vector<int>>adj;
vector<int>vis;
vector<vector<int>>paths;
lli sv , ev;
void dfs(int src , vector<int>&ans) {
vis[src] = 1;
ans.push_... | ALGO | 0.999928 | 4.454806 |
75bd1b1b-4172-44ad-b94b-3b8150251e64 | Kot97/prir | MPI/bradley_serial.cpp | #include <iostream>
#include <mpi.h>
#include "lib/adaptive_thresholding.hpp"
#include "lib/benchmarking.hpp"
int main(int argc, char *argv[])
{
std::cout << "Bradley algorithm on image " << argv[1] << std::endl;
cv::Mat image(cv::imread(argv[1], cv::IMREAD_GRAYSCALE));
cv::Mat result = cv::Mat::zeros(ima... | ALGO | 0.995023 | 6.252884 |
a9911ee6-5d4d-471d-88da-ffb49bd24394 | Nafyaz/my-codes | Codeforces/0748D.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
bool isPalindrome(string s)
{
string t = s;
reverse(t.begin(), t.end());
return s == t;
}
int main()
{
ll k, n, a, ans, x, y;
string s;
map<string, ll> freq, palFreq;
map<string, priority... | ALGO | 0.999582 | 3.932865 |
37d44588-8795-4542-a440-f895ebde705e | santhosh-4000/IPMP1921 | week10/BSsortedRotated.cpp | //https://leetcode.com/problems/search-in-rotated-sorted-array/submissions/
//O(logN) time
int search(vector<int>& nums, int target) {
int m,l=0,r=nums.size()-1;
while(r-l>1){
m=l+(r-l)/2;
if(nums[l]<nums[m]){
if(nums[l]<=target&&nums[m]>target... | ALGO | 0.999997 | 6.145004 |
7e51ad12-04dd-413b-b717-05689933667c | acado/acado | examples/multi_objective/catalyst_mixing_nbi.cpp | /**
* \file examples/multi_objective/catalyst_mixing_nbi.cpp
* \author Filip Logist, Boris Houska, Hans Joachim Ferreau
* \date 2009
*
* Objectives:
* Maximize desired product
* Minimize catalyst A
*
* Reference:
* Adapted from
* Gunn and W.J. Thomas, 1965.
* ... | ALGO | 0.999983 | 5.234737 |
c5f2a478-b3a3-44dc-8ac1-462b89982209 | omerqmalik/cftd-solver | modules/cppcore/cppcore_rungekutta.cpp | #include <mex.h>
#include <matrix.h>
#include <complex>
#include <iostream>
#include <boost/serialization/array_wrapper.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/assign/list_inserter.hpp>
#include <boost/numeric/odeint.hpp>
#include "output.h"
#include "log.h"
#include "runge_kutta.h"
// Entry poi... | ALGO | 0.999725 | 5.928518 |
ff9132d5-1f95-48ba-9c50-c8098e1f9ecb | CsSnow98/StudyNotes | Acwing/C++/语法课/day01/燃料消耗.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
long t,v;
double o;
cin >> t >>v;
o = t*v/12.0;
printf("%.3f",o);
return 0;
} | ALGO | 0.989942 | 3.442179 |
4575c0ca-7da5-4f9f-a9e3-9f20537def01 | lo0b0o/dsa | lg1303/lg1303-2.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef vector<int> vi;
vi a, b;
int la, lb;
void mul(vi &a, vi &b, vi &c) {
for (int i = 0; i < la; i++)
for (int j = 0; j < lb; j++) {
c[i + j] += a[i] * b[j];
c[i + j + 1] += c[i + j] / 10;
c[i + j] %= 10;
}
while (c.size() > 1 && !c.back())... | ALGO | 0.999944 | 4.163916 |
0e692cce-fab1-49ba-a7fd-dd4cb8e82acb | AnhLM027/CPP_PTIT | CPP0124 - PHÂN TÍCH THỪA SỐ NGUYÊN TỐ - 2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define AnhLM027 "Le Minh Anh"
bool cmp(pair<int, int> a, pair<int, int> b) {
if (a.second == b.second) return a.first < b.first;
return a.second > b.second;
}
int main() {
int n; cin >> n;
int i = 2;
vector<pair<int, int>> res;
while (i <= s... | ALGO | 0.999768 | 4.316947 |
dcb3e9eb-9e1e-42a7-b07c-92d3b386eee2 | Doaa-Tartir/Problem-Solving | Codeforces/ICPC Assiut University Community/Sheet #1/X. Two intervals.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int l1, l2, r1, r2;
cin>>l1>>r1>>l2>>r2;
if(max(l1,l2)<=min(r1,r2)){
cout<<max(l1,l2)<<" "<<min(r1,r2);
}
else{
cout<<"-1";
}
}
| ALGO | 0.999829 | 3.351718 |
72af422c-c934-4311-b9ed-ffe79992adef | atharvsankpal7/CPP---DSA-BootCamp-Jan-2k25 | day15/_01_fuel_consumption.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// capactiy of fuel tank
// distance we can drive
int tankCapacity;
int distance;
cin >> tankCapacity >> distance;
int CONSTANT = 100;
float output = (tankCapacity * CONSTANT) / (float)distance;
cout << output << endl;
// fo... | ALGO | 0.956724 | 3.314399 |
7094be67-fe1c-42ea-b5c3-b42ce54ce187 | josdank/programacion2023B | Laboratorio6 20-12-2023/Ejercicios planteados/Planteados_Ejercicio9_Guerra_Josué.cpp | #include <iostream>
using namespace std;
int main()
{
// Ejercicio 9: Arbolito de navidad
//Pedir al usuario n nmero
//Se mostrara el arbolito segun el nmero
cout<<"Ejercicio 9: Arbolito navideo"<<endl;
cout << "Ingrese el nmero de ramas del Arbolito de Navidad: ";
int numRamas;
cin >> numRamas;
... | ALGO | 0.998775 | 4.783927 |
6b69f901-54cb-414d-a2bc-e68531543e78 | ishandutta2007/codeforces | stupid_justin/normal/1566/B.cpp |
#include<bits/stdc++.h>
#define int long long
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#define rd(x) x=read()
#define wt(x) write(x)
#define pos(x) (((x)-1)/SZ+1)
#define endl "\n"
#define pii pair<int,int>
#de... | ALGO | 0.999909 | 3.868057 |
e2cc7541-3631-4de3-bf49-1a9e1fe41773 | vedant-konade/Cpp_Programming | Loops/Loops8.cpp | //Print the number in reverse order
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter a number: ";
cin>>n;
int reverse=0;
int i=n;
while(i>0){
int lastdigit= i%10;
reverse= reverse*10 + lastdigit;
i=i/10;
}
cout<<"Reverse of "<<n<<" is "<<r... | ALGO | 0.997985 | 3.866185 |
4460dc5a-f38b-4871-81ca-6ecd2e3352e5 | kapishps/AlgoDS | Interviewbit/Binary Search/matrix search.cpp | int Solution::searchMatrix(vector<vector<int> > &A, int B) {
// row column naming exchanged;
int clo = 0, chi = A.size()-1, cmid;
while(clo < chi){
cmid = (clo+chi)/2;
if(A[cmid][A[0].size()-1] < B){
clo = cmid +1;
} else {
chi = cmid;
}
}
in... | ALGO | 0.99991 | 5.470455 |
81c1d26c-2c78-4a86-967c-3e8bde22a665 | EslamKhder/problem-solving-with-c- | sheets/sheet #5 (functions)/G. Max and MIN.cpp | #include<bits/stdc++.h>
using namespace std;
void sorting(int arr[],int size){
sort(arr,arr+size);
}
int main(){
int size;
cin>>size; // 4
int arr[size]; // [5,6,7,1]
for(int i=0;i<size;i++){
cin>>arr[i];
}
sorting(arr,size);// [1,5,6,7]
cout<<arr[0]<<" "<<arr[size-1];
}
| ALGO | 0.999953 | 3.053151 |
2a4b0c03-6522-4559-9e64-2efe3748bf80 | MilkClouds/Competitive-Programming | BOJ/milkclouds/02929/2929.cpp | # pragma GCC optimize ("O3")
# pragma GCC optimize ("Ofast")
# pragma GCC optimize ("unroll-loops")
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define rep2(i,a,b) for(int i = (b) - 1; i >= (a); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int... | ALGO | 0.999397 | 3.766194 |
ef6a37a5-966b-42d1-88f0-1993d346ee17 | SwapnanilHalder/CodingFiles | cp_practice/Array/Kadane's_Algorithm.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// arr: input array
// n: size of array
//Function to find the sum of contiguous subarray with maximum sum.
int maxSubarraySum(int arr[], int n){
// Your code here
... | ALGO | 0.999814 | 6.428083 |
e6818d1b-3178-47bd-a579-456474596897 | kmjp/procon | codeforce/801-850/837/d2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999851 | 4.38756 |
b34689c7-baf4-4977-8d79-91ba15f92181 | SNURobotics/Decision-intelligence-2017 | srLib2017/src/RRTmanager/TBrrtManager.cpp | #include "TBrrtManager.h"
#include <Eigen/Dense>
#include <Eigen/Eigenvalues>
TBrrtManager::TBrrtManager(rrtConstraint* constraint) : _error_threshold(0.1), _smoothing_error_threshold(0.25)
{
rrtConstraints = constraint;
}
TBrrtManager::~TBrrtManager()
{
}
rrtVertex * TBrrtManager::generateNewVertex(rrtVertex * ne... | ALGO | 0.99971 | 4.291972 |
404e088e-796e-44c4-a00d-ce7aea8cd33c | ishandutta2007/codeforces | i_love_dasha_karpenko/normal/1508/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
ll gi(char ch){
return ch-'0';
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll t;
cin>>t;
while(t--){
ll n;
cin>>n;
string a,b,c;
cin>>a>>b>>c;
ll c... | ALGO | 0.999992 | 4.550972 |
4cc1ae52-4f57-46fd-a505-8a1b28ad97f3 | hyunsik-yoon/study | leetcode/src/708_Insert_into_a_Sorted_Circular_Linked_List.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <vector>
using namespace std;
// 708_Insert_into_a_Sorted_Circular_Linked_List
// https://leetcode.com/problems/insert-into-a-sorted-circular-linked-list/description/
/*
// Definition for a Node.
clas... | ALGO | 0.999987 | 5.915249 |
f092fb9f-b8d7-4a36-8470-c04a57d8521b | AbdullaKhan01/Competitive-Programming | 1200/RemoveTwoLetters.cpp | #include<bits/stdc++.h>
#define mod 1000000007
#define mod2 998244353
#define ceil(a,b) ((a+b-1)/b)
#define ll long long
#define int long long
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define input(x) for(auto &a:x) cin >> a;
#define output(x) for(auto a:x) cou... | ALGO | 0.999856 | 4.675066 |
236fc59d-1a49-4d65-83ef-d670c84a4287 | virajchandra51/TLE_CP_31 | 1000/08 - Distinct Split.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
long long n;
cin >> n;
string s;
cin >> s;
unordered_set<char> st;
vector<long long> prefix_unique_count(n + 1, 0);
vector<long long> suffix_unique_count(n ... | ALGO | 0.99994 | 5.111876 |
d453ca87-bb33-4327-8867-1801c7dff123 | kandika-Rohan/leetcode-practicing | Difficulty: Medium/Find length of longest subsequence/find-length-of-longest-subsequence.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
#define MAX 1000
using namespace std;
int maxSubsequenceSubstring(string x, string y, int n, int m);
// Driver Program
int main()
{
int t;
cin>>t;
while(t--){
int n,m;
string x,y;
cin>>n>>m;
cin>>x>>y;
cout<<maxSubseq... | ALGO | 0.9999 | 5.837563 |
62bed664-3126-48da-b8d0-c1fdb5dbf98f | aber6/Codeforces-problems | 705A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
if(i%2==0)
{
cout<<"I love";
}
else
{
cout<<"I hate";
}
if... | ALGO | 0.99997 | 3.524987 |
28d2a24d-bedd-45e1-b605-52aaa30d1e34 | galippi/xcsoar | src/Util/StringUtil.cpp | #include "StringUtil.hpp"
#include "Compatibility/string.h"
#include <assert.h>
#include <string.h>
#include <ctype.h>
const TCHAR *
string_after_prefix(const TCHAR *string, const TCHAR *prefix)
{
assert(string != NULL);
assert(prefix != NULL);
size_t prefix_length = _tcslen(prefix);
return _tcsncmp(string, ... | TOOL | 0.876147 | 5.979478 |
e0f04dba-e49f-4f00-890b-089ca4ecd798 | cheon-yong/algorithm | programmers/Lv2/행렬의곱셈.cpp | #include <string>
#include <vector>
using namespace std;
vector<vector<int>> solution(vector<vector<int>> arr1, vector<vector<int>> arr2) {
vector<vector<int>> answer;
for(int i=0; i<arr1.size(); i++){
vector<int> v;
for(int j=0; j<arr2[0].size(); j++){
int sum = 0;
... | ALGO | 0.999914 | 5.477297 |
351f24e9-7159-431a-bea0-bfe59282c6e3 | Anup0099/450DSA_Question | 0839-similar-string-groups/0839-similar-string-groups.cpp | class Solution {
public:
vector<int> parent;
vector<int> rank;
int find (int x) {
if (x == parent[x])
return x;
return parent[x] = find(parent[x]);
}
void Union (int x, int y) {
int x_parent = find(x);
int y_parent = find(y);
if (x_parent =... | ALGO | 0.99999 | 5.837405 |
8027854a-a3a8-43cd-a106-94245e1ac310 | afifabroory/CompetitiveProgramming | CodeChef/CRDGAME/solution.cpp | #include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
unsigned short t;
cin >> t;
while (t--) solve();
return 0;
}
void solve() {
unsigned short n;
cin >> n;
unsigned ptA = 0, ptB = 0;
while (n--) {
string... | ALGO | 0.999988 | 4.700909 |
d34ff06d-0a58-41e6-baf7-281029d50a6f | SauravHaldar04/ModaliQ | 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 |
79848427-2fe0-43ff-bc8c-f6a8a50b9e0f | Skc2004/Cpp-DSA-Practice | program8.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
getline(cin,s);
int d=0,l=0;
for(int i=0;i<s.length();i++)
{
if((s[i]>=65 && s[i]<=90) || s[i]>=97 && s[i]<=122)
{
l++;
}
else if (s[i]>=48 && s[i]<=57)
{
... | ALGO | 0.996289 | 4.375041 |
8fe90cb1-50c6-4901-af7e-8521b2cd0b9f | TheRegext/laboratorio1-20231C-M | Clase 2023-04-28/minimo_sin_cero2.cpp | ///Ejercicio:
///Autor:DEK
///Fecha:
///Comentario:
# include<iostream>
# include<cstdlib>///stdlib.h
using namespace std;
///Inicializacin de variables para el clculo del mximo o mnimos depende
/// del contexto del programa.
int main(){
int num,minimo, i;
bool tengoMinimo=false;
for(i=1;i<=5;i++){
... | ALGO | 0.999726 | 3.036135 |
d5f213e7-fefc-4981-ba5e-a40a47b56a72 | dhy2000/tsinghua_DSA | THU/PA4/Process/process2.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
typedef long long ll;
const int MAX_N = 1000005;
const int MAX_HEAPSIZE = 1000005;
template <typename T>
inline void swap(T *pa, T *pb) {T tmp = *pa; *pa = *pb; *pb = tmp;}
template <typename T>
struct heap {
T Ele[MAX_HEAPSIZE] = {}; ... | ALGO | 0.999956 | 3.519207 |
e894853b-8329-417f-b8a8-cac7fdb03e4d | raincross7/code-similarity | codes/train_code/problem468/problem468_157.cpp | #include <bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
//typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
// #include <ext/rope>
// using namespace __gnu_cxx;
typedef long long int ll;
typedef long double... | ALGO | 0.999796 | 3.53153 |
1d39b34b-f907-4586-acf8-05b78f2908dc | KwanWaiPang/CMax-SLAM-comment | thirdparty/basalt-headers/thirdparty/eigen/bench/benchVecAdd.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchTimer.h>
using namespace Eigen;
#ifndef SIZE
#define SIZE 50
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef float Scalar;
__attribute__ ((noinline)) void benchVec(Scalar* a, Scalar* b, Scalar* c, int size);
__attribute__ ((noinline)) void be... | TOOL | 0.907148 | 5.111393 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.