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 |
|---|---|---|---|---|---|---|---|
d8b09814-552f-4a1b-9ca3-c8814e61239e | MarcToussaint/robotics-course | course1-Lectures/old/13-bayesOpt/main.cpp | #include <stdlib.h>
#include <Core/array.h>
#include <Core/util.h>
#include <Plot/plot.h>
#include <Algo/MLcourse.h>
double f(const arr& x){
CHECK(x.N==1, "");
return -.3*cos(7.*x(0)) + sumOfSqr(x);
}
int main(int argc,char **argv){
rnd.clockSeed(); //random seed rng
//display the function: evaluate it over ... | ALGO | 0.999607 | 5.024711 | {
"github_metadata": {
"branch": "master",
"commit_count": 252,
"repo_created_at": "2018-10-17T13:14:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 41,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "992de0... |
0056caf3-e661-4867-b908-1f7f91946853 | kingMonkeh/CCC-Solutions | DMOJ/Educational DP Contest AtCoder K - Stones.cpp | #include <bits/stdc++.h>
/*
Very similar problem to CCC problem "Nukit", using DP approach
Idea is to view the game as a choice tree
When the game has reached a point where no move can be made, we view this as a losing position, return false.
If some amount of stones was removed from a certain state of the game, cau... | ALGO | 0.999997 | 4.433443 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2022-12-23T00:05:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "7344817ddf... |
8cffe1a2-e3a7-4f79-b07c-e9e34437c965 | marglvn/Data-Structures | 2DVector_2DList.cpp | #include <iostream>
#include <vector>
#include <list>
#include <fstream>
#include <sstream>
using namespace std;
void intake(vector<vector<string>>& v, fstream& f)
{
string line;
while (getline(f, line))
{
stringstream stream(line);
string cell;
vector<string> temp;
while (getline(stream, cell, ','))
{... | TOOL | 0.953995 | 4.025906 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-02-27T03:17: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": "326437892cf... |
fce22b19-66b5-432e-a2a9-ba512912c5ce | Junghs-cloud/Baekjoon | Silver/1/_12849.cpp | #include <iostream>
using namespace std;
int main()
{
cin.tie(NULL);
ios::sync_with_stdio(false);
int N;
cin >> N;
long long** dp = new long long*[N+1];
for (int i = 0; i < N + 1; i++)
{
dp[i] = new long long[8];
for (int j = 0; j < 8; j++)
{
dp[i][j] = 0;
}
}
dp[0][0] = 1;
for (int i = 1; i < N ... | ALGO | 0.99998 | 3.874889 | {
"github_metadata": {
"branch": "master",
"commit_count": 816,
"repo_created_at": "2023-01-08T13:47: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": "b50bb218... |
2914645f-5086-43d2-aa99-54a7ea6c4dd6 | mhiu05/Code_PTIT | DSA/DSA09011_So_luong_hon_dao.cpp | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
void faster()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
using ll = long long;
const int mod = 1e9 + 7;
const int MAXN = 100005;
int n, m;
int a[501][501];
int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy[8] = {-1, 0, 1... | ALGO | 0.999735 | 5.165566 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-09-17T15:48:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7e81b47389... |
20473d6c-45e0-4354-9573-5ebe20beced2 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/MixtralExpert/top0-100/jump-Solution.jump/177907_DoS_Exec_Code_Overflow.cpp | void Splash::scaleMaskYuXd(SplashImageMaskSource src, void *srcData,
int srcWidth, int srcHeight,
int scaledWidth, int scaledHeight,
SplashBitmap *dest) {
Guchar *lineBuf;
Guint pix;
Guchar *destPtr0, *destPtr;
int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep, xx, d, d0, d1;
int i;
yp ... | ALGO | 0.969515 | 3.25511 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-22T14:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab21ada5b0b5... |
0e2348d0-c858-4105-b16a-72a20437c234 | ishandutta2007/codeforces-n | nik_storm_2010/normal/234/G.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 10;
vector <int> ans[N];
int res;
void solve(int l, int r, int nom)
{
res = max(res, nom);
if (l == r) return;
int m = (l + r) / 2;
for (int i = l; i <= m; i++) ans[nom].push_back(i);
solve(l, m, nom + 1);... | ALGO | 0.99955 | 3.618215 | {
"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": "549d129d0868... |
b0753eff-a3e5-4c1d-8c02-722af8f12e8c | sgrade/cpptest | leetcode/min-stack.cpp | // 155. Min Stack
// https://leetcode.com/problems/min-stack/
#include <bits/stdc++.h>
using namespace std;
class MinStack {
public:
MinStack() {
}
void push(int val) {
st.push(val);
if (mins.empty() || val < mins.top().first) {
mins.emplace(pair<int, int>(val, 1));
... | ALGO | 0.999771 | 6.437932 | {
"github_metadata": {
"branch": "master",
"commit_count": 2401,
"repo_created_at": "2020-08-01T16:38:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fbe7d4... |
175f3c89-067c-46f2-a063-208e02397e8d | smurfedGitHubIO/AtCoder-Solutions | Unsorted/ARC74A.cpp | #include <iostream>
#include <cstdlib>
#include <time.h>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <array>
#include <string>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#includ... | ALGO | 0.999889 | 3.333365 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2021-11-17T10:39: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": "073f001856... |
cf299173-5244-48e1-90bf-f1bf0d0dc7e2 | kochol/kge | Source/ps/ParticleBehavior.cpp | // File name: ParticleBehavior.cpp
// Des:
// Date: January 11, 2011 (21/10/1389)
// Programmer: <NAME>
#include "../../Headers/ps/Particle.h"
#include "../../Headers/ps/ParticleBehavior.h"
#include "../../Include/math/Utility.h"
#include <stdio.h>
namespace kge
{
namespace ps
{
//-------------------------------... | ALGO | 0.949405 | 4.647606 | {
"github_metadata": {
"branch": "master",
"commit_count": 168,
"repo_created_at": "2012-05-14T10:11:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 12,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd708c... |
71e2f370-4820-47b5-9364-ca855bc03c75 | pieceof/usaco | CHAPTER 1/ex1.cpp | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
void get1(char a, int len) {
char (*p)[10];
p = a;
for (int i = 0; i < len; i++) {
scanf("%s", &(*p)[len]);
}
return;
}
void str2(char a[], int len) {
len = strlen(a);
for (int i = 0; i < len - 1; i++) {
for (int j = 0... | ALGO | 0.999939 | 3.257605 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-01-08T02:54: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": "93f7094a5c... |
f5ab72e6-e559-49a1-9c03-510b6e3f6db4 | daniiito07/PRACTICAS-PROGRAMACI-N-CASA | P012_BUCLES_V0/P012_BUCLES_V0/P012_BUCLES_V0.cpp | // P012_BUCLES_WHILE_FOR_V0.cpp :
// <NAME>.
// Realizar un contador de vida, que sean 3
#include <iostream>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "ES_MX.UTF-8");
int i = 0;
bool iniciar;
bool repetir = true;
do
{
std::cout << "Tenías 3 vidas y ya perdiste una, ¿Deseas... | TOOL | 0.918955 | 3.566256 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-09-23T16:37: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": "0a1b9843e98... |
fca42aac-7f46-4832-9ac3-ff496bbc4610 | ishandutta2007/codeforces-d | danya090699/normal/1009/G.cpp | #include <bits/stdc++.h>
using namespace std;
const int A=6;
int lq[1<<A], mq[1<<A], yk[1<<A];
int cha(int le, int mask, int add)
{
for(int a=0; a<(1<<A); a++)
{
if(a&(1<<le)) lq[a]+=add;
if(a&mask) mq[a]+=add;
}
}
bool check()
{
for(int a=0; a<(1<<A); a++)
{
if(lq[a]>mq[a]) ... | ALGO | 0.999825 | 3.998579 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "4eefb696cdc8... |
3cf370ac-a7cf-4284-a08c-2815ca65577a | ElitsaY/Design_and_analysis_of_algorithms_practicum | homeworks/2 & 3/zigzag-testgen.cpp | //0 -> testgen
//1 -> wrong solition
//2 -> correct solution
//3 -> testcase splitter
#define MODE 0
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <random>
#include <chrono>
#include <queue>
#include <list>
#include <set>
#include <map>
using namespace std;
... | ALGO | 0.999901 | 4.671491 | {
"github_metadata": {
"branch": "main",
"commit_count": 200,
"repo_created_at": "2022-03-26T19:32:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "947b876cce... |
35cb8c4e-0273-4a94-9c83-e69b8a9ce48d | m0rphed/SPBU-homework-sem01 | source/testworks/testwork-02-try-01/dataStructures.cpp | #include "dataStructures.h"
#include <iostream>
#include <vector>
#include <utility>
using namespace std;
typedef int ElementType;
Node::Node() : data(0), next(nullptr)
{
}
Node::Node(const ElementType &value) : data(value), next(nullptr)
{
}
MyLinkedList::MyLinkedList()
{
head = nullptr;
length = 0;
}
MyLi... | TOOL | 0.990824 | 3.773031 | {
"github_metadata": {
"branch": "master",
"commit_count": 221,
"repo_created_at": "2018-09-16T13:07:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "c72b4157... |
a6da4368-11ee-4112-b07e-c83da7e36d2f | Peter-Schenkels/IPASS-Sogyrolib-MatrixEngine | src/Frog Jump (Demo)/main.cpp | // Copyright <NAME> 2019 - 2021.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
#include "hwlib.hpp"
#include "matrix_engine.hpp"
#include "l3g4_master.hpp"
#include "controller.hpp"
//#... | TOOL | 0.927259 | 4.034295 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-07-01T19:17: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": "bd3bf0a09... |
04696b97-e1b1-41e1-9018-6881a7419988 | AlexeyShik/Algorithms-and-data-structures | Year-2-Term-3-Work-1/Algo_8_P.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
enum color {
WHITE, BLACK
};
int curr_component = 0;
inline void dfs(int u, vector<color> &used, vector<int> &order, vector<vector<int> > &g) {
used[u] = BLACK;
for (int v : g[u]) {
if (used[v] == WHITE) {
... | ALGO | 0.999972 | 4.377198 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2019-11-23T21:12: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": "8ad1b9f9b... |
9751ec1a-64b3-4468-bf12-440c3056b1ba | KSH-code/TIL | algorithm/BOJ/1865/Main.cpp | #include <cstdio>
#include <vector>
/**
* https://www.acmicpc.net/problem/1865
* BOJ 백준온라인져지 1865 웜홀 풀이
*/
using namespace std;
int N, M;
int main () {
int T;
scanf("%d", &T);
while(T--) {
int N, M, W;
scanf("%d%d%d", &N, &M, &W);
int *d = new int[501];
vector<vector<pair<int, int> > > edges(N ... | ALGO | 0.999931 | 4.959822 | {
"github_metadata": {
"branch": "master",
"commit_count": 425,
"repo_created_at": "2018-01-08T12:09:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a4e8fc7... |
113517d2-7ff1-4c36-8fc0-1b07c6517e79 | thinker99k/BOJ-24winter | 2502/250222/9097F-2E.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <sstream>
#define DEBUG 0
using namespace std;
typedef struct {
int row;
int col;
} Pos;
typedef struct __Node {
string val;
__Node *childs[4];
} Node;
Node *makeNode() {
Node *ret = new Node;
... | ALGO | 0.999898 | 4.867507 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-12-19T03:35: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": "fce695eaa85... |
4e2a317c-27d9-4e9e-81da-96db91e5fc40 | markusnygard/8-channel-NDI-encoder | DecklinkSDK/Linux/Samples/PlaybackStills/ImageLoaderLinux.cpp | /* -LICENSE-START-
** Copyright (c) 2018 Blackmagic Design
**
** Permission is hereby granted, free of charge, to any person or organization
** obtaining a copy of the software and accompanying documentation (the
** "Software") to use, reproduce, display, distribute, sub-license, execute,
** and transmit the... | TOOL | 0.970723 | 6.308822 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-09-27T03:56:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb039a91c8... |
5901586a-8a73-42eb-974b-c09fd5b9d249 | roshnimishraa/Interview-Bit | Tree/BST traversal/2-Sum Binary Tree.cpp | TC : O(N)
SC : O(log N) ~ O(N)
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
bool helper(TreeNode* A, int B, unordered_set<int> &st)
{
if(A == NULL) return false;
int... | ALGO | 0.999998 | 5.445428 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2024-07-16T07:46:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5546250e58... |
b29ad629-785d-4659-8681-7fe5b332198d | Troy96/leetcode-challenges | june-challenge/sort_color.cpp | // Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.
// Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
// Note: You are not suppose to use ... | ALGO | 0.999982 | 6.016548 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2020-05-10T18:26: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": "b7c1f2ce9... |
59ba906e-0e33-4303-98b8-531b4a370c48 | ArashPartow/schifra | schifra_reed_solomon_threads_example01.cpp | /*
(**************************************************************************)
(* *)
(* Schifra *)
(* Reed-Solomon Error Correcting Code Library *)
(* ... | ALGO | 0.990089 | 5.45468 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2010-12-07T20:37:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 31,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e649bf1... |
a9b4ce77-449c-4bd4-a881-56b9c8115c43 | greenfox-zerda-sparta/besszerf | week-02_matrix/Day-1_if_while_do_for/romans.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
cout << "Hi! Let's see the roman numbers!" << endl << endl;
int input;
do {
string out = "Roman number: ";
cout << "Enter a number between 1 and 3999 (or -1 for exit): ";
cin >> input;
if (input == -1){
break;
} else if (input <... | TOOL | 0.992406 | 3.458636 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2016-10-19T11:34:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4830ee409... |
4dd3fec4-4955-478b-b973-9bdfed5d0410 | nevermore3/RoadMatch | modules/differ/hmm/hmm_probability.cpp | #include "hmm_probability.h"
#include "geom/geo_util.h"
#include "data_manager/mesh_manager.h"
#include "pathengine/path_engine.h"
#include "util/match_geo_util.h"
#define measurementErrorSigma 20.0
#define transitionProbabilityBeta 0.00959442
#define timeDifference(x) ( (x * 1.0) / 400.0)
#define PI 3.14159265358979... | ALGO | 0.999651 | 4.066466 | {
"github_metadata": {
"branch": "1.0/feature/diffroad",
"commit_count": 38,
"repo_created_at": "2019-10-28T16:21:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_i... |
763c3c44-eaa5-4643-b078-10ea16b49622 | gs18103/PS | BOJ/Archive/19833.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define em emplace
#define all(v) v.begin(), v.end()
#define reset(x) memset(x, 0, sizeof(x))
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
const int MAX = 101010;
const int INF = 1... | ALGO | 0.999963 | 3.450415 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-03-02T00:20:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8b1e55036d... |
552ee9c9-8fd3-431e-8cdc-87137e4c1edd | sanhaa/Coding | 백준/Gold/21610. 마법사 상어와 비바라기/마법사 상어와 비바라기.cc | // BOJ 21610: 마법사 상어와 비바라기
#include <iostream>
using namespace std;
const int MAXN = 60; // <= 50
int dr[] = { 0,0,-1,-1,-1,0,1,1,1 }, dc[] = { 0,-1,-1,0,1,1,1,0,-1 };
int A[MAXN][MAXN] = { 0, }, clouds[MAXN][MAXN] = { 0, };
int N = 0, M = 0;
void print_arr() {
cout << "A: " << endl;
for (int i = 1; i <= N; i++)... | ALGO | 0.999935 | 4.787107 | {
"github_metadata": {
"branch": "master",
"commit_count": 410,
"repo_created_at": "2020-07-14T07:57:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "a56de23... |
4cfab1cc-8468-4498-8e65-f9ddff01c874 | MVARUNREDDY8203/LEETCODE_- | 2294-minimum-time-to-complete-trips/minimum-time-to-complete-trips.cpp | class Solution {
public:
long long minimumTime(vector<int>& time, int totalTrips) {
long long int l = INT_MAX, r = INT_MIN, n = time.size();
for (int i=0; i<n; i++) {
if (time[i] > r) {
r = time[i];
}
}
l = 1;
r = r * totalTrips;
... | ALGO | 0.999974 | 5.545859 | {
"github_metadata": {
"branch": "main",
"commit_count": 3042,
"repo_created_at": "2023-07-05T16:07: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": "fdb260769... |
bcbcfce0-9b44-4aa6-b503-cbbc6c96ce94 | pkestene/euler2d_kokkos | src/main.cpp | // SPDX-FileCopyrightText: 2024 euler2d_kokkos authors
//
// SPDX-License-Identifier: Apache-2.0
/**
* Hydro2d solver for teaching purpose.
*
* \date April, 16 2016
* \author <NAME>
*/
#include <cstdio>
#include <cstdlib>
#include "kokkos_shared.h"
#include "HydroBaseFunctor.h"
#include "ComputeRadialProfileFu... | ALGO | 0.994205 | 5.67984 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2017-11-06T18:19:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "674c1a1... |
4d4b0970-58d6-41e3-b42c-e45eff0f5188 | KEON-KIM/Programmers | level3/gem.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
using namespace std;
vector<int> solution(vector<string> gems) {
vector<int> answer(2);
map<string, int> gemMap;
set<string> num(gems.begin(), gems.end());
int abs, left, right;
left = right = 0;
for(string ... | ALGO | 0.999249 | 4.687437 | {
"github_metadata": {
"branch": "main",
"commit_count": 166,
"repo_created_at": "2022-05-16T06:05:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f15041289... |
53386ab6-dfc5-43d1-a59a-1684385c309e | Cateds/LeetCode-Practice | 1038.binary-search-tree-to-greater-sum-tree.cpp | /*
* @lc app=leetcode.cn id=1038 lang=cpp
* @lcpr version=30111
*
* [1038] 从二叉搜索树到更大和树
*/
// @lcpr-template-start
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <s... | ALGO | 0.999987 | 6.498292 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2024-11-05T13:57: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": "d9bea0406a1... |
e3a2928e-3425-43be-8b0a-1f3427e02f61 | 2019331043-Zakaria/Codes | CB/G_1_Teleporters_Easy_Version.cpp | #include <bits/stdc++.h>
#define pb push_back
#define f first
#define s second
#define pi acos(-1.0)
#define LCM(a,b) a*b/__gcd(a,b)
#define GCD(a,b) __gcd(a,b)
#define sof sizeof
#define endl '\n'
#define eps 1e-6
typedef long long ll;
using ... | ALGO | 0.999892 | 4.264333 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-09T16:22: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": "61c6c770ac25... |
75e83283-5b7c-4bf8-920b-4f92ad469bfe | parvezaalam786/Placement-Preparation | DP/Ladders.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define fast_io ios::sync_with_stdio(false);cin.tie(NULL);
#define input freopen("Test.txt","r",stdin)
#define output freopen("Output.txt","w",stdout);
#define what_is(x) cout<<#x<<" is "<<x<<endl;
#define F(i,a,b) for(int i = a; i < b... | ALGO | 0.999972 | 3.329309 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-07-26T19:24:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f48b6fac... |
df86966d-2e0e-4577-b909-5cc5a14250a6 | romie88/leetcode | Min.Stack.cpp | //Min Stack 2014-11-09
//
//Design a stack that supports push, pop, top, and retrieving the minimum
//element in constant time.
//
// * push(x) -- Push element x onto stack.
// * pop() -- Removes the element on top of the stack.
// * top() -- Get the top element.
// * getMin() -- Retrieve the minimum element in the sta... | ALGO | 0.994998 | 6.431149 | {
"github_metadata": {
"branch": "master",
"commit_count": 279,
"repo_created_at": "2014-10-17T17:22: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": "5c4beeed... |
e337de25-34bd-4047-b1de-9b5376752bac | Hsu1997/Leetcode | daily/2022/2279_Maximum_Bags_With_Full_Capacity_of_Rocks.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution{
public:
int maximumBags(vector<int>& capacity, vector<int>& rocks, int additionalRocks) {
int ans = 0;
for (int i = 0; i < capacity.size(); i++){
capacity[i] -= rocks[i];
if (capacity[i] == 0) ans++;... | ALGO | 0.99889 | 5.14832 | {
"github_metadata": {
"branch": "main",
"commit_count": 1965,
"repo_created_at": "2022-01-25T09:04: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": "97f48f2ed... |
f75f12a4-0515-43c3-b405-fbdd8c0eec94 | paulmathai01/Pupil-Interfaced | pupil_src/shared_modules/pupil_detectors/singleeyefitter/EllipseEvaluation2D.h | #ifndef singleeyefitter_EllipseEvaluation2D_h__
#define singleeyefitter_EllipseEvaluation2D_h__
namespace singleeyefitter {
class EllipseEvaluation2D {
public:
EllipseEvaluation2D(const cv::Rect& centerVarianz, const float roundness_ratio, const float size_min, const float size_max) :
... | TOOL | 0.972997 | 6.681863 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-28T19:16:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "819db2978e... |
6da2b279-7648-47f6-af10-e61c1cf4fe49 | Snapex2409/KoMD | src/plugins/ADR/AdResS.h | //
// Created by alex on 10/15/24.
//
#ifndef ADRESS_H
#define ADRESS_H
#include "plugins/Plugin.h"
#include "math/Array.h"
#include "util/Kokkos_Wrapper.h"
class AdResS : public Plugin {
public:
AdResS();
~AdResS() override = default;
void init() override;
void begin_loop() override;
void po... | ALGO | 0.917185 | 5.720328 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-08-04T20:46: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": "05df8bddf4a... |
22c9f274-406f-4940-b0db-81671f9c5748 | HuiEng/tree | source/primary_tree_main.cpp | // int primary_tree_main(int argc, char *argv[]) { return 0; }
#include <random>
#include "tree_main_cmdline.hpp"
#include "primary_tree.hpp"
#include "cluster.hpp"
// #include "stats.hpp"
typedef primary_tree primary_tree_type;
using namespace std;
static tree_main_cmdline args; // Command line switches and arguments... | DATA | 0.981965 | 3.545864 | {
"github_metadata": {
"branch": "main",
"commit_count": 293,
"repo_created_at": "2022-07-21T22:47:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eca11592e... |
5f4135f2-181f-4d94-a44c-9ed9b8de7d0f | rekhav55/LeetcodeSolutions | 92-reverse-linked-list-ii/92-reverse-linked-list-ii.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverse(Lis... | ALGO | 0.999999 | 5.71696 | {
"github_metadata": {
"branch": "main",
"commit_count": 1983,
"repo_created_at": "2022-01-05T18:54: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": "8d4b27c07... |
eafbd296-1be0-4725-9453-904e6d5c4c90 | cmuparlay/parlaylib | examples/radix_tree.h | #include "parlay/sequence.h"
#include "parlay/primitives.h"
#include "cartesian_tree.h"
// **************************************************************
// Radix Tree (also called radix trie, compressed trie or, for binary
// alphabets, PATRICIA tree.).
// It is a trie with nodes with a single child removed and thei... | ALGO | 0.999541 | 7.179991 | {
"github_metadata": {
"branch": "master",
"commit_count": 221,
"repo_created_at": "2019-12-10T19:52:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 369,
"forks": 71,
"issues": 17,
"pull_requests": 3
},
"file_meta": {
"content_id": "36c1f... |
f6ab02ac-0b6d-453a-9ed5-47739682323b | MariaQuaresma/AlgoritmosEstruturasDados1C | Atv22_destinoJogoRPGbidimensional.cpp | //Altere o código da atividade anterior para considerar a vila (caractere '2'), a torre (caractere '3') e a árvore (caractere '4') como destinos possíveis.
//O programa deve perguntar para onde o usuário deseja ir, e calcular o melhor caminho até o destino escolhido.
#include <stdio.h>
#include <stdlib.h>
#include <ct... | ALGO | 0.998856 | 3.150573 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-07-12T23:21: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": "d588c96e09... |
9d6cac30-b6bb-4552-9aa1-373f5b0a4d49 | Div-ya18/DSA | Two Pointers/15. 3sum.cpp |
//Pointers approach to return true or false
class Solution{
public:
//Function to find triplets with zero sum.
bool findTriplets(int arr[], int n)
{
sort(arr,arr+n);
int i,m,l;
for(i=0; i<n-1; i++){
l=i+1;
m=n-1;
while(l<m){
if(arr... | ALGO | 0.999905 | 5.889081 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-07-08T10:59: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": "fe65436c8e7... |
fe6a0e95-5861-4618-aec8-62e8db629283 | I3J03RN/ProgrammingChallenges | Codeforces/gym/[102644] Errichto Matrix Exp/H.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define fi first
#define se second
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define eb em... | ALGO | 0.999865 | 4.363515 | {
"github_metadata": {
"branch": "master",
"commit_count": 214,
"repo_created_at": "2019-06-23T16:17: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": "7251a134... |
43052286-dc51-4f0e-9db0-ebd2fad43ad5 | joju18h/BTP500 | lqueue/main.cpp | #include <iostream>
#include <string>
class Queue{
private:
struct Node{
std::string data;
Node* next;
Node(const std::string &data = "", Node *next_ptr = nullptr) : data(data), next(next_ptr){};
};
Node* front;
Node* rear;
int size;
p... | TOOL | 0.979854 | 4.856503 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-22T02:19: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": "13740b9de4f3... |
86b06c0e-7658-49b7-9904-cf69bad6845b | qdttdev/Hacker-Rank | Problem Solving/Algorithms/Migratory_Birds.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
// Complete the migratoryBirds function below.
int migratoryBirds(vector<int> a)
{
int maxCount = 0;
int minId = 6;
vector<int> bCount(6,0);
for(int i = 0;... | ALGO | 0.999932 | 4.903416 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2020-06-20T23:23:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "457f3632... |
0a3cfaa1-fb0f-4afd-9ec6-a64bcb6cade2 | huyuguang/ZkPod3-lib | public/circuit/fixed_point/precision_gadget.h | #pragma once
#include "./misc.h"
namespace circuit::fixed_point {
// precision reduction
// insure a >=-kFrDN && a < kFrDN, that is [-2^(D+N), 2^(D+N)-1]
// convert to <D,M> which M < N
// sign = a >= 0? 1 : 0
// num_constraints:
// num_variables:
template <size_t D, size_t N, size_t M>
class PrecisionGadget : publ... | TOOL | 0.936722 | 6.705214 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2019-12-17T04:22:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f63f1a4e... |
16d93d2c-5fe7-47ff-a6ef-e54f0c49821e | apache/cloudberry | src/backend/gporca/libgpopt/include/gpopt/operators/CNormalizer.h | //---------------------------------------------------------------------------
// Greenplum Database
// Copyright 2012 EMC Corp.
//
// @filename:
// CNormalizer.h
//
// @doc:
// Normalization of expression trees;
// this currently includes predicates push down
//-------------------------------------------------------... | ALGO | 0.993529 | 6.942139 | {
"github_metadata": {
"branch": "main",
"commit_count": 71549,
"repo_created_at": "2023-05-24T06:58:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1000,
"forks": 167,
"issues": 104,
"pull_requests": 50
},
"file_meta": {
"content_id": "f... |
bf188aca-ebcd-4fa9-b7f1-73e1b770b2c1 | scipopt/soplex | src/soplex/spxleastsqsc.hpp | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the class library */
/* SoPlex --- the Sequential object-oriented simPlex. */
... | ALGO | 0.999158 | 3.985402 | {
"github_metadata": {
"branch": "master",
"commit_count": 5578,
"repo_created_at": "2021-04-09T09:46:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 68,
"forks": 23,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "681b5... |
c78ff30b-d3ec-48dd-abdb-b0ce9c3da194 | ankushsingh24/Data-Structure-And-Algorithm | Stack/parenthesis_matching.cpp | #include <iostream>
using namespace std;
struct Node
{
char data;
Node *next;
} *top = NULL;
void push(char x)
{
Node *t = new Node;
if (t == NULL)
{
cout << "Stack Overflow !!!\n";
}
else
{
t->data = x;
t->next = top;
top = t;
}
}
char pop()
{
... | ALGO | 0.998912 | 4.572172 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2021-09-20T18:34: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": "943aa081870... |
43fda99b-5ba5-4f9b-927b-238bfc9e8c9a | magneto-09/CodingNinjasSoln---git | OOPS_01/Complex_Number_Class.cpp | Complex Number Class
A ComplexNumber class contains two data members : one is the real part (R) and the other is imaginary (I) (both integers).
Implement the Complex numbers class that contains following functions -
1. constructor
You need to create the appropriate constructor.
2. plus -
This function adds two give... | ALGO | 0.999793 | 5.269361 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2021-10-09T09:28: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": "253cd9bee... |
801752f9-49e6-4db9-b584-2c9709942a67 | resfeber14/SDE-Sheet | Day 1/Sort Colors.cpp | // Problem Link: https://leetcode.com/problems/sort-colors/
// Problem Statement:
// Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent,
//with the colors in the order red, white, and blue.We will use the integers 0, 1, and 2 to represe... | ALGO | 0.999956 | 5.641943 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2021-08-26T14:39:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4088e49ddc... |
b2d8e015-6a12-4620-a0bc-2b670499f1b0 | Gecode/gecode | gecode/kernel/branch/val.hpp | /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* <NAME> <<EMAIL>>
*
* Copyright:
* <NAME>, 2008
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, t... | ALGO | 0.958352 | 7.44956 | {
"github_metadata": {
"branch": "master",
"commit_count": 5620,
"repo_created_at": "2015-11-06T07:33:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 309,
"forks": 77,
"issues": 40,
"pull_requests": 9
},
"file_meta": {
"content_id": "36d6... |
a1b88e90-4801-4a3b-b354-788ed9c28bf0 | zhucongx/LatticeMonteCarlo | deprecated/KineticMcChainMpi.h | #ifndef LKMC_LKMC_MC_INCLUDE_KINETICMCCHAINMPI_H_
#define LKMC_LKMC_MC_INCLUDE_KINETICMCCHAINMPI_H_
#include <random>
#include <mpi.h>
#include "VacancyMigrationPredictorQuarticLru.h"
#include "JumpEvent.h"
namespace mc {
// j -> k -> i -> l
// |
// current position
class KineticMcChainMpi {
public:
Kineti... | TOOL | 0.980853 | 5.017124 | {
"github_metadata": {
"branch": "main",
"commit_count": 853,
"repo_created_at": "2021-03-29T04:39:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce821873a9... |
d737e199-9eb8-4871-9400-da1bb166e25f | CaptainFl1nt/DoublePendulum | RungeKuttaSolver.hpp | #ifndef __RungeKuttaSolver__
#define __RungeKuttaSolver__
#include "ODESolver.hpp"
#include <iostream>
#include <vector>
using namespace std;
class RungeKuttaSolver : public ODESolver {
public:
RungeKuttaSolver() : ODESolver() { }
RungeKuttaSolver(vector<double> (*func)(vector<double>, double), vec... | ALGO | 0.999026 | 5.720057 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-01-04T22:48: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": "fe90bf9f8234... |
f948f8df-8888-4d35-bf7b-6727c66c9eab | mnhatdaous/algorithms | toChiago.cpp | #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <limits>
#include <vecto... | ALGO | 0.99984 | 3.981153 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-10T15:56: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": "68a5c2dc9d... |
7f900d73-df9a-42b9-9357-31905c0267a6 | n-saurino/fix_engine | benchmarks/MetricCalcs.hpp | #pragma once
#include <algorithm>
#include <cmath>
#include <numeric>
#include <vector>
// Compute mean from a vector of times.
inline double CalcMean(const std::vector<double>& times) {
return std::accumulate(times.begin(), times.end(), 0.0) / times.size();
}
// Compute median from a vector of times.
inline double... | ALGO | 0.995955 | 6.885 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2025-02-19T16:04:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 17,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4a0797dc5... |
8e94c062-9f21-4f03-8166-1c88dc3ca18a | RubySunset/BalanceBot | esp32/control/MPC_control.ino | #include <AccelStepper.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
#include <BasicLinearAlgebra.h>
using namespace BLA;
#include <ElementStorage.h>
AccelStepper s1(AccelStepper::DRIVER, 23, 19); //STRR, DIRR
AccelStepper s2(AccelStepper::DRIVER, 18, 5); //STRL, DIRL
Adafruit_MPU605... | ALGO | 0.924027 | 4.78149 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-05-23T16:37: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": "dcac228bdce... |
302ec3b3-5e60-477a-a1ba-98749ede81da | Fave7903/codejam | odd.cpp | #include <bits/stdc++.h>
using namespace std;
int odd_sum(int n) {
int num = n * 2;
int sum = 0;
for (int i = 1; i < num; i += 2) {
sum += i;
}
return sum;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
int n, k, s;
cin >> n >>... | ALGO | 0.999939 | 3.765885 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-03-01T21:27: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": "a2615700c3f0... |
aeaea910-1ff0-4f7e-830f-479ca9967586 | plast7/codetree-TILs | 240913/개발자의 가위바위보/developer's-rock-paper-scissors.cpp | #include <iostream>
using namespace std;
#define MAX_N 100
int p1[MAX_N] = {};
int p2[MAX_N] = {};
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> p1[i] >> p2[i];
}
int max_win = 0;
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 3; j++) {
... | ALGO | 0.999979 | 4.489368 | {
"github_metadata": {
"branch": "main",
"commit_count": 1223,
"repo_created_at": "2024-02-27T02:38: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": "edaa8c319... |
d7b38e4f-1ed9-45b5-a96c-f47b00235da6 | rajanraj2/CodeForces | CF_Round_991_D3/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
long long sum = 0;
cin >> n;
vector<int> arr(n);
string result = "NO";
long long even = 0, odd = 0;
for (int i = 0; i < n; i++) {
cin >> arr[... | ALGO | 0.999836 | 5.064435 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2024-06-06T15:29: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": "a616dbd6540... |
edb17fbf-6a55-4707-8495-5f714c83229b | nickzuck/SPOJ-solutions | stpar.cpp | #include<iostream>
#include<algorithm>
#include<stack>
using namespace std ;
int main ()
{
int i , t , flag , n , arr[1002] ;
while (1){
cin >> n ;
if (n == 0 )
break ;
for (i = 0 ; i< n ; i++)
cin >> arr[i] ;
stack <int> mystack ;
int counter = 1 ;
for (i = 0 ; i<n ; i++){
if (arr[i] ... | ALGO | 0.999938 | 3.798709 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2015-07-08T05:47:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ea433a3... |
9944fb54-a3f7-4b1a-a19b-655937d06ba7 | WorldEditor50/N-spirits | dl/conv.hpp | #ifndef CONV_HPP
#define CONV_HPP
#include <cmath>
#include "../basic/tensor.hpp"
#include "../basic/linalg.h"
namespace conv {
inline int out(int i, int kernelSize, int stride, int padding)
{
return std::floor((i - kernelSize + 2*padding)/stride) + 1;
}
inline void conv1d(Tensor &y, const Tensor &kernels, const... | ALGO | 0.904957 | 5.405313 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2023-02-07T07:40:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ffee5a558... |
0513fe5c-ad93-48f1-b762-1076b4f90cd8 | tianyicaii/leetcode | raw/2024/leetcode/cpp/0124-binary-tree-maximum-path-sum.cpp | #include <algorithm>
#include <iostream>
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), left(left), right(righ... | ALGO | 0.999995 | 5.788153 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-12-18T00:34: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": "8f8b64009ab8... |
e1ba0e62-5557-4428-8d16-a1d516068b74 | Saurabhkumar108/Decode | LEETCODE/Q167.cpp | #include<iostream>
#include<vector>
using namespace std;
bool check(int lo,int hi,vector<int>& numbers, int ans,int idx){
while(lo <= hi){
int mid = (lo + hi) / 2;
if(numbers[mid] == ans){
idx = mid + 1;
return true;
}
else if(numbers[mid] < ans) lo = mid + 1;... | ALGO | 0.999939 | 4.858036 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-04-24T16:15:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "809d1ea2143... |
9028cec2-5034-474b-afbd-7f83f7649499 | siddhanttomar2003/CP | 2116-check-if-a-parentheses-string-can-be-valid/2116-check-if-a-parentheses-string-can-be-valid.cpp | class Solution {
public:
bool check(string &s){
stack<int>st;
for(int i=0;i<s.size();i++){
if(s[i]=='('){
st.push(i);
}
else {
if(st.size()>0)st.pop();
else {
return false;
}
... | ALGO | 0.999908 | 5.413803 | {
"github_metadata": {
"branch": "main",
"commit_count": 3377,
"repo_created_at": "2023-10-03T09:03:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e13c16928... |
db6bb89a-f604-4d2d-ba6d-24f25fc2e292 | v-biryukov/cs_mipt_faki | module2_classes_and_templates/seminar2_encapsulation/homework/code/number/number.hpp | /*
Класс Number - класс положительных больших чисел
Большое число будет храниться в массиве в сегменте куча.
В самом объекте будем хранить указатель на данные в куче.
Также, в самом объекте будут храниться размер и вместимость массива.
data - указатель, на элементы, хранящиеся в куче.
... | TOOL | 0.982241 | 3.901286 | {
"github_metadata": {
"branch": "master",
"commit_count": 310,
"repo_created_at": "2015-09-10T11:40:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a7762a4... |
93e31c7b-aeef-472d-acaf-843babb2fae1 | InsightSoftwareConsortium/ITK | Modules/Numerics/Optimizersv4/include/itkGradientDescentLineSearchOptimizerv4.h | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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
*
* https://www.apache.o... | ALGO | 0.997493 | 7.37056 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "5... |
5194634e-62d6-4e25-afb4-0e67fb37ab00 | jam-usb/cp-book | tests/graph/hungarian/2.cpp | // https://codeforces.com/gym/103640/problem/H
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int das;
#define FOR(i,n,m) for(int i = n; i < (int)m; i++)
#define ROF(i,n,m) for(int i = n; i > (int)m; i--)
#define ms(obj,va... | ALGO | 0.999984 | 3.474701 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2022-03-06T18:12:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "795b9fe6c788... |
ce3011cf-5222-495a-b9f4-63f496ad074a | Xarma123/cp-practice | A_Get_together.cpp | #include <bits/stdc++.h>
#define lol long long
using namespace std;
lol n;
vector<pair<long double, long double>> a;
bool check(long double t)
{
long double seg1 = INT_MIN, seg2 = INT_MAX;
for (lol i = 0; i < n; i++)
{
seg1 = max(seg1, (a[i].first - a[i].second * t));
seg2 = min(seg2, (a[i].... | ALGO | 0.999888 | 4.440874 | {
"github_metadata": {
"branch": "master",
"commit_count": 176,
"repo_created_at": "2022-09-18T23:21: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": "dea15e98... |
6407de8d-58bf-4693-b9a3-07c05d7473ae | hschoi1104/Algorithm | BOJ/다이나믹프로그래밍/1102_발전소.cpp | #include<iostream>
#include<vector>
#include<string>
#include <string.h>
#include <algorithm>
#define INF 999999999
using namespace std;
int arr[16][16];
int dp[1 << 16];
string onoff;
int n, p;
int go(int cnt, int on) {
if (cnt >= p) return 0;
int& ret = dp[on];
if (ret != -1) return ret;
ret = INF;
for (int i ... | ALGO | 0.999823 | 3.959347 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2019-08-11T02:11:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74b0201b... |
d061da09-dce9-46b4-b239-4a65975721b7 | ayegenberdiyeva/cpp_pp1_labs | lab1/lab1_3.cpp | /* #include <iostream>
using namespace std;
void DecToBinary(int n){
int binnum[32];
int i;
while(n > 0){
binnum[i] = n % 2;
n = n / 2;
i++;
}
} // from decimal to binary wout reversing
int BinToDecimal(int n){
int binnum = n;
int decnum = 0;
int base = 1;
int t... | ALGO | 0.999883 | 4.479928 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-29T18:37: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": "79b2cf39b49f... |
1c0b2dcf-b7d9-4dd3-9764-802a90a03286 | Sanjaykumar0521/Programs | segmentTreeSum.cpp | #include <iostream>
using namespace std;
int tree[20005],a[10005];
void build(int v, int low, int high, int tree[],int a[]) {
if (low == high)
tree[v] = a[low];
else {
int mid = (low + high) / 2;
build(2 * v+1, low, mid, tree, a);
build(2 * v + 2, mid + 1, high, tree, a);
tree[v]=tree[2*v+1]+tre... | ALGO | 0.999975 | 4.227384 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2018-01-19T07:02: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": "2a9687eca... |
87c1b127-896b-44aa-9178-57f74272eb22 | akashydv311/180-Days-Of-Code | Coder Army/Day-37/assignment/Soluction123.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> my_push_back(vector<int> v)
{
}
int main()
{
// Prove that the average time Complexity of Push_back operation in Vector is O(1) time.
// How to find the number of Occurance of an element in a vector. You need to use ... | TOOL | 0.993472 | 3.430876 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2023-09-27T08:56: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": "7641bf0878... |
1b7c0eb4-b947-4f14-a8c5-ad659abcdc99 | lucasxia01/Competitive-Programming-Problems | ICPC/NADC 2021/B.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stdlib.h>
#include <time.h>
#include <complex>
#include <iterator>
#include <regex>
#include <fstream>
#include <utility>
#include <vector>
#include <string>
#include <cstring>
#include <stack>... | ALGO | 0.999873 | 3.920213 | {
"github_metadata": {
"branch": "master",
"commit_count": 227,
"repo_created_at": "2018-10-14T07:51:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d0c8feb... |
e2d94c9d-13a3-4c00-9a8d-ed8165bf3da3 | FridayUser/Projekty | Sorter_projekt_grupowy/Kod źródłowy/SorterRGB.h | #ifndef SORTERRGB_H
#define SORTERRGB_H
#define COLUMNS 3 // Liczba składowych: 3 (r + g + b)
#define REFERENCE_POINTS_COUNT 5 // Liczba punktów odniesienia w tablicy
#include <Arduino.h>
#include <math.h>
/**
* @brief SorterRGB - Klasa reprezentująca sortownik RGB.
*
* Klasa zawiera metody rozpoznawania kolo... | ALGO | 0.989914 | 5.235911 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-05T13:01: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": "dff8278b2528... |
7ee1f53c-83d8-442c-8d22-0d24c7caa1eb | quant1x/q1x | include/q1x/ta/rolling.h | #pragma once
#ifndef QUANT1X_TECHNICAL_ANALYSIS_ROLLING_H
#define QUANT1X_TECHNICAL_ANALYSIS_ROLLING_H 1
#include <q1x/dataframe/series.h>
#include <q1x/dataframe/periods.h>
#include "rolling_window.h"
#include <vector>
#include <functional>
#include <cmath>
#include <memory>
namespace ta {
template<typename T>
... | TOOL | 0.993891 | 7.421669 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2025-07-08T22:44:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b10a3ef9e... |
287108d2-ac70-41ce-9253-c08f357f9f45 | echristophe/OTB | Modules/Segmentation/MorphologicalProfiles/include/otbMultiScaleConvexOrConcaveClassificationFilter.h | /*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ... | ALGO | 0.964877 | 4.489204 | {
"github_metadata": {
"branch": "master",
"commit_count": 18139,
"repo_created_at": "2011-07-02T03:58:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6a85... |
f72067e6-a1c9-4537-8525-a3755742818e | Eagle233Fake/Eagle233-Algorithms | ProgrammerCarl/20250224-/BinaryTree/513.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.999991 | 5.763944 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2025-03-05T13:48: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": "fc4d83f9384... |
87299b9b-ac92-4adb-8364-24ba63bebbaa | PengJi/Algorithms | dp/lc_70_climbing-stairs.cpp | /**
* 70. 爬楼梯
* https://leetcode-cn.com/problems/climbing-stairs/
*/
class Solution {
public:
// 暴力法(超时)
// 类似一棵递归树
// 时间复杂度:O(2^n)
// 空间复杂度:O(n)
int climbStairs(int n) {
return climbStair(0, n);
}
int climbStair(i, n) {
if (i > n) return 0;
if (i = n) return 1;
... | ALGO | 0.999962 | 5.272923 | {
"github_metadata": {
"branch": "master",
"commit_count": 1239,
"repo_created_at": "2020-02-29T08:58: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": "fe254b7... |
b7a24db9-b915-482a-bc97-2534d6bc9284 | wtomczyk/rzeczy-z-technikum | informatyka/d/main.cpp | void zamien(int & liczba1, int & liczba2)
{
int pamiec = liczba1;
liczba1 = liczba2;
liczba2 = pamiec;
return;
}
//scala tablice
void merge(int T[], int t[], int start, int middle, int end)
{
for(int i = start; i < middle; i++)
t[i - start] = T[i];
int Ti = start;
int i1 = 0;
int i2 = middle;
while ((i1 + start) < mi... | ALGO | 0.999507 | 4.021028 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-23T12:04: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": "c8e6df86913b... |
f4af1881-a7c6-4493-b5e8-bc654ac29511 | Leapense/problems | 31362번: Nano alarm-clocks/Nano alarm-clocks.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
const ll L = 12LL * 1000000LL * 1000000LL; // Total cycle in seconds: 12 * 1e6 * 1e6 = 12e12
vector<ll> times(n);
ll sum_t = 0;
for(i... | ALGO | 0.999302 | 4.710638 | {
"github_metadata": {
"branch": "master",
"commit_count": 2661,
"repo_created_at": "2024-10-12T10:53: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": "7331289... |
3621b848-6a33-4fcd-9e9a-af4b7196752d | LaikaN57/cmpe195_laztech | software/Pt.h | #include <iostream>
#include <vector>
#ifndef PT_H_
#define PT_H_
// Point class
typedef struct {
uint32_t x;
uint32_t y;
} point_t;
point_t * point_add(point_t * a, point_t * b) {
point_t sum;
sum.x = a->x + b->x;
sum.y = a->y + b->y;
return ∑
}
class Pt
{
public:
Pt();
Pt(double a, double b);
... | TOOL | 0.924303 | 5.022596 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2016-02-08T06:11: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": "1aee38817... |
f49afcbb-a844-4b5e-91d0-5757d7b52813 | Harsh-91221/CODEFORCES | ABBalanace.cpp | // Input
// 4
// b
// aabbbabaa
// abbb
// abbaab
// Output
// b
// aabbbabaa
// bbbb
// bbbaab
/*Explanation-> You are given a string s of length n consisting of characters a and/or b.
Let AB(s) be the number of occurrences of string ab in s as a substring.
Analogically, BA(s) is the number of occurrences of ba in s... | ALGO | 0.999995 | 4.424612 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2023-07-01T16:15:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "998c7b5ebca... |
1d2d6683-bfd2-408d-bb41-4aef32c0ee07 | kroharu/Gauss_method | laba1.cpp | #include <stdio.h>
#include <math.h>
// void matrix_multiplication(float matrix[3][4], float X[3])
// {
// int i = -1, j = -1;
// float rez[3] = {0,0,0};
// while (++i < 3)
// {
// while (++j < 3)
// rez[i] += matrix[i][j] * X[j];
// j = -1;
// }
// i = -1;... | ALGO | 0.999871 | 3.08226 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-09-15T15:11: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": "cc7b255d8b... |
4b27c2be-dd8c-4917-8282-bcc00c76139f | shikharbaheti/dsanda | PAS/A5/topological_sort.cpp | #include <iostream>
#include "graph.h"
void Graph::compute_indegree()
{
for (int i = 0; i < node_list.size(); i++)
{
for (const auto edges : *adj_list[i])
{
node_list.at(edges - 1).indegree++;
}
}
}
void Graph::topological_sort()
{
queue<Vertex> q;
int counter =... | ALGO | 0.999915 | 5.21077 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-01-15T14:59: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": "2b42f3ab1... |
66bcc924-177a-46d0-ba93-eee06268c1eb | YangchenVR/Diabolo | src/Base/vrCoordinate.cpp | #include "vrCoordinate.h"
namespace VR
{
namespace Coord
{
bool vec3LessCompare::operator()(const vrVec3& lhs, const vrVec3& rhs)const
{
if (lhs[2] < rhs[2])
{
return true;
}
else if (lhs[2] > rhs[2])
{
return false;
}
// Otherwise z is equal
if (lhs[1] < rhs[1])
{
return t... | ALGO | 0.96793 | 5.715414 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-01-30T12:22: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": "af912bd3ed... |
b7fb47b4-d63e-4c6a-ae92-aedbdcdc32b5 | hmazhar/physbam_public | PhysBAM_Tools/Matrices/MATRIX_MXN.h | //#####################################################################
// Copyright 2002-2007, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//######################... | ALGO | 0.998045 | 5.027354 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-04-02T21:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 13,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "0818be1... |
114a6875-0e63-4f88-9243-0b3d302bdfc9 | tofuwen/icpc-Rujia-Liu | Beginning_Algorithm_Contests/Volume 0. Getting Started/458 The Decoder/458 the decoder.cpp | /*
The Decoder
Write a complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded set of characters and print the exact message that the characters contain. The code key for this simple coding is a one for one character substitution b... | ALGO | 0.985843 | 3.179899 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2016-08-10T03:39:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9789b614... |
a9004b58-3243-4919-9d77-ff37b20b7975 | f20500909/study_note | cpp/online_judge/leetcode/editor/cn/环形链表 II.cpp | //给定一个链表,返回链表开始入环的第一个节点。 如果链表无环,则返回 null。
//
// 为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始)。 如果 pos 是 -1,则在该链表中没有环。
//
// 说明:不允许修改给定的链表。
//
//
//
// 示例 1:
//
// 输入:head = [3,2,0,-4], pos = 1
//输出:tail connects to node index 1
//解释:链表中有一个环,其尾部连接到第二个节点。
//
//
//
//
// 示例 2:
//
// 输入:head = [1,2], pos = 0
//输... | ALGO | 0.999895 | 5.854682 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-12-19T01:26: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": "80d884695... |
1fc420a3-0f80-46ef-91c3-9e56d2d97dde | VastoLorde95/Competitive-Programming | CodeChef/WF/Easy Medium/AVGSHORT/A.cc | #include <bits/stdc++.h>
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define _ ios_base::sync_with_stdi... | ALGO | 0.999323 | 3.653373 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-07-25T11:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 171,
"forks": 41,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f83c19... |
eb78bda2-38af-423c-940b-3da52c8cddc6 | BonnQiam/Snippets | Kata/Best practice/5kyu/Peano numbers.hpp | // 这段代码定义了一种用于表示皮亚诺数(Peano numbers)的C++模板元编程结构
// 这段代码通过C++的模板元编程和继承机制,建立了一个用于表示和操作皮亚诺数的类型系统。通过这种方式,可以在编译时进行数学运算和逻辑判断,而不是在运行时。
struct Peano {
};
// inherit from Peano
struct Zero: Peano {
static constexpr int value = 0;
};
// inherit from Peano
template<class T>
struct Succ: Peano {
static constexpr int valu... | TOOL | 0.992608 | 6.111994 | {
"github_metadata": {
"branch": "Main",
"commit_count": 40,
"repo_created_at": "2024-01-02T06:51: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": "c7ab402e8fb... |
883ff1f3-a02b-4544-aa25-4f543545bb11 | vinus322/algorithm_mac | Forming a Magic Square Forming a Magic Square hack_magicSquare.cpp | ////
//// Forming a Magic Square Forming a Magic Square hack_magicSquare.cpp
//// algorithm
////
//// Created by 김민영 on 2020. 8. 2..
//// Copyright © 2020년 김민영. All rights reserved.
////
//
////#include <bits/stdc++.h>
//#include <stdio.h>
//#include <iostream>
//#include <vector>
//#include <algorithm>
//
//
//u... | ALGO | 0.999918 | 5.339249 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-04T14:18:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "546ec0844f... |
955e8c74-e5de-4b8d-bf23-fc6ff1199064 | burakbayramli/books | Nodal_Discontinuous_Galerkin_Methods_Hesthaven/nudg++/trunk/Src/Examples2D/EulerShock2D/EulerShock2D_Run_Iter.cpp | // EulerShock2D_Run_Iter.cpp
// function [Q,resid] = AdaptiveEuler2D(tol, fluxtype)
// Purpose : Integrate 2D Euler equations using a
// 2nd order SSP Runge-Kutta time integrator
// Stop if residual drops below tol
// 2007/08/15
//---------------------------------------------------------
#includ... | ALGO | 0.999933 | 4.055238 | {
"github_metadata": {
"branch": "master",
"commit_count": 652,
"repo_created_at": "2016-10-31T17:24:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 325,
"forks": 201,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45b6... |
6a4dd481-14fd-41e5-a27f-8318acda70f6 | dox404/Cpp_basics | stl/Container/Map/Map.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
///it stores data in key value paris
map<int, int>mpp;///key is integer value is integer
map<int, pair<int,int>>mpp;//key is integer and value is two integer
map<pair<int,int>,int>mpp;//here key is two integer and value is 1 integer
mpp[1]... | ALGO | 0.978559 | 3.937302 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-01-29T22:17: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": "670ec7d8e2... |
0691c532-1b60-4834-99c7-7e329207f650 | pyjune/PRO_update | 1035_MST_quicksort.cpp | #include <stdio.h>
int V, E;
typedef struct EdgeType{
int n1;
int n2;
int w;
};
EdgeType edge[1000000];
int mst[1000000];
void qs(int l, int r);
int kruskal(void);
int rep(int n);
int main(void)
{
//freopen("Text.txt", "r", stdin);
int T;
scanf("%d", &T);
for (int tc = 1; tc ... | ALGO | 0.999955 | 4.859579 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-09-25T23:50:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e34ec012... |
45ed4344-144b-4724-a4be-01eaea075052 | juleswh/rectangle_table_detection | src/tableDetectionGeometricModel.cpp | #include "tableDetectionGeometricModel.h"
typedef tableDetectionGeometricModel::Rectangle Rectangle;
typedef tableDetectionGeometricModel::Vertex_def Vertex_def;
typedef tableDetectionGeometricModel::Line_def Line_def;
tableDetectionGeometricModel::tableDetectionGeometricModel(Eigen::Vector3f origin, Eigen::Vector3f ... | ALGO | 0.995349 | 4.085731 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2013-09-02T12:44: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": "57b0afae4... |
b8f7577b-22cb-436d-baf5-7b1d0377c2c1 | WEN1WE/PAT | B1018.cpp | /*
* 1. printf("%c", 'a');
* 2. 由于scanf使用%c时会将换行符\n读入,因此需要在合适的地方使用getchar()吸收空格
*/
#include <iostream>
#include <map>
using namespace std;
int check(char a, char b) {
if ((a == 'C' && b == 'J') || (a == 'J' && b == 'B') || (a == 'B' && b == 'C')) {
return 1;
} else if (a == b) {
return 0;
... | ALGO | 0.999985 | 3.557095 | {
"github_metadata": {
"branch": "master",
"commit_count": 307,
"repo_created_at": "2019-08-01T12:17: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": "f3176f05... |
ee753912-9738-41bf-8f0e-c4c47af9a893 | my4-dev/atcoder | 22_AIZU_ONLINE_JUDGE/ALDS1/1_15/1_15_B.cpp | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}
// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';
/*
string s = "abcdefg"
s.sub... | ALGO | 0.999992 | 3.938539 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-12-01T11:16: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": "1ebf2e54f8... |
ce2fd509-13ad-4819-85aa-6e2cc4800029 | Durjoy001/Data-Structure-and-Algorithms | Tree/Binary Tree/Binary tree traversal/Level Order Traversal123.cpp | //https://www.youtube.com/watch?v=86g8jAQug04&list=PL-pUjcDnciX3Z5AEE8HHRrcfj-987Ia94&index=9
//https://www.geeksforgeeks.org/level-order-tree-traversal/
//https://practice.geeksforgeeks.org/problems/level-order-traversal/1
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* left;
... | ALGO | 0.999781 | 3.660754 | {
"github_metadata": {
"branch": "master",
"commit_count": 818,
"repo_created_at": "2020-08-04T19:20:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f9edb20... |
2cafb87d-76d7-47f8-9660-c1e75ebdca74 | radio-astro/casa | code/air_casawvr/src/apps/arraygains.cpp | /**
<NAME> <<EMAIL>>, <<EMAIL>>
Initial version January 2010.
Maintained by ESO since 2013.
This file is part of LibAIR and is licensed under GNU Public
License Version 2
\file arraygains.cpp
Structure to hold gains derived from WVR data
*/
#include "arraygains.hpp"
#include "arraydata.hpp"
#in... | ALGO | 0.985346 | 4.697562 | {
"github_metadata": {
"branch": "master",
"commit_count": 18139,
"repo_created_at": "2015-08-20T09:27:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "458b193... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.