uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
85595033-05e7-4d8b-b4e0-cd6c34b3ba8e | ChenTanyi/small-c-compiler | testInput/gcd/gcd.cpp | int gcd(int a, int b){
if (!b)
return a;
return gcd(b, a % b);
}
int main(){
int a, b;
read(a);
read(b);
write(gcd(a, b));
} | ALGO | 0.999638 | 3.741856 |
ee719668-57ad-4dff-87b4-0fa0f1008a9e | Param129/codeforces | tempCodeRunnerFile.cpp | void countSort(vector<int>& arr) {
// int n = arr.size();
// int max_element = *max_element(arr.begin(), arr.end());
// vector<int> count(max_element + 1, 0);
// vector<int> output(n);
// for (int i = 0; i < n; i++)
// count[arr[i]]++;
// for (int i = 1; i <= max_element; i++)
// ... | ALGO | 0.999915 | 5.348589 |
96c631c1-8605-49ec-80e0-e1cd4bf2da2c | thebesttv/00.ACM | 01.UVa/11853.cpp | // Tag: i
// 判断左右边最北点:与顶端连通的所有与左右相交的圆的最南点
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<ctime>
#include<vector>
#include<queue>
#include<stack>
#include<list>
#include<set>
#include<map>
#include<utility>
#include<algorithm>
using namespace std;
#def... | ALGO | 0.999349 | 3.924238 |
56bbed68-73d2-4f3c-a648-b7017be94f7e | abdelrhman746/CPPBasics | Level2/Lessons/C6_L48.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int>num{ 1,2,3,4,5 };
//declare iterator
vector<int>::iterator iter;
// use iterator with for loop
for (iter = num.begin(); iter != num.end(); iter++)
{
cout << *iter << " ";
}
return 0;
}
| ALGO | 0.984376 | 3.591196 |
5bda9281-f351-40c4-b027-9c38012aec8f | Devang-soni/100DayOfCodeChallenge | Day3.cpp |
//Given an integer x, return true if x is a palindrome , and false otherwise.
class Solution {
public:
bool isPalindrome(int x) {
string str = to_string(x);
int l=0, r= str.size()-1;
while(1<=r){
if(str[l++] != str[r--])
return false;
}... | ALGO | 0.99975 | 5.619368 |
004f48b6-9baf-4759-949d-2577e91f6045 | trautschlaci/massp_sa | solvers/simulated_annealing/manager/state_manager.cpp | #include "state_manager.h"
#include "problem_constants.h"
bool StateManager::create_move(MoveBase* moveType) const
{
return moveType->create_random_move(random_selector, current_state);
}
long long int StateManager::delta_inspect_move(CostInspector& cost_inspector, MoveBase* moveType)
{
return moveType->delta... | ALGO | 0.963649 | 5.183576 |
74609231-3016-48cc-8ee9-3eb0cc40ced5 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3158_0.cpp | #include <bits/stdc++.h>
struct pairs {
char origen[30];
char destino[30];
int momento;
} pares[1010];
int amigos[1010];
int main() {
int n, d;
int t;
int i, j;
int k = 0;
int t2;
int y;
int flag;
scanf("%d%d", &n, &d);
for (i = 1; i <= n; i++) {
scanf("%s%s%d", pares[i].origen, pares[i].des... | ALGO | 0.999988 | 3.640375 |
9b844928-1134-4536-9d2e-a81c4ee21bc6 | dddddzc/MyLeetcodeSolutions | 70.爬楼梯.cpp | /*
* @lc app=leetcode.cn id=70 lang=cpp
*
* [70] 爬楼梯
*/
// @lc code=start
#include<vector>
using namespace std;
class Solution {
public:
int climbStairs(int n) {
if(n <= 1) return n;
// 如果 n = 1,那么只有一种
// 如果 n = 2,那么有两种 1 + 1 / 2
vector<int> dp(n + 1);
dp[1] = 1;
... | ALGO | 0.999866 | 5.884733 |
3a6b1668-ff3b-4c03-b931-8cc5c41c261e | sofikulsk02/DSA_in_c- | PatternsPractice3/bridge.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int m=n-1;
for(int i=1; i<=2*n-1; i++){
cout<<"*";
}
cout<<endl;
for(int i=1; i<=m; i++){
for(int j=1; j<=m-i+1; j++){
cout<<"*";
}
for(int k=1; k<=2*i-1; k++){
cout<<" ... | ALGO | 0.999982 | 3.451988 |
417f32e0-f04e-42a6-9510-1946381d7db9 | shvmsh20/GFG_POTD | Aug 2022/Max length chain.cpp | static bool cmp(val a, val b){
return a.second<b.second;
}
int maxChainLen(struct val p[],int n){
//Your code here
sort(p, p+n, cmp);
int count=1;
int end = p[0].second;
for(int i=1; i<n; i++){
if(p[i].first>end){
count++;
... | ALGO | 0.999441 | 4.740681 |
84f97fb1-7cce-4d94-b17a-0d588b1e06bd | zakisadique/TicTacToe | myCode/TicTacToeBotPlayer.cpp | /*
* Bot.cpp
*
* Created on: Nov 10, 2023
* Author: zakis
*/
/**
* @file TicTacToeBotPlayer.cpp
* @brief Implementation of the TicTacToeBotPlayer class.
*
* This file contains the implementation of the TicTacToeBotPlayer class,
* which represents a bot player for a Tic Tac Toe game.
*/
#include "TicT... | ALGO | 0.983593 | 6.254657 |
5eb86fd1-b9b7-49db-9a6e-8e75620262fd | dimaystinov/bitcoin | src/rpc/client.cpp | #include <rpc/client.h>
#include <util/system.h>
#include <set>
#include <stdint.h>
class CRPCConvertParam
{
public:
std::string methodName; //!< method whose params want conversion
int paramIdx; //!< 0-based idx of param to convert
std::string paramName; //!< parameter name
};
// clang-format... | CONFIG | 0.948108 | 7.610474 |
4cc13b0d-45b6-4817-a00d-3be7bf970cf2 | jovinlidan/competitive-programming | CodeForces/GNU C++14/71A | Way Too Long Words/64145642.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
string data[100];
for (i = 0; i < n; i++)
{
cin >> data[i];
}
for (i = 0; i < n; i++)
{
if (data[i].length() > 10) {
cout << data[i][0] << data[i].length() - 2 << data[i][data[i].length() - 1] << endl;
}
else
co... | ALGO | 0.999488 | 4.284884 |
a2367629-7878-48df-9fbf-ed07c43f257c | lfwxyC/sduoj | 13-t1.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios::sync_with_stdio(false);
ll l, r, k;
cin >> l >> r >> k;
bool flag = true;
for (int i = 0; i < 100; i++) {
ll mul = pow(k, i);
if (mul > r) break;
if (mul >= l) {
printf("%lld ... | ALGO | 0.999948 | 3.590406 |
23e1d473-423f-4e98-9b09-97b65d4c7919 | caiopetruccirosa/mc521-2022s1 | contest-2022-05-06/C.cpp | #include <bits/stdc++.h>
#include <stdio.h>
#define _ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
using namespace std;
int main() {_
int n, a, b, c;
cin >> n >> a >> b >> c;
int max_cuts = 0;
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= n; j++) {
... | ALGO | 0.999835 | 3.55336 |
3633c6af-790f-421f-a1eb-a917f88865b1 | 0x1Shub/Data-Structures-And-Algorithms | Striver DSA Sheet/1-Learn the basics/1.4-Basic Maths/04_GCD_or_HCF.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int findGcd(int n1, int n2)
{
int gcd = 1;
for (int i = 1; i <= min(n1, n2); i++)
{
if (n1 % i == 0 && n2 % i == 0)
{
gcd = i;
}
}
return gcd;
}... | ALGO | 0.999868 | 6.115492 |
122daefb-6889-4380-92a9-2cb7c27372f5 | Chuan81/Algorithm_Problem | LanQiao/25.02.27 simOJ/5.cpp | #include<bits/stdc++.h>
using namespace std;
int nmax = pow(2,24);
int main()
{
string s;
int ans=0;
bitset<24> bit();
for(int i=0;i<nmax;i++)
{
bitset<24> bit(i);
s=bit.to_string();
int cnt1=0;
bool isT=0;
for(int l=0;l<24-5+1;l++)
{
cnt1=0;
string s5 = s.substr(l,5);
for(int p=0;p<5;p++)
... | ALGO | 0.999167 | 3.607636 |
1b0f00c3-7cd0-474f-a990-0159485e509a | royalpranjal/LeetCode | Algorithms/Minimum Distance Between BST Nodes.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
void dfs(TreeNode* root, priority_queue<int>& q){
if(!root){
return;
... | ALGO | 0.999987 | 6.410647 |
51b4364a-0eec-41a3-bb3e-e232dce03811 | superboySB/agile_autonomy_ws | src/rotors_simulator/rotors_control/src/library/roll_pitch_yawrate_thrust_controller.cpp | #include "rotors_control/roll_pitch_yawrate_thrust_controller.h"
namespace rotors_control {
RollPitchYawrateThrustController::RollPitchYawrateThrustController()
: initialized_params_(false),
controller_active_(false) {
InitializeParameters();
}
RollPitchYawrateThrustController::~RollPitchYawrateThrustCon... | ALGO | 0.939853 | 7.261931 |
6d871551-8fb1-44c7-88d9-03b29e61760e | 21A91A05C1/GeeksforGeeks | Medium/Remove loop in Linked List/remove-loop-in-linked-list.cpp | //{ Driver Code Starts
// driver code
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int val)
{
data = val;
next = NULL;
}
};
void loopHere(Node* head, Node* tail, int position)
{
if(position==0) return;
Node* walk = head;
... | ALGO | 0.99992 | 4.259841 |
2cd08674-683e-4e31-9854-e4ef54bf35b0 | Milan-Bhingradiya/All_Flutter_projects | animation/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.998163 | 6.785645 |
2f491a3c-45db-4344-9497-1591b7d6ff55 | InFluX-M/Solving-Problem | Codeforces/50A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef string str;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const ll MOD = 1e9 + 7;
#define nl "\n"
#define fastio \
ios_base::sync_with_s... | ALGO | 0.99982 | 4.052374 |
9a8ba27b-e655-4557-851d-5ab108a07ed6 | mahimalmuntashir/CodeForces | 1300-1399/1316A-GradeAllocation.cpp | #include <cstdio>
int main(){
long t; scanf("%ld", &t);
while(t--){
long n, m; scanf("%ld %ld", &n, &m);
long long s(0);
for(long p = 0; p < n; p++){long x; scanf("%ld", &x); s += x;}
printf("%ld\n", (s < m) ? s : m);
}
return 0;
}
| ALGO | 0.999306 | 3.697913 |
540e34b4-e0b5-4d9a-9a9f-b8fc880289a0 | asrezoun/contest-programming | number theory/codeforces/B. Weird Subtraction Process.cpp | #include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<utility>
#include<climits>
#include<cstring>
#include<string>
#include<cmath>
#include<bitset>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define f first
#define s secon... | ALGO | 0.999829 | 3.250034 |
66321433-3525-4f6b-85c6-282d76c65ccb | nhan0504/Algorithm-Toolbox | Week3/fractional_knapsack.cpp | #include <iostream>
#include <vector>
#include<algorithm>
#include<map>
using namespace std;
bool cmp(pair<double,int>& i, pair<double,int>& j) {
return i.first > j.first;
}
double get_optimal_value(int capacity, vector<int> weights, vector<int> values) {
double value = 0.0;
map<double,int> compare;
for (int i = 0... | ALGO | 0.99998 | 4.811966 |
8b376562-9279-45f5-9118-36a6178de47a | ishandutta2007/codeforces | a_g/normal/1614/D1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> primes;
const int maxn = 5e6+2;
int main () {
ios_base::sync_with_stdio(0); cin.tie(0);
vector<int> is_prime(maxn, 1);
for (int i = 2; i < maxn; i++) {
if (is_prime[i]) {
primes.push_back(i);
for (int j = 2*i; j < max... | ALGO | 0.999884 | 3.908359 |
8b46251f-5003-4a17-88fb-0264c1f9375f | shelltdf/osgall | prebuild/boost_1_82_0/libs/msm/doc/HTML/examples/iPodSearchEuml.cpp | // same as iPodSearch.cpp but using eUML
// requires boost >= v1.40 because using mpl::string
#include <vector>
#include <iostream>
#include <boost/msm/back/state_machine.hpp>
#include <boost/msm/front/euml/euml.hpp>
#include <boost/msm/front/euml/stl.hpp>
using namespace std;
using namespace boost::msm::front::euml... | ALGO | 0.986677 | 5.675474 |
a9b8f846-3ed2-4ae6-909a-1c7b3ccb393d | AgredaLuis/Estructura-de-Datos-Cpp | Estructura-de-Datos-Cpp/Asignacion de la Universidad de EDD/Sexta Asignacion - Lista Circulares Doble/Lista Circular.cpp | #include <iostream>
#include <string>
using namespace std;
template<class T>
class Nodo {
Nodo<T> *previo;
Nodo<T> *proximo;
T clave;
public:
Nodo() {
previo = proximo = NULL;
}
void setPrevio(Nodo<T> *x) {
previo = x;
}
Nodo<T> *getPrevio() {
return previo;
}
void setProximo(Nodo<T> *x) {
proximo = ... | ALGO | 0.998579 | 5.351283 |
5bb6148a-a72f-40ee-9f58-99d8bcc2eaf9 | ishandutta2007/codeforces | enchom/normal/1609/D.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
int n, d;
int father[2011];
int sz[2011];
int Find(int ver)
{
if (father[ver] == 0)
return ver;
else
{
father[ver] = Find(father[ver]);
return father[ver];
}
}
int thisSize[1011];
void Union(int r1, int r2)
{
thi... | ALGO | 0.999939 | 3.795178 |
9e53cde4-3179-499b-8229-80e36715510f | DeshmukhNikita/cpp-programming | 33th practise program.cpp | /*
* File: main.cpp
* Author: Shree
*
* Created on March 23, 2021, 8:15 pm
8
* 8
* 7 */
#include<iostream>
using namespace std;
int add(int n);
int main() {
int n;
cout << "Enter a positive integer: ";
cin >> n;
cout << "Sum = " << add(n);
return 0;
}
int add(int n) {
if(n != 0)... | ALGO | 0.999551 | 4.356928 |
be363a52-06bc-47a1-9465-13ba38a26ae9 | RyanYunruiYang/notes | c++lippman/ch_11/11.28.cpp | /*
Exercise 11.28: Define and initialize a variable to hold the result of calling find on a
map from string to vector of int.
*/
#include <vector>
#include <list>
#include <map>
#include <string>
#include <iostream>
#include <utility>
using std::vector;
using std::list;
using std::map;
using std::string;
using std::p... | ALGO | 0.986206 | 5.053592 |
18813ba8-59a3-4cd2-9f46-41f9773bd987 | p0pular131/JaJuSung_HEVEN | main/jajusung_main/src/gps_stanley.cpp | #include "gps_stanley_h.h"
#include <iostream>
#include <utility>
#include <jajusung_main/HevenCtrlCmd.h>
#include <tf/transform_datatypes.h>
#include <cmath>
void GPS_STANLEY::init_dict()
/* INITIALIZE DICTIONARY!!! */
{
std::vector<std::string> csv_file_path = {
// "/home/heven/erp_ws/src/JaJuSung_HEVEN... | ALGO | 0.985528 | 4.433474 |
e5d5e6a7-ffc3-495a-8166-a3c67f67f131 | haarsh01/Recursion_solutions | substring.cpp | #include <iostream>
using namespace std;
void subseq(string s, string ans){
if(s.length()==0){
cout<<ans<<endl;
return;
}
char ch=s[0];
string ros=s.substr(1);
subseq(ros,ans);
subseq(ros,ans+ch);
}
int main(){
subseq("ABC" ,"");
cout << endl;
return 0;
} | ALGO | 0.999903 | 4.152096 |
d77e638d-be7e-4a1b-9112-4191b6afc867 | danielhO9/PS | ATCODER/abc390C.cpp | #include <bits/stdc++.h>
using namespace std;
int H, W;
char board[1000][1000];
void solve() {
cin >> H >> W;
for (int i = 0; i < H; ++i) {
string s; cin >> s;
for (int j = 0; j < W; ++j) board[i][j] = s[j];
}
int xmn = 1000, xmx = -1, ymn = 1000, ymx = -1;
for (int i = 0; i < H; ++i) for (int j = 0; j < W; ... | ALGO | 0.999974 | 4.117782 |
eda3e54b-f994-4578-8737-53b5395beb0d | tauhrick/Competitive-Programming | Upsolves/Atcoder/ABC-193-A.cpp | #ifndef LOCAL
#include <bits/stdc++.h>
using namespace std;
#define debug(...) 42
#else
#include "Debug.hpp"
#endif
class Task {
public:
void Perform() {
Read();
Solve();
}
private:
int a, b;
void Read() {
cin >> a >> b;
}
void Solve() {
double diff = a - b;
cout << fixed << set... | ALGO | 0.997944 | 4.226093 |
f34beecf-0379-4b30-b41d-caa40519855e | willswow/Core | dep/g3dlite/source/uint128.cpp | /**
@file uint128.cpp
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@author Kyle Whitson
@created 2008-07-17
@edited 2008-07-17
*/
#include "G3D/uint128.h"
namespace G3D {
/** Adds two 64-bit integers, placing the result and the overflow into 64-bit integers.*/
static void addAndCarry(const ... | ALGO | 0.973332 | 7.435829 |
2f8301a2-cbfb-482a-8d38-b3ccd444d49e | ZakRipoll/ACM | Backtracking/167.cpp | #include <iostream>
#include <string>
#include <sstream>
#define MAX 8
#define MAXMAX 64
using namespace std;
int main()
{
int loop, result, chessBoard[MAX][MAX];
string sqare;
cin >> loop;
for( unsigned i = 0; i < loop; ++i )
{
for( unsigned j = 0; j < MAX; ++j ){
cin >> sqare;
stringstream ss( sq... | ALGO | 0.994175 | 3.313487 |
0d6a3177-2513-4a66-9ce0-5325c8df2242 | kummandas/400DSA | BINARY SEARCH TREE/89.CPP | /*#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main()
{
// Given Appointments.
vector<vector<int> > v{
{ 1, 5 }, { 3, 7 }, { 2, 6 },
{ 10, 15 }, { 5, 6 }, { 4, 100 }
};
// sort according to start time of meet/appointment.
// sort(v.begin(), v.end());
// number of pair or appointments... | ALGO | 0.999814 | 5.215993 |
5b1cbe89-9959-46b2-a739-edaed1591126 | bharat1999/LeetHub | 354-russian-doll-envelopes/354-russian-doll-envelopes.cpp | class Solution {
static bool cmp(vector<int>& a, vector<int>& b){
if(a[0]==b[0]) return a[1] > b[1];
return a[0] < b[0];
}
public:
int maxEnvelopes(vector<vector<int>>& env) {
int n = env.size();
sort(env.begin(), env.end(), cmp);
vector<int> lis;
fo... | ALGO | 0.999997 | 6.040941 |
7e25a915-9cd8-4c8c-a7d7-ef85656c2192 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_2890_5.cpp | #include <bits/stdc++.h>
using namespace std;
int ans[111115];
int main() {
int i, a[10], k, j, len;
char str[10];
ans[111111] = 30;
ans[11112] = 15;
ans[1113] = 5;
ans[114] = 2;
ans[15] = 1;
ans[1122] = 8;
ans[123] = 3;
ans[24] = 2;
ans[222] = 6;
ans[33] = 2;
ans[6] = 1;
while (scanf("%s", ... | ALGO | 0.999663 | 3.57681 |
6eb9d8e3-ae99-4ad4-ba11-af32ac6a7ad8 | yoctoyotta1024/ValidatingCLEO | src/collisions/main_golovin.cpp | #include "./main_supplement.hpp"
inline MicrophysicalProcess auto create_microphysics(const Config &config,
const Timesteps &tsteps) {
const PairProbability auto prob = GolovinProb();
const MicrophysicalProcess auto colls = CollCoal(tsteps.get_collstep(), &step2... | ALGO | 0.949888 | 6.332061 |
b0a1356d-d692-473f-9e5a-a86d7d1fe054 | buaazmac/DBGAcc | applications/Megahit/src/localasm/local_assemble.cpp | #include "local_assemble.h"
#include <algorithm>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#include <omp.h>
#include "idba/contig_graph.h"
#include "idba/hash_graph.h"
#include "idba/sequence.h"
#include "kmlib/kmbit.h"
#include "hash_mapper.h"
#include "mapping_result_collector.h"
#... | ALGO | 0.994458 | 6.291502 |
5ac7ce7b-536c-40c6-891b-52694a0bec5e | PrveenYadav/DSA-Journey | 18_Stack and Queue/Lecture-57 Stack/code2.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
// Function to find the largest rectangle area in a histogram
int largestRectangleArea(vector<int>& heights) {
stack<int> st;
int maxArea = 0;
heights.push_back(0); // Add a dummy zero height to ensure stack empties
for (... | ALGO | 0.999997 | 7.079524 |
e5279513-f707-426b-b98a-83c37c44fb4b | abbash77/DSA | 965-univalued-binary-tree/965-univalued-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.999741 | 6.163665 |
b4dc72fa-2aa8-4592-8267-71bf09a10ce8 | rayhanulmukul/Structural-Programming-Language | @Contest && Codeforce/492B.cpp | #include <bits/stdc++.h>
#include<vector>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define ft front()
#define bk back()
#define pi 2*acos(0.0) /// acos(-1) , 3.14159265359
const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll BIG =... | ALGO | 0.999696 | 4.640654 |
d23c4bba-5dd5-483c-9e15-b151613037b7 | Federica-Martines/Esercitazione6_Sorting | Esercizio_2/main.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include <numeric> //per std::iota
#include <string>
#include "SortingAlgorithm.hpp"
using namespace std;
using namespace std::chrono;
using namespace SortLibrary;
double tempi_merge(vector<int>& data_merge)
{
vector<unsigned int> tempi_merge;
unsigned i... | ALGO | 0.999035 | 5.552283 |
463c09f3-4405-4b3f-808b-a87bf3466ddd | anishmehta24/cp | B_Shrink.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void solve() {
int n;cin >> n;
cout << 1 << " " ;
for(int i=n ;i>=2;i--) {
cout << i << " ";
}
cout << '\n';
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t = 1;
cin >> t;
while (t--)... | ALGO | 0.999842 | 4.657039 |
a383b9c3-419b-4a19-92b0-07f6f2b7b1aa | pranali21pawar/Competitive-Coding | HackerRank/Algorithms/CamelCase.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.999273 | 3.708195 |
b0e0fb95-3a74-42dc-9ce0-0fb10de4f5c0 | sairudraksh/DSA | 222-count-complete-tree-nodes/count-complete-tree-nodes.cpp | class Solution {
public:
int count(TreeNode* root){
if(root==NULL) return 0;
return 1+count(root->left)+count(root->right);
}
int countNodes(TreeNode* root) {
if(root==NULL) return 0;
return count(root);
}
}; | ALGO | 0.999861 | 6.297879 |
5d4237e0-7036-488e-ad62-60223986f3eb | drstone-genius04/opencv-using-flask- | modules/imgproc/src/featureselect.cpp | #include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencv2/core/openvx/ovx_defs.hpp"
#include <cstdio>
#include <vector>
#include <iostream>
#include <functional>
namespace cv
{
struct greaterThanPtr
{
bool operator () (const float * a, const float * b) const
// Ensure a fully determinis... | ALGO | 0.997892 | 6.696264 |
2ee0000b-3a18-4e41-8fe3-d38342bc33af | gakgonullu/data-structure-and-algorithms | oop_sorting.cpp | #include<vector>
#include <iostream>
using namespace std;
class Rational{
private:
int numer;
int denom;
public:
Rational(){
numer=0;
denom=1;
}
Rational(int n, int d){
numer=n;
denom=d;
}
~Rational(){;}
int getnum(){
return numer;
}
int getdenum(){
return denom;
}
friend ost... | ALGO | 0.999597 | 4.146371 |
51f27845-f814-4b49-af99-debe56d57522 | sarvex/leetcode-shakespeare | solution/1100-1199/1146.Snapshot Array/Solution.cpp | class SnapshotArray {
public:
SnapshotArray(int length) {
idx = 0;
arr = vector<vector<pair<int, int>>>(length);
}
void set(int index, int val) {
arr[index].push_back({idx, val});
}
int snap() {
return idx++;
}
int get(int index, int snap_id) {
auto... | ALGO | 0.99759 | 6.249122 |
6a2e004a-35b7-4ce8-b431-24ea1e8b7058 | shajunguang/Algorithm_competition | 537_Study/191011/map.cpp | #include <map>
#include <unordered_map>
#include <vector>
#include <iostream>
using namespace std;
map<string,int> mm;
vector<string> sto;
//return the index of sto
//while dealing with a lot of string , this function is useful
int string2int(string in){
if(mm.count(in))return mm[in];
else{
sto.push_back(in);
re... | TEST | 0.972617 | 3.664965 |
927c45d6-49bb-48d0-abbc-ebcbef55490b | 1010varun/Leetcode-Problems | 0278-first-bad-version/0278-first-bad-version.cpp | // The API isBadVersion is defined for you.
// bool isBadVersion(int version);
class Solution {
public:
int firstBadVersion(int n) {
int s = 1;
int e = n;
while(s < e) {
int mid = s + (e-s)/2;
if(isBadVersion(mid) == false) s = mid + 1;
else e = mid;
... | ALGO | 0.999815 | 6.597736 |
5e7bd616-1abb-453a-a946-aaf5ccef6c6b | lulyon/DPAlgorithm | DouglasPeucker.cpp | #include "DouglasPeucker.h"
double DouglasPeucker::PerpendicularDistance(MyPointStruct &point1, MyPointStruct &point2, MyPointStruct &point3)
{
// 点到直线的距离公式法
double A, B, C, maxDist = 0;
A = point2.Y - point1.Y;
B = point1.X - point2.X;
C = point2.X * point1.Y - point1.X * point2.Y;
maxDist = fabs((A * point3.X... | ALGO | 0.999656 | 4.239435 |
24c8c381-ab95-4057-9af0-ce60aa55c3a5 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6154_3.cpp | #include <bits/stdc++.h>
const int N = 4e5 + 3;
int fa[N], R[N], root[N];
long long Ans;
struct Segment_Tree {
int tot, sz[N * 20], son[N * 20][2];
long long sum[N * 20];
void Insert(int &x, int l, int r, int pos) {
if (!x) x = ++tot;
if (l == r) {
sz[x] = 1, sum[x] = pos;
return;
}
in... | ALGO | 0.999788 | 3.533577 |
e37b1bab-5011-4f89-b8a3-ed09839134fb | soyabali64/helloworldapplication | 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 |
90e5fd55-4f92-4bd2-b1e8-639060a5e636 | Apress/learn-cocos2d-game-dev-w-ios-5 | CH04_code/DoodleDrop04/libs/Box2d/Dynamics/Contacts/b2CircleContact.cpp | #include <Box2D/Dynamics/Contacts/b2CircleContact.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Collision/b2TimeOfImpact.h>
#include <new>
b2Contact* b2CircleContact::Create(b2Fixture*... | ALGO | 0.975689 | 6.919396 |
bd2ca0cc-9a53-4752-8e73-719d5fc38678 | 18-RAJAT/ONLINE-JUDGE | C_Weight_of_the_System_of_Nested_Segments.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
struct points
{
int wt,id,pos;
};
void sol()
{
int n,m;
cin>>n>>m;
vector<points>pt(m);
for(int i=0;i<m;++i)
{
cin>>pt[i].pos>>pt[i].wt;
pt[i].id=i+1;
}
sort(pt.begin(),pt.end(),[&](points a,points b)->boo... | ALGO | 0.999918 | 3.795117 |
e5e2b18f-1eea-4771-8471-6195923dfcca | Gaolious/algorithm | UVA-Online/Volume_001/126/126.cpp | // 125 - Numbering Paths
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_SIZE (80)
typedef struct _xy_ XY, *PXY;
struct _xy_
{
int coefficient ;
int exponential_x ;
int exponential_y ;
PXY prev, next ;
} ;
char *parse_positive_int(char *s, int *val)
{
int num = 0 ;
int... | ALGO | 0.998986 | 3.560911 |
82246501-55a2-4c54-aeed-a968d4253cfb | alexanderkjeldaas/boost-mirror | libs/mpi/src/computation_tree.cpp | // Compute parents, children, levels, etc. to effect a parallel
// computation tree.
#include <boost/mpi/detail/computation_tree.hpp>
namespace boost { namespace mpi { namespace detail {
int computation_tree::default_branching_factor = 3;
computation_tree
::computation_tree(int rank, int size, int root, int branchi... | ALGO | 0.999956 | 6.533988 |
cf6f74e6-44f3-485a-86d6-fc6942f0d571 | azanahmed000/C--Problem-Solutions | Switch Case/P#2 Identification of Vowels and consonants.cpp | #include<iostream>
using namespace std;
int main(){
char key;
cout<<"Enter any key ";
cin>>key;
switch(key)
{
case'a':
case'A':
cout<<"You Enter a Vowel";
break;
case'e':
case'E':
cout<<"You Enter a Vowel";
break;
case'I':
case'i':
cout<<"You Enter a Vowel";
break;
case'O':... | ALGO | 0.971555 | 3.001899 |
c5b83aae-5721-4011-a7d6-dd008bf54aff | SaulCondoriM/Analisis-de-Algoritmos | TAREA_01/workgroupsProjects.cpp | #include<iostream>
using namespace std;
template <typename T>
class CLinkedList {
private:
struct NODE {
T m_data;
NODE *m_pNext;
};
NODE* m_pRoot;
public:
CLinkedList() : m_pRoot(nullptr) {}
void Insert(T data) {
NODE* newNode = new NODE;
newNode->m_data = da... | ALGO | 0.99948 | 5.823921 |
9427f47b-4390-4e94-b3dd-6d8f858874af | SJMA11723/Problem-solving | codeforces/Codeforces Round 515 (Div. 3)/A.cpp | /**
* Author: Jorge Raul Tzab Lopez
* Github: https://github.com/SJMA11723
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t; cin >> t;
while(t--){
int L, v, l, r;
cin >> L >> v >> l >> r;
if(L < l) co... | ALGO | 0.999574 | 3.278307 |
d69f2546-eefd-4f6c-b00f-3e811c0c0640 | strawy12/Algorithm | Programmers/없는 숫자 더하기.cpp | #include <string>
#include <vector>
using namespace std;
int solution(vector<int> numbers) {
int answer = -1;
int size = numbers.size() + 1;
bool checkNum[10] = { false, };
for (int n : numbers)
{
checkNum[n] = true;
}
for (int i = 0; i <= 9; i++)
{
if (checkNum[i] ==... | ALGO | 0.998303 | 5.290565 |
a3f4647f-9574-4918-9a94-3d5fe2bc8d94 | Hanawh/LeetCode | 数据结构/队列&栈/目标和.cpp | class Solution {
public:
int findTargetSumWays(vector<int>& nums, int S) {
int count = 0;
DFS(nums, S, 0, 0, count);
return count;
}
void DFS(vector<int>& nums, int S, int sum, int i, int& count){
if(i == nums.size()){
if(sum == S){
++count;
... | ALGO | 0.999982 | 6.059721 |
33af32fa-fbf0-4080-b3db-c70875519da8 | sebi2805/An2 | ASD/lab3/p2/main.cpp | #include <iostream>
#include <string.h>
using namespace std;
struct stiva{
char val;
stiva *next;
}*prim;
char s[1001];
char peek(){
if(prim==NULL)
return 0;
return prim->val;
}
void add(int val){
if(prim==NULL){
prim= new stiva;
prim->next=NULL;
prim->val=val;
... | ALGO | 0.99996 | 3.457244 |
9e87cf43-bc38-49b7-8b6a-7af63d7317f3 | yinchuan/LeetCodeFly | Hard/1531_String_Compression_II.cpp | // https://leetcode.com/problems/string-compression-ii/?envType=daily-question&envId=2023-12-28
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <stack>
#include <numeric>
#include <queue>
#include <cmath>
#include "../lib/ListN... | ALGO | 0.999974 | 5.849749 |
f778c219-f7d7-41b8-bdb4-58b888e2fdf0 | schubertce/DFOR740-Final | FinalProject/main.cpp | #include <boost/asio.hpp>
#include <iostream>
#include <fstream>
#include <chrono>
#include <string>
#include <csignal>
#include <vector>
#include <sstream>
#include <regex>
#include <map>
using boost::asio::ip::tcp;
namespace asio = boost::asio;
namespace chrono = std::chrono;
asio::io_service io_service;
class Sim... | WEB | 0.981001 | 6.42733 |
fd69c18e-a07a-43a4-9d7b-d2d2d545605d | gautham227/Leetcode-submissions | 1669-merge-in-between-linked-lists/1669-merge-in-between-linked-lists.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:
ListNode* mergeInBetw... | ALGO | 0.999983 | 4.805244 |
3401fd8a-7c36-49bd-9ca1-8dd8356e4315 | Aty-0/S2DE | Libs/boost_1_76_0/libs/compute/example/vector_addition.cpp | #include <iostream>
#include <boost/compute/algorithm/copy.hpp>
#include <boost/compute/algorithm/transform.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/functional/operator.hpp>
namespace compute = boost::compute;
// this example demonstrates how to use Boost.Compute's STL
// implementa... | ALGO | 0.998986 | 5.966454 |
5597b7e7-4587-4f79-a02a-af7df2bdb0f1 | sheriby/LeetCode | NowCoder/HJ13.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> strs;
string str;
while (cin >> str) strs.push_back(str);
for (int i = strs.size() - 1; i >= 0; --i) {
cout << strs[i] << " ";
}
return 0;
} | ALGO | 0.991673 | 4.60998 |
1be4947c-e062-485e-b3d0-2f9722a0d34e | C0ldSmi1e/CompetitiveProgramming | Contests/CodeforcesCodeforcesRound933Div.3/G_RudolfandSubway.cpp | /**
* Author: C0ldSmi1e
* Created Time: 03/13/2024 02:08:30 PM
**/
// time-limit: 2000
// problem-url: https://codeforces.com/contest/1941/problem/G
#include <bits/stdc++.h>
using namespace std;
#ifdef DANIEL_DEBUG_TEMPLATE
#include "../debug.h"
#else
#define debug(...) 42
#endif
int main() {
cin.tie(nullptr)->... | ALGO | 0.999952 | 6.217071 |
16d48805-4e06-4890-87c2-de895b0c833e | libigl/libigl-legacy | python/py_igl/py_barycentric_coordinates.cpp | m.def("barycentric_coordinates", []
(
const Eigen::MatrixXd& P,
const Eigen::MatrixXd& A,
const Eigen::MatrixXd& B,
const Eigen::MatrixXd& C,
const Eigen::MatrixXd& D,
Eigen::MatrixXd& L
)
{
return igl::barycentric_coordinates(P, A, B, C, D, L);
}, __doc_igl_barycentric_coordinates,
py::arg("P"), py::arg(... | ALGO | 0.997528 | 6.713926 |
119cbd6b-327f-4e8c-8b6f-82121ae87c80 | HemaGarima/DSA-Cpp | 16_Linkedlist_insertion.cpp | // Insertion in a linked list in C++ language.
#include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
void linkedlistTraversal(Node* ptr){
while(ptr != NULL){
cout<<"Element : "<<ptr->data<<endl;
ptr = ptr->next;
}
}
// Case :... | ALGO | 0.999817 | 5.176428 |
b0ae30ef-787f-45a1-9c85-789b16d534bf | Louis-Leee/Animate3DGS | Language_embedded_3DGS/submodules/diff-gaussian-rasterization_contrastive_f/third_party/glm/test/gtx/gtx_simd_mat4.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... | TEST | 0.981842 | 6.514054 |
3728c359-55e4-4347-9923-324d318c9cd6 | yeshenyong/Wiki_Wiki | LeetCode/二叉树/110. 平衡二叉树$.cpp | class Solution {
public:
int getDepth(TreeNode *root) {
if (root == NULL) return 0;
int leftDepth = getDepth(root->left);
if (leftDepth == -1) return -1;
int rightDepth = getDepth(root->right);
if (rightDepth == -1) return -1;
return abs(leftDepth-rightDepth)>1?-1:1+m... | ALGO | 0.999933 | 6.34962 |
a9eada39-4554-4e74-83e7-bd0c83a1bbbb | ishandutta2007/codeforces | kdvinit/normal/1560/F1.cpp | /*
K.D. Vinit |,,|
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<int> kk[3][10][11];
void solve()
{
int n, k;
cin>>n>>k;
string nn = to_string(n);
int y = nn[0]-'0';
if(k==1) y=0;
int m = nn.size();
int ans = n*100, val=-1;
for(auto x: kk[k][y][m])
... | ALGO | 0.999432 | 4.246191 |
ff2e263a-780c-4020-979a-9ef55b892e17 | ishandutta2007/codeforces | enjapma/normal/1479/B1.cpp | #include <bits/stdc++.h>
#include <numeric>
using namespace std;
// using mint = long double;
// using mint = modint998244353;
// using mint = modint1000000007;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> T;
typedef pair<ll, vector<ll> > Pd;
const ll INF = 1e18;
const ll fact_table = 3200008;
... | ALGO | 0.999974 | 4.374971 |
e66b8517-7a75-4160-a560-681ef56b01fe | morrazzzz/Nocturning-studio-project-X | xrSound/SoundRender_Core_Processor.cpp | #include "stdafx.h"
#pragma hdrstop
#include <cl_intersect.h>
#include "SoundRender_Core.h"
#include "SoundRender_Emitter.h"
#include "SoundRender_Target.h"
#include "SoundRender_Source.h"
CSoundRender_Emitter *CSoundRender_Core::i_play(ref_sound *S, BOOL _loop, float delay)
{
VERIFY(S->_p->feedback == 0);
CSoundRe... | TOOL | 0.908803 | 4.798895 |
dd192f1a-efa8-4860-92fb-9bc6c0a93c87 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_557_8.cpp | #include <bits/stdc++.h>
using namespace std;
signed main() {
long long int n;
cin >> n;
pair<long long int, long long int> a[n];
for (long long int i = 0; i < n; i++) {
cin >> a[i].first >> a[i].second;
}
vector<long long int> v;
long long int c = 0;
for (long long int i = 0; i < n; i++) {
if (... | ALGO | 0.999869 | 3.847373 |
f2d0e496-51ce-4586-a4ea-57dd56d1164e | ishandutta2007/codeforces | monogon/normal/1214/B.cpp |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int b, g, n;
int main() {
ios::sync_with_stdio(false);
cin >> b >> g >> n;
cout << min(b, n) - n + min(g, n) + 1 << endl;
} | ALGO | 0.99902 | 3.134699 |
b93ca234-ae8f-4946-a3f1-a673788b4d19 | Volgarenok/spbspu-labs-2024-tp-a | agarkov.sergey/T2/main.cpp | #include <iostream>
#include <limits>
#include <vector>
#include <iterator>
#include <algorithm>
#include "datastruct.hpp"
int main()
{
std::vector< agarkov::DataStruct > data;
while (!std::cin.eof())
{
using iter = std::istream_iterator< agarkov::DataStruct >;
std::copy(iter{std::cin}, iter{}, std::back_... | ALGO | 0.987703 | 4.332168 |
263e3ab5-7640-41e9-9808-4da9e14a2f66 | JeffMony/AndroidFFmpegCompile | fdkaac-src/libFDK/src/FDK_crc.cpp | /* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
The Fraunhofer FDK AAC Codec Lib... | TOOL | 0.994494 | 5.495261 |
6939f9bd-3e7a-4f32-9f58-bd2f7c0a2be9 | GustavoLopesOliveira/Programacao_Competitiva | Codeforces/QuestoesAleatorios/comoEstaSuaLogica.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
vector<int> vet(n);
int nNeg = 0, nPos = 0;
for(int i = 0; i < n; i++){
cin >> vet[i];
if(vet[i] > 0){
nPos++;
}else{
nNeg++;
}
}
cout << ((nPos > nNeg) ? nPos... | ALGO | 0.999981 | 4.498602 |
a65dd243-d36a-409e-9047-1853ffcf8507 | CodeFromRahul/DSA-c- | evenodd.cpp | #include<iostream>
using namespace std;
bool iseven(int n){
if(n&1){
return 0;
}
return 1;
}
int main(){
int num ;
cout<<"Enter the number "<<endl;
cin>>num;
if(iseven(num)){
cout<<"Even"<<endl;
}
else{
cout<<"odd"<<endl;
}
return 0;
} | ALGO | 0.999519 | 3.496085 |
409fe3db-29c7-4080-b2ee-21d2cccca578 | noochila/-DSA- | Difficulty: Easy/Coverage of all Zeros in a Binary Matrix/coverage-of-all-zeros-in-a-binary-matrix.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int findCoverage(vector<vector<int>>& matrix) {
// Code here
int ans=0;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
for(int i=0;i<matrix.size();i+... | ALGO | 0.99987 | 6.424484 |
940fdf1e-246f-4fa8-9a01-a630d8c92baf | mirinta/leet_code | binary_search/0644_maximum_average_subarray_II.cpp | #include <vector>
/**
* You are given an integer array nums consisting of n elements, and an integer k.
*
* Find a contiguous subarray whose length is greater than or equal to k that has the maximum
* average value and return this value. Any answer with a calculation error less than 10^-5 will be
* accepted.
*
... | ALGO | 0.999962 | 6.890201 |
fd839407-7d04-4628-917b-9b0aac5bad20 | masud-rana44/BeeCrowd | 1036.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
double a, b, c, R1, R2;
cin >> a >> b >> c;
if((((b*b)-4*a*c)<0) || a==0 || b==0 || c==0){
cout << "Impossivel calcular" << endl;
}
else{
R1 = (-b + sqrt((b*b)-4*a*c))/(2*a);
R2 = (-b - sqrt((b*b)-4*a*c))/(2*a);
... | ALGO | 0.999911 | 4.518581 |
7340ab04-cd36-4443-a524-4de62486fd52 | oMadMano/SunWellCore | src/server/scripts/Northrend/VioletHold/boss_erekem.cpp | /*
REWRITTEN FROM SCRATCH BY PUSSYWIZARD, IT OWNS NOW!
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "violet_hold.h"
enum eSpells
{
SPELL_BLOODLUST = 54516,
SPELL_BREAK_BONDS = 59463,
SPELL_CHAIN_HEAL_N = 54481,
SPELL_CHAIN_HEAL_H = 59473,
SPELL_EARTH_SHIELD_N = 5... | TOOL | 0.867905 | 3.374655 |
0f2f1c5c-4c88-4a8b-ba6f-7dafe0dde992 | Rpeng666/NUAA_DataStructure_2021 | CourseDesign/MustToDo/T4/T4/main.cpp | #include<iostream>
#include"bus.h"
#include<string>
using namespace std;
int main() {
string from, to;
vector<string>temp;
cout << "#######Ͼйʾϵͳ######" << endl << endl;
cout << ": ";
cin >> from;
cout << endl << "Ŀĵ: ";
cin >> to;
cout << endl;
Bus bus_1,bus_2;
bus_1.createGraph();
bus_2.createGraph();
t... | ALGO | 0.999502 | 3.633528 |
c002249a-c8e5-41da-9235-b52ecbff0c4c | EKRoy/daily-practics-problem | week-19/day1/B_Forming_Triangles.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define TC(t) int t; cin >> t; for(int i = 1; i <= t; i++)
#define pii pair<int,int>
#define ft ios::sync_with_stdio(false); cin.tie(NULL);
#define endl "\n"
#define pb push_back
#define... | ALGO | 0.999904 | 4.269554 |
215c4360-6c38-41b7-8dea-5cf5dcfd14c3 | sinian666/codes_41_1 | cpp_副本14/chapter_graph/graph_adjacency_matrix.cpp | /**
* File: graph_adjacency_matrix.cpp
* Created Time: 2023-02-09
* Author: what-is-me (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 基于邻接矩阵实现的无向图类 */
class GraphAdjMat {
vector<int> vertices; // 顶点列表,元素代表“顶点值”,索引代表“顶点索引”
vector<vector<int>> adjMat; // 邻接矩阵,行列索引对应“顶点索引”
public:
/* 构造方法 */
... | ALGO | 0.999625 | 6.27092 |
89865000-0475-4cd3-abfe-15ac624e0d82 | TeCSAR-UNCC/gem5-SALAM | src/systemc/tests/systemc/misc/synth/combo/switch4/switch4.cpp | /*****************************************************************************
switch4.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/****************************************************************************... | ALGO | 0.961755 | 5.225846 |
bd89b8a3-88e4-4f39-baea-4f08f40b4f64 | Tracktion/tracktion_engine | modules/tracktion_engine/3rd_party/soundtouch/source/SoundTouch/BPMDetect.cpp | #define _USE_MATH_DEFINES
#include <math.h>
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <cfloat>
#include "FIFOSampleBuffer.h"
#include "PeakFinder.h"
#include "BPMDetect.h"
using namespace soundtouch;
// algorithm input sample block size
static const int INPUT_BLOCK_SIZE = 2048;
// decimate... | ALGO | 0.99876 | 4.551571 |
3b54c865-08af-40f8-98db-c5bd92137809 | biswajit-k/DSA | leetcode/problems/partition_array_such_that_maximum_difference_is_k/solution.cpp |
class Solution {
public:
int partitionArray(vector<int>& nums, int k) {
sort(nums.begin(), nums.end());
int c = 0, s = 0, n = nums.size();
for(int i = 1; i < n;i++)
{
if(nums[i] - nums[s] > k)
{
c++;
s = i;
}
}
c++;
return c;
}
}; | ALGO | 0.999949 | 5.656569 |
dddf2250-dac4-4afd-85e0-16c233625b01 | destroller22/RenegadosWoW | src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp | /* ScriptData
SDName: Instance_Onyxias_Lair
SD%Complete: 100
SDComment:
SDCategory: Onyxia's Lair
EndScriptData */
#include "ScriptMgr.h"
#include "AreaBoundary.h"
#include "CellImpl.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "Map.h"
#include "onyxias_lair.h"
#include "TemporarySummon.h"
B... | TOOL | 0.87588 | 5.939243 |
1d5d77b6-9c4c-420c-9b33-0b69c741544f | lowsfish/OI | tyvj/1214硬币问题.cpp | #include<cstdio>
#include<algorithm>
const int MAXN=100+5;
const int INF=1<<28;
const int MAXS=10000+5;
int a[MAXN];
int dpmin[MAXS],dpmax[MAXS];
int n,s;
int srcmin(int sum)
{
if(sum==0) return 0;
if(dpmin[sum]>0) return dpmin[sum];
int ans=INF;
for(int i=0;i<n;++i) if(sum>=a[i])
ans=std::min(ans,srcmin(sum-a[i]... | ALGO | 0.999305 | 3.479378 |
48983ac0-ef79-4b88-ab25-9f78a56ee03c | Puci123/Dijkstra | dijktstra.cpp | #include<fstream>
#include<iostream>
#include<chrono>
#include "AdjacencyMatrix.h"
#include "IncidenceMatrix.h"
#include "AdjcencyList.h"
#include "EdgeList.h"
#include "PriorityQueueArray.h"
#include "Heap.h"
#include "FiboHeap.h"
#include "LinqedListQueue.h"
#include "Node.h"
#define MAX_EDGE_WEIGHT 100;
const cha... | ALGO | 0.943432 | 4.367234 |
c8c7cb75-d9ac-4676-be0a-e9877513b6f8 | manikanta2901/ubuntu | .history/practice/cpp/Hackerrank/Ds/Array/hourglass_20210319105423.cpp | #include <bits/stdc++.h>
using namespace std;
// Complete the hourglassSum function below.
int hourglassSum(vector<vector<int>> arr) {
int max = INT_MIN;
i
for(int i = 0; i < 6; i++){
}
}
int main()
{
ofstream fout(getenv("OUTPUT_PATH"));
vector<vector<int>> arr(6);
for (int i = 0; i <... | ALGO | 0.999285 | 5.373393 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.