uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d3c49a4a-7cf8-41bb-ba2c-63b85d05ee86 | csvultrainstinct/c-_Practice | cpp-practice/14.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int i=1,n;
cout <<"Enter the lenght of the series(N):" ;
cin>>n;
for(int i=1;i<=n;i++)
{
cout<<(i*i)*pow(-1,(i+1))<<" ";
}
return 0;
} | ALGO | 0.999533 | 3.375697 |
3db732c1-53e1-4fe0-a567-0bd7bbc6f93c | monta-20/LeetCode | 43.Multiply-Strings.cpp | #include <bits/stdc++.h>
#include <iostream>
#include<string>
using namespace std;
string multiply(string num1, string num2) {
if (num1 == "0" || num2 == "0")
return "0";
vector<int> res(num1.size() + num2.size(), 0);
int n1 = num1.size();
int n2 = num2.size();
for (... | ALGO | 0.999968 | 5.443093 |
b1ee2668-41e8-4da4-a4ea-5cb3270b3cd0 | rg-rupeee/competitive-programming | seprate_0_and_1.cpp | /*
author : Mr Rupesh Garhwal
id: rg_rupeee
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define fast_io \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define MAX_N 1e5 + 1
#define INF 1e9
#de... | ALGO | 0.999821 | 3.512218 |
872eba69-5a6a-40bc-8a4b-ecbfcc6d40d0 | tim-taylor/evobee | src/Pollinator.cpp | /**
* @file
*
* Implementation of the Pollinator class
*/
#include <cmath>
#include <random>
#include <cassert>
#include <string>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <iostream>
#include "tools.h"
#include "ModelParams.h"
#include "EvoBeeModel.h"
#include "PollinatorConfig.h"
#includ... | ALGO | 0.970767 | 7.108818 |
bde2c308-81ef-494a-8ed4-d53b3db2aa8e | ersakshamjain94/Autonomous-Navigation-Simulation | generate_training_data.cpp | //warnings
//always refer to field position with pos_circle variable a field is nothing but field of view of the car
// once you are done with training, close the gui window with upper right cross botton otherwise training data wont be saved
//it is assumed that user wont rotate more than 180 degrees
#include <SFML/Gra... | ALGO | 0.962616 | 3.47165 |
9d9095eb-8e57-4163-8b91-dc0531ff0e5d | LumitoLuma/qt-ifw-patched | src/libs/3rdparty/7zip/win/CPP/7zip/Compress/ByteSwap.cpp | // ByteSwap.cpp
#include "StdAfx.h"
#include "../../Common/MyCom.h"
#include "../ICoder.h"
#include "../Common/RegisterCodec.h"
class CByteSwap2:
public ICompressFilter,
public CMyUnknownImp
{
public:
MY_UNKNOWN_IMP
STDMETHOD(Init)();
STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
};
class CByteSw... | ALGO | 0.923936 | 5.81271 |
e110c826-0768-4af0-a092-05a53b1366c4 | Martini35/GAME_OF_LIFE | GOL2/SFML-2.6.1/examples/island/Island.cpp |
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#define STB_PERLIN_IMPLEMENTATION
#include <stb_perlin.h>
#include <SFML/Graphics.hpp>
#include <vector>
#include <deque>
#include <sstream>
#include <algorithm>
#include <cstring>
#incl... | TOOL | 0.881254 | 6.654213 |
31c68815-cb00-4bea-9623-4686fd3c47be | jshk1205/LLM | ChatGPT(예진)/Cpp (수정 완료)/Transmission_Algorithms_Hamming_CRC_RSA.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
// Hamming Code Implementation
std::string generateHammingCode(const std::string& data) {
int n = data.length();
int m = 0;
while (std::pow(2, m) < n + m + 1) {
m++;
}
std::string hamm... | ALGO | 0.999986 | 6.718748 |
c71cedbb-5a9a-4b29-aa7b-3a73fcc302ac | reven86/dreamfarmgdk | Source/third_party/boost_1_58_0/libs/regex/src/cregex.cpp | /*
* LOCATION: see http://www.boost.org for most recent version.
* FILE: cregex.cpp
* VERSION: see <boost/version.hpp>
* DESCRIPTION: Implements high level class boost::RexEx
*/
#define BOOST_REGEX_SOURCE
#include <boost/regex.hpp>
#include <boost/cregex.hpp>
#if !defined(BOOST_NO_STD_... | TOOL | 0.904749 | 5.407757 |
d479c592-69b6-48a0-862a-e470071b3d6d | abdulalimswe/Competitive-Programming | Competitive Programmer's Handbook/Comparison Operators/tuple_pair_sorted.cpp | #include <iostream>
#include<tuple>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
vector<tuple<int,int,int>>v;
v.push_back({1,2,3});
v.push_back({3,2,1});
v.push_back({2,3,1});
sort(v.begin(),v.end());
for (int i = 0; i < v.size(); i++)
{
cout<<get<0>(v[i... | ALGO | 0.9997 | 3.872153 |
8f88cd89-be58-4987-804c-dc5ffe4c46e7 | guisongchen/image_process_codes | laplace_filter.cpp | #include <iostream>
#include <opencv2/highgui.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
// 2nd derivative of f(x,y)
// d^2f(x,y) = d^2(f)/d(x^2) + d^2(f)/d(y^2);
// d^2(f)/d(x^2) = df(x+1,y) - df(x,y) / (x+1 - x);
// -- df(x+1,y) = f(x+1,y) - f(x,y) / (x+1 - x) = f(x+1,y) - f(x,y);
// --... | ALGO | 0.998488 | 5.085279 |
df999c07-6ac1-4686-a11e-b6139ae90c7d | tanthml/meta-heuristics-1.3 | tsp/tspVNSSearch.cpp | /*
* File: main.cpp
* Author: Tieu Minh
*
* Created on April 7, 2014, 4:24 PM
*/
#include "tspProblem.h"
#include "tspSolution.h"
#include "tspInsertion.h"
#include "tsp2Opt.h"
#define N graph.size()
using namespace std;
#if COMM_MPI
static edaMpiWorkflow workflow;
#else
static edaSeqWorkflow workfl... | ALGO | 0.999782 | 4.984137 |
9aa05a9f-23a3-4062-a43c-006041e96b4c | coolpi-george/panfork | src/compiler/glsl/opt_constant_variable.cpp | /**
* \file opt_constant_variable.cpp
*
* Marks variables assigned a single constant value over the course
* of the program as constant.
*
* The goal here is to trigger further constant folding and then dead
* code elimination. This is common with vector/matrix constructors
* and calls to builtin functions.
*... | ALGO | 0.954693 | 7.939769 |
6487fb3a-3c53-4814-8b80-f43018cd4f52 | hongwei7/LeetcodePractice | 46.全排列.cpp | /*
* @lc app=leetcode.cn id=46 lang=cpp
*
* [46] 全排列
*/
// @lc code=start
class Solution {
public:
void solve(vector<int>& nums, unordered_set<int>& exist, vector<int>&now, vector<vector<int>>& result){
for(auto num : nums){
if(exist.count(num) == 0){
exist.insert(num);
... | ALGO | 0.999963 | 6.395731 |
c4c39a87-4703-4a3e-9cce-fac7626275b9 | Anilritm/DSA-Problem- | DSA/c++/BinaryTree/TraversalInTree.cpp | #include<bits/stdc++.h>
using namespace std;
// Inorder Traversal = ( LNR )Left to NULL to Right
// PreOrder Traversal = ( NLR ) NULL to Left to Right
// Post Order traversal = ( LRN ) Left to Right to NULL
// class of node
class Node
{
public:
int data ;
Node* left;
Node* right ;
// cons... | ALGO | 0.9999 | 4.278182 |
f7c65217-191a-4087-996c-9d476ba75552 | rasinhas/Maratona | uri/algar-xiii/h.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cmath>
#include <string>
#include <cassert>
#define ff first
#define ss second
#define eps 1e-6
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
double adj[111][111], d[111][111];
double x[1... | ALGO | 0.999811 | 3.34548 |
16cff0e6-6d7f-429a-927a-2d9ca44713fe | ssk4988/Coding | metahackercup/2023/round2/a1.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<ld, ld>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<ld>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vv... | ALGO | 0.999726 | 4.755465 |
a91c8bdb-58fd-429f-873c-5b554ed0a54b | annu3902/Leetcode_Problems | 948-sort-an-array/sort-an-array.cpp | class Solution {
public:
vector<int> sortArray(vector<int>& nums) {
int n = nums.size();
dfs(0, n-1, nums);
return nums;
}
void dfs(int start, int end, vector<int>& nums){
if(start >= end){
return;
}
int mid = (start + end)/2;
dfs(start, ... | ALGO | 0.999999 | 5.985089 |
82c7c8ce-c7d9-4957-b64f-050bfb0e6743 | NikitaNikson/soc_engine_fixed | SDK/boost_1_30_0/libs/spirit/phoenix/example/fundamental/sample3.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include "boost/spirit/phoenix/functions.hpp"
#include "boost/spirit/phoenix/primitives.hpp"
using namespace std;
using namespace phoenix;
struct is_odd_ {
template <typename ArgT>
struct result { typedef bool type; };
template <typename ArgT>
... | ALGO | 0.991503 | 5.4013 |
ee434de9-929b-4816-b6ff-363efe737ef2 | JSeungBeom/Data-structure | personal practice/personal practice/tree3.cpp | #include <iostream>
#include <vector>
using namespace std;
struct node {
int data;
node* parent;
vector<node*>childList;
node(int data, node* parent) {
this->data = data;
this->parent = parent;
}
};
class Tree {
private:
node* root;
vector<node*>nodeList;
int find(int data, vector<node*>& list) {
for (... | ALGO | 0.999901 | 4.413877 |
45157e39-67f2-4953-913f-8c73c5eba5a9 | raincross7/code-similarity | codes/train_code/problem213/problem213_414.cpp | #pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include... | ALGO | 0.99991 | 3.691862 |
55e09207-bbb3-4bbb-8485-9dc31b1a26d6 | AlaminPu1007/leet-code | Leet-Code/258. Minimum Number of Vertices to Reach All Nodes/1557_Minimum_Number_of_Vertices_to_Reach_All_Nodes.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<int> findSmallestSetOfVertices(int n, vector<vector<int>> &edges)
{
vector<int> res;
vector<bool> isInDegree(n, false);
// check in-degree of vertices
for (auto item : edges)
{
// ... | ALGO | 0.999868 | 5.980487 |
4119f8a7-1a7c-40ff-b494-177dab33e923 | YooBIK/Algorithms | BOJ/AlgorithmStudy/Week_2/BackTracking/2580.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int sudoku[9][9];
bool row[9][10];
bool col[9][10];
bool smallbox[3][3][10];
vector<pair<int,int>> vec;
bool flag=false;
void print_sudoku(){
for(int i=0;i<9;i++){
for(int j=0;j<9;j++){
cout << sudoku[i][j] << " ... | ALGO | 0.999543 | 5.571187 |
41f6af43-cebc-4fa6-bd7c-d982ee250ae1 | hnpl/gem5-sst | src/systemc/tests/systemc/misc/cae_test/general/arith/addition/increment/increment.cpp | /*****************************************************************************
increment.cpp --
Original Author: Rocco Jonack, Synopsys, Inc., 1999-07-09
*****************************************************************************/
/****************************************************************************... | ALGO | 0.997518 | 4.950881 |
7cb5e8d3-7edb-444c-9c88-0abaa144ef98 | tuhin-cse/ProblemSolvingPractice | Highly Composite Numbers/main.cpp |
///High
#include <iostream>
using namespace std;
int prime[] = {2, 3, 5, 7, 11, 13, 17, 19, 23 };
int resNum, resDiv, n;
void recur ( int pos, int limit, long long num, int div ) {
if ( div > resDiv ) { //Get the number with highest NOD
resNum = num;
resDiv = div;
}
else if ( div == res... | ALGO | 0.999763 | 4.22009 |
08eaf565-1160-4086-bf6d-d28ac81fbbe4 | moscowlights/xray-soc | trunk/3rd party/boost/libs/graph/example/graph.cpp | #include <boost/graph/adjacency_list.hpp>
using namespace boost;
using namespace std;
typedef property<vertex_color_t, default_color_type,
property<vertex_distance_t,int,
property<vertex_degree_t,int,
property<vertex_in_degree_t, int,
property<vertex_out_degree_t,int> > > > > VertexPropert... | ALGO | 0.959219 | 5.300358 |
055adc97-d09f-43a1-80d1-cc2f4790eef3 | wien0128/problem-solve | BaekJoon/7568_덩치_BruteForce.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// 덩치 7568 BruteForce
// O( n^2 )
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n;
cin >> n;
// {몸무게, 키} 벡터
vector<pair<int, int>> v(n);
// 입력
for (auto& [w,... | ALGO | 0.999987 | 5.031288 |
7db0509d-feec-4b8e-8991-36319ed8e49f | zenomyth/oj_problems | dmoj/aac1p5/main.cpp | #include <iostream>
#include <cstdint>
#define N 200000
using namespace std;
int n;
struct Node {
int dest;
int parity;
struct Node *next;
};
struct Node *conn[N + 1];
struct Node pool[N * 2];
struct Node *watermark = pool;
struct PathFromNode {
int64_t odd;
int64_t even;
int pass_in_parity;
... | ALGO | 0.999929 | 4.398572 |
e8fa4cd7-5af7-4915-8885-4515de3dbf3f | djh2/benzene | src/hex/VCUtil.cpp | //----------------------------------------------------------------------------
/** @file VCUtil.cpp */
//----------------------------------------------------------------------------
#include "VCUtil.hpp"
#include "VCSet.hpp"
#include "HexBoard.hpp"
#include "BoardUtil.hpp"
using namespace benzene;
//----------------... | ALGO | 0.994437 | 6.533916 |
068ba6cd-e875-4ed2-b8ac-3be17af549d7 | nka21/atcoder | adt/20250304/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
string s;
int a, b;
cin >> s >> a >> b;
a--;
b--;
char tmp = s[a];
s[a] = s[b];
s[b] = tmp;
cout << s << endl;
} | ALGO | 0.999932 | 3.882563 |
7da841a7-593c-47e6-b07f-65fb0af40c93 | ChooSeoyeon/ps-history | 프로그래머스/lv2/42747. H-Index/H-Index.cpp | #include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
/*
[문제 설명]
- h번 이상 인용된 논문이 h편 이상이고
- 나머지 논문이 h번 이하 인용되었다면
- h의 최댓값이 H-Index
[문제 접근]
- 내림차순 정렬 후, 앞에서부터 `h번 이상 인용된 논문 >= h편`인지 확인
- 내림차순되어 있어서 현재 논문의 뒷부분이 `h번 이하 인용`된 논문들인 건
- 당연한 사실이라 확인할 필요 없음
- 원소의 값 == 인용 횟수
- 원소의 인덱스+1 == 몇 번째인지
*/
... | ALGO | 0.999943 | 5.634658 |
b4ba229b-12b0-4ab6-a8c1-a8f447b5a4dd | alizaen/bxccore | src/bitcoinclassic-cli.cpp | #include "chainparamsbase.h"
#include "clientversion.h"
#include "rpc/client.h"
#include "rpc/protocol.h"
#include "util.h"
#include "utilstrencodings.h"
#include <boost/filesystem/operations.hpp>
#include <stdio.h>
#include <event2/event.h>
#include <event2/http.h>
#include <event2/buffer.h>
#include <event2/keyvalq... | WEB | 0.951055 | 6.817035 |
494d9802-e450-4ab5-8790-d941b9d19697 | Sonal-557/strivers | ReverseString.cpp | #include <iostream>
#include <cmath>
#include <limits.h>
using namespace std;
class Solution {
public:
int reverse(int x) {
int rev = 0;
while (x != 0) {
int digit = x % 10;
x /= 10;
if (rev > INT_MAX / 10 || (rev == INT_MAX / 10 && digit > 7)) return 0;
... | ALGO | 0.998952 | 5.89787 |
0632f9f8-9d78-4864-82cf-2f6a77c93ea6 | saikiranpatil/my-dsa-problems | Shortest Common Supersequence - GFG/shortest-common-supersequence.cpp | //{ Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution
{
public:
//Function to find length of shortest common supersequence of two strings.
int shortestCommonSupersequence(string X, string Y, int... | ALGO | 0.999962 | 6.334629 |
8ccd0922-28af-41c9-a6c4-a07b7d9ee699 | r-d-s-l-w/competitive-programming | Codeforces/1257E - The Contest.cpp | /// Radoslaw Mysliwiec 2019
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB emplace_back
#define ALL(x) (x).begin(),(x).end()
#define endl '\n'
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using pi = pair<int,int>;
using pll =... | ALGO | 0.999834 | 3.980307 |
f0fe4f3b-6b09-4e6d-b57e-9103b2b0ecbd | Abhibhab/Abhibhab_Leetcode | 144-binary-tree-preorder-traversal/144-binary-tree-preorder-traversal.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.99998 | 6.139342 |
50001564-88cf-4df3-99ea-0565b7d3d90c | Forrest-Z/cplus_plus_code | functional/function-ch.cpp |
#include<iostream>
#include<string>
#include<vector>
#include<functional>
class User {
public:
std::string first, last;
bool enabled;
};
// could take this approach but lots of typing
void createListOfFirstNames(std::vector<User> &users, std::vector<std::string> &u) {
for(auto i = users.begin(); i != us... | TOOL | 0.95417 | 5.847568 |
bc2a4c6d-cb7f-476e-9888-f6cb6f34844d | ishandutta2007/codeforces | cookiedoth/normal/1017/D.cpp | /*
Code for problem D by savkinsd2089
Generated 08 Aug 2018 at 08.28 pm
The Moon is Waning Crescent (11% of Full)
_____________
_____________
_____________
_____________ ______
_____________
_____________
___________ ________
\_()_/
^_^
>_<
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <set>... | ALGO | 0.999936 | 4.100653 |
3feddfe6-9c1e-42dc-8228-38eda856a8ca | Dikshitakanani/CPP | class/p2.cpp | #include<iostream>
using namespace std;
class rectangle
{
private:
int lenght, height;
public:
int l=lenght, h=height;
int area(int l, int h)
{
return l*h;
}
int circ(int l, int h)
{
return 2*(l+h);
}
};
int main... | ALGO | 0.999209 | 4.175739 |
3cda88a1-a185-4216-9bb0-87a6b19ab887 | ishandutta2007/codeforces | cz_xuyixuan/normal/871/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define P 1000000007
#define INF 2e9
template <typename T> void read(T &x) {
x = 0; int f = 1;
char c = getchar();
for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
x *= f;
}
int n, x[MAX... | ALGO | 0.999946 | 3.797909 |
3eb141a1-40b6-41ec-81c1-7488940285a6 | ishandutta2007/codeforces | demon1999/normal/645/C.cpp | #include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <cassert>
#define forn(i, n) for(ll i = 0; i < int(n); i++)
#define mp(i, j) make_pair(i, j)
#define rs(j) resize((j))
#define pb push_back
#define p... | ALGO | 0.999987 | 3.998658 |
4e421200-9d60-4add-b79b-d162ebee2784 | Eliozk/CPP_Course_Tasks-System_Programming | Ex4/main.cpp | // Mail: <EMAIL>
#include <iostream>
#include <string>
#include "Tree.hpp"
using namespace std;
int main() {
Tree<double> tree; // Binary tree that contains doubles.
Node<double> root_node(1.1);
tree.add_root(root_node);
Node<double> n1(1.2);
Node<double> n2(1.3);
Node<double> n3(1.4);
... | ALGO | 0.982851 | 4.855982 |
bb4a1f24-d4d0-458e-8e5f-5c4d76bf0a84 | rhks7410dyd/PSstoringplace | Dynamic_Programming/boj2568.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#define endl '\n'
#define SIZE 100001
using namespace std;
vector<pair<int,int>> input;
vector<vector<pair<int,int>>> dp; // first : value & second : pos
void put_num(int val, int pos);
int check_min_val(vector<pair<int,int>>& v);
void print_dp();
int main... | ALGO | 0.999993 | 3.89967 |
a5ba9e3a-7b35-4393-947b-3cc51a1ddf1d | anujeet98/DSA | codingblocks/stack/min_max_stack.cpp | #include<iostream>
#include<vector>
using namespace std;
class Stack {
private:
vector<int> st;
vector<int> min_stack;
vector<int> max_stack;
public:
void push(int data) {
int curr_min = data;
int curr_max = data;
if (min_stack.size()) {
curr_min = min(curr_min, min_stack[min_stack.size() - 1]);
curr... | ALGO | 0.99963 | 4.661031 |
399605bc-d46b-44a6-be79-f732b55d62db | Chiyoshic/SCAU-OJ-online-judge | 2-数据结构/实验7-图论/18448*-最小生成树.cpp | #include <iostream> // 标准输入输出
#include <vector> // 向量容器
#include <queue> // 优先队列,用于Prim算法
using namespace std;
/* 类型定义和常量 */
typedef long long ll; // 定义长整型别名,用于处理大数
typedef pair<ll, int> pii; // 定义边类型(权重,顶点)
const ll INF = 1LL << 60; // 定义无穷大值
/**
* Prim算法实现最小生成树
* 算法思想:贪心策略,每次选择连接已选和未选顶点集合的最小边
* 记忆方法:P(优先队... | ALGO | 0.999997 | 4.841157 |
5e4120c5-cfbb-4247-973c-40ca0de44fb2 | Shivar-J/Fortify | Engine/Core/Source/core.cpp | #include "core.h"
void Engine::Core::Application::run()
{
initWindow();
initVulkan();
initImGui();
mainLoop();
cleanup();
}
void Engine::Core::Application::initWindow()
{
glfwInit();
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FA... | TOOL | 0.851494 | 3.118779 |
df382511-f069-4a4f-860f-8eaab211a1c6 | hxs91/LeetCode | Gray Code.cpp | class Solution {
public:
int getValue( int val,int idx ){
return (1<<idx)|(val);
}
vector<int> grayCode(int n) {
vector<int> ans;
ans.push_back(0);
if(n==0) return ans;
ans.push_back(1);
if(n==1) return ans;
for(int i=1;i<n;i++){
int len=... | ALGO | 0.999979 | 5.527827 |
66a0f73a-38b2-4487-bebc-d67605c59dbe | BangKartavya/GFG | Make Array Elements Unique/main.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int minIncrements(vector<int> arr) {
int n = arr.size();
int ans = 0;
unordered_set<int> s;
map<int, int> mp... | ALGO | 0.999846 | 6.38517 |
a57f3ad6-ef50-4222-b989-35d71c3fd9f7 | PiperBetle/MyCode | CF1497C1 k-LCM (easy version).cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cassert>
#define siz(x) int((x).size())
#define cauto const auto
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
using std::cin;using std::cout;
using loli=long long;
using uloli=unsigned long long;
using lodb=lon... | ALGO | 0.999176 | 3.896046 |
ee87ef08-ef7e-41d8-820e-bc706685f6ac | raincross7/code-similarity | codes/train_code/problem478/problem478_337.cpp |
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif
void d_err() {
cerr << endl;
}
template <typename H, typename... T>
void d_err(H h... | ALGO | 0.999953 | 3.331742 |
69eedba8-927e-428b-8819-e3934c5bcfe2 | ifeler/labs | лаба 4/Безымянный3.cpp | #include <stdlib.h>
#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[])
{ system("CLS");
int n,i;
float S;
printf(" n "); scanf("%d",&n);
for (S=0, i=2; i<=n*2; i+=2)
S+=tan(i);
printf ("S=%f",S);
system("PAUSE");
return 0;
}
| ALGO | 0.998643 | 3.263611 |
10e206b7-7952-44cc-ac33-333bdaf8f6dd | baoanth/da22ttc-th-ctdlgt | vo_phuoc_toan/TH4_Danh_sach_lien_ket/dathuc.cpp | #include <stdio.h>
#include <stdlib.h>
typedef struct donthuc
{
int heso;
int bac;
}donthuc;
typedef struct Node
{
donthuc Info;
Node* pNext;
}Node;
typedef struct dathuc
{
Node* pHead;
Node* pTail;
}dathuc;
Node* GetNode(donthuc x)
{
Node *p;
p = new Node;
if (p==NULL)
{
printf("Khong du... | ALGO | 0.96697 | 3.025355 |
43725498-99c6-45be-bc2e-305ed72d096d | nidhiss29/Leetcode1 | 144.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.999972 | 6.224957 |
507f9d15-7a5a-433c-9cb0-c20d09356b20 | SakshamTapadia/LeetCode | 2028-the-earliest-and-latest-rounds-where-players-compete/2028-the-earliest-and-latest-rounds-where-players-compete.cpp | class Solution
{
public:
pair<int, int> dfs(int n, int p1, int p2)
{
if (p1 + p2 == n + 1)
{
return {1, 1};
}
if (p1 > p2)
{
swap(p1, p2);
}
if (n <= 4)
{
return {2, 2};
}
int m = (... | ALGO | 0.999862 | 6.024433 |
369b4178-78d7-48ac-8aa0-c3512df485d3 | Code-Learner-sm9/Phitron | Phitron/Linked List Related/Linked List new/Linked List/Singly Linked List Recap/5_Insert_at_head.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
this->next = NULL;
}
};
void print_the_linked_list(Node *head)
{
cout << "Your Linked List: " << endl;
Node *temp = head;
while (temp != NULL)
... | ALGO | 0.999934 | 4.946706 |
4a3ef486-91db-4cc1-9c3a-8756ff36624a | Devansh-Bhagania/DATA_STRUCTURES_AND_ALGORITHMS | Arrays/CountStairs.cpp | #include <iostream>
using namespace std;
// A simple recursive program to
// find N'th fibonacci number
int fib(int n)
{
if (n <= 1)
return n;
return fib(n - 1) + fib(n - 2);
}
// Returns number of ways to
// reach s'th stair
int countWays(int s) { return fib(s + 1); }
// Driver Co... | ALGO | 0.999426 | 5.182854 |
4e491231-aa58-4635-9dc0-8380590814ab | feliposz/leetcode-solutions | C++/maximum-twin-sum-of-a-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
int pairSum(ListNode*... | ALGO | 0.999976 | 5.718441 |
2ea36da7-1679-44b6-9ea7-5b6c5a93a78e | NIHAL-KUMAR-01/CPP | Control_Statement/Q2.cpp | #include<iostream>
using namespace std;
int main(){
int n1,n2,n3;
cout<<"Enter First Number: ";
cin>>n1;
cout<<"Enter Second Number: ";
cin>>n2;
cout<<"Enter Third Number: ";
cin>>n3;
if (n1>n2 && n1>n3)
{
cout<<n1<<" is greatest amongst "<<n1<<","<<n2<<","<< n3;
}
... | ALGO | 0.994769 | 3.580273 |
f285d770-81f6-4b30-9857-0adeeb770902 | rellanium/super_test | src/crypto/sha1.cpp | #include "crypto/sha1.h"
#include "crypto/common.h"
#include <string.h>
// Internal implementation code.
namespace
{
/// Internal SHA-1 implementation.
namespace sha1
{
/** One round of SHA-1. */
void inline Round(uint32_t a, uint32_t& b, uint32_t c, uint32_t d, uint32_t& e, uint32_t f, uint32_t k, uint32_t w)
{
... | ALGO | 0.998394 | 7.492003 |
936292c6-c032-4576-99ad-8040b27ec6ad | xmg2024/Leetcode-Solutions | 2501-3000/2549-Count-Distinct-Numbers-on-Board/cpp-2549/main.cpp | /// Source : https://leetcode.com/problems/count-distinct-numbers-on-board/description/
/// Author : liuyubobobo
/// Time : 2023-01-28
#include <iostream>
#include <vector>
using namespace std;
/// Math
/// Time Complexity: O(1)
/// Space Complexity: O(1)
class Solution {
public:
int distinctIntegers(int n) {
... | ALGO | 0.998113 | 5.853452 |
7943b2d8-bb99-4b68-9564-e3161cd8e1eb | SongHojinjin/Clone-TikTok | 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 |
2053c089-e130-4aab-b4f7-fadb18044394 | jalexp/c345 | boost_1_71_0/libs/spirit/example/qi/compiler_tutorial/calc5.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// Same as Calc4, this time, we'll incorporate debugging support,
// plus error handling and reporting.
//
// [ JDG April 28, 2008 ] For BoostCon 2008
// [ JDG February 18, 2011 ] Pure attributes. No semantic actions.
//
/////... | TOOL | 0.952737 | 7.892432 |
51bdee44-2bba-47fb-aa49-1536700359ad | lucaciarimboli/progettoAPSC | project/src/utils/CrossSectionsData.cpp | //#include "utils/CrossSectionsData.hpp"
#include "../../include/utils/CrossSectionsData.hpp" // for testing
CrossSectionsData::CrossSectionsData(const std::vector<std::string> & species, const double& E_max,
const std::vector<double> & mix, const double& N):
gas(species), n_r... | ALGO | 0.862875 | 5.394166 |
60da4c17-95e3-4ac8-884e-6bfbfca6f971 | AQIB-NAWAB/DSA-Problems-Solutions | Week 3/Detect Cycle in LinkedList/index.cpp | #include<iostream>
#include<vector>
#include<unordered_set>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int data) {
this->data = data;
this->next = NULL;
}
};
class LinkedList {
public:
Node* head;
Node* tail;
LinkedList() {
this->... | ALGO | 0.999963 | 5.509368 |
9b784ad2-993e-47b1-9b79-1d66da5046aa | Steelbadger/FiveOhOneDarts | Source/FiveOhOne Darts/Game.cpp | //=============FiveOhOne Darts=============//
#include <iostream>
#include <cstdlib>
#include <time.h>
#include <string>
using namespace std;
const int boardpoints[20] = {20, 1, 18, 4, 13, 6, 10, 15, 2, 17, 3, 19, 7, 16, 8, 11, 14, 9, 12, 5};
// Doubles and trebles generated in run-time
const int BULLSEYE = 50;
c... | TOOL | 0.958255 | 3.942399 |
3ec4673c-3e0f-4c7b-a1bc-ddab8be787f2 | robinyb/leetcode | Balanced_Binary_Tree.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool isBalanced(TreeNode *root) {
if (NULL == root)
return true;
int iTmp(0);
return isBalanced(root, iTmp);
}
... | ALGO | 0.999846 | 5.961301 |
0064cbbd-5767-42ea-8b1b-320fd7181975 | hshs1103/programmers | lv2/lv2_scoville.cpp | #include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
int solution(vector<int> scoville, int K) {
int answer = 0;
priority_queue<int, vector<int>, greater<>> pq;
for(int i =0; i< scoville.size(); i++){
pq.push(scoville[i]);
}
while(!pq.empty... | ALGO | 0.999897 | 5.546368 |
cc364977-8fb6-4a5c-b478-576192842ef3 | polardb/polardbx-engine | storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp | #define DBTUX_MAINT_CPP
#include "Dbtux.hpp"
#define JAM_FILE_ID 369
/*
* Maintain index.
*/
void
Dbtux::execTUX_MAINT_REQ(Signal* signal)
{
jamEntryDebug();
TuxMaintReq* const sig = (TuxMaintReq*)signal->getDataPtrSend();
// ignore requests from redo log
IndexPtr indexPtr;
ndbrequire(c_indexPool.getPtr(... | ALGO | 0.990589 | 6.207417 |
e41d8fd6-4a9d-4c18-b50e-3542fe70f310 | Priyansh2/code | sliding-window-maximum/sliding-window-maximum.cpp | class Solution {
public:
vector<int> solve1(vector<int> &nums, int k){
vector<int> res;
deque<pair<int,int>> dq;
int n = nums.size();
for(int i = 0;i<n;i++){
while(!dq.empty() && dq.front().second <= i-k){
dq.pop_front();
}
while(!d... | ALGO | 0.999996 | 5.760831 |
c155e3be-336e-45e5-acd5-2c731134b762 | KristyleModin/UniVents_Website | 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 |
19c4bfd8-7dda-4211-bf4e-4197c1339c87 | alizul01/road-to-gemasweet | src/toki/basic/ifelse.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string input;
cin >> input;
string ans = "";
int lengthAns = input.length();
if (lengthAns == 1) {
ans = "satuan";
} else if (lengthAns == 2) {
ans = "puluhan";
} else if (lengthAns == 3) {
ans = "ratusan";
} else if (lengthAns == 4) {
ans = "... | ALGO | 0.975916 | 4.333123 |
2f970611-a599-46d4-8956-38660301eccd | Calebisco/L.T.C.S | C++/distribute-repeating-integers.cpp | // Time: O(n + m * 3^m)
// Space: O(n + 2^m)
class Solution {
public:
bool canDistribute(vector<int>& nums, vector<int>& quantity) {
unordered_map<int, int> count;
for(int i = 0; i < size(nums); ++i) {
++count[nums[i]];
}
int total = (1 << size(quantity)) - 1;
... | ALGO | 0.999961 | 5.879033 |
54719e52-276e-48d1-bd89-1b745fc240f4 | Latasharma26/Array | 2414-move-pieces-to-obtain-a-string/2414-move-pieces-to-obtain-a-string.cpp | class Solution {
public:
bool canChange(string start, string target) {
// Filter out '_' and compare the order of 'L' and 'R'
string filteredStart, filteredTarget;
for (char c : start) if (c != '_') filteredStart += c;
for (char c : target) if (c != '_') filteredTarget += c;
... | ALGO | 0.999837 | 6.808004 |
b82772ed-624e-4292-aba5-d3706c6524a2 | Szelethus/cpp_courses | 2024-25-1/monday8-10/07gy/template2.cpp | #include <iostream>
template <int N>
void printN() {
std::cout << N << '\n';
}
int main() {
printN<500>();
int n;
std::cin >> n;
printN<n>();
}
| ALGO | 0.971379 | 4.101923 |
a16e722a-b9bb-48a0-ac97-857b18e0c567 | priyabrathtripathi/cpp_practice | insertion.cpp | #include<stdio.h>
int main(){
int n,arr[100],i,a,v;
printf("number of element\n");
scanf("%d",&n);
printf("number %d integer\n",n);
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
for(i=1;i<=n-1;i++){
a=i;
while(a>0 && arr[a]<arr[a-1]){
v = arr[a];
... | ALGO | 0.999979 | 3.749104 |
68bbaf76-d7e0-4587-8307-3ad00b90759a | chakitg/cp_solutions | leetcode-potd/2279. Maximum Bags With Full Capacity of Rocks.cpp | You have n bags numbered from 0 to n - 1. You are given two 0-indexed integer arrays capacity and rocks. The ith bag can hold a maximum of capacity[i] rocks and currently contains rocks[i] rocks. You are also given an integer additionalRocks, the number of additional rocks you can place in any of the bags.
Return the ... | ALGO | 0.999857 | 5.830678 |
a11062fb-5ce4-4bec-99d8-cd5cefceb930 | RajThakur777/GFG-POTD | Difficulty: Easy/Closest Neighbour in BST/closest-neighbour-in-bst.cpp | /*
class Node {
public:
int data;
Node *left;
Node *right;
Node(int x) {
data = x;
left = NULL;
right = NULL;
}
}; */
class Solution {
public:
void inorder(vector<int> &ans , Node* root){
if(root == NULL) return;
inorder(ans , root->left)... | ALGO | 0.999997 | 5.282472 |
b302b888-144f-426c-b84b-faf807a8b0d6 | omarhosny206/Data-Structures-and-Algorithms-Specialization | 1- Algorithmic Toolbox/Week 2/Programming Assignments/1- Fibonacci Number/Fibonacci Number.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
long long Fibonacci(long long Number)
{
long long previousNumber = 0, currentNumber = 1, newCurrentNumber, i;
if (Number == 0)
return previousNumber;
for (i = 2; i <= Number; i++)
{
newCurrentNumber = previousNumber + currentNu... | ALGO | 0.999896 | 4.955802 |
a7a9d56c-2e71-4496-a869-ae38edcb9fd4 | Sheng5Qing/ds-c | 5.Tree/LBiTree.cpp | #include <iostream>
#include <iterator>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
#define TRUE 1
#define FAlSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1 //
typedef int Status; //״̬
// ΪTElemType
typedef char TElemType;
//ʽ洢ṹ
typedef struct BiNode {
TElemType data; /... | ALGO | 0.999873 | 4.051163 |
f52774e6-2f3d-4e81-851b-38fadca9f93e | ajayjangid-51/dsa | dsasolve/solve/leetcode/RegioninBinaryMatrix_m2.cpp | #include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define sz(x) x.size()
#define ll long long
#define pint unsigned int
#define pb push_back
#define mp make_pair
#define vb vector<bool>
#define vi vector<int>
#define vvi vector<vi>
#define vvb... | ALGO | 0.999988 | 5.861582 |
f80e6e20-ba7e-4536-87ac-f8b08f479517 | yayankov/Design-and-analysis-of-algorithms-practical | Homework3/Homework_3.cpp | /*
Подземие
Поради наближаващата сесия Мими започна да играе нова игра,
за да отлага ученето. Част от играта се нарича Подземието. То се
състои от Лагери, изградени от играчите, и пещери, които ги
свързват. Във всяка пещера има чудовище, което е на определено
ниво, и за да може играч да премине през пещерата, то негови... | ALGO | 0.999856 | 4.282895 |
3673808b-6765-4b19-bc7e-99f37e217530 | m1o9n6s8t8e3r/IncrementalCH | 2Drunner.cpp | #include <iostream>
#include <chrono>
#include "seqhull.h"
#define point2D pair<int, int>
#define facet2D pair<point2D, point2D>
#define ridge2D point2D
int main(int argc, char** argv)
{
bool debug = false;
if (argc > 1 && argv[1] == "-debug") {
debug = true;
}
int size = 0;
std::cin >> size;
... | ALGO | 0.989035 | 5.33069 |
a0f930fe-1de3-478f-af2b-5b805e3af837 | Tukekehaohaonuli/algorithm | LuoGu/P1138.cpp | #include<stdio.h>
#define N 10000
#define K 30000
//int function(int temp[],int low,int high){
// int mid;
// int tmp=temp[low];
// while(low<high){
// while(low<high&&temp[high]>=tmp) high--;
// temp[low]=temp[high];
// while(low<high&&temp[low]<=tmp) low++;
// temp[high]=temp[low];
// }
// temp[low]=tmp;
// retur... | ALGO | 0.999984 | 3.44518 |
f6bbc2fa-efc6-4ec6-ae93-67b95495f99e | wxy1245/Numerical-Algebra- | SVD/SVD/Function.cpp | #include "Function.h"
#include "auxiliary.h"
#include <cmath>
#define ERROR 1e-6
void householder(vector<double> x, vector<double> &v, double &beta)
{
int n = x.size();
double eta = vector_norm_infinity(x);
if (abs(eta) < 1e-5)
{
for (int i = 0; i < n; i++)
{
v[i] = 0;
}
beta = 0;
return;
}
for (in... | ALGO | 0.999907 | 3.466592 |
b16abfba-0356-45f1-aad9-0eba87db073e | cuhk-seclab/SPatch | main/split/z3/src/qe/qe_util.cpp | #include "qe_util.h"
#include "bool_rewriter.h"
namespace qe {
void flatten_and(expr_ref_vector& result) {
ast_manager& m = result.get_manager();
expr* e1, *e2, *e3;
for (unsigned i = 0; i < result.size(); ++i) {
if (m.is_and(result[i].get())) {
app* a = to_app(r... | TOOL | 0.878778 | 5.796563 |
56b17d16-6774-47c0-8294-5aa1fb084194 | Aryan6290/Competitive_Programming | Codechef/Rated/Long Challenge/October Long Challenge (2020)/covid run.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
map<int, int> m1,m2,m;
map<int, int>::iterator itr;
int t;
cin>>t;
while(t--)
{
int flag=0;
int n,k,x,y;
cin>>n>>k>>x>>y;
for(int i=1;i<=n;i++){
if((x+ i*k)%n==y)
{
flag=-1;... | ALGO | 0.999933 | 3.240949 |
1f4a07e4-5e7f-4c6d-a475-ec1d817f7cf8 | yasinenis/happy-codings-examples-c | examples-01-02-34/main.cpp | // Find the Odd Element given an Array with only two Different Element
#include <stdio.h>
void printodd(int array[], int size)
{
int xor2 = array[0];
int set;
int j;
int n = size - 2;
int x = 0, y = 0;
/* The xor will basically be xor of two odd occurring elements */
for (j = 1;j < size;j++)
{
xor2 = xor2 ^... | ALGO | 0.999824 | 4.497249 |
8d3266eb-cc50-4b45-aa84-1de07cad4fa1 | eggag32/Competitive-Programming | DMOJ/CCC '03 S5 - Trucking Troubles.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) debug(x) debug(y);
#define repn(i, a, b) for(int i... | ALGO | 0.999946 | 5.082209 |
57e18d80-3e26-48a5-ad6c-55e9a93b1c65 | muazgulfam/Type_Casting | Type Casting/main.cpp | #include <iostream>
using namespace std;
int main()
{
int num1{}, num2{}, num3{}, num4{};
cout << "Enter 4 integers separated by space " << endl;
cin >> num1 >> num2>> num3 >> num4;
int divident = num1 + num2 + num3 + num4;
const int divisor {4};
double average{};
average = divident / divi... | ALGO | 0.934077 | 3.793771 |
4089bbaa-afc4-4e6d-a259-ac182e0745fa | anuragpatil11/DSA-GFG-Leetcode-Solved-Problems | Difficulty: Hard/Longest valid Parentheses/longest-valid-parentheses.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
int maxLength(string S){
// code here
stack<char>st;
//from left to right we mark
string s=S;
... | ALGO | 0.997565 | 5.311034 |
d8710eb5-ece0-45d9-b168-45208c8be478 | Altu-Bitu/Altu-Bitu-study | 0907 - map/1620.cpp | //
// Created by banya on 2021-09-10.
//
#include <iostream>
#include <map>
#include <string>
using namespace std;
int main() {
int n,m;
string input;
map<string, int> name;
map<int, string> number;
cin >>n>>m;
for(int i =1; i<=n;i++){
cin >> input;
name[input]=i;
numb... | ALGO | 0.999716 | 4.945073 |
3bbf1cd7-169d-4a35-8b4e-ba828438321e | LeonardoFassini/Competitive-Programming | URI/2832-TIMMY.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 100000000;
const int MAXV = 112345;
int n, f;
int v[MAXV];
int solve(int num){
int ans = 0;
for(int i = 0;i < n; i++){
ans += num/v[i];
}
return (ans >= f);
}
int bbin(int menor, int maior){
int ans;
int med;
while(maior > menor){
... | ALGO | 0.999928 | 3.930199 |
8dbdaa5f-cf7d-42ae-b90f-6a5246eec0f0 | caiomuniz/codcadSolutions | 164-determinante-matriz.cpp |
#include <iostream>
using namespace std;
int det(int m[][3]){
int dp, dn, tot;
dp = (m[0][0]*m[1][1]*m[2][2]) + (m[0][1]*m[1][2]*m[2][0]) + (m[0][2] * m[1][0] * m[2][1]);
dn = (m[0][0]*m[1][2]*m[2][1]) + (m[0][1]*m[1][0]*m[2][2]) + (m[0][2] * m[1][1] * m[2][0]);
return dp - dn;
}
int main(){
int m[3][3];
... | ALGO | 0.999987 | 3.524432 |
5cf813e8-cdde-4570-9fe0-657eefc7b021 | alexandraback/datacollection | solutions_2464487_1/C++/sohelH/a.cpp | #include<cstdio>
#include<iostream>
#include<queue>
#include<stack>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<sstream>
#include<cmath>
#include<cctype>
#include<cassert>
#include<cstring>
#include<cstdlib>
using namespace std;
// ------------- PRE-WRITTEN CODES ---------------------... | ALGO | 0.999836 | 3.988495 |
6300b887-74d4-450b-ac18-c64d7dfa81f4 | yzzupgo/MFTCG | Data/abc170_b/Laylania/ac/14306694.cpp | #include<bits/stdc++.h>
using namespace std;
int main(void) {
int X, Y;
cin >> X >> Y;
for (int c = 0; c <= 100; ++c) {
for (int t = 0; t <= 100; ++t) {
if ((c + t) == X && (2 * c + 4 * t) == Y) {
cout << "Yes" << endl;
return 0;
}
}
}
cout << "No" << endl;
}
| ALGO | 0.999976 | 3.2851 |
ad6268b9-e3d5-4179-aa9a-7e6c08b17b37 | anshul31901/DSA_practice | BS235. Lowest Common Ancestor of a Binary Search Tree(leetcode).cpp | https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/description/
/**
* 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:
Tree... | ALGO | 0.999994 | 6.298741 |
51628090-cf93-4a30-9513-58c81509a186 | EnzoHideki/algo | reference/halim/ch2/ch2_07_graph_ds.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> ii;
typedef vector<ii> vii;
int main() {
int V, E, total_neighbors, id, weight, a, b;
int AdjMat[100][100];
vector<vii> AdjList;
priority_queue< pair<int, ii> > EdgeList; // one way to store ... | ALGO | 0.999868 | 3.844124 |
8fbba922-bdb1-44f4-9cd1-21850db22bf3 | LeonSysprog/DijkstraAlgorithm | MinBinHeapVersion.cpp | #include <iostream>
#include <climits>
#include <queue>
#include <list>
#define V 8
using namespace std;
struct AdjListNode {
int endPoint, weight;
AdjListNode(int p, int w) : endPoint(p), weight(w) {}
};
struct Comparator {
bool operator() (pair<int, int> a, pair<int, int> b) {
return a.first >... | ALGO | 0.999758 | 5.055543 |
1fad8f14-ca4d-4d9f-aff0-e01013d6f468 | anandhu720/Leetcode-Solutions | 218-the-skyline-problem/218-the-skyline-problem.cpp | class Solution {
public:
vector<vector<int>> getSkyline(vector<vector<int>>& buildings) {
vector<pair<int, pair<int, int>>> sky;
//1 is start
//2 is end
for(auto v:buildings){
int start = v[0];
int finish = v[1];
int h = v[2];
sky.push_... | ALGO | 0.999958 | 6.180073 |
7cb70171-6e43-469f-85ae-b7f67e6aab68 | ailab-hanyang/Radar4VoxMap | thrid_party_library/g2o/g2o/solvers/cholmod/solver_cholmod.cpp | #include "linear_solver_cholmod.h"
#include "g2o/core/block_solver.h"
#include "g2o/core/solver.h"
#include "g2o/core/optimization_algorithm_factory.h"
#include "g2o/core/optimization_algorithm_gauss_newton.h"
#include "g2o/core/optimization_algorithm_levenberg.h"
#include "g2o/core/optimization_algorithm_dogleg.h"
... | TOOL | 0.991091 | 6.539937 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.