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 |
|---|---|---|---|---|---|---|---|
32d23956-1fcc-415d-8139-3fd6e250fa34 | Yappedyen/Sword_Offer | Sword_Offer/384solution_class.cpp | #include"functions.h"
//给你一个整数数组 nums ,设计算法来打乱一个没有重复元素的数组。
//
//实现 Solution class :
//
// Solution(int[] nums) 使用整数数组 nums 初始化对象
// int[] reset() 重设数组到它的初始状态并返回
// int[] shuffle() 返回数组随机打乱后的结果
class Solution {
public:
Solution(vector<int>& nums) :origin(nums), m(nums) {
}
vector<int> reset() {... | ALGO | 0.998847 | 5.567798 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2021-10-18T07:34:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ceb8826ca... |
8d9be2f0-170a-443b-b476-3e034bbf4db5 | AM-Darshan/Data_Structures-And-Algorithms | RecursionAndBacktracking/Palindrome_partitioning.cpp | #include<bits/stdc++.h>
using namespace std;
class SolutionDP
{
public:
vector<vector<string>> partition(string s)
{
int len = s.length();
vector<vector<bool>> dp(len, vector<bool>(len, false));
vector<vector<string>> result;
vector<string> currentList;
dfs(result, s, 0,... | ALGO | 0.999709 | 5.574786 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-06-10T02:57:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38a10c6f2a6... |
424ceee9-010c-4f81-9a57-e022052b6ddf | cms-sw/cmssw | TrackingTools/GsfTools/src/MultiGaussianStateTransform.cc | #include "TrackingTools/GsfTools/interface/MultiGaussianStateTransform.h"
#include "TrackingTools/GsfTools/interface/GetComponents.h"
#include "TrackingTools/GsfTools/interface/MultiGaussianState1D.h"
#include "DataFormats/TrackReco/interface/TrackExtraFwd.h"
#include "DataFormats/GsfTrackReco/interface/GsfTrackExtraFw... | TOOL | 0.909764 | 5.79541 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
8e2bba9a-de45-4baa-997f-a96b63903d98 | elstonsage/sageCore | trunk/src/c++/include/mcmc/mcmc_simulator.ipp | //=======================================
// Inline Implemantation: mcmc_simulator
//=======================================
inline
MersenneTwister&
mcmc_simulator::get_random() const
{
return my_random_generator;
}
inline
double
mcmc_simulator::get_random_real() const
{
return my_random_generator.uniform_real();... | ALGO | 0.991649 | 3.620121 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-03-24T21:34:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cd7ed92f15... |
a2664193-387f-406d-a866-3707cdfc792c | ishandutta2007/codeforces-f | ffao/normal/183/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int(i)=0;(i)<(int)(n);(i)++)
namespace IO
{
const int SIZE = 1 << 22;
char buff[SIZE], *p = buff + SIZE;
char read_char()
{
if( p == buff + SIZE )
{
fread( buff, 1, SIZE, stdin );
p = buff;
}
return *(p++);
}
inline ... | ALGO | 0.999731 | 3.434025 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "5b6e4f1d05f3... |
9530787c-deab-4e7e-b37a-213be56143b1 | kulaizki/Codeforces | 1100/counting-orders.cpp | #include <bits/stdc++.h>
using namespace std;
#define kulaizki {ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
#define poof(a) {for (const auto& x : a) cout << x << ' ';}
#define pb push_back
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
const ll template_array_si... | ALGO | 0.999994 | 5.242312 | {
"github_metadata": {
"branch": "main",
"commit_count": 394,
"repo_created_at": "2023-02-17T03:26:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46421b6033... |
20919a91-2d00-43cd-9733-8ba4b2b17695 | Ishwarendra/Contests | CODEFORCES_CONTEST/Previous Contests/744_Div3/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(0);
using vi = vector<int>;
using ll = long long;
void print(vector<ll> &a)
{
for(auto i : a)
cout << i << " ";
cout << "\n";
}
int get_idx(vector<ll> &a, ll x)
{
for(int i = 0; i < ... | ALGO | 0.999562 | 3.917236 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-02-11T15:50:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10928d5aed67... |
5b6bbb61-2d98-4365-8941-91ac21954966 | NguyenKhoiDinh/CompetitiveProgramming | Codeforces/CodeforcesRound/Round944/e.cpp | #include <iostream>
#include <algorithm>
#include <utility>
#include <assert.h>
int numTest;
int n, k, numQueries;
int a[100005], b[100005];
int main () {
std::cin >> numTest;
for (int testCase = 1; testCase <= numTest; testCase++) {
std::cin >> n >> k >> numQueries;
for (int i = 1; i <= k; i++) {
... | ALGO | 0.999878 | 3.407392 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2021-03-25T18:48:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5555748... |
c03a247d-e04e-4fb5-8804-6f3d93013327 | lukYanovich/BSU | FAMCS/sem4/AiSD/lab2_2/lab2_2/Source.cpp | #include <iostream>
#include <fstream.>
using namespace std;
int func(int, int);
int optimal(int, int);
int N, K;
int* arr[2];
int main(int argc, char argv[]) {
ifstream fin("in.txt");
fin >> N >> K;
arr[0] = new int[N];
arr[1] = new int[N];
int first = -1, last = -1;
for (int i = 0; i < N; i++) {
fin >>... | ALGO | 0.999918 | 3.623767 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-01-05T22:07:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "887d7521be... |
546e7dbf-d2ef-4c4b-a07c-51d1daaa28d3 | gulyassimone/ELTE-3-Programozasi-nyelvek-C- | 7_ora/13_nodes_better_solution.cpp | nclude <iostream>
struct Node
{
int val;
Node *left, *right;
Node( int i )
{
val = i;
left = right = 0;
}
};
void insert( Node*& n, int v )
{
if ( n ) // n != 0
{
insert( v < n->val ? n->left : n->right, v );
}
else
{
n = new Node( v );
}
}
v... | ALGO | 0.999815 | 5.010344 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-09-09T16:01:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5c1ae00ab... |
ddf1f085-e52e-4f4d-9c12-1bc7e3178ac9 | tingluotw/leetcode | 102_binary_tree_level_order_traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999993 | 6.205582 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-07-07T04:27: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": "0e07d0562... |
31012f8e-8cd9-42c3-8375-e8511525fa23 | KonduitAI/deeplearning4j | libnd4j/include/ops/declarable/helpers/cpu/triangular_solve.cpp | /*******************************************************************************
* Copyright (c) 2020 Konduit, K.K.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unle... | ALGO | 0.999892 | 6.356411 | {
"github_metadata": {
"branch": "master",
"commit_count": 1046,
"repo_created_at": "2019-10-14T06:42:12.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "deeplearning4j/deeplearning4j",
"stars": 11,
"forks": 7,
"issues": 7,
"pull_requests": 24
},
"file_meta": {... |
3bb516b6-768b-42b9-89dc-9924fb09d662 | StevenL2017/Codeforces | problem/archive/1661/1661C.cpp | #include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <cstring>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <algorithm>
#include <functional>
using namesp... | ALGO | 0.999701 | 4.481008 | {
"github_metadata": {
"branch": "master",
"commit_count": 1534,
"repo_created_at": "2022-09-26T06:10:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2615923... |
7f6dc9d6-2446-47d4-867d-4d2f0b0f3fb7 | rdefeo/adventofcode | 2017/day7.cxx | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <deque>
#include <set>
#include <regex>
using namespace std;
typedef pair<string, int> tower;
int main()
{
map<string, string> tparents;
vecto... | ALGO | 0.995322 | 3.45745 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2020-12-12T21:07: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": "79a161c64a... |
25d6850a-c6d1-4d46-8328-339d4fe7de6f | gabriel88766/C-CPP-AlgorithmsAndContests | Codeforces/359/A.cpp | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
const ll INF_LL = 0x3f3f3f3f3f3f3f3f, MOD = 998244353; //1e9+7
const int INF_INT = 0x3f3f3f3f;
const long double PI = acosl(-1.), EPS = 1e-9;
using namespace std;
//cout << fixed << setprecision(6)
int main(){
ios_base::sync_wi... | ALGO | 0.999961 | 4.364942 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2020-08-21T00:21:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef59cfc4... |
ec470117-f30e-4fbe-8b82-53a7851b4359 | keertipurswani/LLD-Design-Patterns | Composite Design Pattern/C++/employee.cpp | #include <iostream>
using namespace std;
class EmployeeComponent {
public:
virtual void displayInfo() = 0;
virtual double calculateSalary() = 0;
virtual ~EmployeeComponent() {}
};
class Employee : public EmployeeComponent {
private:
string name;
double salary;
public:
Employee(string empName... | TOOL | 0.985867 | 6.653853 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-09-21T13:01:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 229,
"forks": 129,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c186d5... |
e4763a3b-205c-409a-a995-f057b4107bfa | kenzhegaliyevn/Competitive-programming | acmp/0465/main.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <bitset>
#include <cstdlib>
#define sqr(x) (x) * (x)
#define F first
#define S second ... | ALGO | 0.999993 | 3.562107 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-02-17T03:51:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9447cd754e0... |
977ad5d0-4088-4b71-887e-de10a1383462 | ishandutta2007/codeforces-a | al.cash/normal/464/A.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <complex>
#include <numeric>
#include <bitset>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define all(a) (a).begin(),... | ALGO | 0.999974 | 3.531816 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "668ad4afa810... |
fa0cb1d3-98de-4862-9fb2-aba09f483b8d | ChenxingyuSu/Chess | king.cc | #include "king.h"
#include <math.h>
#include <vector>
using namespace std;
King:: King(int col, int row, Colour colour): Cpiece(col,row,colour){}
string King::get_chess_type(){
return namepiece;
}
int King::getability(){
return ability;
}
bool King::is_mv_valid(std::vector<std::vector<Cpiece*> > & board,... | ALGO | 0.922401 | 4.477808 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-06-22T11:05: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": "416dc7f0a2d6... |
85f6bb7a-a413-4dfd-a7e9-3e9db9da70ac | igoingdown/leetcode | 845_dp.cpp | class Solution {
public:
int longestMountain(vector<int>& A) {
int n = A.size();
vector<int> dp1(n), dp2(n);
for (int i = 0; i < n; i++) {
if (i > 0 && A[i] > A[i - 1]) dp1[i] = dp1[i - 1] + 1;
}
for (int i = n - 1; i >= 0; i--) {
if (i < n - 1 && A[i]... | ALGO | 0.99996 | 5.496571 | {
"github_metadata": {
"branch": "main",
"commit_count": 536,
"repo_created_at": "2021-08-23T02:33:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ec1e5096d... |
7b8cea9d-f12a-41fc-a5c2-9b6b82009a48 | Ang-In/462B-v5code-highstakes2024 | crystal-vex-hwchallenge/src/robot-config.cpp | #include "vex.h"
using namespace vex;
using signature = vision::signature;
using code = vision::code;
// A global instance of brain used for printing to the V5 Brain screen
brain Brain;
// VEXcode device constructors
motor leftF = motor(PORT1, ratio6_1, true);
motor leftM = motor(PORT4, ratio6_1, true);
motor leftR ... | TOOL | 0.975774 | 4.085759 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-10-31T05:02: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": "e2046d09c959... |
e377042c-8fba-4d16-9b5a-0e5a383ef765 | singlarohan/leetcode_sol | 0107-binary-tree-level-order-traversal-ii/2022-08-27 00.53.57 - Accepted - runtime 15ms - memory 12.5MB.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.999994 | 5.802509 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-08-05T02:14:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f39e27670648... |
7dbbfec9-fd71-481e-9e94-d5d8bdb22cae | hjiang13/LLM4IR | Benchmarks/Human_xBenchmarks_164/test/CPP_74.cpp | /*
Write a function that accepts two vectors of strings and returns the vector that has
total number of chars in the all strings of the vector less than the other vector.
if the two vectors have the same number of chars, return the first vector.
Examples
total_match({}, {}) ➞ {}
total_match({"hi", "admin"}, {"hI", "... | ALGO | 0.999557 | 5.040429 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e52c6da5be... |
58130259-0dca-40f5-b6af-93a68530df1f | Ahmad-AlDeeb/Problem-Solving | Leetcode/1368. Minimum Cost to Make at Least One Valid Path in a Grid.cpp | const vector<int> di = {0, 0, 1, -1};
const vector<int> dj = {1, -1, 0, 0};
struct Edge {
int to, weight;
Edge(int to, int weight) : to(to), weight(weight) {
}
bool operator< (const Edge &e) const {
return weight > e.weight;
}
};
class Solution {
int m, n;
vector<vector<int>>... | ALGO | 0.999993 | 5.758861 | {
"github_metadata": {
"branch": "main",
"commit_count": 1500,
"repo_created_at": "2023-01-11T08:37:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ffc3bc93... |
d370f9a6-67b4-4fe8-8f29-07b1fbbb26be | deepak0byte/GeeksforGeeks-problems | Dynamic Programming/Longest Repeating subsequence.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int LongestRepeatingSubsequence(string str) {
// Code here
int n = str.length();
int dp[n + 1][n + 1];
memset(dp, 0, sizeof(dp));
string s = str;
for (int i = 1; i < n + 1; ++i)
{
for (... | ALGO | 0.99994 | 5.923755 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2021-08-14T16:11: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": "6a658dc5043... |
7d3cafe6-109c-4c47-b723-a180e4edf95c | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0619/personal_submission/cf1051d_tiger2005.cpp | int main() {
auto [n, k] = reads<int, int>();
if (k == 1)
return puts("2"), 0;
vector<vector<Z>> f(k + 1, vector<Z>(4)), g;
f[1][0] = f[1][3] = f[2][1] = f[2][2] = 1;
for (int i = 2; i <= n; i ++) {
g.assign(k + 1, vector<Z>(4, 0));
for (int l = 0; l < 4; l ++)
for (int r = 0; r < 4; r ++) {... | ALGO | 0.999904 | 3.708324 | {
"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": "2fc9... |
a9309fef-f0b8-4b15-b22a-1aed787dde8c | Joel970203/CodeExperience | 백준/Gold/1240. 노드사이의 거리/노드사이의 거리.cc | #include <iostream>
#include <vector>
#include <algorithm>
#define fastio() ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
vector<vector<pair<int, int>>> graph;
int dfs(int current, int target, vector<bool>& visited) {
if (current == target) return 0;
visited[current] = true;
fo... | ALGO | 0.999996 | 5.294834 | {
"github_metadata": {
"branch": "main",
"commit_count": 367,
"repo_created_at": "2024-12-04T05:27:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f8d5b6551... |
bfb52ca7-1a46-4b88-8660-73347aa43530 | wwlapaki310/C--OpenGL-Win32API | Projects/ConsoleApplication18/ConsoleApplication18/Source.cpp | #include<math.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include"glut.h"
#pragma warning(disable:4996)
#define NAME "DLC Film Formation Simulator"
#define AR_NUMBER 10000 // Max number of Ar ion particles.
#define DLC_NUMBER 40000 // Max number of DLC particles.
#define AR_R... | TOOL | 0.949716 | 3.112356 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-09-20T04:46: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": "1e9743a7c3... |
59d34731-d06a-4edb-9a65-59f4832b4992 | Ph4sm4/Programming | standard/cpp_studia/lab5/sllist.cpp | #include "sllist.h"
#include <cstring>
#include <iostream>
using namespace std;
std::ostream &operator<<(std::ostream &os, const sllist &list)
{
// Note that I removed the identifier of the second parameter to avoid
// compiler warning. You'll need it to iterateo over the nodes in list.
os << '{';
s... | TOOL | 0.986084 | 4.73039 | {
"github_metadata": {
"branch": "main",
"commit_count": 160,
"repo_created_at": "2021-11-24T09:55:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4392789de0... |
bc06e1e6-f0e2-4bb8-84ea-548c2b8f45b3 | kimchanmiii/algorithm_cpp | algorithm/longestString.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main() {
int testCase;
cin >> testCase;
for (int t = 0; t < testCase; t++)
{
char input1[101];
char input2[101];
int dp[101][101];
cin >> input1;
cin >> input2;
for (int i = 0; i <= strlen(... | ALGO | 0.999961 | 4.945352 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-08T06:17:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b41539a3b71... |
c1b15673-7074-4bdb-af8d-e0487f16ba7b | jonas-ellert/nearest-smaller-suffixes | include/xss/tree/algorithm.hpp | // Copyright (c) 2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, d... | ALGO | 0.99742 | 3.620325 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2019-10-24T10:46:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3f9fc962... |
4a8cdb22-4a25-495f-851f-8598b826a97c | hanil12/2024_5_30_Unreal | Algorithm/WINAPI_Algorithm/Algorithm/Babbling.cpp | #include <string>
#include <vector>
#include <unordered_map>
#include <iostream>
using namespace std;
vector<string> argument;
vector<string> babble = {"aya", "ye", "woo", "ma"};
vector<bool> visited;
unordered_map<string, int> canBabble;
// babble을 이용해서 만들 수 있는 단어를 다 만들어본다.
// 총 만들 수 있는 64가지 단어
void DFS(int here, ... | ALGO | 0.995196 | 3.933921 | {
"github_metadata": {
"branch": "main",
"commit_count": 176,
"repo_created_at": "2024-06-21T01:08:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3658097c73... |
d1e03c2d-f1c6-4f10-a71e-95273dc6d689 | iamrakesh28/Competitve-Programming | Codechef/ant.cpp | #include <bits/stdc++.h>
using namespace std;
long int maxStackHeight(long int *arr, int n)
{
long int msh[n],weight=0;
for (int i = 0; i < n; i++ )
msh[i] = 1;
for (int i = 1; i < n; i++ )
{
weight=0;
for (int j = 0; j < i; j++ )
if (msh[i] < msh[j] + 1 && weight <6*arr[i])
... | ALGO | 0.999882 | 3.614948 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-04-10T17:17:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f97ee8b8a... |
9f35ca18-6f65-4ca3-9a13-3e9fc35c6f84 | haoyuanliu/hihoCoder | hiho106_SBT树/BinarySearchTree/bst.cpp | #include <iostream>
#include <stack>
using namespace std;
typedef struct node
{
int data;
node *left, *right, *father;
node(int data_) : data(data_)
{
left = NULL;
right = NULL;
father = NULL;
}
}*Node;
Node root = NULL;
Node insert(Node n, int data)
{
if(root == NULL)... | ALGO | 0.999975 | 4.078715 | {
"github_metadata": {
"branch": "master",
"commit_count": 479,
"repo_created_at": "2016-03-06T12:29:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93c6d47a... |
d592425a-e442-4a1c-94bd-75df7db875e6 | samararora15/data-structures-and-algorithms | dsa 1/slidingwindow.cpp | //sliding window technique
#include<bits/stdc++.h>
using namespace std;
queue<int> negs;
vector<int> maximum_of_all_subarrays_of_size_k(vector<int> &nums, int k)
{
int l=0,r=0,n=nums.size(),ans=INT8_MIN;
// int temp;
vector<int> ansvec;
// 1,3,-1,-3,5,3,6,7
while(r<n)
{
ans = max(an... | ALGO | 0.999788 | 5.158593 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2023-12-21T10:15:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7aa943c79... |
0f2d350d-8167-4104-add6-801af2f7413a | Vincent550102/Competitive-Programming-Warehouse | old/APCS code/機器人的路徑.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int n,m;
ll map[105][105];
bool check_map[105][105];
int dir_r[4] = {-1,0,1,0};
int dir_c[4] = {0,1,0,-1};
cin >> n >> m;
int min_point_r = -1,min_point_c = -1;
int min_point_value = 1000005;
for(int i = 0; i<n; i++){
for(int j = ... | ALGO | 0.999971 | 3.927973 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2020-11-14T16:25:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b9924842... |
1093710a-a729-4f27-8073-707aac739583 | Sriharivignesh/codePractice | C++/Diagonal_Traverse.cpp | #include <iostream>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <string>
#include <vector>
#include <limits>
#include <stack>
#include <iterator>
#include <set>
#include <queue>
#include <sstream>
#include <stdlib.h>
#include <fstream>
#include <cstdint>
#include <random>
#include <valarray>
#... | ALGO | 0.99999 | 5.76364 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2016-05-21T18:01:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d61f4193... |
a372c8b9-c1b1-435f-ab32-ed2458afcbc4 | spdomin/NaluUnit | include/element_promotion/new_assembly/HighOrderCoefficients.h | /*------------------------------------------------------------------------*/
/* Copyright 2014 Sandia Corporation. */
/* This software is released under the license detailed */
/* in the file, LICENSE, which is located in the top-level NaluUnit */
/* director... | ALGO | 0.998269 | 7.069788 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2015-06-18T16:46:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33ddbabea... |
80687251-611f-4b1d-9a2e-b3a9ed40d9e6 | yalavrinenko/aoc-2019 | day_12.cpp | //
// Created by yalavrinenko on 12.12.2019.
//
#include <fstream>
#include <vector>
#include <iostream>
#include <array>
#include <tuple>
#include <unordered_map>
struct vec3d{
int x = 0, y = 0, z = 0;
vec3d& operator+=(vec3d const &v){
x += v.x; y += v.y; z += v.z;
return *this;
}
};
using... | ALGO | 0.999807 | 3.968403 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-12-09T13:54: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": "2498e56276... |
6db5786d-0093-4869-91aa-9fbc96aa9b16 | Itzsleepy5z/TOI-ZERO-LOL | A3-026.cpp | #include <bits/stdc++.h>
using namespace std;
char op(char p,char q){
if (p=='-'){
if (q=='-'){
return '-';
}
if (q=='+'){
return '+';
}
return 'x';
}
if (q=='-'){
return op(q,p);
}
return '*';
}
int main(){
int n,m;
c... | ALGO | 0.999992 | 4.179475 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-03T05:57:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90c94998c271... |
b1e4221e-b4c3-4739-95e1-5a0c89f277e3 | SHIVI-007/portfolio-repo | asap5.cpp | #include<iostream>
using namespace std;
class Tringle
{
int base , height;
float area;
public:
Tringle(int b,int h)
{
base=b;
height=h;
area=0.5*base*height;
}
void print()
{
cout<<"\nBase is :"<<base<<"\nheight is :"<<height<<"\nArea of traingle ... | ALGO | 0.953485 | 4.230392 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-11-09T12:14: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": "bbf3f231d3... |
e98ca0f3-eb4c-4543-a867-55418aa3d841 | abhishek-mishra019/DataStructuresAndAlgorithms | arrays/arrayAssignment.cpp | #include<iostream>
#include<vector>
using namespace std;
void findMissingElements(int arr[], int n){
int i=0;
while(i<n){
int index=arr[i]-1;
if(arr[i]!=arr[index]) swap(arr[i],arr[index]);
else i++;
}
for(int i=0; i<n;i++){
if(arr[i]!=i+1){
cout<<i+1<< " ";
... | ALGO | 0.999599 | 4.514269 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2024-09-13T00:56: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": "eac04a6af... |
2e037877-481c-49a6-b9fe-3343a136e5a2 | playbar/mapbox-gl-android | src/mbgl/algorithm/generate_clip_ids_impl.hpp | #pragma once
#include <mbgl/algorithm/generate_clip_ids.hpp>
#include <mbgl/math/log2.hpp>
#include <mbgl/util/logging.hpp>
namespace mbgl {
namespace algorithm {
template <typename Renderable>
void ClipIDGenerator::update(std::vector<std::reference_wrapper<Renderable>> renderables) {
std::size_t size = 0;
... | TOOL | 0.943836 | 7.389174 | {
"github_metadata": {
"branch": "master",
"commit_count": 12049,
"repo_created_at": "2018-02-11T04:07:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "589ae2... |
3626e51c-7d18-4c7c-9e60-2d4eacefb60d | kooku0/Sinbaram_18Summer_Algo | SJH/20180814/1260.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
vector<vector<int>> graph;
vector<bool> visitNode;
void dfs(int node);
void bfs(int node);
int main(void)
{
int numNode, numEdge, startNode;
cin >> numNode >> numEdge >> startNode;
graph.resize(numNode + 1... | ALGO | 0.999989 | 4.846558 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2018-06-29T05:40:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d05abbd2... |
1fddd2af-d20b-4037-b298-9a7c6d32c3d1 | CSoC-2020/Project-on-Data-structure | Gaurav_2610/Largest Divisible subset/subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
sort(begin(nums), end(nums));
const int n = nums.size();
vector<int> dp(n), parent(n), res;
int maxSize = 0;
int beginIdx = -1;
for(int i = n - 1; i >=0; i--)
for(... | ALGO | 0.999955 | 5.394495 | {
"github_metadata": {
"branch": "master",
"commit_count": 470,
"repo_created_at": "2020-05-05T07:24:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58c74c88... |
941d07f0-2da6-4d09-858f-125725cf7ae3 | jo5huar3/Sudoku | sudokuSolver.cpp | #include <pthread.h>
#include <semaphore.h>
#include <fcntl.h>
#include <iostream>
#include <vector>
/*
ThreeByThree
3x3 Matrix, where stillNeed refers to values the 3x3 matrix is missing. SmallSquare inner struct
represents an individual square from the matrix.
*/
struct ThreeByThree
{
struct
{
... | ALGO | 0.998367 | 5.741318 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-07-21T20:09: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": "56745bfd16f1... |
2fc641fd-1cb7-4b31-bfd5-3405b5c8549f | JamesRaynard/Learn-Modern-Advanced-Cpp | list_operations/merge.cc | #include <iostream>
#include <list>
using namespace std;
int main() {
list<int> list1{1, 12, 6, 24};
list<int> list2{9, 3, 14};
cout << "Elements in list1" << endl;
for (auto el: list1)
cout << el << ", ";
cout << endl;
cout << "Elements in list2" << endl;
for (auto el: list2)
cout << el << ", ";
... | ALGO | 0.995622 | 4.915856 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2022-07-30T19:00:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 74,
"forks": 42,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1859985f2... |
146edb1c-3b51-40ab-ab68-4cf6a0be69fd | shiva92/Contests | UVA/Map/10138_CDVII.cpp | #include <iostream>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <sstream>
#include <set>
#include <climits>
#include <cstdio>
#include <string>
#include <map>
#include <unordered_map>
using namespace std;
int timings[24];
char ... | ALGO | 0.984164 | 3.931136 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-10-10T07:20: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": "9d43a6d72... |
1e79a000-44a6-4e10-9a1f-506f41210eff | alexanderommel/Competitive-Programming | Codeforces/Madoka and Formal Statement/c1717.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define pb push_back
#define vi vector<int>
#define ff(size) for (int i = 0; i < size; i++)
#define viin(vec,n) ff(n){int x; cin>>x; vec.pb(x);}
#define fr(size, i) for (int i=0; i<size; i++)
using namespace std;
void sol(int n,vi a, vi b){
... | ALGO | 0.999936 | 3.492356 | {
"github_metadata": {
"branch": "main",
"commit_count": 397,
"repo_created_at": "2022-09-29T05:28:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5fdbb4b347... |
9e08ec7d-ab90-48d5-afd6-bc7575b4c09b | Andromeda0007/Codeforces | BadBoy.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int t;
cin >> t;
while(t--)
{
int n, m, x, y;
cin >> n >> m >> x >> y;
int a = x-1 + y-1;
int b = m-x + y-1;
int c = x-1 + n-y;
int d = m-x + n-y;
int k = max(a,... | ALGO | 0.999551 | 3.469177 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2023-05-18T18:36:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "017909a21ed... |
df48cf3e-2c37-4d6a-918d-a9477e4c0e06 | dongturbo/LeetCode | 126. Word Ladder II.cpp | /*参考的比人的代码,利用bfs构建树,利用dfs搜索结果。
*/
void add_to_tree(map<string, vector<string>>& tree,
string word,
string neigh,
bool forward) {
if (forward) tree[word].push_back(neigh);
else tree[neigh].push_back(word);
}
vector<vector<string>> construct_paths(map<string,... | ALGO | 0.999992 | 5.504599 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2015-09-22T13:03:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c7459c2... |
807f3a31-e1e7-4c77-9202-65ce42e0b2cf | otavioon/COLA-2022-Tools | datasets/src/optz/codenet/4/p02891_s100621367.cpp | /* _ _ _
| | | | ___ ___
| | | || . || _|
|_____||_ ||_| _____
|_| |_____| */
// Time : 19/10/15
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 0x3f3f3f3f
int main(){
#ifdef Wqr_
freopen("in.txt","r",s... | ALGO | 0.999951 | 3.768903 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2022-06-08T12:17:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcec9cff6... |
a56227d1-a47d-4305-ac25-44f98c179f99 | threedalpeng/algorithm_study | 19_2/Inha/week2_brute_force/2985.cpp | // 세 수
#include <iostream>
using namespace std;
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
int A, B, C;
char f, b;
cin >> A >> B >> C;
if (A + B == C) f = '+', b = '=';
else if (A - B == C)
f = '-', b = '=';
else if (A * B == C)
f = '*', b = '=';
else ... | ALGO | 0.999801 | 4.089998 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2019-09-15T10:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bff322edb... |
8119bed9-0754-4888-8b72-8f4d8ce7f121 | devin-lepur/Binary-Search-Tree | BinarySearchTree.h | /* <NAME>
Red ID: 825148526
CS-496
Prof Kraft
*/
// BinarySearchTree.h: Header file for BinaryBinarySearchTree.cpp
// The only way to insert data in a tree is with the insert function, thus
// satisfying the BST rule giving it a well behaved ordering to the type T.
#ifndef BINARY_SEARCH_TREE_H
#define BINARY... | ALGO | 0.99971 | 5.332253 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-02-07T01:22:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8e3b8ad6f92... |
5f7c938d-aa30-43a6-8f21-f0dfdd4dfccb | LuisLuettgens/Worhp-with-ADOL-C | cpp_example.cpp | /* Copyright [2018] */
/*-----------------------------------------------------------------------
*
* Minimise f
*
* subject to -0.5 <= x1 <= INFTY
* -2 <= x2 <= INFTY
* 0 <= x3 <= 2
* -2 <= x4 <= 2
* g1 == 1
* ... | ALGO | 0.99997 | 5.74306 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2018-11-29T17:27:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "60d2752d6... |
5f684ee4-6af6-4684-8e29-9879eb18a13d | Itsrajsk/DSA-In-Cpp-From-Scratch | DP/Min-Cost-Stairs-Approach-2.cpp | // Minimum Cost Of Stairs Approach No 2
#include <iostream>
#include <vector>
#include <climits> // For INT_MAX
using namespace std;
int solve(vector<int> &cost, int n, vector<int> &dp)
{
if (n == 0)
{
return cost[0];
}
if (n == 1)
{
return cost[1];
}
if (dp[n] != -1)
... | ALGO | 0.99998 | 5.998925 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2024-02-26T18:48:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb3cabb49d... |
a59957b3-913d-47ab-8f42-4d2ad42ae97a | Animesh606/Prismforce_Chakravyuha | solution.cpp | #include <bits/stdc++.h>
using namespace std;
class Chakravyuha {
private:
int initialPower, levelCount, rechargeCount, skippedCount;
vector<int> enemyPower;
vector<vector<vector<vector<vector<int>>>>> dp;
bool recursionCheck(int remainingPower, int a, int b, int circleIndex, bool ... | ALGO | 0.999893 | 4.227346 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-08-30T20:52: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": "72d89d2598b9... |
27f82014-87c0-4ac2-9b80-351a0558ae43 | bhallashivam1997/Code_Explainer_Youtube | codechef/Replace_for_X.cpp | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
# define M_PI 3.14159265358979323846
const int M=1e9+7;
long long mod(long long x){
return ((x%M + M)%M);
}
long long add(long long a, long long b){
... | ALGO | 0.999955 | 4.308292 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2020-10-06T07:54:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 20,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6895cba5... |
47e67dd3-0132-4370-80c8-264186468d81 | samplec0de/PolynomialOperations | Polynomial.hpp | //
// Polynomial.hpp
// [Backend] Операции с многочленами
//
// Created by <NAME> on 14/04/2019.
// Copyright © 2019 <NAME>. All rights reserved.
//
#ifndef Polynomial_hpp
#define Polynomial_hpp
#include <stdio.h>
#include <vector>
#include "exceptions.hpp"
#include "utils.hpp"
#include <cmath>
struct Node {
... | TOOL | 0.979292 | 3.90975 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-05T21:15:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b48a3ad6b1... |
91c8b47a-389b-47f4-af69-8cbec6df51d6 | shivam-rathore-04/AC | Backend/c++/hell.cpp | #include <iostream>
#include <map>
#include <vector>
#include <sstream>
#include <iomanip>
#include <cmath>
using namespace std;
struct Room {
int capacity;
int weekday_rate;
string status = "vacant";
string guest_id = "";
string checkout_time = "";
int cleaning_time = 0;
int occupied_night... | ALGO | 0.971944 | 5.410898 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2025-02-14T14:07: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": "91ca970c1... |
a0bcc813-83d1-465c-9fe9-976d92adbee2 | naseem12007571/Interview-Revison-dsa- | 8 Days Probelm/258. Add Digits.cpp | class Solution {
public:
int addDigits(int num) {
while(num>9){
int ans=0,rem;
while(num!=0){
rem= num%10;
num=num/10;
ans=ans+rem;
}
num= ans;
}
return num;
}
};
// while(num!=0) pahle case mein niche gaya re nikala fir 63 not equl to... | ALGO | 0.999886 | 5.642647 | {
"github_metadata": {
"branch": "main",
"commit_count": 218,
"repo_created_at": "2023-12-18T06:01: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": "cec3cc945b... |
5c34c75e-2136-4153-ba93-6a10333a960c | ishandutta2007/codeforces-k | kostka/normal/922/E.cpp | //<NAME>
// You are not prepared!
#include "bits/stdc++.h"
using namespace std;
#define x first
#define y second
#define SZ(x) int(x.size())
#define ll long long
#define pii pair <int, int>
#define vi vector <int>
const int MAXN = 1e3+7;
const int MAXA = 1e4+7;
const long long INF = 1e18+7;
ll dp[MAXN][MAXA];
int... | ALGO | 0.999888 | 3.902897 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "d0416b9029a2... |
5e64076f-19f9-4777-8037-7d460b930b5b | PaddlePaddle/Paddle-Lite | lite/kernels/host/cos_compute.cc | // Copyright (c) 2020 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... | DATA | 0.982046 | 6.941577 | {
"github_metadata": {
"branch": "develop",
"commit_count": 7526,
"repo_created_at": "2017-09-20T11:41:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7124,
"forks": 1620,
"issues": 68,
"pull_requests": 17
},
"file_meta": {
"content_id": ... |
85667702-53d7-4090-a6ad-ac78de5328d1 | ishandutta2007/codeforces-f | ftiasch/normal/1455/F.cpp | #include <bits/stdc++.h>
const int N = 500;
int n, m;
char s[N + 2];
char improve(char c) { return (c == 'a' || c == 'a' + m - 1) ? 'a' : c - 1; }
int main() {
int T;
scanf("%d", &T);
while (T--) {
scanf("%d%d%s", &n, &m, s);
bool changed = false;
s[n] = s[n + 1] = 'z';
// cedk
// bEDK
... | ALGO | 0.999941 | 3.524458 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "a41b029aee39... |
78fb9d8b-dbaa-4c6b-bafb-92f84e51f809 | hushanjushi/BeginningCpp20FromNoviceToProfessionalExercise | chapter-4/4-8/4-8.cpp | import <iostream>;
import <format>;
int main() {
std::cout << "Please input the amount of money(in dollar):\n";
double x;
std::cin >> x;
if (x < 0 || x>10) {
std::cout << "We can't compute this range of money.\n";
return 1;
}
double y=x;
unsigned quarter = static_cast<unsigned>(y / 0.25);
y -= 0.25 * quart... | TOOL | 0.956102 | 4.287766 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-06-15T07:18:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3eaafe9c7... |
7901f28a-5829-430a-8248-200c9c1d894b | qingconglaixueit/c_cplus_algorithm | shujujiegou/quicksort.cpp | #include <iostream>
#include <time.h>
using namespace std;
void quicksort3(int *a,int left,int right)
{
if(left >= right) return ;
int tmp = rand()%(right -left) + left;
int k = a[tmp];
a[tmp] = a[left];
a[left] = k;
int i = left;
int j = right;
int base = a[left];
while(i<j)
{
while(i< j && a[j] >= ... | ALGO | 0.999947 | 4.516605 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-02-16T08:55:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e89473c83... |
ed0279da-f4e4-4cf7-b08a-e6a5a3e9ba9a | 2013011491/algorithm_practice | cpp_prac/kakaoblockmv.cpp | #include <string>
#include <vector>
#include <queue>
#include <array>
using namespace std;
int solution(vector<vector<int>> board) {
int visit[101][101][101][101]={0,};
int answer = 0;
int n=board.size();
queue<array<int,5>> bucket;
array<int,5> pres;
bucket.push({0,0,0,1,0});
while(!buck... | ALGO | 0.999814 | 4.927233 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2019-09-17T07:39:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db9c49d10... |
00157f7c-0b46-40e1-8a3a-4eff15d7412e | wisdompeak/LeetCode | Recursion/1088.Confusing-Number-II/1088.Confusing-Number-II_v2.cpp | class Solution {
public:
unordered_map<char,char>Map={{'0','0'},{'1','1'},{'6','9'},{'8','8'},{'9','6'}};
int count = 0;
int N;
string n;
long perm(int l)
{
return 4*pow(5,l-1);
}
long symmetric(int l)
{
if (l%2==0)
return... | ALGO | 0.999502 | 4.74367 | {
"github_metadata": {
"branch": "master",
"commit_count": 8912,
"repo_created_at": "2017-03-01T10:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6018,
"forks": 1314,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "3... |
21570cec-1668-446d-806b-fdcccbf6bfc4 | yayaratta/MonteCarloParallele | src/pricerPacked.cpp | #include <stdexcept>
#include <cstdlib>
#include <iostream>
#include "MonteCarlo.hpp"
#include <mpi.h>
#include "../src/parser.hpp"
#include "Options/OptionBasket.hpp"
#include "Options/AsianOption.hpp"
#include "Options/PerformanceOption.hpp"
using namespace std;
//////////////////////////////////////////////////////... | TOOL | 0.916336 | 6.169792 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2016-12-01T10:53: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": "ac7c08094... |
00770376-177a-4fa4-a6d5-a1e61fb9e706 | rsln-s/aggregative-coarsening-for-multilevel-hypergraph-partitioning | packages/rol/example/dual-spaces/simple-eq-constr-1/example_01.cpp | // @HEADER
// ************************************************************************
//
// Rapid Optimization Library (ROL) Package
// Copyright (2014) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on be... | ALGO | 0.999772 | 5.180633 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-04-04T20:05:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91c55f0cfe... |
45741d0c-a08a-417a-9a22-a41cde8f90ac | hellowcoder/cpcode | V_Find_B.cpp | //Author: sandeep172918
//Date: 2025-03-04 23:13
#include <bits/stdc++.h>
#define lli long long int
#define fr(i,n) for(lli i=0;i<(n);i++)
#define frs(i,s,n) for(lli i=s;i<(n);i++)
#define fr1(i,n) for(lli i=1;i<=(n);i++)
#define uint unsigned long long int
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.... | ALGO | 0.999862 | 3.910552 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2024-11-17T14:05: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": "f8576ca29... |
cb73d505-d324-4c4c-a7bc-a0915ab999bb | manchalaharikesh/CODES-POTDs | LeetCode/706. Design HashMap.cpp | // DATE: 04-OCT-2023
// Question URL: https://leetcode.com/problems/design-hashmap/
// Question: 706. Design HashMap
// Description: Design a HashMap without using any built-in hash table libraries.
// Implement the MyHashMap class:
// MyHashMap() initializes the object with an empty map.
/... | ALGO | 0.998388 | 6.070404 | {
"github_metadata": {
"branch": "main",
"commit_count": 389,
"repo_created_at": "2023-08-17T10:03: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": "0b103757c5... |
782dc081-52c7-4a47-b4d2-d1846b101afa | xuesunny/tomasulo-algorithm | Reservation_station.cpp | #include"Reservation_station.h"
static int get_number(string s) { // 读取字符串中的数字
string num = "";
int i = 0;
while (i < s.length() && !isdigit(s[i])) i++;
while (i < s.length() && isdigit(s[i])) {
num += s[i];
i++;
}
return stoi(num); // 转为整数
}
Reservation_station::Reservation_station() {
rob = NULL;
sche... | ALGO | 0.951726 | 3.15379 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-01-25T03:42:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e20721b70ab7... |
04696c3a-f4a7-4b5d-8f73-6483af5b21c0 | Zer03sx/DATASTRUCT | DATASTRUCT/01_线性表的相关操作.cpp | #include <iostream>
using namespace std;
#define MAXSIZE 100
typedef int Element;
typedef struct {
Element data[MAXSIZE];
int len;
}SqlList;
// 顺序表的插入--------
bool ListInsert(SqlList& L, int pos, Element element)
{
//判断pos是否合法
if (pos < 1 || pos > L.len + 1)
return false;
//如果位置满了
if (L.len >= MAXSIZE)
ret... | ALGO | 0.99609 | 3.907568 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-03-19T15:23:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36843520bf... |
2503ec11-7a3b-4dba-8d1b-3e002cf28e44 | MilkClouds/Competitive-Programming | BOJ/milkclouds/18267/18267.cpp14.cpp |
#include <bits/stdc++.h>
#define rep(a,b,c) for(ll a=b;a<c;a++)
#define rep2(a,b,c) for(ll a=b;a>c;a--)
#define pb push_back
#define x first
#define y second
#define all(x) x.begin(), x.end()
using namespace std;
using ll=long long;
using ti=tuple<ll,ll,ll>;
using pi=pair<ll,ll>;
const int MAX = 1e5 + 5;... | ALGO | 0.999842 | 4.129788 | {
"github_metadata": {
"branch": "main",
"commit_count": 3514,
"repo_created_at": "2021-02-23T16:44:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f919d7705... |
f0351ac3-5645-44c8-a81f-8a6702bcf0a9 | tanviijain/data-structures | Heap/heap.cpp | #include<iostream>
using namespace std;
class heap
{
public:
void create_max_heap(int *,int);
void create_min_heap(int *,int);
void max_heapify(int *,int,int);
void min_heapify(int *,int,int);
void delete_from_heap(int *,int&);
void insertion_in_heap(int *,int,int&);
void display_heap(int *,... | ALGO | 0.999176 | 3.707004 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-08-07T15:02:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e0c10fce... |
4aafca6e-be36-47df-a4bd-6dabfbb1e979 | csaraiba/TAIS | AgujerosEnLaManguera/Source.cpp |
/*@ <answer>
*
* Nombre y Apellidos: <NAME>
*
*@ </answer> */
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
/*@ <answer>
Escribe aquí un comentario general sobre la solución, explicando cómo
se resuelve el problema y cuál es el coste de la solución, en función
del tamaño del... | ALGO | 0.999473 | 4.080466 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-10-23T12:55: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": "7a13e27dbbb... |
0f05deb0-f3d0-4ff7-aca8-f0b01dbc226a | giumanuz/cses | Sorting and Searching/ Ferris Wheel.cpp | #include <bits/stdc++.h>
#ifdef Giulio
#include <bits/debug.h>
#else
#define dbg(...)
#endif
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
... | ALGO | 0.999984 | 4.79819 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-02-21T21:30: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": "634966aa064... |
3d16915b-2f4c-4e69-9c0a-dc24d998796d | prady8339/placement_prep | recursion/casechangeper.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(string &s, string temp, int idx)
{
if (idx >= s.size())
{
cout << temp << endl;
return;
}
temp.push_back(s[idx]);
solve(s, temp, idx + 1);
temp.pop_back();
temp.push_back(s[idx] - 'a' + 'A');
solve(s, temp, idx + 1... | ALGO | 0.999814 | 4.064872 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-06-04T04:46:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d7fd4486e1... |
101eaffc-3dd3-415c-9343-437971268b64 | rk946/cpp | leetcode/test.cpp | #include<iostream>
#include<vector>
// #include<bitset>
using namespace std;
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, T... | ALGO | 0.999894 | 4.315259 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2020-06-29T05: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": "60045a89f... |
86c7f970-8bae-4d44-952b-f52f0a07e4c7 | sirkp/DSA | 17. Graphs/problems/p11.cpp | // https://practice.geeksforgeeks.org/problems/x-total-shapes3617/1/?track=DSASP-Graph&batchId=154
void dfs(int x, int y, vector<string>& adj, int m, int n){
adj[x][y] = 'O';
int i=x, j=y;
i = x+1;
if((i>=0 && i<m) && (j>=0 && j<n) && adj[i][j]=='X')
dfs(i, j, adj, m, n);
i = x-1;
... | ALGO | 0.999523 | 5.336135 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2020-06-18T05:36:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c79fec059... |
010ba4d0-46d1-4dc9-b011-f0cb2efb96e3 | bakkiraju/sharpenskills | Arrays/DuplicatesAtDistanceK.cc | /* Find if the array has duplicate items within distance K */
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
vector<int> findDuplicatesAtDistance(vector<int> &v, int size, int dist)
{
if (dist == 0) { return v;}
unordered_map<int,int> indxMap;
vector<int> res{};
... | ALGO | 0.999856 | 5.552386 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-07-10T22:54: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": "3a2861dc8... |
94e79a50-dbd5-415c-ba63-42afa88a0962 | Bishtashish/parallel_workspace | activity-numericalintegration/main.cpp | #include <iostream>
#include <cmath>
#include <cstdlib>
#include <chrono>
using namespace std::chrono;
#ifdef __cplusplus
extern "C" {
#endif
float f1(float x, int intensity);
float f2(float x, int intensity);
float f3(float x, int intensity);
float f4(float x, int intensity);
#ifdef __cplusplus
}
#endif
int mai... | ALGO | 0.998464 | 4.315223 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2021-01-28T22:35:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0da464fcc... |
c3d8da60-c8c7-4556-8020-cea71110db4c | godotengine/godot | thirdparty/jolt_physics/Jolt/Physics/Collision/ManifoldBetweenTwoFaces.cpp | // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
// SPDX-FileCopyrightText: 2021 <NAME>
// SPDX-License-Identifier: MIT
#include <Jolt/Jolt.h>
#include <Jolt/Physics/Collision/ManifoldBetweenTwoFaces.h>
#include <Jolt/Physics/Constraints/ContactConstraintManager.h>
#include <Jolt/Geometry/ClipPoly.h>
#... | ALGO | 0.994616 | 6.870723 | {
"github_metadata": {
"branch": "master",
"commit_count": 76043,
"repo_created_at": "2014-01-04T16:05:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98972,
"forks": 22820,
"issues": 5000,
"pull_requests": 3866
},
"file_meta": {
"content... |
b92f9d4c-18b5-40d0-8e31-4c7c0e804e2a | AbhiArya20/practice-language-or-technology | c++/dsa/085linkedList.c++ | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int val)
{
data = val;
next = NULL;
}
};
void insertAthead(Node *&head, int val);
void insertAtEnd(Node *&head, int val)
{
if (head == NULL)
{
insertAthead(head, val);
... | ALGO | 0.999967 | 4.617789 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-16T16:46: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": "861af7aac0cf... |
ff0aab88-4a7a-44a9-99ba-6dfee02607fa | Soth1985/Thor2 | tests/Practice/Shared.h | #define CHECK(cond, msg) printf("%s: %s: result:%d\n", __FUNCTION__, #msg, (cond) != 0)
template <class T>
void Swap(T& a, T& b)
{
T temp = a;
a = b;
b = temp;
}
template <class T>
T Abs(const T& val)
{
if (val < 0)
return -val;
return val;
}
int BinarySearch(int* array, int arraySize, in... | ALGO | 0.996804 | 4.855337 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2016-04-26T06: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": "0a5537f5... |
d3ae2a50-9c04-42b0-b687-5627a11f9df1 | yanfulongyan/AOSphere | Agre.cc | #include<stdio.h>
#include <string.h>
#include <omnetpp.h>
#include "pkt_m.h"
#include "Optical_m.h"
using namespace omnetpp;
bool AGG_Channel_busy[4160*16];
using namespace omnetpp;
class AgreY : public cSimpleModule
{
private:
int FOSRadix;
simtime_t finish_time;
int totalserverNum;
... | ALGO | 0.996118 | 3.440604 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-12-15T02:46: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": "e6fc8fc55d4a... |
d8b517db-116d-475c-b7d1-f0550b47beea | Ad2710/cse205-ds | assignments/11.10.2023/912.cpp | void merge(vector<int> &nums, int s, int e)
{
int mid = s - (s-e)/2;
int size1 = mid - s + 1;
int size2 = e - mid;
int* first = new int[size1];
int* second = new int[size2];
int k = s;
for(int i = 0; i < size1; i++)
{
first[i] = nums[k++... | ALGO | 0.999962 | 5.481107 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-08-02T09:05: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": "196eb28cd3c... |
1d51a746-9827-411c-8c69-f29118fb2db4 | MckinleyX/competition | regex/regex.cpp | //USACO: Find & Replace (2023 <NAME>)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define f first
#define s second
struct node
{
char val;
node *l, *r;
ll size = 1;
node()
{
val = '`';
l = nullptr;
r = nullptr;
}
node(char c)
{
val = c;
l = nullptr;
r = nullptr;
}
node(nod... | ALGO | 0.999964 | 4.325006 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-04-15T01:13: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": "50906340a69... |
d288dd01-d562-44fe-8035-0ed1339a6486 | tarpeyd12/spiky_nes | spnn/neat/mutations_connection.cpp | #include "mutations.hpp"
namespace neat
{
namespace Mutations
{
// connection value variations
uint64_t
Mutation_Conn_weight::operator()( NetworkGenotype& genotypeToMutate, InnovationGenerator&, const MutationRates& rates, const MutationLimits& limits, std::shared_ptr< Rand::RandomFun... | ALGO | 0.951681 | 6.117581 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2019-03-29T05:47: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": "2d7ec3ff... |
a2e4b7a8-8ec1-479f-8612-03c53c30a9cf | mt-shihab26/courses | 05_synapse-beginner-regular-season-2_mahmud-sajjad-abeer/Class-09-Cpp-Basic-DS-STL/Long-Contest-Code/B_Friends_of_Friends.cpp | #include <bits/stdc++.h>
using namespace std;
#define endn '\n'
#define umap unordered_map
#define uset unordered_set
#define pb push_back
#define GLOBAL_ARRAY_SIZE 10000005
#define LOCAL_ARRAY_SIZE 100005
typedef short int sint;
typedef unsigned int uint;
typedef long long int llint;
typedef unsigned long long int ull... | ALGO | 0.999601 | 4.000469 | {
"github_metadata": {
"branch": "main",
"commit_count": 667,
"repo_created_at": "2023-03-17T19:35:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "abb2eb0f23... |
21ceded6-41f6-4459-bb30-c3807a7ebfb1 | G33k1973/CodingGames | GraphColoringProblem.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
bool isSafe(int v, const std::vector<std::vector<bool>>& graph, int V, int color[], int c)
{
for (int i = 0; i < V; i++)
if (graph[v][i] && c == color[i])
return false;
return true;
}
/* A recursive utility function to solve ... | ALGO | 0.999942 | 5.633198 | {
"github_metadata": {
"branch": "master",
"commit_count": 151,
"repo_created_at": "2019-05-03T07:17: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": "ef89d03c... |
1746d991-e73b-4b1f-9648-20030c433e57 | mesaperry/cs225 | mp_traversals/imageTraversal/DFS.cpp | #include <iterator>
#include <cmath>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include "../cs225/PNG.h"
#include "../Point.h"
#include "ImageTraversal.h"
#include "DFS.h"
using namespace cs225;
/**
* Initializes a depth-first ImageTraversal on a given `png` image,
* starting at `start`... | ALGO | 0.998186 | 5.227058 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2022-07-23T18:17: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": "55032984f... |
c27021de-5b60-45e6-8f92-e87bcd5485d1 | gexahedron/cycle-double-covers | previous experiments/33pp_from_nz5/33pp_from_nz5.cpp | /*
* File: 33pp_from_nz5.cpp
* Author: <NAME>
*
* Created on 17 December 2016
* First version finished on 10 January 2017
*/
#include "util.h"
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <climits>
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <vector>
#include... | ALGO | 0.999375 | 3.724145 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2016-04-24T23:02:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4d11ebb... |
2356306f-af00-4481-b983-0ca521a140d7 | FahimAbrar0112/CP-Codes | Codes/DP/At Coder/1036C.cpp | // https : // codeforces.com/contest/1036/problem/C
#include <bits/stdc++.h>
using namespace std;
#define ll long long
string S;
ll dp[20][2][4];
ll go(ll index, bool small_taken, ll non_zero_digits)
{
if (non_zero_digits > 3)
return 0;
if (index == S.size())
return 1;
ll &ans = dp[inde... | ALGO | 0.999456 | 4.947484 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-11-19T20:39:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f488312857... |
3aef34fb-ae31-463e-99f2-3128748538a4 | bww9641/Algorithm_Project | codeup/2000번대/2130.cpp | #include<stdio.h>
double f(double x)
{
double sum = x;
double result = x;
double fact = 1.0f;
double x2 = x*x*-1.0f;;
//유한한 테일러 급수 전개
for(int i=1;i<15;++i)
{
fact *= ((2*i) * (2*i+1));
result *= x2;
sum += (result / fact);
}
... | ALGO | 0.999776 | 3.068077 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-07-21T23:30:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86a1827f2... |
788ef5e3-6046-426a-8fac-d5a869f82210 | Gurpreetsingh9465/modeling-and-simulation | chi.cpp | #include<bits/stdc++.h>
using namespace std;
float round(float var, int num)
{
char str[40];
sprintf(str, "%.2f", var);
sscanf(str, "%f", &var);
return var;
}
void solve() {
cout<<"Enter number of classes\n";
int n;
cin>>n;
int N,chi,interval;
N = chi = interval = 0;
... | ALGO | 0.999844 | 4.196188 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-05-04T15:40:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "7a34c44902... |
ddd8e7e3-7842-4443-bc5b-18f74aec0b52 | igorbraun/motis | modules/revise/src/get_ev_key.cc | #include "motis/revise/get_ev_key.h"
#include <algorithm>
#include "utl/verify.h"
#include "motis/core/access/realtime_access.h"
#include "motis/core/access/station_access.h"
#include "motis/core/access/trip_access.h"
namespace motis::revise {
ev_key get_ev_key(schedule const& sched, journey const& j,
... | ALGO | 0.901915 | 5.833251 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2020-06-25T08:25:03.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "motis-project/motis",
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"conten... |
73dce82d-6c8a-4589-aa1c-f9a675e62b65 | 716-Anuj/Codes | DSA Linked List/oddEvenOptimize.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* next;
public:
Node(int data1, Node* next1){
data = data1;
next = next1;
}
public:
Node(int data1){
data = data1;
next = nullptr;
}
};
Node* convertarr2LL(vector<int> &... | ALGO | 0.999988 | 5.554879 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-07-18T05:04: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": "e8a988a2a40... |
65b8cca1-34ed-48dc-8fd0-6ffe67bf2468 | kishen19/CentroidHAC | src/utils/nn_types.h | #pragma once
#include <queue>
#include "src/vamana/index.h"
#include "src/vamana/utils/beamSearch.h"
#include "src/vamana/utils/types.h"
#include "src/vamana/utils/stats.h"
#include "src/utils/graph.h"
#include "src/utils/union_find.h"
template<typename PointRange, typename indexType>
struct nn_knn {
using Point =... | ALGO | 0.999525 | 6.307696 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-04-05T21:31:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe07aa32e18... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.