uuid stringlengths 36 36 | repo_name stringlengths 5 133 | relative_path stringlengths 3 3.76k | content stringlengths 282 4.03M | category stringclasses 6
values | algo_rel_score float32 0.9 1 | quality_score float32 3 8.13 | source_meta dict |
|---|---|---|---|---|---|---|---|
e09ba594-1836-4e9c-8955-fd263f9e0824 | davidseungjin/CPP-DSA | class_Spring_2019/hw9/ref_07.cpp | /*
https://rosettacode.org/wiki/Dijkstra%27s_algorithm#C.2B.2B
Solution follows Dijkstra's algorithm as described elsewhere. Data like min-distance, previous node, neighbors, are kept in separate data structures instead of part of the vertex. We number the vertexes starting from 0, and represent the graph using an ad... | ALGO | 0.999979 | 5.763796 | {
"github_metadata": {
"branch": "master",
"commit_count": 190,
"repo_created_at": "2019-04-15T08:24:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d98c664e... |
9fb04e1d-87af-4e1d-9049-85126d1289e6 | pederfo/Project4 | project4/main.cpp | /*
Program to solve the two-dimensional Ising model
with zero external field.
The coupling constant J = 1
Boltzmann's constant = 1, temperature has thus dimension energy
Metropolis sampling is used. Periodic boundary conditions.
*/
#include <cmath>
#include <iostream>
#include <fstream>
#include <iomani... | ALGO | 0.999813 | 5.375904 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2015-10-28T13:35:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6016a001b... |
6b9206ec-2ca1-4f54-9765-ce8d14996c6c | clau224/leetcode | leetcode-cn/133. 克隆图.cpp | /*
* 133. 克隆图.cpp
*
* Created on: 2018年9月15日
* Author: garvin
*/
/*
克隆一张无向图,图中的每个节点包含一个 label (标签)和一个 neighbors (邻接点)列表 。
OJ的无向图序列化:
节点被唯一标记。
我们用 # 作为每个节点的分隔符,用 , 作为节点标签和邻接点的分隔符。
例如,序列化无向图 {0,1,2#1,2#2,2}。
该图总共有三个节点, 被两个分隔符 # 分为三部分。
第一个节点的标签为 0,存在从节点 0 到节点 1 和节点 2 的两条边。
第二个节点的标签为 1,存在从节点 1 到节... | ALGO | 0.999119 | 5.896194 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-07-02T13:46:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "327a6d8d6... |
dee988b1-7577-4f17-ba92-a0980971c6e3 | ITC-Vanadzor/ITC-7 | Gevor_Vardanyan/Homeworks/19.11.15/char_massiv.cpp | // [] {} "" '' ete meknumeki zuygy chka ktpi vor textum sxal ka
#include <iostream>
#include <cstring>
int main()
{
char ch[100];
std::cout<<"TEXT->";
std::cin>>ch;
int flag[6]={0};
int n = strlen(ch);
for(int i = 0; i < n; ++i)
{
if(ch[i] == '[' ){
++flag[0];
... | ALGO | 0.945972 | 3.396308 | {
"github_metadata": {
"branch": "master",
"commit_count": 3066,
"repo_created_at": "2015-10-21T19:38:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "337365e7... |
34e9bff2-14fe-4040-991b-c49c330513b2 | ishandutta2007/codeforces-p | pavlekn/normal/1037/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 2e9;
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n;
cin >> n;
vector<vector<int>> g(n);
for (int i = 0; i < n - 1; ++i)
{
int u, v;
cin >> u >> v;
-... | ALGO | 0.999992 | 4.707341 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2aa024e8280c... |
3d5783e1-e946-4293-81f7-c86a525d2c1e | EvgeniyZubov/KHAI | lab10/lab10.cpp | #include <iostream>
using namespace std;
struct TTriangle {
struct TPoint {
float X, Y;
};
TPoint A;
TPoint B;
TPoint C;
void enter(TTriangle& Triangle) {
cout << "Enter X of A point: ";
cin >> Triangle.A.X;
cout << "Enter Y of A point: ";
cin >> Triangle.A.Y;
cout << "Enter X of B point: ";
cin... | ALGO | 0.95373 | 3.487002 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-12-16T14:12:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5838f8e2b68... |
be55a682-e80c-43bb-b526-df8480a3b592 | rawan-sleem/LeetCode | 1-two-sum/two-sum.cpp | // Time O(n)
// Space O(n) if store all element in the hash table
// Idea hash table to store the element and index of it and make compare
/* Trace => Input = {2, 7, 11, 15} int target = 9
loop on nums
nums[0]=2 check if target -nums[i]=7 in exists in the hash table (not found ) store the element and the index ... | ALGO | 0.999983 | 5.999198 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-02-04T22:35:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc81db41145... |
22a00452-e3ba-4d59-be00-c5bb9063f168 | ayushkr667/Must_Do_Problems | Day17 (Binary Tree)/Top View of Binary Tree.cpp | // Given below is a binary tree. The task is to print the top view of binary tree.
// Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. For the given below tree
// 1
// / \
// 2 3
// / \ / \
// 4 5 6 7
// Top view will be: 4 2 1 3 7
// No... | ALGO | 0.999998 | 5.685021 | {
"github_metadata": {
"branch": "main",
"commit_count": 272,
"repo_created_at": "2021-06-25T12:46:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbf9995064... |
52ef5d23-cd69-43f9-ba43-0c8d18b73666 | rynnxz/sorting-cpp | insertsort.cpp | #include <iostream>
using namespace std;
// function untuk mengganti element
void swap(int &a, int &b) {
int temp = a;
a = b;
b = temp;
}
// function untuk print array
void printArray(int arr[], int size) {
for (int i = 0; i < size; i++)
cout << arr[i] << " ";
cout << endl;
}
// Insertion... | ALGO | 0.999978 | 5.43807 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-27T16:05:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9334c5aed1a... |
50fccbed-f357-4616-a055-e591e6534437 | jiangxubin/decoder | decoder-cpp/lm/interpolate/backoff_reunification.cc | #include "lm/interpolate/backoff_reunification.hh"
#include "lm/common/model_buffer.hh"
#include "lm/common/ngram_stream.hh"
#include "lm/common/ngram.hh"
#include "lm/common/compare.hh"
#include <algorithm>
#include <cassert>
namespace lm {
namespace interpolate {
namespace {
class MergeWorker {
public:
MergeWork... | ALGO | 0.997449 | 6.309981 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-09-11T09:11:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e75f04254... |
b6cf2c62-e95e-4c55-8b09-084af03b5c83 | evga7/codeforces | Codeforces_#579_01.cpp | /*
¹®Á¦
A. Circle of Students
There are n students standing in a circle in some order. The index of the i-th student is pi. It is guaranteed that all indices of students are distinct integers from 1 to n (i.?e. they form a permutation).
Students want to start a round dance. A clockwise round dance can be started if t... | ALGO | 0.99998 | 4.580208 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-08-31T12:41:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e95d7a4d4... |
cf0c29b9-b30f-40df-a699-2c740a99ffc9 | Shahraaz/CP_S5 | codechef/KodeKombat'19/a.cpp | //Optimise
#include <bits/stdc++.h>
using namespace std;
// #define multitest 1
#ifdef WIN32
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
#define pc(...) PC(#__VA_ARGS__, __VA_ARGS__);
template <typename T, typename U>
ostream &operator<<(ostream &out, const pair<T, U> &p)
{
out << '[' << p.first << ", " << p.secon... | ALGO | 0.99995 | 3.802751 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2019-07-15T23:57:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39e15a45... |
dac17726-0f51-49a1-b5ef-6de523b33f8e | AbasarAhmad/DSA_Practice | stack/12_InsertPrevious.cpp | // Iput= [2,1,4,3]
// Output={ 1,-1,3,-1}
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
void print(vector<int> vt)
{
for (int i = 0; i < vt.size(); i++)
{
cout << vt[i] << " ";
}
}
vector<int> PushNextSmallerElement(vector<int> &vt, int n)
{
stack<int> s... | ALGO | 0.999985 | 4.569829 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-28T19:29:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e01157e0199e... |
33c6d550-6d49-440b-b6ff-8ae2525e57a7 | DortyTheGreat/Code-Samples | C++/SportProg/MTUCI/stepik/binomial/main.cpp | /*
#include <iostream>
using namespace std;
void YesNo(bool a){
if(a) cout << "true\n";
else cout << "false\n";
}
int main()
{
int a = 0;
YesNo(a = 1); /// (1)
YesNo(a = 0); /// (2)
a = 0;
YesNo(a == 1); /// (3)
YesNo(a == 0); /// (4)
///YesNo(1 = 1); (5)
YesNo(1 == 1); /// (6)... | ALGO | 0.998747 | 3.674981 | {
"github_metadata": {
"branch": "main",
"commit_count": 317,
"repo_created_at": "2022-03-17T13:47:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0de05f3ec8... |
c9c7b425-9618-4c74-9e4a-82ddb3e4293e | SebastianJaroszek/zadania-hackerrank | find-digits/FindDigits.cpp | #include <bits/stdc++.h>
using namespace std;
/*
korzystając z wiedzy o tym, że:
5 to 12345 % 10
4 to 12345 / 10 % 10
3 to 12345 / 100 % 10
2 to 12345 / 1000 % 10
1 to 12345 / 10000 % 10
*/
// Complete the findDigits function below.
int findDigits(int n) {
int numberLength = to_string(n).length();
int divis... | ALGO | 0.998964 | 5.653324 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-06-21T18:46:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a7d3b881... |
37b03da9-83b8-4ab8-a0f7-c589fd5b54e2 | donnyrla10/CodingTest | BOJ/cpp/17609.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
bool checkP(string s){
int l = 0, r = s.size()-1;
while(l<r){
if(s[l] != s[r]) return false;
else{
l++; r--;
}
}
return true;
}
void ccheck(string s){
int l = 0, r = s.size() - 1;
... | ALGO | 0.999985 | 3.867337 | {
"github_metadata": {
"branch": "main",
"commit_count": 457,
"repo_created_at": "2022-01-16T07:00:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7fbc97c1b... |
f019aeda-6d9b-4ab6-ada9-18b7e7313452 | joris997/cassie_ws_tmp | src/cassie_controllers/include/cassie_controllers/OUTPUT_HLIP.hpp |
#ifndef OUTPUT_HLIP_HPP
#define OUTPUT_HLIP_HPP
#include <cassie_description/cassie_model.hpp>
#include <ros_utilities/ros_utilities.hpp>
#include <cassie_common_toolbox/PhaseVariable.hpp>
#include <cassie_common_toolbox/smoothing.hpp>
#include <std_srvs/Empty.h>
#include <ros_utilities/timing.hpp>
// #include <cassi... | TOOL | 0.978022 | 5.129319 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-01-05T09:06:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0107b96939... |
327cbc6b-d670-457f-8ac4-7b7c0f7837a9 | Nikhil-687/Cpp-Codes-and-Contests | CodeForces.cpp/Problemset/1841B.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define int long long
#define endl '\n'
#define all(x) x.begin(), x.end()
#define pb push_back
#define pob pop_back
#define mp make_pair
#define fi first
#define se second
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<in... | ALGO | 0.999988 | 4.113257 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-02-09T23:30:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7467f3cd17c... |
68caf202-5634-4b97-986c-ab9adc4fedcc | akkasturi/practice | round2/cpp/dpBinomialCoefficients.cpp | #include <iostream>
using std::cout;
using std::endl;
//skiena 279, search google.
int binomialCoeff(int n, int k)
{
if (k == 0 or k == n) return 1; //base condition
return (binomialCoeff(n-1,k-1) + binomialCoeff(n-1,k));
}
int dpBinomialCoefficient(int n, int k)
{
const int MAX_M = 10;
const int MAX_N = 1... | ALGO | 0.999949 | 5.684749 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-06-12T13:59:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77d63dc27... |
af1827b5-fd85-4ed8-b1fc-c892447a24de | lanlei/PD-IPC-ArmadilloDemo | Bow/Physics/FixedCorotated.cpp | #include "FixedCorotated.h"
#include <Bow/Math/SVD.h>
#include <Bow/Math/PolarDecomposition.h>
#include "ConstitutiveModel.h"
#include <Bow/Math/Utils.h>
#include <Bow/Math/MathTools.h>
namespace Bow {
namespace ConstitutiveModel {
namespace FixedCorotated {
namespace internal {
template <class DerivedV, class Derived... | ALGO | 0.999422 | 7.572038 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-06-27T03:39:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c018429b2b4... |
bcd3926a-2448-438a-89a5-370dfb1b321d | renatocjn/LTE-Sim_NB-IoT | src/utility/frequency-reuse-helper.h | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2010,2011,2012,2013 TELEMATICS LAB, Politecnico di Bari
*
* This file is part of LTE-Sim
*
* LTE-Sim is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* p... | TOOL | 0.983466 | 4.13387 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-10-17T16:02:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0535a913... |
15e56738-71b0-49c2-aec3-4dd0fc87560f | WIZARD-CXY/p | 1611.cpp | /*************************************************************************
> File Name: 1611.cpp
> Author:
> Mail:
> Created Time: Tue 25 Nov 2014 12:58:52 PM CST
************************************************************************/
#include<iostream>
using namespace std;
#include<cstdio>
int num[30001]; /... | ALGO | 0.99991 | 3.620508 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2013-11-18T12:24:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aed10b0f7... |
cd6cc339-def2-466c-bb67-301f27d6aea3 | eiichiromomma/pcl_samples | regionGrowing/main.cpp | #include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/common/common.h>
#include <pcl/segmentation/sac_segmentation.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/radius_outlier_removal.h>
#include <pcl/features/normal_3d.h>
#include <pcl/segmentation/region_growing.h>
#include <pcl/visualizati... | ALGO | 0.963457 | 5.914738 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-09-19T09:32:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8fa62ee8... |
aed5bbae-eb1e-4c70-97ac-3eb8e4f58bd7 | gengdd/Leetcode | 3_无重复字符的最长子串.cpp | #include<iostream>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<map>
#include<algorithm>
#include<vector>
using namespace std;
class Solution {
public:
int lengthOfLongestSubstring(string s) {
int res = 0, left = -1, n = s.size();
unordered_map<int, int> m;
for (int i = 0; i < n; +... | ALGO | 0.999755 | 4.953575 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-25T10:57:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5ea6b77b6... |
49cf76ba-8893-4739-87fb-8df525e233f2 | strategist614/ACM-Code | 刷题比赛/算法竞赛进阶指南/BZOJ2818.cpp | /**************************************************************
Problem: 2818
User: strategist614
Language: C++
Result: Accepted
Time:1632 ms
Memory:183496 kb
****************************************************************/
/*
独立思考
一个题不会做,收获5%,写了代码10%,提交对了30%,总结吃透了这个题才是100%.
*/
#include<b... | ALGO | 0.999964 | 3.847108 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-24T07:35:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6eae46170f... |
22987af8-ae67-42e4-811e-80ff1c0c1620 | Terpodia/Competitive-Programming | Problems Solved/Codeforces/Greedy/Histogram Ugliness.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;
using ll = long long;
const int MAXN = 4e5;
int n;
ll a[MAXN];
ll solve() {
if (n == 1) return a[0];
ll cnt = 0;
for (int i = 0; i < n; i++) {
if (i == 0 && i < n - 1 && a[i] > a[i + 1]) {
cnt += a[i] - a[i + 1];
a[i... | ALGO | 0.999677 | 4.262958 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2021-12-10T22:43:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b336bdb3a2... |
6f88bfdb-72b8-46f7-8de7-76b688d69ed3 | pjotrp/biopp | phyllib/Phyl/RE08.cpp | //
// File: RE08.cpp
// Created by: <NAME>
// Created on: Mon Dec 29 10:15 2008
//
/*
Copyright or © or Copr. CNRS, (November 16, 2004)
This software is a computer program whose purpose is to provide classes
for phylogenetic data analysis.
This software is governed by the CeCILL license under French law and
abiding... | ALGO | 0.997728 | 5.351221 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2009-05-22T10:13:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20e48e62a7... |
b40e1692-ce32-467c-9dd2-530cc9395b16 | Krokys9/all-my-work | C++/we/main.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
int arr[3][12];
/*
0 2 3 4 5 | 6 7 8 9 10 11 12 0
0 2 3 4 5 |6 7 8 9 10 11 12 1
0 2 3 4 5 |6 7 8 9 10 11 12 2
*/
srand(time(NULL)); //seed the generator
int maximum =-6;
for( int i = 0 ; i <... | ALGO | 0.998428 | 3.195824 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-20T17:26:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce3fd24ce4... |
8ccfcf4b-ec03-4b64-8f9c-15fb6b715e92 | abdur-rab-khan/data-structures-algorithms | Data Structure/others/basic_maths/02_find_all_division.cpp | #include <bits/stdc++.h>
using namespace std;
// Brute force method to find -- all divisor
vector<int> getAllDivisor(int n) {
vector<int> divisor = {};
for (int i = 1; i <= n; i++) {
if (n % i == 0) {
divisor.push_back(i);
}
}
return divisor;
}
// Using modulo and divisi... | ALGO | 0.999554 | 4.801425 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2025-04-08T15:17:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccc301a603b... |
066b1d05-907d-43a0-a96b-4ed34a09c35c | fmckenna/nataf_gsa_cpp | runForward.cpp | #include "runForward.h"
#include <iterator>
runForward::runForward() {}
runForward::runForward(vector<vector<double>> xval, vector<vector<double>> gmat)
{
this->xval = xval;
this->gval = gmat;
nmc = xval.size();
nrv = xval[0].size();
std::cout << "RV Mean StdDev Skewness Kurtosis" << std::endl;
for ... | ALGO | 0.994879 | 4.976456 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2020-10-28T23:35:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97f5d0e17... |
6196d8a6-6103-4e3d-898b-c4aca6ee0dc7 | 3omdawy/CarND-MPC-Project-Delivery | src/cppad/ipopt/coin/IpLapack.cpp | // Copyright (C) 2005, 2009 International Business Machines and others.
// All Rights Reserved.
// This code is published under the Eclipse Public License.
//
// $Id: IpLapack.cpp 2449 2013-12-16 00:25:42Z ghackebeil $
//
// Authors: <NAME> IBM 2005-12-25
#include "IpoptConfig.h"
#include "IpLapack.hp... | TOOL | 0.984773 | 5.623479 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-06-15T14:35:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "575f082b35... |
ac3c11b1-1c64-464f-97e3-8f84b88d06ad | StoicGang/Problem_Solving | 27/Palindrome2.cpp | /*
Problem:
Given a string S, determine if it can be made into a palindrome by deleting at most one character.
A palindrome is a string that reads the same forwards and backwards.
Input:
- String s: The input string to check
- Length n: Length of the string s
Output:
- "YES" if string can be made ... | ALGO | 0.999996 | 5.737017 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2025-01-01T05:59:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97e5a1d0cd6... |
c3645a82-9ed0-41c5-b2cc-6b6f2767b3de | Sushil-kafle/data_structure_and_algo | array/sort_0_1.cpp | // 0 1 1 0 0 0 0 1 1
// 0 0 0 0 0 1 1 1 1
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> a(9);
for (int &i : a)
{
cin >> i;
}
int start = 0;
int end = a.size() - 1;
// while (start < end)
// {
// if (a[start] == 1 && a[end] == 0)
// ... | ALGO | 0.999996 | 3.564844 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-05-02T01:36:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4daad37a88... |
35ff8f65-75d3-428f-8fde-29181102cc36 | dhirajsahh/CodeToConquer | BinarySearch/count_neg_num.cpp | //https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix/description/
class Solution {
public:
int countNegatives(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
int count = 0;
for (int i = 0; i < m; i++) {
int ans = 0;
... | ALGO | 0.999989 | 6.10089 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2024-11-29T03:20:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5312f14f56... |
ceaff98b-4d0a-45cf-acc3-9c032edd26dc | Zhaoyi-Tian/World-of-Warcraft-Major-Project | 魔兽世界之二:装备.cpp | #include<iostream>
#include<string>
#include<map>
#include<vector>
#include <algorithm>
#include <cstdio>
using namespace std;
vector<string> Warriors={"dragon","ninja","iceman","lion","wolf"};
vector<string> weapon={"sword","bomb","arrow"};
map<string,int> Warriors_HP;
map<string,vector<string>> order={{"red",{"iceman... | ALGO | 0.994047 | 3.378822 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-04T12:35:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7675bbffe5be... |
fbac3af7-7110-408b-8151-63481af8a118 | VikasPatel91/Cplusplus | Lecture_39/challenge_2.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
template <typename T>
bool isInRange(const T &val, const T &minVal, const T &maxVal)
{
return (val >= minVal && val <= maxVal);
}
double calculateDistance2D(int x1, int y1, int x2, int y2)
{
return sqrt(pow(x2 - x1, 2) + pow(y2 - y1... | ALGO | 0.964776 | 5.356395 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-11-14T08:02:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47c98b39c527... |
b84c3d0c-08c9-4c0a-8a71-6d3fa85d291a | NAU-ACM/ICPC-Question-Solving | BedirT/Chapter 3/UVa - 10819.cpp | /*
Question: UVa - 10819
Related Topic: Knapsack, DP
Author: BedirT
Date: May 28, 2017
*/
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int knapsack(int C, int n, int * p, int * val){ // C is capacity, n is size
// p is prices, and val is value
int d[15000], res = 0;... | ALGO | 0.999942 | 3.588301 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2017-04-28T16:54:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 28,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5f997d... |
ba683233-66bc-4900-91b7-9ca2643cc7c4 | atikshborundia/snuc-sem-2-dsa-lab | 5/lab5cll.h | #include <stdio.h>
#include <stdlib.h>
class CircularLinkedList {
private:
struct Node {
int data;
Node* next;
};
Node* head;
int size;
public:
// Constructor
CircularLinkedList(){
head = NULL;
size = 0;
}
// Destructor
~CircularLinkedList(){
... | ALGO | 0.992588 | 5.386412 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2025-05-04T16:00:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94fdcef88d3... |
3944019c-09f5-406c-99be-2465c1bc4aa5 | JunBinLiang/OI | 树链剖分/918-软件包管理器.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <queue>
#include <list>
#include<fstream>
using namespace std;
using ll = long long;
#define pb push_back
//ifst... | ALGO | 0.999849 | 4.324474 | {
"github_metadata": {
"branch": "main",
"commit_count": 780,
"repo_created_at": "2022-07-07T05:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bebc8eaed9... |
09bfe6a7-2b4b-42b0-a682-c88e587769b8 | Pwiley24/Classes | classes.cpp | /*
* This project creates a database to store media types wit different values.
* Author: <NAME>
* Date: 12-5-2022
*/
#include <iostream>
#include <vector>
#include "digitalMedia.h"
#include "Videogame.h"
#include "Music.h"
#include "Movie.h"
using namespace std;
void add(vector<digitalMedia*> &mediaList);
void... | TOOL | 0.958575 | 3.606482 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-11-03T20:57:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbc04c469dad... |
76b7c69f-2bbf-476b-9d16-3c967a3d1864 | Aitoly/FA-3sem-Lab3 | Task9/Task9.cpp | #pragma warning(disable:4996)
#include<stdio.h>
#include<iostream>
#include<ctype.h>
#include<math.h>
#include<time.h>
///////////////////////////////////////////////////////////
/////////// Adress
//////////////////////////////////////////////////////////
typedef struct
{
char* city;
char* street;
int house;
i... | TOOL | 0.925582 | 3.527444 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-09-01T17:34:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ba0236491... |
a249aff1-2db9-4bcd-854d-7b37a65e0e79 | vishal8803/DSA-Practice | 1834-single-threaded-cpu/1834-single-threaded-cpu.cpp | class Solution {
public:
struct ComparePair {
bool operator()(pair<int,int> const &p1, pair<int,int> const &p2)
{
if(p1.second == p2.second) return p1.first > p2.first;
return p1.second > p2.second;
}
};
vector<int> getOrder(vector<vector<int>>& tasks) {
... | ALGO | 0.999996 | 5.703651 | {
"github_metadata": {
"branch": "main",
"commit_count": 3290,
"repo_created_at": "2022-05-19T14:47:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7cd031e82... |
5c832059-2ce7-41f8-982d-6e3fe5d7b2ba | lint89/leetcode-lint | leetcode-lint/valid-anagram/valid-anagram.cpp | // Source : https://leetcode.com/problems/valid-anagram/
// Author : LinTao
// Date : 2016-06-01
// ****************************************************************
//
// Given two strings s and t, write a function to determine if t is an anagram of s.
// For example,
// s = "anagram", t = "nagaram", return true.
... | ALGO | 0.998896 | 4.808968 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-06-01T07:48:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b24c6b6e81... |
04aaabc0-ec17-42dd-831e-f8fb14abef8c | hansol4412/algorithm | number77_3.cpp | #include <stdio.h>
#include <algorithm>
using namespace std;
int unf[100];
int Find(int v){
if(unf[v]==v) return v;
else return unf[v]=Find(unf[v]); //메모라이제이션
}
void Union(int a, int b){
a=Find(a);
b=Find(b);
if(a !=b) {
unf[a]=b;
}
}
int main() {
// 77_3. 친구인가
/* 현수네 반 학생은 N명이고, 모든 학생은 1부터 N까지 번호가 ... | ALGO | 0.999875 | 4.15979 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2020-12-06T02:51:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f18c1b3e... |
8fd3d119-a9b4-4c71-95fc-252f9ae69d7e | alxsoares/OI | poj/p1659.cpp | /*
* $Date: Sun Feb 27 20:40:37 CST 2011
* $Author: csimstu
* $Prob: poj1659(根据度序列构造无向图)
* $Sol: Havel Theorem + Greed construction
*/
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#define INPUT "t.in"
#define OUTPUT "t.out"
namespace Solve
{
const int N_VTX_MAX = 10;
class Vertex
{
... | ALGO | 0.99982 | 3.977501 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-06-29T20:25:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39423678e8... |
ea22e419-73da-4c88-bc5c-54f9e448ac83 | artrosisca/OpenGL_Game | JogoOpenGL/JogoOpenGL.cpp | #include <SFML/Graphics.hpp>
#include <time.h>
#include <iostream>
using namespace sf;
// Enumeração para representar os estados do jogo
enum class GameState {
Playing,
GameOver
};
// Dimensões da janela
const int W = 600;
const int H = 480;
// Velocidade global dos jogadores
int velocidade = 2;
// Matriz ... | TOOL | 0.959463 | 5.096216 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-11-30T02:09:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a095401af... |
18bab94b-ef4c-428f-b621-1413286cdc13 | Djokovic0311/LeetCode | problems/implement_magic_dictionary/solution.cpp | class TrieNode {
public:
bool isWord = false;
TrieNode* next[26];
};
class MagicDictionary {
public:
TrieNode* root;
MagicDictionary() {
this->root = new TrieNode();
}
void buildDict(vector<string> dictionary) {
for(string word : dictionary) {
TrieNode* node = ro... | ALGO | 0.99973 | 5.704644 | {
"github_metadata": {
"branch": "main",
"commit_count": 3188,
"repo_created_at": "2023-01-03T19:43:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3bc2fc1a... |
b6359a3f-fae4-4c61-9188-f622dae156f0 | wishescsnow/Competitive-Programming | Chapter 4 Graph/Minimum Spanning Tree/Variants/10369.cpp | /*input
1
3 6
0 1
0 2
0 4
0 5
0 7
0 8
*/
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
vector<pair<double, ii> > EdgeList;
vector<pair<int, int> > PointList;
class UnionFind{
private: vi p, rank, ... | ALGO | 0.999826 | 4.311235 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-03-12T13:39:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e8e821cf7... |
e29d0768-5416-4dc0-9e11-2be88816ffc6 | natsalete/SO-algoritmo-roundRobin-e-algoritmo-SRT | Trabalho SO.cpp | #include <iostream>
#include <locale>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
// Função de comparação para ordenar os processos pelo tempo de chegada
bool ordena(pair<char, pair<int, int>> a, pair<char, pair<int, int>> b) {
return a.second.second < b.second.second;
}
void SRT... | ALGO | 0.999971 | 5.42766 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-07-15T20:02:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fae59790098... |
506a832f-2d7c-4761-a6d7-5bfacb41bcb5 | vikashsharma0707/cpp | fileoops.cpp | #include<iostream>
using namespace std;
class Shapes{
protected:
int d1,d2;
public:
Shapes(int a){
d1=a;
}
Shapes(int a,int b){
d1=a;
d2=b;
}
virtual void calculate_area(){
cout<<"area calculated here";
}
};
class Circle:public Shapes{
public:
Ci... | TOOL | 0.986214 | 4.919671 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2024-03-27T07:02:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c28363911... |
584e1e53-57c7-4dbf-b903-fe498f21e72c | pyi7628/coding_test-study | baekjoon/2206.cpp | #include <cstdio>
#include <vector>
#include <queue>
#define CNT_MAX 10000000
using namespace std;
struct node
{
int r;
int c;
int d;
int is_broken;
};
int dir[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
queue<node> q;
char map[1001][1001];
bool check[1001][1001][2];
int n, m, min_cnt = CNT_MAX;
no... | ALGO | 0.999928 | 3.36185 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2021-04-23T04:29:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18807c16... |
b92d533a-6e81-4e0b-b150-ccf84afd4d4b | onweg/Ya_Practicum | 01 Основные компоненты C++/02 Спринт 2/02 Фреймворк для юнит-тестов/05 Применяем фреймворк на практике/Задание 00/src/main.cpp | #include <cassert>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
using namespace std;
template<typename T, typename U>
void AssertEqualImpl(const T& a, const U&b, const string& a_str, const string& b_str, const string& file, const int line, const string& function, const string... | ALGO | 0.993436 | 5.395359 | {
"github_metadata": {
"branch": "main",
"commit_count": 220,
"repo_created_at": "2024-07-14T12:15:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d7a42be46... |
e9a65922-f8fe-47a6-883b-16283b9e5af9 | HuoYingxiao/MemeticAlgorithm | MemeticAlgorithm/RMHC.cpp | #include "RMHC.h"
RMHC::RMHC(Knapsack* knapsack)
:HillClimbing(knapsack){
}
RMHC::RMHC(GAPProblem* gap)
: HillClimbing(gap) {
}
void RMHC::setMoveAcceptance(int i) {
if (i == 1 || i == 0)
this->moveAcceptance = i;
}
void RMHC::localSearch(int solutionIndex) {
if (problem == 1) {
double bestValue = knaps... | ALGO | 0.99998 | 4.638041 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-12-19T03:30:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "baf943d7993f... |
6ef4709a-c3c6-4161-84d0-ab8a980aee1b | simonnguyen175/cp-repo | training/anh_dung_day/8-6-2021/order.cpp | #include<bits/stdc++.h>
#define pb push_back
using namespace std;
const int N = 1e5 + 5;
int n, m;
int sk[2*N], a[2*N], degin[N], tmp[N], ans[N];
vector<int> adj[N];
void init(){
cin >> n >> m;
for (int i = 1; i <= m; i ++){
int k; cin >> k;
for (int j = 1; j <= k; j ++)
cin >> a[s... | ALGO | 0.999998 | 3.605305 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-16T14:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5860820fb... |
16032c5b-2de9-4b25-9a70-c3346c1ebe81 | SuprimDevkota/SDL-Projects | Visualizing-Sorting-Algorithms/Visualizing Sorting Algorithms/src/main.cpp | #include "..\Headers\Header.h"
int main(int argc, char* argv[])
{
int c;
printf("%s:\n", "Select the sorting algorithm you want to visualize");
printf("%s - 1\n%s - 2\n%s - 3\n%s - 4\n%s - 5\n", "Bubble Sort", "Insertion Sort", "Selection Sort", "Merge Sort", "Quick Sort");
scanf_s("%d", &c);
//Starts up SDL and... | ALGO | 0.990906 | 4.604037 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-05-13T13:37:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43d42370f8b4... |
509c5f15-54d9-4d87-9d45-0c4e3e75be72 | vucongtuanduong/dsa-codeptit | submit/algo-design/graph/dsa09005/dsa09005.cpp | #include <bits/stdc++.h>
using namespace std;
typedef int Vertex;
struct adjNode {
Vertex v;
adjNode *next;
};
struct Graph{
int nV;
int nE;
adjNode **edges;
};
/**
* Returns a new graph with nV vertices
*/
Graph *GraphNew(int nV);
/**
* Frees all memory allocated to a graph
*/
void GraphFree(... | ALGO | 0.999967 | 4.818587 | {
"github_metadata": {
"branch": "main",
"commit_count": 682,
"repo_created_at": "2023-12-21T11:07:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b70e792f8... |
fcb8afc7-fa24-4e58-8cf5-0a2ae89d64df | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0604/personal_submission/cf1133f2_md.cpp | // 0604
#include <bits/stdc++.h>
using i64 = long long;
using pii = std::pair<int, int>;
struct DSU {
private:
std::vector<int> f;
std::vector<int> siz;
public:
explicit DSU(int n) noexcept : f(n), siz(n, 1) {
std::iota(std::begin(f), std::end(f), 0);
}
int leader (int x) noexcept {
... | ALGO | 0.999988 | 5.041391 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "cc4c... |
a460df2c-70af-4038-b551-42f524704e74 | Joey-Liu/online-judge-old-version | 数据结构编程实验/14_3_1/14_3_1/C-j.cc | /* Copyright <NAME> (ACM ICPC ECNA 1999) */
#include <iostream>
#include <string>
using namespace std;
int numReceps, numPlugs, numAdapts, globalMax;
string names[400]; // yes, this was originally 300
int nnames;
bool receps[100];
//设备信息
struct plug {
int val;
bool list[400]; // thi... | ALGO | 0.955463 | 3.752515 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-05-07T08:07:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebc65a47ce... |
c68e08fc-4873-460d-a4f7-26f1f4110f89 | SanjayDevTech/OOPs | Ass-7/program01.cpp | #include<iostream>
template<typename T>
void swap(T* a, T* b) {
T temp = *a;
*a = *b;
*b = temp;
}
int main() {
char choice;
std::cout << "Which type?\n"
<< "0 => int, 1 => double, 2 => char: ";
std::cin >> choice;
if(choice == '0') {
int a, b;
std::cout << "Enter two in... | ALGO | 0.979253 | 4.655097 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2020-08-04T02:29:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adf97fca1... |
fffe102b-4181-4513-9878-221a38ba546a | HugoDeZume/Chapter4 | 4.3.cpp | #include<conio.h>
#include<stdio.h>
int main (void){
int rea,rep; // resultado del area, resultado del perimetro, utilizamos int porque tenemos numeros enteros
int w=3, h=5; //utilizamos variable de tipo flotante porque los numeros que tenemos son enteros
rea=w*h;// el valor del area de rectangulo es width * height
... | ALGO | 0.979904 | 3.289236 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2021-02-11T23:11:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9baf7ff98f7f... |
8150fffd-0186-41a9-9a33-7b7fcce3a7fd | Racon23/leetcode2 | solution/213.打家劫舍-ii.cpp | // @before-stub-for-debug-begin
#include <vector>
#include <string>
#include <algorithm>
#include "commoncppproblem213.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=213 lang=cpp
*
* [213] 打家劫舍 II
*/
// @lc code=start
class Solution
{
public:
int rob(vector<int> &nums)
... | ALGO | 0.999979 | 5.685588 | {
"github_metadata": {
"branch": "master",
"commit_count": 312,
"repo_created_at": "2020-09-29T09:55:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffd71cc1... |
27fefa4e-0dd1-44c2-ae9f-3bc5fdd0dfea | eyangch/competitive-programming | Codeforces/1712/e.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define eat cin
#define moo cout
#define int long long
using namespace std;
#define MXN 200005
int T, L[100000], R[100000], ans[100000];
vector<int> F[2*MXN], I[MXN+5];
int nF[2*MXN];
struct segment_tree{
int A[8*MXN];
void init(){
fill(A, A+8*MXN, 0);
}
void upd(int ... | ALGO | 0.999701 | 3.857987 | {
"github_metadata": {
"branch": "master",
"commit_count": 1164,
"repo_created_at": "2019-04-01T01:31:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b9eaf... |
e3ae16c2-aa46-484d-9386-27e559cc65f8 | rohaquinlop/UVa-Solutions | Solved/10131.cpp | /*
*
* Problema UVA 10131 - Is Bigger Smarter?
*
*/
#include <bits/stdc++.h>
using namespace std;
class Elephant{
public:
int w;
int iq;
int i;
public:
Elephant(int s, int iq, int i){
this->w = s;
this->iq = iq;
this->i = i;
}
bool operator<(Elephant& e){
if( e.w == this->w ){
return this->iq > e.i... | ALGO | 0.999962 | 3.413152 | {
"github_metadata": {
"branch": "master",
"commit_count": 246,
"repo_created_at": "2019-05-08T03:06:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a5a6f90... |
86699a53-a0ab-4d26-8fdd-03e05b1cf468 | kjbartel/magma | src/dgetrs_batched.cpp | /*
-- MAGMA (version 1.6.1) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date January 2015
@author <NAME>
@generated from zgetrs_batched.cpp normal z -> d, Fri Jan 30 19:00:19 2015
*/
#include "common_magma.h"
#include "... | ALGO | 0.997661 | 5.976257 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2015-06-04T17:28:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f9af051... |
43ea5b51-2e17-450e-ad21-30732c23849e | AdityaPatil-AP/LeetCode-Questions-TopicWise | Leet_Code_Solutions/TreesAndBinaryTrees/2265.count-nodes-equal-to-average-of-subtree.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.99993 | 6.391972 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2022-07-24T12:59:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f50c6b003... |
be790f9a-f1a4-465d-89fc-f9a6468006a1 | kooreshakhbari/CSC317 | computer-graphics-bounding-volume-hierarchy/src/find_all_intersecting_pairs_using_AABBTrees.cpp | #include "find_all_intersecting_pairs_using_AABBTrees.h"
#include "box_box_intersect.h"
// Hint: use a list as a queue
#include <algorithm>
#include <list>
using namespace std;
typedef pair<std::shared_ptr<Object>, std::shared_ptr<Object>> list_pair;
void check_and_insert(std::shared_ptr<Object>& nodeA,
... | ALGO | 0.998189 | 5.650286 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2022-01-13T19:13:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e79467c2... |
f112af13-5c8a-4e54-99c1-73b25b252b79 | orsoromeo/contactWrenchSet | thirdparty/politopix/trunk/Neighbours_Rn.h | // politopix allows to make computations on polytopes such as finding vertices, intersecting, Minkowski sums, ...
// Copyright (C) 2014-2015 : <NAME>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// ... | ALGO | 0.997532 | 6.222343 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-08T17:13:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a95ddfb8c... |
f2fb8e1e-1010-4df6-bf79-95816b354636 | Partha-SUST16/100_Days_Coding_Challange | LinkedListAll.cpp | #include<bits/stdc++.h>
using namespace std;
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) {}
};
void PrintNode(ListNode* head)
{
while(head)
{
cout<<head-... | ALGO | 0.99912 | 4.58925 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2020-01-01T17:39:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fab2738... |
b65ee0b1-3c3d-4903-bbc3-aa1044b4e1d9 | zmx4/MySteps | PTA/C语言/复习/刮刮彩票.cpp | #include <iostream>
#include <map>
using namespace std;
int getGold(int number) {
std::map<int, int> goldMap = {
{6, 10000}, {7, 36}, {8, 720}, {9, 360}, {10, 80},
{11, 252}, {12, 108}, {13, 72}, {14, 54}, {15, 180},
{16, 72}, {17, 180}, {18, 119}, {19, 36}, {20, 306},
{21, 1080}, {2... | ALGO | 0.999142 | 3.994359 | {
"github_metadata": {
"branch": "master",
"commit_count": 317,
"repo_created_at": "2024-11-25T11:00:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1cf8e11... |
4ceaa44b-3bec-4556-9d82-3daac2cf88c7 | Superm4n97/competetive-programming | Codeforces vol 04/1407D2.cpp | #include<bits/stdc++.h>
#define ll long long int
#define maxn 400005
#define inf 1000000000012
using namespace std;
pair<ll,ll> S[4*maxn];
ll A[maxn] , n;
vector < ll > G[maxn];
void build(ll node, ll b, ll e)
{
if (b==e){
{/**Initial Value assign**/
S[node] = make_pair(A[b],A[b])... | ALGO | 0.99966 | 3.534811 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-12-16T18:34:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e94815eed... |
0263b243-fcd1-42ef-ae69-e0e5ac832c1e | OctHe/leetcode_unit | problems/63_Unique_Paths_II/63_Unique_Paths_II.h | /*
* Problem 63: Medium
* Description: A robot is located at the top-left corner of a m x n grid.
* The robot can only move either down or right at any point in time. The robot is
* trying to reach the bottom-right corner of the grid.
* Now consider if some obstacles are add... | ALGO | 0.999328 | 5.889132 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2021-07-18T08:12:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e89aa0b9... |
359f8e0d-4b2b-419f-84b3-97d64f967665 | vernuser/college_C | C++/判断两点之间是否存在路径/判断两点之间是否存在路径.cpp | #include<bits/stdc++.h>
using namespace std;
class Nodemember{
public:
int data;
Nodemember* next;
Nodemember(int b)
{
this->data = b;
this->next = NULL;
}
};//定义了一个类Nodemember作为图的结点
class Nodehead{
public:
char b;
Nodemember* nextone;
Nodehead(){
nextone = NULL;... | ALGO | 0.999988 | 4.00085 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-12-10T07:45:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c67fe6372... |
e17ecc09-6b54-4e3d-8188-a2dfc734511f | PKNU-IT-ALGORITHM2019/pa-03-RyunHwaKang | 3-제출용/SortAlgorithm/main.cpp | #pragma warning(disable:4996)
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<time.h>
#define SIZE1 1000
#define SIZE2 10000
#define SIZE3 100000
//프린트 할 2차원 배열을 전역으로 선언해 각 배열 계산 후 그 함수 내부에서 데이터 넣어서 main의 마지막에 프린트
int **reverseData1000;
int **reverseData10000;
int **reverseData100000;
int **randomData... | ALGO | 0.999767 | 4.331034 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-03-24T16:51:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed1fddda318... |
d0e4d9bc-bd78-4c78-a807-efeeb984ab15 | IB-2023-2024/IB-class-code-examples | Homework_exercises/Exercises_P07/exponential/exponential2.cc | /**
* Universidad de La Laguna
* Escuela Superior de Ingeniería y Tecnología
* Grado en Ingeniería Informática
* Informática Básica
*
* @author <NAME>
* @date 23.nov.2020
* @brief Ejercicios propuestos en las prácticas de Informática Básica
* Ejercicio 3. Práctica 7:
* La función exponencial,... | ALGO | 0.999756 | 4.717602 | {
"github_metadata": {
"branch": "master",
"commit_count": 357,
"repo_created_at": "2020-06-04T10:28:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 27,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10889a4... |
e4f31349-2b75-4482-86c8-a66449df11eb | jeffry1829/ojcode | 417D.cpp | // #pragma GCC optimize(1)
// #pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC ... | ALGO | 0.999748 | 4.006078 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-08-09T08:41:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af2129680... |
ddab7d83-8222-44ff-9ea0-ecf04aab31c8 | d-coder111/DSAmplify | C++/2699_Modify_Graph_Edge_Weights.cpp | /*
2699. Modify Graph Edge Weights
You are given an undirected weighted connected graph containing n nodes labeled from 0 to n - 1, and an integer array edges where edges[i] = [ai, bi, wi] indicates that there is an edge between nodes ai and bi with weight wi.
Some edges have a weight of -1 (wi = -1), while others have... | ALGO | 0.999991 | 6.067445 | {
"github_metadata": {
"branch": "main",
"commit_count": 303,
"repo_created_at": "2023-10-06T22:45:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 60,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1d34d2a... |
0b1d1783-178d-493c-86e4-f96504f2bd96 | ehdwns1516/coding_test_practice | 프로그래머스/kakao/k진수에서 소수 개수 구하기(level2)/main.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int solution(int n, int k) {
int answer = 0;
string converted_num = "";
vector<string> splitted_numbers;
while(n){
char temp = '0';
temp += (n % k);
n /= k;
converted_num.push... | ALGO | 0.999945 | 5.011563 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2022-02-11T03:17:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16f4aa0d22... |
dade5c27-81de-4fd8-a6b8-6fa6a08e2887 | NagaChiang/leetcode-solutions | C++ 2/0018_4Sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
vector<int> sortedNums(nums);
sort(sortedNums.begin(), sortedNums.end());
vector<vector<int>> combs;
for (int i = 0; i < sortedNums.size(); i++) {
if (i > 0 && sortedNums[i] == ... | ALGO | 0.999978 | 6.320055 | {
"github_metadata": {
"branch": "master",
"commit_count": 276,
"repo_created_at": "2016-10-31T03:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd05995b... |
4cf6ae3d-71ec-4564-8bfb-fa8704cefa06 | snap-stanford/snap | snap-exp/wikinet.h | #ifndef snap_wikinet_h
#define snap_wikinet_h
#include "Snap.h"
#include "signnet.h"
class TWikiElecBs;
class TWikiMetaHist;
class TWikiTalkNet;
typedef TPt<TWikiTalkNet> PWikiTalkNet;
/////////////////////////////////////////////////
// Wikipedia Talk Network
class TWikiUsr {
//private:
public:
TChA Usr;
TBool... | ALGO | 0.980377 | 3.445247 | {
"github_metadata": {
"branch": "master",
"commit_count": 1991,
"repo_created_at": "2012-05-10T18:43:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2233,
"forks": 803,
"issues": 83,
"pull_requests": 11
},
"file_meta": {
"content_id": "4... |
2847dcb2-7002-44a0-90d6-c32c75925d58 | AdityaBhute/IT-2015-SPPU-course-2022-passout | ADSL/Assign1.cpp | /*
* C++ Program To Implement BST
*/
# include <iostream>
# include <cstdlib>
using namespace std;
/*
* Node Declaration
*/
class node
{
public:
int info;
struct node *left;
struct node *right;
}*root;
/*
* Class Declaration... | ALGO | 0.999705 | 5.080933 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2021-10-18T06:43:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9fbaad51b3e... |
751609b6-aa19-463c-b10e-c0a4086c4260 | DennisAruhuanca/ejercicios-de-arreglos-y-cadenas | imprimir en forma espiral.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> crearMatriz() {
return {{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15, 16}};
}
void imprimirMatrizEnEspiral(vector<vector<int>> matriz) {
int filas = matriz.size();
int columnas =... | ALGO | 0.999889 | 5.484999 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-03T02:46:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f05d2d6e627... |
59267c76-1826-44fe-9bad-52507efd9145 | ChrisKimZHT/Algorithm-Problems | WHUT/2021/TeamExercise_05/A_SPFA.cpp | #include <iostream>
#include <vector>
#include <queue>
#define INT32_MAX 2147483647
using namespace std;
struct NODE
{
int dist, point;
NODE(int first, int second)
{
dist = first;
point = second;
}
bool operator<(const NODE &x) const
{
return dist > x.dist;
}
};
in... | ALGO | 0.999911 | 4.463196 | {
"github_metadata": {
"branch": "master",
"commit_count": 366,
"repo_created_at": "2022-03-26T17:03:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9193f3f8... |
674a6d3f-bd14-4a05-b202-41f4a90c0b3b | Zero-Vec/cppACM | starryCoding/suanfajichu/09/P44.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int p = 998244353;
ll quick_power(ll base,ll power){
ll result = 1;
while(power){
if(power & 1)
result = result * base % p;
base = base * base % p;
power >>= 1;
}
return result;
}
ll inv(ll x){
... | ALGO | 0.999965 | 4.262671 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-04T17:21:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b026a9d2415b... |
712df9cb-a061-491c-b0cc-61ae769e9a4d | DonaldWhyte/multidimensional-search-fyp | mdsearch/src/test_trace.cpp | #include "kdtree.hpp"
#include "pyramidtree.hpp"
#include "bithash.hpp"
#include "multigrid.hpp"
#include "operationlist.hpp"
#include "timing.hpp"
#include <string>
using namespace mdsearch;
int main(int argc, char* argv[])
{
// Load operation list containing trace of real operations
OperationList<3> operationList... | ALGO | 0.941744 | 5.061893 | {
"github_metadata": {
"branch": "master",
"commit_count": 421,
"repo_created_at": "2014-02-23T23:28:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80713ce2... |
e84fb524-1c5f-4b10-b547-19fc0f9a5b07 | aboy-jiang/vs_code_project | leetcode/89_gray_code.cpp | /**
* @author JZC (<EMAIL>)
* @date 2021-03-08
* @brief https://leetcode-cn.com/problems/gray-code/
*
* 解决思路:
* 动态规划
* f(0) = [0]
* f(1) = [0, 1]
* f(2) = [00, 01, 11, 10]
* ...
* f(n) = f(n-1), f(n-1)倒序最高位补1]
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vect... | ALGO | 0.999933 | 5.421551 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2021-01-29T03:22:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01e382ca5... |
8608aeef-ee8a-4270-bcc4-89481e106e77 | cristid9/fii | object-oriented-programming/lab3/main.cpp | #include <iostream>
#include "big_int.h"
using namespace std;
int main()
{
{
BigNumber n {23};
BigNumber n2 {"+11"};
BigNumber n3 {"+11"};
// cout << (n3 < n2) << endl;
}
{
BigNumber n1 {"-11"};
BigNumber n2 {"-11"};
// cout << (n1 == n2) << endl;... | ALGO | 0.992948 | 4.378006 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2015-12-21T16:17:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "e29eb6db... |
be89d151-13bb-49be-9ff1-df39bdeecc8c | yanjusong/Algorithm | unclassified/kth-number/kth.cpp | #include <iostream>
#include <vector>
using namespace std;
int partition(vector<int> &nums, int start, int end)
{
int left = start;
int right = end;
int mid = nums[end];
while (left < right) {
while (left < right && nums[left] < mid) ++left;
nums[right] = nums[left];
while (le... | ALGO | 0.999987 | 5.099124 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2016-09-25T02:19:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c8195ee... |
6a1d5787-9cd9-4f88-88f1-d8f7bca48727 | geoffsmith/raceya | src/lib.cpp | #include "lib.h"
#include "logger.h"
#include <math.h>
#include <iostream>
#include <SDL/SDL_image.h>
using namespace std;
void read_obj(const char *filename, GLfloat (*vertices)[3], GLfloat (*textures)[2], GLfloat (*normals)[3]) {
}
void matrixMultiply(float* matrix, float* vector, float* result) {
float sum;... | TOOL | 0.987369 | 3.904331 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2009-02-21T17:41:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "537b7aaf... |
4dfa0977-09b4-424e-a58a-dd4bbec2592b | NVIDIA/nvbench | nvbench/detail/entropy_criterion.cxx | /*
* Copyright 2023 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 with the LLVM exception
* (the "License"); you may not use this file except in compliance with
* the License.
*
* You may obtain a copy of the License at
*
* http://llvm.org/foundation/relicensing/LICENSE.txt
*... | ALGO | 0.97957 | 7.198436 | {
"github_metadata": {
"branch": "main",
"commit_count": 541,
"repo_created_at": "2021-03-03T19:29:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 687,
"forks": 82,
"issues": 56,
"pull_requests": 2
},
"file_meta": {
"content_id": "37aa1ca... |
670b0e63-e7fb-4bc3-acd5-3565347e6335 | tnzk-ren/atcoder | ABC120/D.cpp | #include <bits/stdc++.h>
using namespace std;
class UnionFind{
public:
UnionFind(int N);
int root(int x);
bool connect(int x, int y);
int size(int x);
private:
vector<int> parent;
};
UnionFind::UnionFind(int N)
{
parent = vector<int>(N, -1);
}
int UnionFind::root(int x)
{
if(parent[x] < 0) return x;
... | ALGO | 0.99998 | 3.803452 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-05-26T14:03:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd608d414... |
c512fd81-b753-40aa-9895-fd2303af90b1 | RonDingDing/GAMES | 101/0/main.cpp | #include<cmath>
#include<eigen3/Eigen/Core>
#include<eigen3/Eigen/Dense>
#include<iostream>
int main(){
// Basic Example of cpp
// std::cout << "Example of cpp \n";
// float a = 1.0, b = 2.0;
// std::cout << a << std::endl;
// std::cout << a/b << std::endl;
// std::cout << std::sqrt(b) << std:... | ALGO | 0.994684 | 4.265115 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2021-05-21T05:31:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4af79ac7f... |
f227811e-b404-490a-92c0-8aa21b3f1e71 | Omkarharkulkar/Data-Structures-and-Algorithms | Union and Symmetric Difference.cpp | #include <iostream>
using namespace std;
// Function to merge two halves of an array
void merge(int arr[], int l, int m, int r) {
int n1 = m - l + 1;
int n2 = r - m;
// Dynamically allocate temporary arrays
int* L = new int[n1];
int* R = new int[n2];
// Copy data to temporary arrays L[] and R... | ALGO | 0.999982 | 6.140437 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-06-19T13:11:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f0d4eee955d... |
ea1af18b-3f59-43a3-8197-a208565d7f0a | PaddlePaddle/Paddle | paddle/phi/kernels/xpu/generate_proposals_kernel.cc | // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required... | ALGO | 0.963019 | 7.352055 | {
"github_metadata": {
"branch": "develop",
"commit_count": 54743,
"repo_created_at": "2016-08-15T06:59:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23037,
"forks": 5770,
"issues": 1009,
"pull_requests": 823
},
"file_meta": {
"content_... |
131bc6fc-9dea-4733-9cf9-87bbe00f24a2 | s0umy3ndudas/algoverseResources | cp/codeforcesReg/ecfr172/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef map<ll, ll> mll;
typedef vector<pair<ll, ll>> vpll;
typedef pair<int, int> pii;
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second... | ALGO | 0.999966 | 4.09274 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2024-05-19T08:39:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c26d63685... |
bcbd022e-9f8f-453f-af5e-7c8872da6c10 | AkiLotus/AkikazeCP | Vault/Codeforces Rounds/CFR476D2/CFR476D2E.cpp | // Code written by JadeMasochist
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ii pair<ll,ll>
#define mp make_pair
#define fi first
#define se second
#define M... | ALGO | 0.999902 | 3.35076 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2018-07-18T04:56:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9e229469... |
88afd3a6-c648-4ae4-96ba-963757fd1d12 | Pranay-Kamble/GFG-DSA-Course | BinarySearchTree/avlTree.h | //
// Created by <NAME> on 17/09/24.
//
#ifndef AVLTREE_H
#define AVLTREE_H
#include <iostream>
#include "node.h"
class AVLTree {
private:
Node *root = nullptr;
public:
Node *getRoot() {
return this->root;
}
Node* insert(Node *root, int data) {
if (root == nullptr) {
retu... | ALGO | 0.998557 | 5.375135 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-08-10T04:00:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bce04ca6bf... |
1a4dd6c3-399a-4dd5-b640-521ea432a76d | tydanny/proj2 | AlphaPlayer.cpp | //
// Created by ms2 on 3/17/2019.
//
#include "AlphaPlayer.h"
//------------------------------------------------------------------------
// Name: Player::AlphaGetBet()
//
// Description: Get's a bet from the alpha AI player.
//
// Arguments:
// Hand opponent - visible portion of hand of the opponent
// BetHistory ... | ALGO | 0.996003 | 5.907982 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-04-28T16:08:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60acdfaa2e... |
008136de-906d-45fa-a9eb-220e1d4b0a59 | varunmved/TicTacToe | ticTacToePlayer/TicTacToe.cpp | //
// main.cpp
// TicTacToe2
//
// Created by <NAME> on 4/29/14.
// Copyright (c) 2014 <NAME>. All rights reserved.
//
#include <iostream>
#include "Board.h"
#include "TerminalPlayer.h"
#include "ComputerPlayer.h"
//#include "Board.cpp"
int main(int argc, const char * argv[])
{
/*
***** Terminal player im... | ALGO | 0.9385 | 5.043133 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-11-03T21:21:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11912c6593... |
a1eb3d04-9a84-4b17-9913-bcdd1ea6d862 | tatesoto/atcoder | AtCoder/ABC291-300/ABC296/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define out(x) cout<<x<<'\n'
#define all(v) v.begin(),v.end()
#define rep(i,n) for(int i=0;i<(ll)(n);i++)
template<class T> inline bool chmin(T& a, T b) {if(a > b){a = b; return true;} else {return false;}};
template<class T> inli... | ALGO | 0.999641 | 4.366907 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2023-12-06T17:49:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a29afca8... |
af4bf75d-9363-432f-afec-ea3d09fbdef5 | ChrisVilches/Algorithms | urionlinejudge/2700-fundraising.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct Segtree {
private:
vector<ll> tree;
int n;
inline int left(int p) { return p << 1; }
inline int right(int p) { return (p << 1) + 1; }
ll max_query(int p, int L, int R, int i, int j) {
if (i > R || j < L) return INT_MIN;
if (... | ALGO | 0.999788 | 4.408149 | {
"github_metadata": {
"branch": "main",
"commit_count": 855,
"repo_created_at": "2021-10-04T16:05:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "8677d6eed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.