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 |
|---|---|---|---|---|---|---|---|
50efc908-df2d-40e1-99f3-3ebcc127c261 | mgemperl/SpaceSim | Source/CollisionPolygon.h | #pragma once
#include <vector>
#include <set>
#include "Vector2D.h"
namespace SpaceSimNS
{
class CollisionPolygon
{
public:
// Comparator struct for sorting a collection of vector pointers
struct VectorPtrComp
{
// Order vectors by angle in the counter-clockwise direction
bool operator()(const Space::Vecto... | ALGO | 0.999367 | 7.451125 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-02-16T21:16:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "73595a768... |
00b470f6-41d4-4fdd-be3a-ebb079fd79f3 | JoshH28/CP_cpp | jobinterview.cpp | /*
I'm in the thick of it, everybody knows
They know me where it snows, I skied in and they froze
I don't know no nothin' 'bout no ice, I'm just cold
Forty somethin' milli' subs or so, I've been told
I'm in my prime and this ain't even final form
They knocked me down, but still, my feet, they find the floor
I went from... | ALGO | 0.99999 | 3.984323 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-12-23T12:56: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": "04301acc1e10... |
27244eba-1ef8-485f-86ed-392e9d8e2047 | Paras-Roy/micro_mouse | src/main/headers/MMmaze.h | class Maze
{
public:
// ------------------Public Variables---------------------
Cell cells[CELL_SIZE][CELL_SIZE];
// ------------------Public Functions---------------------
Maze()
{
//inititalize all cells
for(int i = 0; i < CELL_SIZE; i++)
{
... | ALGO | 0.991567 | 4.239655 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-07-23T00:33: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": "2635bcc04071... |
0403b5b6-6fa0-45cb-9388-a9db2337c1c0 | hw-sudo/Big_fight | 源代码/main.cpp | #include<stdio.h>
#include<conio.h>
#include<time.h>
#include<math.h>
#include<graphics.h>
#include<easyx.h>
#define FilePath1 "timeer.txt"
#define FilePath "counter.txt"
#define WIDTH 1024 // 屏幕宽
#define HEIGHT 576 // 屏幕高
#define MAPW (WIDTH*4) // 地图宽
#define MAPH (HEIGHT*4) // 地图高
#define... | ALGO | 0.98539 | 3.474253 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-04-25T08:13:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 53,
"forks": 10,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bd3730147... |
c1a5092d-b352-4162-bb52-f487e77d6340 | ChristiaanAlwin/NeuLAND_Veto | R3BRoot_Source/land/calibration/R3BNeulandCal2HitPar.h | // ---------------------------------------------------------------------------------------
// ----- R3BNeulandCal2HitPar -----
// ----- Copied from Land02/detector/land/n_gen_det_cosmic1 on 11-2015 -----
// --------------------------------------------... | DATA | 0.919424 | 3.860335 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-02-17T13:05: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": "3202e597a6... |
fd2804ff-db50-4459-8742-105f8b4208d0 | areslp/matlab | SparseSuite/SuiteSparse/SPQR/MATLAB/spqr_solve.cpp | // =============================================================================
// === spqr_solve mexFunction ==================================================
// =============================================================================
#include "spqr_mx.hpp"
/* x = A\b using a sparse QR factorization.
x ... | ALGO | 0.999858 | 4.083284 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2012-11-02T03:38:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 180,
"forks": 170,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "1331c... |
e74f69c1-462b-4419-b6ed-9fcd31cd424b | sheepduke/leetcode | src/93. Restore IP Addresses/main.cpp | /*
Given a string containing only digits, restore it by returning all possible
valid IP address combinations.
Example:
Input: "25525511135"
Output: ["255.255.11.135", "255.255.111.35"]
*/
#include "../util/common.hpp"
class Solution {
public:
vector<string> restoreIpAddresses(string s) {
auto result = vector... | ALGO | 0.999914 | 6.33946 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2019-03-28T15:51: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": "27ad00da... |
08dbf6d9-6087-4333-870e-0ee2ee3a5c0e | apache/celeborn | cpp/celeborn/conf/BaseConf.h | /*
* Based on Config.h from Facebook Velox
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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... | CONFIG | 0.93563 | 7.34253 | {
"github_metadata": {
"branch": "main",
"commit_count": 2390,
"repo_created_at": "2021-12-10T08:57:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 959,
"forks": 412,
"issues": 2,
"pull_requests": 21
},
"file_meta": {
"content_id": "8d500... |
aec259dc-e328-4a7f-8dcb-2ef0326a3536 | heehelou/TDprog | TP6/src/node.cpp | #include "node.hpp"
#include <iostream>
#include <algorithm>
//Créer un nouveau nœud
Node* create_node(int value) {
return new Node{value, nullptr, nullptr};
}
// vérifier si un nœud est une feuille
bool Node::is_leaf() const {
return left == nullptr && right == nullptr;
}
//insérer une valeur dans l'arbre b... | ALGO | 0.999423 | 3.837705 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-03-26T09:59: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": "587e88e757f0... |
3d5602d3-9e7b-4247-973e-712643d7b8d2 | roberts-erglis/My-Codes | C++ List/Integers_Sorter.cpp | /*
--EN--
The program that reads a sequence of integers from the standard input and outputs
the integers in sorted order (i.e., in non-descending order). Use with sort();
--LV--
Programma, kas nolasa veselu skaitļu secību no standarta ievades un
izvada veselus skaitļus sakārtotā secībā (t.i., nedilstošā secībā). Izm... | ALGO | 0.998315 | 5.147109 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-12-09T21:55: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": "811018b43ef... |
f6c61155-9f80-4abd-80a4-877d6dddda74 | cmeng0321/leetcode | 3.cpp | /*
3. Longest Substring Without Repeating Characters
Given a string s, find the length of the longest substring without repeating characters.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: s = "bbbbb"
Output: 1
Explanation: The answer is "b", with ... | ALGO | 0.999924 | 5.742589 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2019-05-13T14:31:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b866966dc... |
a8ef725f-b12c-49d0-aff0-82a75cedecc0 | 58Tinkal/Leetcode | 1387-find-elements-in-a-contaminated-binary-tree/find-elements-in-a-contaminated-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999833 | 6.010676 | {
"github_metadata": {
"branch": "main",
"commit_count": 1025,
"repo_created_at": "2025-01-10T08:32: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": "f3bd7404b... |
1380b9ec-0945-4637-9b69-ecacaeaca88c | OscarCarPu/codeforces | 1400-1499/1426/F_Number_of_Subsequences.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1e9+7;
const int N=5e5;
int dp[N][4][3];//n, nº of ?, letter (a,0;b,1;c,2);
int poW(int a,int p){
if(p==0)return 1;
if(p==1)return a;
return poW(a*a%mod,p/2)*(p%2?a:1LL)%mod;
}
signed main(){
ios_base::sync_with_stdio(fal... | ALGO | 0.999988 | 3.759645 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-02-18T22:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa31690dc1a1... |
b2dcfad5-f090-4e02-be56-ad504bc0a741 | K1XE/LeetCode | 每日一题/2025-7/7.23/1717.删除子字符串的最大得分.cpp | /*
* @lc app=leetcode.cn id=1717 lang=cpp
*
* [1717] 删除子字符串的最大得分
*/
// @lc code=start
#pragma once
#include <bits/stdc++.h>
#include <ranges>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#define ALL(v) v.begin(), v.end()
#define For(i, _) for (int i = 0, i##end = _; i < i##end... | ALGO | 0.999679 | 5.345794 | {
"github_metadata": {
"branch": "main",
"commit_count": 183,
"repo_created_at": "2025-04-12T03:26:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9b1c6027e... |
6b8b4ea3-9d71-4fca-adfe-3b5102cfbf6a | ashwani361/Leetcode-Solutions | Replace every element with the least greater element on its right - GFG/replace-every-element-with-the-least-greater-element-on-its-right.cpp | //{ Driver Code Starts
/* Driver program to test above function */
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//Back-end complete function Template for C++
class Solution{
public:
// function to get the next least greater index for each and
// every temp.second of the te... | ALGO | 0.999959 | 6.22682 | {
"github_metadata": {
"branch": "main",
"commit_count": 1066,
"repo_created_at": "2021-12-24T09:37: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": "5638e96b4... |
133dfe55-f00c-4305-8d65-72802d51e3bc | hepromark/StereoVisionDepthMap | src/FundamentalSolver.cpp | #include "FundamentalSolver.h"
#include <iostream>
#include <filesystem>
#include <fstream>
#include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/calib3d.hpp>
#include <string>
#include <cmath>
#include "PointSelection.h"
#include "Distortion.h"
Fundamenta... | ALGO | 0.99756 | 4.751987 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2024-02-10T01:10:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c98d11b3611... |
bd85aa0c-6df2-4fbb-8d32-05c063b3bdf8 | roykim0823/CPP | cppstd17-code/lib/partransformreduce.cpp | //********************************************************
// The following code example is taken from the book
// C++17 - The Complete Guide
// by <NAME> (www.josuttis.com)
// http://www.cppstd17.com
//
// The code is licensed under a
// Creative Commons Attribution 4.0 International License
// http://creativecom... | ALGO | 0.998776 | 5.745702 | {
"github_metadata": {
"branch": "master",
"commit_count": 153,
"repo_created_at": "2018-07-26T02:16:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "501b42be... |
67dfedab-a61f-4fbe-a15d-bd51c9c7336f | nCk9/cpp_prac | max_subarr_sum.cpp | // #include<iostream> //O(n^3) solution...
// using namespace std;
// int main()
// {
// int sz;cin >> sz;
// int arr[sz];
// for(int i=0; i<sz; i++)
// cin >> arr[i];
// int sas=1; int max_sum=0;
// while(sas < sz)
// {
// for(int i=0; i<sz ;i++)
// {
// int su... | ALGO | 0.999928 | 4.942338 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-01-20T20:06: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": "bbc65091f7... |
b62f09b3-8abc-4e75-9cab-5a1be7827b14 | ishandutta2007/codeforces-n | niyaznigmatul/normal/1037/D.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<vector<int> > edges(n);
vector<int> r(n), order(n), was(n), q(n);
for (int i = 0; i + 1 < n; i++) {
int x, y;
cin >> x >> y;
--x;
--y;
edges[x].push_back(y);
edges[y]... | ALGO | 0.999996 | 4.87894 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "3bd7eccb861c... |
d162185b-54ee-4f5d-ad6f-390af3bcfc3a | littlesam95/AlgorithmPractice | 백준/Gold/2623. 음악프로그램/음악프로그램.cc | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#define MAX 1001
using namespace std;
int N, M;
vector<int> vec[MAX];
int parent_num[MAX];
queue<int> q;
vector<int> answer;
void dfs() {
while (!q.empty()) {
int now_idx = q.front();
answer.push_back(now_idx);
q.pop(... | ALGO | 0.999994 | 3.984437 | {
"github_metadata": {
"branch": "main",
"commit_count": 933,
"repo_created_at": "2024-08-28T00:09:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9e1c1da65... |
970a05b6-8575-4aa0-9c3a-fb2d78607e30 | jgsu-acm/problems | problems/LQ/LQ2006/std.cpp | #include <iostream>
#include <ctime>
using namespace std;
//==========================================
#include <ranges>
#include <vector>
const int maxn = 1015;
const int mod = 2020;
namespace solution1 // 填表法 DP
{
int dp[maxn][maxn];
int calc(int n)
{
for(int i=1;i<=n;i++) dp[i][0] = 1;
f... | ALGO | 0.99985 | 3.987769 | {
"github_metadata": {
"branch": "main",
"commit_count": 413,
"repo_created_at": "2022-01-22T15:45:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "febc6be9a2... |
a0e7e786-cd0a-48f4-9221-5320cb29acbf | Yefaqihan/124240091_Yefa | TugasPTB_124240091.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
struct Mahasiswa {
char nim[10];
char nama[50];
};
struct Pohon {
Mahasiswa data;
Pohon *kiri, *kanan;
};
FILE *mhs;
Pohon* buatNode(const Mahasiswa &var) {
Pohon *simpul = new Pohon;
simpul->data = var;
simp... | ALGO | 0.99626 | 4.395315 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-02-15T03:25: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": "b68f1bacb930... |
69d44560-bdba-40da-b37a-00f40b204f81 | lugonzalg/advent_code | 2023/day2/p1/main.cpp | #include <vector>
#include <unordered_map>
#include <fstream>
#include <iostream>
using namespace std;
bool get_token(const string &line, const string &delimiter, string token[2]) {
size_t idx;
idx = line.find(delimiter);
//cout << "idx: " << idx << endl;
if (idx == -1)
return true;
token[0] = line.substr(0, ... | ALGO | 0.990999 | 4.457939 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2021-12-02T13:21: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": "adf9aa5c0d6... |
0e9c2c2a-80b9-4094-a089-d5f480a4efb4 | Dptandel/Android_SE_Assignments | Module_4_OOPS_Concepts/Module_4(4)/Prog4.cpp | // 4. Write a C++ Program display Student Mark sheet using Multiple inheritance
#include<iostream>
using namespace std;
class Student {
public:
string sname;
int standard, seat_no;
public:
int getStudent() {
cout << " ***** Enter Details for mark sheet ***** " << endl;
... | TOOL | 0.939664 | 4.676693 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-04-06T08:31:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d8c92afb840... |
fbbec3bb-5da2-4853-8f94-bc22d44333fb | Irfan6220c/Cplusplus-small-projects | Simplified blackjack game/main.cpp | //My take on blackjack game
#include <iostream>
#include <vector>
#include <array>
#include <ctime>
#include <algorithm>
#include <random>
#include <string>
enum Card_Rank
{
Rank_2,
Rank_3,
Rank_4,
Rank_5,
Rank_6,
Rank_7,
Rank_8,
Rank_9,
Rank_10,
Rank_Jack,
Rank_King,
R... | TOOL | 0.98612 | 3.703755 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2020-12-13T01:43: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": "83d80701b5d... |
023c7f2a-3d16-4c27-818d-e24b9e7c167d | jannatulferdos05/Codeforces-Solutions | 1775A1.cpp | // Problem: A1. Gardener and the Capybaras (easy version)
// #843 (Div. 2)
// URL: https://codeforces.com/contest/1775/problem/A1
#include<bits/stdc++.h>
#define For(i,n) for(int i=1;i<n;i++)
#define ll long long
#define pb push_back
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define fo(i,a,b) for(i=a;i... | ALGO | 0.999717 | 4.026091 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-05-07T14:53: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": "b534fca08571... |
088e138f-719f-4698-a7df-73f47df448c2 | Shubhangi001/DSA | DP/knapSack/unbounded/coinchange.cpp | // https://practice.geeksforgeeks.org/problems/coin-change2448/1
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
/**
* @brief combo of subset sum and unbounded knapsack
*
* @param S coin denominations present
* @param n size of array
* @param m cents to make
* @return long ... | ALGO | 0.999954 | 4.93509 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2022-07-01T18:57: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": "ce3d280154a... |
70de02ae-f10e-4a39-8d58-6b03a256039d | ishandutta2007/codeforces-c | cucl2/normal/1305/H.cpp | #include <bits/stdc++.h>
using namespace std;
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define loop(i, a) for (int i = 0; i < (a); ++i)
#define cont(i, a) for (int i = 1; i <= (a); ++i)
#define circ(i, a, b) for (int i = (a); i <= (b); ++i)
#define range(i, a, b, c) for (int i = (a); (c) > ... | ALGO | 0.999941 | 3.672683 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "5be657b04983... |
7d9842be-da3d-476c-8156-cad5556b1408 | BlueSu007/Luogu-codes | P1109 学生分组.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int a[100 + 5];
int n, leftn, rightn, sum;
int main() {
ios::sync_with_stdio( false );
cin >> n;
for ( int i = 1 ; i <= n ; i++ ) {
cin >> a[i];
sum += a[i];
}
int q = 0, p = 0;
cin >> leftn >> rightn;
... | ALGO | 0.999954 | 3.534236 | {
"github_metadata": {
"branch": "master",
"commit_count": 572,
"repo_created_at": "2020-04-08T07:44:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70d047d5... |
61824f9a-47f9-431b-8b11-0d5b43548a4a | andremralves/competitiveProgramming | beecrowd/e.cpp | #include <bits/stdc++.h>
#define pb(x) push_back(x)
#define all(x) x.begin(),x.end()
using namespace std;
using ll = int64_t;
using ii = pair<int, int>;
ll ceil(ll a, ll b) {return a % b == 0 ? a / b : a / b + 1;}
vector<ii> dir4 = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
vector<ii> dir8 = {{1, 0}, {1, 1}, {0, 1}, {-1, 1... | ALGO | 0.99998 | 3.315423 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2022-09-16T06:11:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ba7a4e4... |
0493503a-e39d-49b7-9ec0-d6244c7b627f | heisastark/april-long-2020 | REBIT4.cpp | #include<bits/stdc++.h>
#define ll long long int
#define db double
#define pb push_back
#define fin for(int i=0; i<n; i++)
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL)
#define MOD 998244353
using namespace std;
ll power(ll x, ll y, ll p){
ll res = 1; // Initialize result
x = x % p; ... | ALGO | 0.99997 | 4.616706 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-07-30T15:46: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": "b0c89ab77f... |
e746c347-80c0-4897-b599-fc9207a4626c | brycepg/machine_learning_group2 | mlpack-1.0.12/src/mlpack/methods/regularized_svd/regularized_svd_impl.hpp | /**
* @file regularized_svd_impl.hpp
* @author <NAME>
*
* An implementation of Regularized SVD.
*
* This file is part of mlpack 1.0.12.
*
* mlpack is free software; you may redstribute it and/or modify it under the
* terms of the 3-clause BSD license. You should have received a copy of the
* 3-clause BSD lic... | ALGO | 0.998852 | 7.686132 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2015-03-09T20:10: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": "846aa7bed... |
0d70e17d-07de-453e-8e62-47acfa7294b3 | ASSERT-KTH/Supersonic | predictions/submissions-aizu-cot-gpt4/Codenet/p01538/585519868/response_9.cpp | #include <stdio.h>
using namespace std;
int main() {
int Q, N, count, tmp, max, S;
bool FLG;
scanf("%d", &Q);
for (int loop = 0; loop < Q; loop++) {
scanf("%d", &N);
bool *table = new bool[N + 1]();
count = 0;
table[N] = true;
FLG = false;
while (true) {
if (N / 10 == 0)
br... | ALGO | 0.999798 | 3.745839 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-02-03T10:33:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "799efb594d425... |
7f9f659d-b673-4a0a-a2dc-966fea98b58e | TouwaErioH/Algorithm | 2018summer/8 11/uvalive 4487.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int N = 20020;
int f[N],v[N];
int vis[N],a[20];
int T=N-10;
void init(int n)
{
for (int i=0;i<=n+1;i++){
f[i]=i;
v[i]=0;
vis[i]=0;
}
f[T]=T;
v[T]=0;
}
int findparent(int x) //findparent... | ALGO | 0.999287 | 3.381127 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2018-05-28T04:33: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": "5c68c8c0d... |
250d6a57-0ffb-442a-82bc-49dddb9bf461 | GUKANGx/DataStructureAndAlgorithm | LeetCode/Easy/Q110.cpp | #include "main.h"
using namespace std;
using namespace Utils::MyBinaryTree;
namespace {
class Solution {
public:
unordered_map<TreeNode *, int> depthMap;
int treeDepth(TreeNode *root)
{
if (root == nullptr) {
return 0;
}
int leftDepth... | ALGO | 0.999493 | 6.125325 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2022-01-27T13:59: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": "4f5579c1e... |
95cf5fec-fc4b-4dee-9fd5-2db1e7b135d6 | piyush1146115/Competitive-Programming | Codechef/SnackDown 2018 Round 1B/Waiting in Queue .cpp | /*
* FILE: Waiting in Queue .cpp
*
* @author: <NAME> <piyush123kantidas[at]gmail[dot]com>
*
* LINK:
*
* DATE CREATED: 29.10.2018 10:49:57 +06
*
* DESCRIPTION:
*
* DEVELOPMENT HISTORY:
* Date Version Description
* --------------------------------------------------------------
* 29-10-2018 1.0... | ALGO | 0.999896 | 3.426269 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2019-09-30T18:09:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17be6b4d4... |
3192d653-29bb-4181-b81e-28fad33bcafa | dchular/dchular-CP | done/2019-6-02-AGC/A_Kenken Race.cpp | #include <iostream>
using namespace std;
int main(){
int n,a,b,c,d;
string s;
cin >> n >> a >> b >> c >> d;
cin >> s;
if(c > d){
int flag = 0;
int flag2 = 0;
if(s[b] == '.' && s[b-2] == '.') flag = 1;
else if(s[b] == '.' && s[b+1] == '.') flag = 1;
else if(s[d-2] == '.' && s[d] == '.') ... | ALGO | 0.999952 | 3.127313 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-04-10T01:43: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": "c8db4d928e52... |
e4cbaad3-a62b-4f6e-b429-2b98a7ae1e4a | MukuFlash03/data-structures-algos-CPP | Self/Strings/Capitalize_Each_Word.cpp | /*
Problem:
https://practice.geeksforgeeks.org/problems/upper-case-conversion/0
*/
#include <iostream>
#include <vector>
#include <string>
#include <bits/stdc++.h>
using namespace std;
vector<string> tokenize(string str)
{
vector <string> tokens;
string word;
stringstream checkstr(str);
while (getlin... | ALGO | 0.998634 | 4.655971 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-10-21T08:19:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8ace0701... |
9abbe548-2aa9-43d0-9109-5acb7ca653bb | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03393/s043020443.cpp | #include <bits/stdc++.h>
#define pb push_back
#define pi pair<int, int>
#define l first
#define r second
#define all(x) x.begin(), x.end()
const int maxn = 5e5 + 1;
using namespace std;
int n;
string s;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
string s; cin >> s;
int n ... | ALGO | 0.99968 | 3.839533 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "51a70ff34c... |
97e84c8a-3473-425f-8760-978d2c87b33d | ishandutta2007/codeforces-m | mr.ilchi/normal/57/D.cpp | /*
* in the name of god
*
*
*
*
*
*
*
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <queue>
#include <complex>
#include <stack>
#include <deque>
#include <queue>
#in... | ALGO | 0.999344 | 3.558228 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2db37e9c7e2... |
23284696-bb98-401e-9ad6-d97ae9355b49 | patellakshmi/CppCourse | leetcode/hard/KthSmallestPair.h | /*
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Created by <NAME> on 11/07/21.
Copyright (c) 2021, Fight For Education Pvt. Ltd. All rights reserved.
Please visit us: www.fight4edu.com or www.fight4edu.org
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
... | ALGO | 0.999993 | 6.617354 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-01-13T06:04: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": "b302cb2d211... |
4e1fa965-3662-483a-8576-edccfff96cd8 | anant147/Coding-Problems | dynamic_prog/21.maximumSubSquare.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <stack>
#include <cstring>
#include <utility>
using namespace std;
// dynamic programming video 21
// maximum sub square problem - find the side of maximum sub square in given matrix of 0s and 1s with all 1s
// method 1
// time complexity - o ( row * ... | ALGO | 0.99955 | 4.235075 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-12-11T07:46:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29456aaf1e... |
38c24540-a580-4037-b9f3-141e62e70428 | AhmadMasood-dev/3rd-sem_linked_list | Heap_insert_0index.cpp | #include <iostream>
template <class T>
class Heap
{
private:
T *data;
int n;
public:
Heap(int s = 10)
{
data = new T[s];
n = -1;
}
void insert(T key)
{
n++;
int idx = n;
int temp = key;
data[n] = key;
while (idx > 0 && temp > data[((i... | ALGO | 0.990871 | 3.788374 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2023-10-18T10:47: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": "d455653600... |
f641d758-0ffc-4ead-83c2-5e8c59810806 | omgunjal/DSA-problem-solving-with-Cpp | Object Oriented Programming/operatorOverloadingbasic.cpp | // operator overloading
#include<iostream>
using namespace std;
// creating a class:
class student{
// data members:
public:
string name;
int age;
bool gender;
// constructor
student(string name_, int age_, bool gender_){
name = name_;
age = ... | TOOL | 0.942395 | 5.173641 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-06-03T12:56: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": "f20c34c2df4... |
54ff22a5-2c00-4328-a6dc-afee22345926 | Cron191/DSA | ONDSACUOIKY/38.cpp |
#include <iostream>
using namespace std;
struct NODE
{
int val;
NODE *pLeft;
NODE *pRight;
};
typedef NODE *TREE;
NODE *CreateNODE(int x)
{
NODE *q = new NODE();
q->val = x;
q->pLeft = NULL;
q->pRight = NULL;
return q;
}
void InsertTree(TREE &T, int x)
{
NODE *q = CreateNODE(x);
... | ALGO | 1 | 4.134848 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2024-11-01T07:58:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "843c79b69... |
5eeac30a-d316-4d9b-91db-b4805eb463dd | divyanshu29jha/DSA | STL/15_upper_and_lower_bounds.cpp | // Upper Bound and Lower Bound questions are those of binary search only.
// Lower and upper bounds return memory location (pointers in case of arrays and iterators in case of vectors).
// Lower and upper bounds are always used in 'sorted' array/vector since it works in O(log n) time. Else it will work in O(n) time. (s... | ALGO | 0.999596 | 4.927269 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-08-18T03:35:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ab538a301... |
ebc1f508-95e9-454d-832e-2ed7b388d788 | songkey7/leetcode | 122.best_time_to_buy_and_sell_stock_2/BestTimeToBuyAndSellStock2.cpp | //
// Created by <NAME> on 03/04/2018.
//
#include "BestTimeToBuyAndSellStock2.h"
int BestTimeToBuyAndSellStock2::max_profit(vector<int> &prices) {
int n = prices.size();
vector<int> dp(n + 1, 0);
for(int i = 1; i < n; i++){
dp[i + 1] = max(dp[i + 1], dp[i]);
for(int j = i - 1; j >= 0; j--... | ALGO | 0.99836 | 5.936826 | {
"github_metadata": {
"branch": "master",
"commit_count": 216,
"repo_created_at": "2018-01-05T03:31: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": "fc6dfd0d... |
40b973c3-dbf7-4691-bb55-2caa8bac6d10 | crimson000000/OIcode | luogu/7738.cpp | #define LOCAL
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
typedef unsigned long long ull;
typedef unsigned short us;
inline ll read()
{
ll x;
cin >> x;
return x;
}
const int N = 400010;
bool s[N+1][256];
ull lastans;
ull myRand(ull &k1, ull &k2) {
u... | ALGO | 0.99966 | 3.738072 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-07-06T06:03:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0495139e86... |
e01200f2-ff40-4ea2-9c2d-876313a9191a | ishandutta2007/codeforces-m | mnbvmar/normal/809/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define RE(i,n) FOR(i,1,n)
#define R(i,n) REP(i,n)
#define FI first
#define SE second
#define st FI
#defin... | ALGO | 0.999825 | 5.000521 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6ccdde7da60... |
f65a3789-68c7-457f-b5f9-28b2a90b821c | ChristianOverby/ppnm | exercises/machine_epsilon/main.cpp | #include<cmath>
#include<chrono>
#include<iostream>
#include"includes/functions.hpp"
int main(){
// largest signed & unsigned int number
int x = 0;
unsigned int y = 0;
// largest signed int number
for (int i = 2147482624; i>0; i++) {
x = i;
// This can be done since signed integers... | TOOL | 0.954685 | 4.086434 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2025-01-27T11:43:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25cf8fa45f2... |
9f5fcf52-bbe9-4582-ba42-27f5bb7b5f9b | Hyeondeok-Shin/qmcpack | src/QMCHamiltonians/BareKineticEnergy.h | //////////////////////////////////////////////////////////////////////////////////////
// This file is distributed under the University of Illinois/NCSA Open Source License.
// See LICENSE file in top directory for details.
//
// Copyright (c) 2016 <NAME> and QMCPACK developers.
//
// File developed by: <NAME>, <EMAIL>... | TOOL | 0.948932 | 6.024566 | {
"github_metadata": {
"branch": "develop",
"commit_count": 18080,
"repo_created_at": "2019-09-11T23:19:19.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "QMCPACK/qmcpack",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content... |
c315455f-376f-462d-9c84-46c762c97574 | nygenome/lancet | src/ContigLink.hh | #ifndef CONTIGLINK_HH
#define CONTIGLINK_HH 1
/****************************************************************************
** ContigLink.hh
**
** Classes for representing and storing links between contigs
**
*****************************************************************************/
/************************** CO... | TOOL | 0.909046 | 4.300227 | {
"github_metadata": {
"branch": "v1.1.x",
"commit_count": 172,
"repo_created_at": "2016-02-03T16:52:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 155,
"forks": 35,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d19f5c... |
7ee564f5-3eaf-4029-9590-92c624972d4c | rafaelcsva/CompetitiveProgramming | code/uri/1511.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1010;
class SegTree {
int nodes[N << 2];
int query(int node, int i, int j, int l, int r){
if(j < l || i > r){
return 0;
}
if(l <= i && j <= r){
return nodes[node];
}else{
int mid ... | ALGO | 0.999347 | 4.660149 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-08-30T23:18:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39de60d3d... |
9b527108-b532-4413-ab98-9555b58ab015 | IEEE-WIE-VIT/Everything-CPP | Basics/17.cpp | #include<iostream>
using namespace std;
inline int product(int a, int b)
{
// Not recommended to use below lines with inline functions
// static int c=0; // This executes only once
// c = c + 1; // Next time this function is run, the value of c will be retained
return a*b;
}
float moneyReceived(int cu... | ALGO | 0.958752 | 3.708599 | {
"github_metadata": {
"branch": "main",
"commit_count": 407,
"repo_created_at": "2021-10-02T06:05:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17,
"forks": 89,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "0152f87cb... |
0bd155f0-1857-4434-bad9-07b46a54818d | brianbbsu/program | code archive/CF/920C.cpp | //{
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(i,n) memset(i,n,sizeof i)
#define X first
#define Y second
#define SZ(_a) (int)_a.size()
#define ALL(_a) _a.begin(),_... | ALGO | 0.999996 | 3.636113 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2017-02-06T06:47:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a98eb156... |
38dc24c9-09f8-4509-8405-248b721964f6 | ishandutta2007/codeforces-m | marcin_smu/normal/1630/D.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// gp_hash_table<int, int> mapka;
using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define ... | ALGO | 0.999882 | 3.888025 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffd7a94137f9... |
bccc528b-2ce3-4b22-b424-82fa681dee53 | OpenFOAM/OpenFOAM-dev | src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\... | ALGO | 0.999692 | 6.703134 | {
"github_metadata": {
"branch": "master",
"commit_count": 8589,
"repo_created_at": "2014-12-10T15:47:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1770,
"forks": 642,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "3e... |
ec56aba9-0179-4bd1-900f-fac350cdb6b2 | eescueta/leetcode | leetcode/leetcode/158.h | #pragma once
#pragma once
#include <vector>
#include <iostream>
#include <map>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include "Solution.h"
#include <cstdint>
using namespace std;
/*
The API: int read4(char *buf) reads 4 characters at a time from a file.
The return value is the actual... | TOOL | 0.931418 | 4.824799 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2016-08-27T23:51:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c99858ed... |
d70a9212-cba4-407c-a678-b3c4a37141f9 | CongJyu/Luogu-Problems | P5710/main.cpp | // luogu p5710
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
int n = 0;
cin >> n;
bool dm1 = false, dm2 = false;
if (n % 2 == 0) {
dm1 = true;
}
if (n > 4 && n <= 12) {
dm2 = true;
}
if (dm1 && dm2) {
cout << 1 << " ";
... | ALGO | 0.999972 | 3.054484 | {
"github_metadata": {
"branch": "main",
"commit_count": 204,
"repo_created_at": "2022-07-17T02:58:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7dcdaa60d6... |
d3f76532-edb0-4931-aad8-afc53a4a7d97 | Seraphimu/Hello-World | Algorithms/Example/greedy_backpack.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#define MAX 6
using namespace std;
//描述背包
typedef struct BackPack
{
double weight;
double value;
double unitPrice;
}BackPack;
//最大重量和大价值
double maxWeight = 100;
double maxValue;
double solveVector[MAX];
//背包数量
int n = 5;
void disSolve()
{
f... | ALGO | 0.999515 | 3.408541 | {
"github_metadata": {
"branch": "main",
"commit_count": 154,
"repo_created_at": "2023-01-01T08:52: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": "2291084454... |
3dec9d9e-90e8-495c-83e5-7e0d453ff86a | stlwolf/simple_shooting_game | src/Winsprog/MatrixCal.cpp |
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include "MatrixCal.h"
/**********************************************************
単位行列作成関数
引数:単位行列にするMATRIX4x4型変数のアドレス
戻り値:なし
引数として渡された行列を単位行列にする関数
**********************************************************/
void Mat4x4_Identity( MATRIX4x4 *mat )
{
m... | ALGO | 0.98081 | 3.504368 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2011-11-18T08:41: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": "ff2c6e6549... |
6b37d91b-7125-4d60-a7fb-7bba49df5b62 | Mir00r/Data_Structure | Recursion/Rec_Prac_Set1.cpp | #include <bits/stdc++.h>
using namespace std;
#define LI long int
#define LLI long long int
#define LL __int64
#define ULL unsigned long long
#define LLU long long unsigned
#define row 5
#define col 5
#define MAX 100000
#define jora pair <int, int>
#define memo(array, value) memset(array, value, sizeof(array))
#defin... | ALGO | 0.999795 | 3.400227 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2016-02-19T17:25: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": "6de323566... |
70b875c3-07a9-478e-930e-885ee8471de9 | Lakshmivallala/Understanding-CPP-and-More | PlacementTrainingProblems/Problems/BinaryStringDuplication.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.999822 | 3.918933 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2021-05-28T15:01: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": "911923093... |
68e69c11-4747-4326-a4a1-f9cbe56f9aed | suraj1611/Competitive_Programming | CP-Codes/cuba_trainee8.cpp | /* Code by : Suraj (@suraj1611) */
#include<bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<n; i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define mx INT_MAX
#define mn INT_MIN
#define md 1000000007
#define pb push_back
#define mp make_pair
#define maxs... | ALGO | 0.999987 | 3.394909 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-02-13T16:34: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": "077588317... |
6f5d8424-3dbb-4c2f-b120-e5ffae84abaa | Alfredo-Renteria/1337 | Array/Medium/Minimum_Average_Difference.cpp | /**
* <NAME>
* Leetcode Problem #2256: Minimum Average Difference
* December '22 LeetCoding Challenge - Medium
* @Topics: Array, Prefix Sum
* @Time: O(n) @Space: O(1)
* Where n is the size of nums
*/
#include <cstdlib> //for abs
#include <iostream>
#include <limits> //for numeric_limits
#include <numeric> //for accumu... | ALGO | 0.999886 | 6.788313 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-12-09T08:35: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": "76d9daf9931... |
35e4d5ec-13db-4403-90bd-d63f77c1cc34 | wuxvsuizhong/Li_-pro2 | master/C++/算法题练习/开密码锁.cpp | #include "strsplit.h"
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <unordered_set>
#include <vector>
using namespace std;
class Sulution {
public:
int openlock(vector<string> &deadends, string target) {
if (target == "0000") {
return 0;
}
... | ALGO | 0.999708 | 4.916688 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2017-10-18T06:57: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": "b53fdaab5... |
38daaeae-9684-49b9-be45-9a3dbc8f0908 | pro-ady/UVa-Challenge | Dynamic Programming/minimum steps to reach 1.cpp | #include<bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
int memo_pad[10000];
// 1st approach
// Greedy Solution which is incorrect
int no_of_steps(int n){
if(n==1){
return 0;
}
if(n%3==0){
return 1 + no_of_steps(n/3);
}
if(n%2==0){
return 1 + no_of_steps(n/... | ALGO | 0.999975 | 4.436957 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-05-16T04:27: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": "23f7cba81... |
23f7a1ea-0ba9-4e7a-9a82-0e852e4c4f34 | jonasschultemattler/kmerdict | source/dict_locate.cpp | #include <filesystem>
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/search/views/kmer_hash.hpp>
#include <seqan3/search/views/minimiser_hash.hpp>
#include "dict.hpp"
#include "kmer_minimiser_hash.hpp"
seqan3::dna4_vector kmer_to_string(uint64_t kmer, size_t const kmer_size)
{
seqan3::dna4_vector resu... | ALGO | 0.954465 | 5.156981 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2025-02-17T11:42: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": "076e1c8bb0... |
5c52fd11-c263-4efc-891c-2c7e684dd6b3 | wzmw-zr/Code-Archive | 2024/4/18/1.LeetCode2007.cpp | /*************************************************************************
> File Name: 1.LeetCode2007.cpp
> Author:
> Mail:
> Created Time: 2024年04月18日 星期四 10时40分56秒
************************************************************************/
#include <iostream>
#include <string>
#include <vector>
#include <queue... | ALGO | 0.999966 | 4.675972 | {
"github_metadata": {
"branch": "master",
"commit_count": 1859,
"repo_created_at": "2019-11-28T12:33: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": "e2cd9ec... |
a89c49d2-5cdb-4b24-aa8e-f7b66a22505f | Julia-Khramyshkina/homeworks | first semester/homework 3/task1/qsortWithInsert.cpp | #include <stdlib.h>
#include <iostream>
using namespace std;
void printArray(int a[], int size)
{
for (int i = 0; i < size; ++i) {
printf("%d ", a[i]);
}
}
void sortOfInsert (int massiv[], int left, int right)
{
for (int i = left + 1; i <= right; ++i)
{
for (int j = i; (j > left) && (massiv[j] < massiv[j - 1]... | ALGO | 0.999326 | 4.203181 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2014-02-16T09:27: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": "92456c1a... |
6b6c3dc4-425c-4fc6-9f5c-0dcf6c1bf9f0 | pratiksaha/practice | others/employeeCount.cpp | //to find the reporting chain of a employee
//Using features of C++ Standard (2011) Compile using g++ -std=c++11
#include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
using namespace std;
unordered_map<string, vector<string>> employeeCount(unordered_map<string, string> emp_mgr) {
unordered_m... | TOOL | 0.994849 | 4.625149 | {
"github_metadata": {
"branch": "master",
"commit_count": 371,
"repo_created_at": "2014-10-03T04:22:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1deddb27... |
e797c1e8-f67c-42b8-9e54-d619d79fbebb | khanhnguyen216/CP-WITH-NKHANH | THEORY/PERFECTNUMBER_USINGNAMESPACESUB.CPP | // Code thử nghiệm chia subtask tuỳ dữ liệu đầu vào (Kiểm tra 1 số có phải là số hoàn hảo hay không?)
/*[Keep coding and you will get bugs! :D]*/
/* --------------------------------------*/
/* khnguyen21th06 on screen yah~~ */
/* Noob CPer :( */
/*--------------------------------------... | ALGO | 0.999886 | 4.770585 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2024-10-12T11:11: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": "56c73d50fa5... |
c7a97c00-aec9-4639-99d3-814ea35549c8 | novagc/prog_hw | 32. Доп Задача №112647. Мосты на Мубуту/Source.cpp | #define _CRT_SECURE_NO_WARNINGS
#define ll long long
#include <stdio.h>
#include <limits.h>
#include <algorithm>
#include <stdexcept>
#include <iterator>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <cst... | ALGO | 0.999943 | 3.526122 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-04-27T07:19:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79118d739... |
43cf01eb-2221-4471-9964-14c985c0e393 | WWWanghhhao/Parallel-Programming | 多线程相关编程实验代码/pthread_static_sse.cpp | #include <cstddef>
#include <pthread.h>
#include <semaphore.h>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <emmintrin.h>
#include <fstream>
#include <immintrin.h>
#include <iostream>
#include <nmmintrin.h>
#include <numeric>
#include <pmmintrin.h>
#include <random>
#include <smmin... | ALGO | 0.999177 | 4.111314 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-03-09T01:58: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": "ff34aa8119b... |
59a2debd-6f40-4b12-88c2-4b6de1e311be | Fan-Zhixuan/DL-learning | leecode/1209双指针/搜索旋转排序数组/mian.cpp | #include<iostream>
#include<vector>
#include <algorithm>
using namespace std;
/*关于旋转数组,最重要的是找到有序的那一半。与右侧边界比较,如果小于右侧边界则右侧有序,反之则左侧有序
判断每次的中间值与目标值的大小是否处于有序的一侧,如果在有序一侧则回到最原始的二分法问题,如果不在有序一侧,则在另外一侧继续重复上述过程*/
class Solution {
public:
int search(vector<int>& nums, int target) {
int n = (int)nums.size();
... | ALGO | 0.999996 | 5.243245 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-10-30T08:52: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": "c44241b42eb... |
3e8d319f-1cd5-4fe8-936a-ac6963dfb6e5 | ishandutta2007/codeforces-c | chemthan/normal/913/D.cpp | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define... | ALGO | 0.999967 | 3.302989 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "020b3bb8de9c... |
e13bb6b9-9573-452d-88ed-9c21eec22967 | FollowTheWind-new/Introduction-to-algorithms | Part 6/Chapter 24/main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include "../Chapter 23/SparseGraph.hpp"
#include "../Chapter 23/DenseGraph.hpp"
#include "ShortestPath.hpp"
using namespace std;
int main() {
int vertices = 10;
int egdes = 25;
srand(time(NULL));
//sparseGraph
SparseGrap... | ALGO | 0.994608 | 4.479455 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-11-11T18:16: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": "3e93ab319b... |
c686082d-5d7a-4f96-8621-48274f3d58e8 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/10/1004/personal_submission/cf748e_lettera.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// #define int ll
const int M = 1e7 + 5;
ll cnt[M]{};
void solve()
{
int n, k;
cin >> n >> k;
for (int i = 0; i < n; i++)
{
int x;
cin >> x;
cnt[x]++;
}
ll cur = 0;
for (int i = 1e7; i > 0; i--)
... | ALGO | 0.999879 | 3.934469 | {
"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": "1774... |
6b04c8e8-67e8-41bc-b892-68389a77c4de | ishandutta2007/codeforces-b | belonogov/normal/333/E.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <cassert>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <set>
#include <map>
#include <vector>
#include <queue>
using namespace std;
#define fr first
#define sc second
#define mp make_pair
#define ... | ALGO | 0.999862 | 3.657068 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05: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": "f29c4c25d467... |
466bb317-d414-4941-adbd-3bd581ed430c | Sehee-Lee-01/algorithmCPP | class2/10845.cpp | #include <iostream>
#include <string>
using namespace std;
struct Queue_element {
int data;
Queue_element * next_element;
Queue_element(int data=0, Queue_element * next_element=nullptr) : data(data), next_element(next_element) {}
};
class Queue {
private:
Queue_element * start;
int Queue_size=0;
p... | ALGO | 0.999564 | 4.377373 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2022-06-24T08:53: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": "4daec4aefb... |
cb01a9fa-153e-4837-aad8-483edd4e6e5f | kalsasdf/HiNA-DCN_INET | routing/bgpv4/bgpmessage/BgpUpdate.cc | //
// Copyright (C) 2010 <NAME>
//
// SPDX-License-Identifier: LGPL-3.0-or-later
//
#include "inet/routing/bgpv4/bgpmessage/BgpUpdate.h"
namespace inet {
namespace bgp {
unsigned short computePathAttributeBytes(const BgpUpdatePathAttributes& pathAttr)
{
unsigned short contentBytes = pathAttr.getExtendedLengthBit... | TOOL | 0.941596 | 6.680518 | {
"github_metadata": {
"branch": "main",
"commit_count": 187,
"repo_created_at": "2022-11-23T06:05:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6bfdafe81... |
0c861223-e13e-486f-bb8e-ce10c3bbf040 | AMT9495/amt9495.github.com | C++/ass2.cpp | #include<iostream>
using namespace std;
int main(){
int num1,num2,num3;
cout<<"\nEnter First Number : ";
cin>>num1;
cout<<"\nEnter Second Number : ";
cin>>num2;
cout<<"\nEnter Third Number : ";
cin>>num3;
if(num1>num2 && num1>num3){
cout<<"\nFirst Number is the Largest number... | ALGO | 0.999651 | 3.042172 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2021-07-01T19:10:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "217ee9b38... |
808c55a2-b12d-40cc-b208-adaf24458237 | cmu15418/assignment1 | prog1_mandelbrot_threads/mandelbrotThread.cpp | #include <stdio.h>
#include <pthread.h>
#include "CycleTimer.h"
typedef struct {
float x0, x1;
float y0, y1;
unsigned int width;
unsigned int height;
int maxIterations;
int* output;
int threadId;
int numThreads;
} WorkerArgs;
extern void mandelbrotSerial(
float x0, float y0, floa... | ALGO | 0.969851 | 5.288907 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-01-13T02:50:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 33,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ae953de... |
90547d8d-460b-4cae-997c-6287687ab706 | Manpreet-2002/Interview-Prep | Binary Search/find_ele_sortedArr.cpp | #include <bits/stdc++.h>
using namespace std;
int binarySearch(vector<int> &arr, int start, int end, int key)
{
while (start <= end)
{
int mid = start + (end - start) / 2;
if (arr[mid] == key)
{
return mid;
}
else if (arr[mid] > key)
{
end... | ALGO | 0.999994 | 5.069885 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-06-14T12:15: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": "d7c5ab0cf73... |
b2687bf3-3339-46a1-8b47-53a7ceaf1fc0 | darthsuogles/phissenschaft | algo/leetcode_p4.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
double findKthElem(int *A, int m, int *B, int n, int k) {
if ( m > n ) // A is the shorter array
return findKthElem(B, n, A, m, k);
if ( 0 == m )
return B[k-1];
if ( 1 == k ) // return the s... | ALGO | 0.999991 | 5.834726 | {
"github_metadata": {
"branch": "develop",
"commit_count": 190,
"repo_created_at": "2017-03-12T05:28:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bfb7d3... |
481ee328-1a1a-4da3-b5f7-7e2df8253d03 | K-ona/CPPTraining | snippets/algorithm/string/kmp.cpp | // created by Kona @VSCode
#include <vector>
#include <string>
using std::vector;
vector<int> get_next(std::string str) {
vector<int> next(str.size());
size_t m = str.size();
int t = next[0] = -1;
int i = 0;
while (i < m - 1) {
if (0 <= t and str[i] != str[t]) {
t = next[t];
} else {
++... | ALGO | 0.999943 | 5.64494 | {
"github_metadata": {
"branch": "main",
"commit_count": 531,
"repo_created_at": "2020-10-24T07:49: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": "28870a7677... |
4e7b9984-7b30-4c6b-8470-fd3219e9c1b8 | ThunderMJ2003/DSA | DSA_Striver/A2Z/A2Z_3_1_5_2.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
// void rotate(vector<int>& nums, int k) {
// vector <int> fin(nums.size());
// for (int i=0; i<nums.size(); i++){
// fin[(i+k)%(nu... | ALGO | 0.99987 | 6.15872 | {
"github_metadata": {
"branch": "main",
"commit_count": 262,
"repo_created_at": "2024-08-10T16:48: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": "04b45e7fa2... |
9450a887-2c71-47c9-b1dc-d2e5f0329e0b | KD1-86658-Pankaj/MyRepoStudies | CPP_/Solved_Assignment/Assignment_3/Question_2.cpp | #include <iostream>
using namespace std;
class tollbooth
{
int totalnumberofcars;
int totalamtofmoney;
int totalNonPayingCar;
public:
tollbooth()
{
totalnumberofcars = 0;
totalamtofmoney = 0;
totalNonPayingCar = 0;
}
void payingcars()
{
totalnumberofca... | TOOL | 0.956903 | 3.989338 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-27T03:38:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ecda2c3dd3... |
c2580bbc-5dd2-4227-a00b-40f8b8fb0b01 | Nisha213-mar/Data-Structure | Linked List/Doubly Linked List/doubly_linked_list.cpp | //Implement Doubly linked list
#include<iostream>
using namespace std;
class Node
{
public:
int key;
int data;
Node* next;
Node* previous;
Node()
{
key=0;
data=0;
next=NULL;
previous=NULL;
}
Node(int k,int d)
{
key=k;
data=d;
}
};
class DoublyL... | ALGO | 0.99986 | 5.322209 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2021-09-11T10:44:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fba8da07da... |
b73c9c94-5271-4373-8d43-c4e36176fce7 | ishandutta2007/codeforces-n | nebuchadnezzar/normal/1056/E.cpp | #ifdef LOCAL
# define _GLIBCXX_DEBUG
#else
# define cerr __get_ce
#endif
#include <bits/stdc++.h>
#define ff first
#define ss second
#define szof(x) ((int)x.size())
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
int const INF = (int)1e9 + 1e3;
ll const INFL = (ll)1e18 ... | ALGO | 0.999752 | 4.438626 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "7f0f8c9e6c8a... |
ccc2b496-0219-4462-95af-bab0ddaf6941 | skkwan/reference-Phase2-GCT | RCTSLRB360/bitonicSort16.cpp |
#include "bitonicSort16.h"
//Main CAE block (compare and exchange)
GreaterSmaller AscendDescend(Cluster &x, Cluster &y){
//#pragma HLS PIPELINE II=9
#pragma HLS INLINE
GreaterSmaller s;
s.greater = (x.clusterEnergy() > y.clusterEnergy()) ? x : y;
s.smaller = (x.clusterEnergy() > y.clusterEnergy()) ? y :... | ALGO | 0.99993 | 4.538888 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-09-20T15:25: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": "73657ab17d... |
498b069b-d48a-47d5-9d4f-90130c007805 | fkie/fkie-nbv-planner | include/fkie_nbv_planner/utils.hpp | #ifndef NBV_UTILS_H
#define NBV_UTILS_H
#include <random>
#include <Eigen/Dense>
#include <ros/ros.h>
#include <octomap/octomap.h>
#include <geometry_msgs/Polygon.h>
#include <geometry_msgs/PoseStamped.h>
/**
* @brief Samples one point uniformly over a sphere with a [radius] and within [arm_height_min] and [arm_hei... | ALGO | 0.978773 | 6.852777 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-09-08T16:58:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 46,
"forks": 7,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "8d5311c92959... |
c760fc59-f072-436f-a532-279630315076 | LnC-Study/Acmicpc-net | Tree/Segment Tree/2243 사탕상자/ckw_cpp.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#define INF 987654321
#define MAXFLAVOR 1000000
using namespace std;
class RSQ {
private :
int size;
vector<int> rangeSum;
int init(const vector<int>&arr, int node, int left, int right) {
if (left ==... | ALGO | 0.998757 | 4.248843 | {
"github_metadata": {
"branch": "master",
"commit_count": 313,
"repo_created_at": "2019-01-08T11:14:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "da0bb1721... |
0db2c708-40d2-42ca-ac29-a3e0953a1e93 | rojanbar/scripts | solve_heat_1d.cpp | /// @file init.cpp
/// @author <NAME>
/// @date March 07, 2025
/// @brief Main script for solving the 1D non-linear heat diffusion equation (KPP-Fisher's PDE).
/// Boundary conditions are:
/// BC1: u(x=0,t) = A(sin(t))^2; BC2: u(x=L,t) = 0; initial condition: u(x,0) = 0
/// Discretization scheme is explicit forward Eul... | ALGO | 0.999876 | 5.958535 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-12T16:35: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": "29a728ea1511... |
63777a78-c330-4654-9f15-736528395c58 | saikns/forked-projects | apriltags_cpp/apriltags_demo.cpp | // C++ standard library files
#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <list>
#include <ctime>
// OpenCV library files
#include <opencv2/opencv.hpp>
// Eigen library files
#include <Eigen/Core>
// AprilTags library files
#include <apriltags/TagDetector.h>
#include <apriltags/Ta... | TOOL | 0.971796 | 6.139568 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-04-10T14:28:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4932b0dfcf... |
ce122892-3bea-4aa1-8b2a-8eb76181eade | JackMaguire/RobotsCore | include/robots_core/graph/dense.hh | #pragma once
#include <robots_core/game.hh>
#include <robots_core/forecasting.hh>
#include <robots_core/asserts.hh>
#include <robots_core/graph/board_as_graph.hh>
#include <robots_core/graph/node.hh>
//#include <array>
#include <cmath> //log
#include <vector>
#include <array>
namespace robots_core{
namespace grap... | ALGO | 0.996499 | 5.364475 | {
"github_metadata": {
"branch": "main",
"commit_count": 177,
"repo_created_at": "2021-08-17T01:16: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": "3043a71272... |
a5af4d95-0a4b-4430-8a9d-c8917f0022fd | dimitridim8/DSA_Project_3FINAL | DSA_Project3/VectorGraph.cpp | #include "VectorGraph.h"
#include <algorithm>
#include <iostream>
// Helper function to filter games based on criteria
void VectorGraph::addGame(const GameInfo& game) {
games.push_back(game);
}
std::vector<GameInfo> VectorGraph::filterGames(const std::string& genre, const std::string& publisher,
... | ALGO | 0.990278 | 6.359114 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-12-05T03:26: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": "2c9b0b079d54... |
a3a5862f-4a30-442c-89bb-e5e08d69c7aa | showkat2203/UVa | New_UVA/1237.cpp | #include <bits/stdc++.h>
using namespace std ;
int main()
{
//freopen("1237.txt", "r", stdin) ;
int tst, i, j, k, l, a[10010], b[10010], n, m ;
char A[10010][45], ans[10010][45] ;
scanf("%d", &tst);
for(int tt = 0; tt <tst; tt++)
{
if( tt != 0 )
printf("\n") ;
scanf... | ALGO | 0.999936 | 3.339795 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-10-05T11:52: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": "d8cf807c0f... |
64088886-a50b-428a-ad39-45eb45af0c32 | plasmatic1/templates | string/manachers.hpp | #pragma once
#include "../template.hpp"
/*
* d[i] = Longest odd-length palindrome centered at i. Formally, largest value d[i] s.t. s[i-k] == s[i+k] for all
* 0<=k<d[i].
*
* This algorithm works almost identically to z-algorithm. For more information and explanation, see
* string/z_algorithm.hpp
*
* The key di... | ALGO | 0.999225 | 6.559611 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2021-06-06T23:06:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "e01824b26... |
1fc26235-c58a-4989-b00a-c8fd31a9ae2d | wxiang7/robin_leetcode | Valid Palindrome.cc | class Solution {
public:
bool isPalindrome(string s) {
int slen = s.length();
if (slen == 0) return true;
int from = 0
, to = slen-1;
while (from < to) {
if (!isalnum(s[from])) {
++from;
} else if (!isalnum(s[to])) {
... | ALGO | 0.998443 | 5.726878 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-08-12T13:57: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": "6fac627260... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.