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 |
|---|---|---|---|---|---|---|---|
cdf7c81d-3bee-416e-bdaa-71525a556f84 | mlpack/mlpack | src/mlpack/methods/kde/kde_rules.hpp | /**
* @file methods/kde/kde_rules.hpp
* @author <NAME>
*
* Rules for Kernel Density Estimation, so that it can be done with arbitrary
* tree types.
*
* mlpack is free software; you may redistribute it and/or modify it under the
* terms of the 3-clause BSD license. You should have received a copy of the
* 3-cl... | ALGO | 0.964553 | 6.605968 | {
"github_metadata": {
"branch": "master",
"commit_count": 30653,
"repo_created_at": "2014-12-17T18:16:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5396,
"forks": 1663,
"issues": 16,
"pull_requests": 9
},
"file_meta": {
"content_id": "... |
ff6068fc-115e-41d4-bb46-47344440447f | OwenStadlwieser/encryptedMessaging | 2arduino/encrypted_communication_part2.cpp | /*
<NAME> and <NAME>
Assignment 2: Part 2
CMPUT274, F2019
*/
#include <Arduino.h>
#include <math.h>
const int serverPin = 13;
/*
Returns true if arduino is server, false if arduino is client
*/
bool isServer() {
if (digitalRead(serverPin) == HIGH) {
return true;
} else {
return fals... | ALGO | 0.999059 | 5.586327 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-01-09T23:01: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": "849f01fd44... |
7ede30ca-878b-42ed-962c-e37623b4b61b | TiffyPox/LearnCPP | LearnCPP/vectorsExercise5.2.cpp | #include <iostream>
#include <ostream>
#include <cstdlib>
#include <string>
#include <vector>
void printSum(const std::vector<int>& n)
{
for (size_t i = 0; i <= (n.size() - 1) / 2; i++)
{
int a = n[i];
int b = n[n.size() - 1 - i];
int answer = a + b;
std::cout << a << " + " << b << " = " << answer << std::e... | ALGO | 0.999388 | 5.949672 | {
"github_metadata": {
"branch": "main",
"commit_count": 157,
"repo_created_at": "2023-05-19T15:07: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": "1462c95458... |
58f16ece-affd-4ed7-9503-d7030a91006d | tommyleo2/my-leetcode | cpp/673-Number_Of_Longest_Increasing_Subsequence.cpp | /*
Given an unsorted array of integers, find the number of longest increasing
subsequence.
Example 1:
Input: [1,3,5,4,7]
Output: 2
Explanation:
The two longest increasing subsequence are [1, 3, 4, 7] and [1, 3, 5, 7].
Example 2:
Input: [2,2,2,2,2]
Output: 5
Explanation:
The length of longest continuous increasing sub... | ALGO | 0.999969 | 6.348981 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-08-29T17:16: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": "f6af14675... |
85dbadc3-5901-4687-970e-0991085ec77d | voreen-project/voreen | voreen/modules/flowsimulation/ext/openlb/src/functors/lattice/latticeVelocity2D.hh | /* This file is part of the OpenLB library
*
* Copyright (C) 2019 <NAME>, <NAME>, <NAME>
* E-mail contact: <EMAIL>
* The most recent release of OpenLB can be downloaded at
* <http://www.openlb.net/>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU G... | ALGO | 0.955553 | 5.976517 | {
"github_metadata": {
"branch": "main",
"commit_count": 2506,
"repo_created_at": "2024-10-29T14:44:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18,
"forks": 7,
"issues": 17,
"pull_requests": 0
},
"file_meta": {
"content_id": "5644dabe... |
16ad0574-e0b4-4c2c-8dbb-4fd9e39f8c1e | woooooni/CodingTest | 프로그래머스/1/42862. 체육복/체육복.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(int n, vector<int> lost, vector<int> reserve) {
int answer = 0;
vector<int> Students;
Students.resize(n, 0);
for(int i = 0; i < lost.size(); ++i)
{
Students[lost[i] - 1]--;
}
for(int i =... | ALGO | 0.999767 | 4.327066 | {
"github_metadata": {
"branch": "main",
"commit_count": 489,
"repo_created_at": "2024-03-10T13:59:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75382e0eda... |
8c9a596d-d3aa-433a-b644-1567e3b8dc26 | NickChungVietNam/STEP_2_PHASE_DRIVE_ARDUINO | STEP_2_PHASE.h |
/* THƯ VIỆN ĐIỀU KHIỂN ĐỘNG CƠ 2 PHA ( động cơ step 2 cuộn dây trong máy DVD/ VCD)
/Thư viện được nghiên cứu và viết bởi tác giả:
<NAME>-<NAME>. Bản quyền code thuộc Thái Sơn, code được chia sẻ với tất cả mọi người như một
nỗ lực đem đến những kiến thức bổ ích tới cộng đồng, được cộng đồng đón nhận và tiếp tục xây ... | TOOL | 0.982473 | 3.167467 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-08-03T17:15:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e16f813bc... |
2bbb4193-ccc9-46be-a4a0-677bbadcd6e1 | hicklc01/adventofcode | Day6/part2.cpp | #include <iostream>
#include <numeric>
#include <vector>
#include <functional>
#include <algorithm>
#include <iterator>
#include <regex>
#include <map>
#include <sstream>
#define HEIGHT 1000
#define WIDTH 1000
#define getPos(x,y) (x*1000+y)
using namespace std;
struct Rectangle{
int x1;
int y1;
int x2;
... | ALGO | 0.989877 | 4.406239 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-12-08T02:45: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": "aaf42501d8... |
c5c0e4cb-825d-4e89-adb0-3d4683f191f6 | us419/My-Algorithm-practice | brute-force/picnic.cpp | #include <iostream>
#include <array>
using namespace std;
int count_num(int n, array<bool, 10>& taken, const bool (&friends)[10][10]);
int main(void)
{
int num_testcase = 0;
cin >> num_testcase;
int num, m, i, j, result;
bool friends[10][10];
fill_n(friends[0], 100, false);
array<bool, 10> tak... | ALGO | 0.999938 | 4.306265 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-01-15T06:50: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": "514e4ace1... |
96e9e17b-f5b9-43e2-87ae-2ee02f1a5358 | andras-szoldatics/advent-of-code | 2022/day-21/main.cpp | #include <cstdint>
#include <fstream>
#include <functional>
#include <iostream>
#include <sstream>
#include <unordered_map>
using namespace std;
typedef function<int64_t ()> Yell;
class Monkey {
public:
// simple attributes
string id;
Yell yell;
// parsing function
void parse(const unordered_map... | ALGO | 0.998316 | 4.789083 | {
"github_metadata": {
"branch": "main",
"commit_count": 176,
"repo_created_at": "2022-12-17T13:06: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": "54f7a3835e... |
293a3165-c42f-4a48-b217-5160670c79ce | hiberabyss/LeetCode | cpp/201.bitwise-and-of-numbers-range.cpp | /*
* @lc app=leetcode.cn id=201 lang=cpp
*
* [201] 数字范围按位与
*
* https://leetcode.cn/problems/bitwise-and-of-numbers-range/description/
*
* algorithms
* Medium (54.07%)
* Total Accepted: 79.4K
* Total Submissions: 146.6K
* Testcase Example: '5\n7'
*
* 给你两个整数 left 和 right ,表示区间 [left, right] ,返回此区间内所有数字 按... | ALGO | 0.999947 | 6.122225 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2020-04-17T15:23:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77d85be3d... |
1a739503-e1b9-4965-92ee-298770b365a8 | nocotan/reflib | reflib/sort/bcis.hpp | #ifndef REFLIB_BCIS
#define REFLIB_BCIS
#include <cmath>
namespace reflib {
template<typename T>
void swap_elem(T& t, long long i, long long j) {
long long tmp = t[i];
t[i] = t[j];
t[j] = tmp;
}
template<typename T>
long long is_equal(T& t, long long sl, long long sr) {
... | ALGO | 0.999762 | 5.085971 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-10-06T05:07:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3481cd31d... |
ecc9bb39-f519-4c31-98d6-f30ac8af3d73 | HPI-Artificial-Intelligence-Teaching/25-pt2 | unit9/directed_cycle.h | /******************************************************************************
*
* A depth first search on a directed graph that determines whether a digraph has a directed cycle
*
* Based on the source code from <NAME> and <NAME> at https://algs4.cs.princeton.edu/
*
*********************************************... | ALGO | 0.99875 | 6.547165 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-04-06T10:21:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97f96b3f5bd... |
fc3fc21e-3896-4a04-ace1-d4aefac27039 | chaojunhou/LeetCode | Algorithm/CPP/distinct_subsequences.cpp | # include <stdio.h>
# include <iostream>
# include <vector>
using namespace std;
class Solution {
public:
int numDistinct1(string s, string t) {
int m = t.size();
int n = s.size();
if (m > n) return 0;
vector<vector<int>> dp(m + 1, vector<int>(n + 1, 0));
for (int i = 0; i <=n; i++)
dp[0][i] = 1;
for (... | ALGO | 0.999975 | 4.997335 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2015-04-28T15:49: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": "4f0d34252... |
af2f3af1-63ba-4d40-b046-b482f085b82c | aayush4vedi/MyCompetitiveCoding | codeforces_practice/492B.cpp | #include<bits/stdc++.h>
using namespace std;
#define nl endl
#define ll long long
#define vb vector<bool>
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef map<int,... | ALGO | 0.999982 | 3.244789 | {
"github_metadata": {
"branch": "master",
"commit_count": 551,
"repo_created_at": "2017-08-05T12:25:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "f88d23bf... |
26e99566-8ab8-4744-ae97-73276b622c09 | JayTheCoder77/Striver-Dsa | PATTERNS/eighteen/main.cpp | #include <bits/stdc++.h>
using namespace std;
void printPattern(int n){
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n-i; j++)
{
cout << "*";
}
for (int j = 0; j < 2*i; j++)
{
cout << " ";
}
for (int j = 0; j < n-i; j++)
... | ALGO | 0.999938 | 4.207965 | {
"github_metadata": {
"branch": "main",
"commit_count": 177,
"repo_created_at": "2024-11-18T12:45: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": "a30a52c764... |
e971f823-39fb-46ec-b383-f9d2e5301463 | Pegasust/Tetris_ML | Cmake_Zenix/src/NEAT/organism.hpp | #pragma once
/*
* An organism contains its historical marking (in its genotype) and the "performer" or agent
* that acts on the environment (the phenotype). As a whole, the organism will determine whether
* or not it will cross-breed with another organism, producing a child with structure shared
* by both parents.
... | ALGO | 0.994945 | 7.065193 | {
"github_metadata": {
"branch": "Zenx_canary",
"commit_count": 71,
"repo_created_at": "2019-04-11T18:34: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": "f2dc... |
62c60a24-4422-48d6-a5c6-4a98a03676dd | Pratham-Sharda/LEETCODE_SOLN | 0787-cheapest-flights-within-k-stops/0787-cheapest-flights-within-k-stops.cpp | class Solution {
public:
int findCheapestPrice(int n, vector<vector<int>>& flights, int src, int dst, int k) {
// Initialize adjacency list as a vector of vectors of pairs
vector<vector<pair<int, int>>> adj(n);
for (auto& i : flights) {
int from = i[0];
int to = i[1]... | ALGO | 0.999917 | 6.328416 | {
"github_metadata": {
"branch": "main",
"commit_count": 314,
"repo_created_at": "2024-05-28T05:42: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": "dd766b5c4f... |
4ef9ac37-b995-46da-9bb6-2e9ceeb2144d | dndcruz2001/RobotX_Hydrophone | DD_RobotX_AOA_Hydrophone_Teensy_v1.ino | /* ──────────────────────────────────────────────────────────────
FIRST-THRESHOLD AoA MEASUREMENT – Teensy 4.1
<NAME> / April 2025
-------------------------------------------------------------
Pin-out
HYDRO-1 → A2 (ADC0) ← reference channel
HYDRO-2 → A1 (ADC1)
Signals must alread... | ALGO | 0.992413 | 6.078553 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-04-29T00:53: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": "c7d986d89a89... |
46d67c0e-23d0-4059-8fc4-56e9e1e9d0dc | sheeyen/FE2assignment- | Q3straddle.cpp | //FE2 ASSIGNMENT STRADDLE
#include <iostream>
#include <math.h>
#include <conio.h>
#include <iomanip>
#include <fstream>
#define PI 3.14159265358979323846
using namespace std;
double N (double);
double M (double);
void main ()
{
float time, K, d1, d2, nd1, nd2, n1d1, delta, vega, theta;
float S, r, q, v;
K = ... | ALGO | 0.999509 | 5.246903 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-06-15T14:02: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": "75dc73ed29... |
e6363000-a85b-411d-9079-835b675adedd | Radioacti1ve/Discrete-analysis | lab2/main.cpp | #include <iostream>
#include <utility>
#include <string>
#include <fstream>
#include <algorithm>
using namespace std;
using Tree_pair = pair<string, unsigned long long>;
class AVLTree;
class Node {
public:
Node(Tree_pair value, Node *parent);
void Print(int he... | ALGO | 0.999357 | 4.387706 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-03-24T10:31: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": "7b35d010732... |
91276e72-1a0e-4b31-a574-7ec96a3d1c69 | opencv/opencv | modules/ml/src/kdtree.hpp | #ifndef KDTREE_H
#define KDTREE_H
#include "precomp.hpp"
namespace cv
{
namespace ml
{
/*!
Fast Nearest Neighbor Search Class.
The class implements D. Lowe BBF (Best-Bin-First) algorithm for the last
approximate (or accurate) nearest neighbor search in multi-dimensional spaces.
First, a set of vectors is passe... | ALGO | 0.999547 | 5.498303 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 35401,
"repo_created_at": "2012-07-19T09:40:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 83079,
"forks": 56217,
"issues": 2595,
"pull_requests": 138
},
"file_meta": {
"content_id"... |
6afa4df3-460b-4105-ba2d-44fd8c8d7591 | KingShivamX/OpenGL-CG-Lab | 8_floodFill.cpp | #include <GL/glut.h>
void initOpenGL() {
glClearColor(0.0, 0.0, 0.0, 1.0); // Set background color to black
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 640.0, 0.0, 480.0); // Set up orthographic projection
}
void setPixelColor(float* color) {
glColor3f(color[0], color[1], color[... | ALGO | 0.999537 | 6.536972 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-21T02:57: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": "9ac7811d9a4b... |
040962a4-1253-428f-83b5-93d82754b5e3 | GreenApple-jsy/Algorithm | 정사각형 방.cpp | #include <string>
#include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> rooms;
vector<vector<bool>> visited; //방들의 방문 여부 기록
int visitRoomN(int i, int j, int currentVisitN) {
int maxVisitN = currentVisitN;
int n;
visited[i][j] = true; //현재 방문한 방에 대한 방문표시
if ((i > 0) && (rooms[i-1][j] == ... | ALGO | 0.999707 | 4.23547 | {
"github_metadata": {
"branch": "master",
"commit_count": 485,
"repo_created_at": "2019-08-30T18:57:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d100926... |
765dfaf4-ec78-4a51-8800-0f305fd921dc | Spandan-m-28/Codeforces_CP31_sheet | 900/18.MakeAP.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve() {
ll a, b, c;
cin >> a >> b >> c;
// Try modifying a
ll reqA = 2 * b - c;
if (reqA > 0 && reqA % a == 0) {
cout << "YES\n";
return;
}
// Try modifying b
ll sumAC = a + c;
if (sumAC % 2... | ALGO | 0.999963 | 5.054153 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-04-15T17:00: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": "16fef0dae05... |
98853c7d-b94b-40d7-a7a4-3276755f37d5 | ishandutta2007/codeforces-a | abc864197532/normal/1257/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define fop(i,m,n) for (int i=(m)-((m)>(n));i!=(n)-((m)>(n));i+=2*((m)<(n))-1)
#define test(x) cout << #x << ' ' << x << endl;
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define pii pair <int,int>
int main () {
int t;
cin... | ALGO | 0.999749 | 3.312884 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6232cdbd0209... |
917ce2a6-82f0-4407-8f05-519d4b94d5be | MacJim/LeetCode-C | 154 (binary search with duplicate numbers, revisit).cpp | /*
* 154. Find Minimum in Rotated Sorted Array II
* https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/
*/
/*
* Duplicate numbers easily defeats binary search algorithms with cases where left == mid == right, such as: {2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 2} and {2, 2, 2, 0, 2, 2, 2, 2, 2 , 2, 2, 2}... | ALGO | 0.999937 | 6.580045 | {
"github_metadata": {
"branch": "master",
"commit_count": 372,
"repo_created_at": "2019-07-25T14:49:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97813ece... |
c1efd04f-54a2-4cb3-bcf6-22ce74923460 | Aki-Gonzalez/LeetCodeProblems | LeetCodeCPP/LeetCodeCPP/LongestCommonPrefix.h | #pragma once
#include <string>
#include <vector>
// https://leetcode.com/problems/longest-common-prefix/
class Solution {
public:
std::string longestCommonPrefix(std::vector<std::string>& strs) {
int minCommonLength = INT_MAX;
for (auto& s : strs)
{
minCommonLength = std::min(... | ALGO | 0.998706 | 6.562088 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-11-12T14:58:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19947d80cbb6... |
2b25b56d-af98-4c25-aac7-8099644f29da | cvt220106/algorithm_preparation | dp/subseqAndsubarr/72_minDistance.cpp | // 编辑距离
// 538题的两个字符串,1.只能删除操作,2.word1和word2达到一个相同的状态(不需要一定是二者其一)
// 编辑距离则是,1.可删除、添加、替换 2.word1转为word2!!(必须word2不变的)
// 因此我们的删除、添加、替换操作都是基于word1而言的
// dp数组
// dp[i][j]表示[0, i - 1]的word1子串转变为[0, j - 1]的word2子串的最小编辑距离
// 递推关系
// if word1[i - 1] == word2[i - 1]
// 那么就依赖于dp[i - 1][j - 1]要走的最小编辑距离即可, dp[i][j] = dp[i - 1][j ... | ALGO | 0.999945 | 5.673313 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-07-15T09:32: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": "cc0558a111f... |
4f02c640-f5ba-4225-abd0-32b380a8b66c | rubychen0611/LeetCode | Problemset/iSwD2y/iSwD2y.cpp |
// @Title: 最短的单词编码 (最短的单词编码)
// @Author: rubychen0611
// @Date: 2021-10-20 20:22:34
// @Runtime: 48 ms
// @Memory: 72.2 MB
struct TrieNode {
TrieNode* childNode[26];
bool isVal;
TrieNode () {
isVal = false;
for(int i = 0; i < 26; i++) {
childNode[i] = nullptr;
}
}
}... | ALGO | 0.999986 | 5.553599 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2020-10-24T02: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": "7fe730d32988... |
e65025a0-44d8-491b-a7cc-506cace17868 | eggtgg/RoboconHUETcontest_CaptainHUET_Team | pid_test/pid_test.ino | #define PWM_MOTOR_1 5
#define PWM_MOTOR_2 6
#define EncoderA1 2
#define EncoderA2 3
// cam bien hong ngoai
#define hongNgoai A7
//HC3
#define Trig1 A0
#define Echo1 A1
//HC2
#define Trig2 8
#define Echo2 9
//HC1
#define Trig3 11
#define Echo3 12
volatile long encoder1Count = 0;
volatile long encoder2Count = 0;
f... | TOOL | 0.971582 | 4.095255 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-12T04:08:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b0d6790632... |
37260408-18e2-4592-aea5-4b899386fc33 | thisisdientran/CS_008_final_project | includes/bst_tree/bst_tree.h | #ifndef BST_TREE_H
#define BST_TREE_H
#include <iostream>
#include "../tree_node/tree_node.h"
// -----------------------------HEADER-----------------------------------
// template<typename T>
// void inorder(Node<T>* node, void (*f)(T& data));
// template<typename T>
// void preorder(Node<T>* node, void (*f)(T& dat... | ALGO | 0.992116 | 4.124881 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-10-29T17:38: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": "1c606790070f... |
c64ec104-4958-47a5-a293-b43e3fcf33de | ApolloAuto/apollo | modules/planning/planners/lattice/trajectory_generation/lateral_osqp_optimizer.h | /******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
... | ALGO | 0.941241 | 7.017999 | {
"github_metadata": {
"branch": "master",
"commit_count": 19341,
"repo_created_at": "2017-07-04T19:03:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25847,
"forks": 9793,
"issues": 895,
"pull_requests": 104
},
"file_meta": {
"content_id... |
da67397f-8a78-4b88-b7bc-9f80e26b5016 | arpitp1234/DSA-CPP | _DSA/Module_13_Sorting/10_HeapSort.cpp | #include<iostream>
using namespace std;
void Insert(int A[],int n){
int i=n,temp;
temp=A[i];
while(i>1 && temp>A[i/2]){
A[i]=A[i/2];
i=i/2;
}
A[i]=temp;
}
int Delete(int A[],int n){
int i,j,x,temp,val;
val=A[1];
A[1]=A[n];
A[n]=val;
i=1,j=i*2;
whi... | ALGO | 0.999939 | 3.846308 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-07-05T12:15: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": "9c834a3e92... |
c4f93ed3-6c67-4155-9887-0d883cbc13e4 | timmyjose-experiments/competitive-programming | lc/coreprep/implementation/practice_iterations/patterns_iterations_1/zigzag_traversal.cpp | #include <algorithm>
#include <iostream>
#include <list>
#include <queue>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int val) : val(val), left(nullptr), righ... | ALGO | 0.999972 | 5.171276 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2022-06-14T11:32:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "136c59ac9... |
b3382bf6-acb0-4e8d-9efc-bddeb121f76c | GabrielFrizzo/competitive-programming | treinos/2020/13mai/E.cpp | #include <bits/stdc++.h>
using namespace std;
using pii = pair<int,int>;
using piii = pair<pii, int>;
using vi = vector<int>;
using ll = long long;
const int MxN = 1123;
const int INF = 1e9+5;
int g[MxN][MxN];
int N, M;
bool valid(int i, int j) {
return i >= 0 && j >= 0 && i < N && j < M;
}
void solve() {
cin >> ... | ALGO | 0.999965 | 4.212591 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-07-16T22:35:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "813434719a... |
e67daa5d-3f10-497b-ae5f-e9ed2642d29c | Isimis/Personal_Learning_Projects | Maze_Generator.cpp | #include <iostream> // output
#include <vector> // vector
#include <random> // rng
#include <algorithm> // shuffle
using namespace std;
// Wielkość labiryntu - będzie działać poprawnie przy wszystkich liczbach nieparzystych
const int width = 29;
const int height = 29;
// Tworzenie labiryntu
char grid[height][width];... | ALGO | 0.999943 | 4.42398 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-09-03T19:32: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": "bc29041c110... |
f9a77c57-63b6-4abf-ad82-04dcdadb0e46 | Arko23/My-DSA-with-C- | C++/Random/mergearrCP.cpp | #include <iostream>
using namespace std;
//CP question solved Success yeee:)
void merge(int arr1[], int n, int arr2[], int m, int arr3[])
{
int i = 0, j = 0, k = 0;
while (i < n && j < m)
{
if (arr1[i] < arr2[j])
{
arr3[k] = arr1[i];
k++;
i++;
}
... | ALGO | 0.999929 | 3.931254 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-14T22:28: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": "5ef596397de1... |
624db4a9-2d2a-44ce-9f1d-7ed4861f5ce3 | lessandro/nbis | misc/nistmeshlab/vcglib/apps/sample/trimesh_ray/trimesh_ray.cpp | #include <vector>
using namespace std;
// VCG headers for triangular mesh processing
#include<vcg/simplex/edge/base.h>
#include<vcg/simplex/vertex/base.h>
#include<vcg/simplex/face/base.h>
#include <vcg/complex/trimesh/base.h>
#include <vcg/complex/trimesh/update/topology.h>
#include <vcg/complex/trimesh/update/edges... | ALGO | 0.994208 | 4.63006 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2011-09-21T11:13:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 80,
"forks": 81,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "360de3fd... |
7f2897f0-a8cb-42d4-b546-b99372f5da39 | Anachor/HellBent | Ashiq's Code Library/Miscellaneous/stern brocot tree(copied).cpp | #include<bits/stdc++.h>
using namespace std;
#define x first
#define y second
/// finds a fraction x/y with minimum y, such that L <= (x/y) < R
/// https://codeforces.com/blog/entry/50244
pair<long long, long long> solve(long double const&L, long double const&R){
pair<long long, long long> l(0, 1), r(1, 1);
... | ALGO | 0.999555 | 3.695293 | {
"github_metadata": {
"branch": "master",
"commit_count": 209,
"repo_created_at": "2019-09-27T07:37:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 59,
"forks": 17,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "523f14... |
a9bb83de-f439-4f30-82a1-4f024e742d8b | namnp201002/CTDL-GT-PTIT | BAI TAP Code PTIT/DSA06040_GIAO_CUA_BA_DAY_SO.cpp | #include<iostream>
#include<vector>
using namespace std;
int main(){
int t; cin >> t;
while(t--){
int N1, N2, N3; cin >> N1 >> N2 >> N3;
vector<int> arr1(N1);
vector<int> arr2(N2);
vector<int> arr3(N3);
for(int i = 0; i < N1; i++) cin >> arr1[i];
for(int i = 0;... | ALGO | 0.999946 | 4.103299 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-02-09T14:56:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cde69c7d49... |
d90c4c1d-acca-4a31-84fc-7697b134b878 | EamonTracey/cubot | src/lib/prune.cc | #include "prune.h"
#include <cstdint>
#include <deque>
#include <fstream>
#include <string>
#include <unordered_set>
#include <vector>
#include "algorithm.h"
#include "cube.h"
namespace cubot {
void GeneratePruneTable(uint8_t *prune_table, size_t prune_table_len,
int (*calculate_state)(const... | ALGO | 0.99926 | 6.216503 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2025-01-02T08:01: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": "92a406ccd28... |
2502660c-6025-43d3-a692-35a10c0f9ae3 | allenanswerzq/byteme | old/codeforces/random/51a/51a.cc | /*
* Name : 51a
* Creat : Thu Jul 11 12:30:19 CST 2019
* Accept : Thu Jul 11 14:19:19 CST 2019
* Author : landcold7
* Description : Action speaks louder more than words
*/
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define sz(x) ((int)(x).size())
#ifndef... | ALGO | 0.999975 | 3.914316 | {
"github_metadata": {
"branch": "master",
"commit_count": 810,
"repo_created_at": "2017-06-16T09:27:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f36e5b0... |
af80a8b2-5eaa-44ef-9375-740d369fe6b8 | heyshb/Competitive-Programming | CodeForces/PastContest/1425/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int N, K;
LL A[100010], D[100010];
LL ps[100010];
LL pm[100010];
LL ss[100010];
int main() {
scanf("%d%d",&N,&K);
for (int i=1;i<=N;i++) {
scanf("%lld",&A[i]);
}
for (int i=1;i<=N;i++) {
scanf("%lld",&D[i]);
}
... | ALGO | 0.999919 | 3.5203 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2018-02-21T09:20: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": "bac2f3932... |
52e14d8d-14ec-4df5-80ac-1b5c5f652478 | StefanPiscu/competitive-programming-work | programe/codeforces/100451/k.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int n, fa, fb;
struct task{
int a, b, t;
int ind=0;
bool operator<(const task &ot) const{
return t<ot.t;
}
};
vector<task> v;
vector<int> finsol;
bool check(int d){
int cost=fa;
int suma=0, sumb=0, mini=1e9;
int last=1;
finsol.c... | ALGO | 0.999891 | 3.858355 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-14T14:29: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": "76fad2170daf... |
0158601f-7ea2-48a8-a54f-51feb5934e00 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0925/personal_submission/cf1210b_kamtuo.cpp | /*----------------------------------*/
/* Author : KaMtuo */
/* Email : <EMAIL> */
/* Creation_time : 2024-09-25 19:04 */
/* Software : Visual Studio Code */
/*----------------------------------*/
#ifndef KAMTUO_LEETCODE
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nul... | ALGO | 0.999954 | 4.62885 | {
"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": "5a4b... |
2fbdb854-64e3-4c6c-befa-8a4af1c347db | allwellll/cf_code_jiangly | 1543/1543E-E-TheFinalPursuit.cpp | // url:https://codeforces.com/contest/1543/problem/E
// time:2021-07-07 19:02:41
// name:E-TheFinalPursuit
#include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t--) {
int n;
std::cin... | ALGO | 0.999659 | 4.48071 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2022-10-17T23:31:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 97,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d99c7e578... |
5bea2d05-6a41-4087-9772-58c3dffbbcbe | yosefgoren/Animated-N-Body-Simulation | main.cpp | #include <iostream>
#include <SFML/Graphics.hpp>
#include <cmath>
#include <vector>
#include "Space.h"
#include "NBodySystem.h"
using namespace std;
int amain(){
try{
Matrix m1 = vector<vector<float>>({
{7.f, 0.f},
{0.f, 5.f}
});
Matrix m2 = vector<vector<float>>({... | ALGO | 0.999412 | 3.638633 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-01-11T16:02:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3534f49308... |
06e09d21-63e7-40a7-9cce-514a52ee08fd | adenchfi/modified_alps | applications/dmft/qmc/interaction_expansion/measurements.cpp | /*****************************************************************************
*
* ALPS DMFT Project
*
* Copyright (C) 2005 - 2009 by <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>,
* <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
*
*
* This soft... | ALGO | 0.945789 | 5.462598 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-09-30T14:47:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82fc03082b... |
a5ae9588-53d4-4c6d-a0a7-c312b0ceedc6 | Jorgefiestas/CompetitiveProgramming | Codeforces/CF1461E.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
long long k, l, r, t, x, y;
bool seen[N];
int yes() {
cout << "Yes\n";
return 0;
}
int no() {
cout << "No\n";
return 0;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> k >> l >> r >> t >> x >> y;
if (x > y) {
long long ... | ALGO | 0.999775 | 3.835866 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2019-01-08T13:08: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": "b1f5977d6... |
9826bea7-e852-468a-b88d-d513fcf0d0a7 | PayalNarwal/Data-Structure | Graphs/g2_bfs.cpp | #include <iostream>
#include <unordered_map>
#include <list>
#include <vector>
#include <queue>
using namespace std;
void prepareAdjList(unordered_map<int,list<int>> &adjList, vector<pair<int,int>> &edges){
for(int i = 0; i<edges.size(); i++){
int u = edges[i].first;
int v = edges[i].second;
... | ALGO | 0.999978 | 4.610637 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-09-28T04:58: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": "a72669c47492... |
5768c8eb-6c7a-43c1-800b-6ee2e7ee4a16 | Fenixfire111/Labs | 01-Sem/04-Lab/z2.cpp | #include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main() {
ifstream myFile;
if(!myFile) {
cout << endl << "Failed to open file";
return 1;
}
char a[300],b[300];
ifstream fin("qwer.txt");
int f=0;
while (fin.getline(a,1024)){
int q=0;
... | ALGO | 0.99883 | 3.357173 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2020-09-17T15:05: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": "6cd69b77b28... |
87fa86cf-1c42-465e-9b06-45e4dd259219 | sailor-ux/mycodes | leetcode_vscode/leetcode_143/leetcode_143_2.cpp | #include <iostream>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode* next) : val(x), next(next) {}
};
class Solution {
public:
void reorderList(ListNode* ... | ALGO | 0.999999 | 5.68814 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2019-10-11T08:27: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": "06b38ccf45c... |
333b86d2-0c9a-4f6c-adf2-c0a86deb1142 | AbhisekDas01/DSAwithCPP | Dynamic Programing/PaintingFanceAlgorithm.cpp | /*Given a fence with n posts and k colors, find out the number of ways of painting the fence
so that not more than two consecutive posts have the same colors. Since the answer can be
large return it modulo 109 + 7.*/
#include <iostream>
#include <vector>
#define mod 1000000007
using namespace std;
// Normal recursi... | ALGO | 0.999993 | 6.355184 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2024-08-07T15:11: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": "13122f7881... |
887fe22d-4530-43c4-8df7-1939fafeceac | primat000/Perceptron | Net_lib/Neuron_net.cpp | #include "Header.h"
using namespace std;
/*..........................class neuron_net..........................*/
neuron_net::neuron_net(int layers, vector<int> neuron_in_layers)
{
L_count = layers;
int IN = neuron_in_layers[0];
int OUT = neuron_in_layers[neuron_in_layers.size()-1];
In.resize(IN);
... | ALGO | 0.984446 | 3.314616 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-09-28T19:51: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": "aa1e6cb3b9... |
ada5fa08-78e8-4ae0-bdd9-8fc7fcb18208 | tkarthikeyan132/Graph-algorithms | bipartite.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Edge
{
public:
int src, dest, weight;
};
int Comparator(const void* a, const void* b);
class Graph
{
public:
int V;
int E;
int directed;
vector<pair<int,int>>adj[20]; //makes an array of vectors
//Add... | ALGO | 0.999921 | 5.043057 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2020-03-29T05:31:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4eb7da10... |
1c11c8d9-c2ec-4f4f-a6db-10c07c576d42 | nikhilgarg28/libalgo | MinMaxQ.cpp | /*
* Author : <NAME>
* Date : 2010-12-31
* A templatized MinMax Queue implementation.
* Provides O(1) insert, delete, fimnMin and findMax opertions.
* Assumption : all elements pushed in queue are different. This assumption can be
* relaxed after some extra book keeping code.
*
* I'm pre allocating space for queues... | ALGO | 0.996855 | 5.158657 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2012-01-10T11:10:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a955cb47... |
49a1f967-0961-49e5-b76b-99570946313d | AllenOris/ACM-Solution | 暑假集训5/C.cpp | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
using namespace std;
int map[2000][2000];
int n, m;
int in[2000];
int out[2000];
int dp[2000];
int s = 1500, t = 1501;
bool used[2000];
struct E
{
int v, next, to;
} e[10050];
int head[2000],cnt;
void add(int a,int b,... | ALGO | 0.999906 | 3.898335 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2018-07-19T02:52:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7db6d82d9... |
375c4ccd-1130-4ce7-8b32-b53af44a7100 | shadykdc/AdventOfCode | 2020/19.cpp | /*
Advent of Code Day 19
To run on a mac:
1. Update makefile "DAY" variable to 19
2. Run "make"
3. Run "./aoc"
Problem:
https://adventofcode.com/2020/day/19
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <unordered_map>
#include <sstream>
#include <... | ALGO | 0.998375 | 4.666458 | {
"github_metadata": {
"branch": "master",
"commit_count": 311,
"repo_created_at": "2019-12-04T05:12: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": "338f9e86... |
26cd3f48-9d21-42d3-aacb-c1b713d9c15c | Socialfew146575/DSA | Binary Tree/1-Reverse-level-order-traverse.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
data = d;
left = nullptr;
right = nullptr;
}
};
node *buildTree(node *root)
{
cout << "Enter the data to enter the node:" << endl;
int data;
... | ALGO | 0.999978 | 4.744886 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-09-25T19:27: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": "ecc0d9a55df... |
7bc3466f-3fd7-42f0-b365-685ee87e12f8 | CGAL/cgal | Algebraic_kernel_d/include/CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h | // Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : <NAME> <<EMAIL>>
// <NAME> <<EMAIL>>
// ... | ALGO | 0.998852 | 7.346108 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
ad9ed50f-07c0-4e1b-80e8-4daee69a38aa | Xilinx/Vitis_Libraries | dsp/L2/include/hw/vitis_2dfft/fixed/vitis_fft/fft_kernel.hpp | /*
* Copyright 2021 Xilinx, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | ALGO | 0.988529 | 6.915756 | {
"github_metadata": {
"branch": "main",
"commit_count": 471,
"repo_created_at": "2019-09-23T19:13:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 988,
"forks": 381,
"issues": 0,
"pull_requests": 12
},
"file_meta": {
"content_id": "64208f... |
bff9af1d-63c9-4ed1-93a9-ca4a7ee3d1a8 | mingnine/BOJ | code/1074_Z.cpp | #include <iostream>
#include <cmath>
using namespace std;
int f(int n, int r, int c)
{
int result = 0;
int mid = pow(2, n) / 2;
if (n == 1)
{
if (r == 0 && c == 0)
return 0;
else if (r == 0 && c == 1)
return 1;
else if (r == 1 && c == 0)
return 2;
else if (r == 1 && c == 1)
return 3;
}
// 1... | ALGO | 0.999872 | 4.282228 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2019-04-25T11:21: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": "3d7776cad... |
c8ea3695-5c78-4c73-bf48-a7ff4e38ccd1 | manujgrover71/cp_codes | codeforces/1419/B.cpp | #include <algorithm>
#include <iostream>
#include <climits>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <set>
#include <map>
using namespace std;
template <typename T> istream &operator>>
(istream &is, vector<T> &vec)
{ for (auto &v : vec) is >> v; return is; }
... | ALGO | 0.999863 | 4.392581 | {
"github_metadata": {
"branch": "master",
"commit_count": 517,
"repo_created_at": "2020-12-21T09:52: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": "574ae35e... |
fc32c567-a12f-449b-b848-5f9b08af5dc0 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/04/0401/personal_submission/cf1016d_inhng.cpp | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define endl '\n'
#define int long long
#define lowbit(x) x & -x
#define PII pair<int, int>
#define PIII pair<int, PII>
#define ctzll(x) __builtin_ctzll(x)
#define popcount(x) __builtin_popcount(x)
const int INF = 0x3f3f3f3f;
const int m... | ALGO | 0.999977 | 3.532473 | {
"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": "94ea... |
3de5b06e-b5cc-44c3-9871-b20c8983cc39 | Tudor67/Competitive-Programming | AtCoder/ABC333/G_sol2_stern_brocot_trees_O(30xN)_time_TLE.cpp | #include <bits/stdc++.h>
using namespace std;
string add(string A, string B){
const int A_LEN = A.length();
const int B_LEN = B.length();
const int C_LEN = max(A_LEN, B_LEN);
string C(C_LEN, '0');
int carry = 0;
for(int i = 0; i < C_LEN; ++i){
int digitA = (i <= A_LEN - 1 ? A[A_LEN - 1... | ALGO | 0.999971 | 4.271018 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2020-02-27T19:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d9139b0... |
14441c9a-8d91-465a-9e49-c777abc6a3a6 | seajunk/cp | cf/practice/1878E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(){
ll n; cin >> n;
ll a[n];
for(int i = 0; i < n; i++) cin >> a[i];
vector<vector<ll>> pfcnt(n + 1, vector<ll>(32, 0)); //pfcnt[i][j] = count of j th bit in [0, i)
for(int i = 1; i <= n; i++){
bitset<32> temp(a... | ALGO | 0.999911 | 4.557902 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-02T02:50:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5727a9386e5... |
45494d9e-1613-4af2-bdb5-eb612581faaf | sonumahajan/All_Program_helper | Cses dp/Distinct_Numbers.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pll pair<ll, ll>
#define vl vector<ll>
#define vpl vector<pair<ll, ll>>
#define mll map<ll, ll>
#define pb push_back
#define f(i, a, b) for (ll i = a; i < b; ++i)
#define rev(i, a, b) for (ll i = a; i >= b; --i)
#define print(x) cout << x <... | ALGO | 0.999593 | 4.022674 | {
"github_metadata": {
"branch": "main",
"commit_count": 1698,
"repo_created_at": "2021-10-01T14:26:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 64,
"forks": 331,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "cf9255... |
ee4fcd9d-721c-4b3c-898c-8840711a1db8 | STEllAR-GROUP/3d-eulerian-amr | euler/initialize.cpp |
#include "../defs.h"
#ifdef EULER
#include "initialize.h"
#include "../grid/grid_node.h"
#include "state.h"
#include "math.h"
void initialize(GridNode* g) {
State U = Vector<Real, STATE_NF> (0.0);
Real r;
const Real rho0 = 1.0;
const Real ei0 = 1.0;
const Real tau0 = pow(ei0, 1.0 / State::gamma);
const Real rho... | ALGO | 0.999155 | 3.516444 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2012-08-22T17:43:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b71018315... |
7096a15a-d206-4256-9ab5-1b91b21bb3c9 | weolar/miniblink49 | third_party/WebKit/Source/platform/geometry/FloatPolygon.h | /*
* Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above
* copyright notice, this ... | TOOL | 0.992135 | 7.671795 | {
"github_metadata": {
"branch": "master",
"commit_count": 1788,
"repo_created_at": "2016-09-27T03:41:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7578,
"forks": 1142,
"issues": 340,
"pull_requests": 6
},
"file_meta": {
"content_id": ... |
465dbe49-2320-4777-b6c8-1cbeff239dd6 | ishandutta2007/codeforces-l | l0tus/normal/1736/D.cpp | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define sz(x) int((x).size())
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i, 0, a)
#define each(a, x) for (auto &a : x)
#define FAST_IO \
ios::sync_with_stdio(false); \
... | ALGO | 0.999486 | 3.422826 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "480e568d0914... |
6021f1b9-f4f2-456b-9958-039e83875337 | HernanG234/proyecto | libproject/inc/ANMS_SSC.hpp | #include <iostream>
#include <stdlib.h>
#include <opencv2/opencv.hpp>
using namespace std;
void ssc(vector<cv::KeyPoint>& keyPoints, unsigned int numRetPoints,float tolerance, int cols, int rows){
//Sorting keypoints by deacreasing order of strength
vector<int> responseVector;
for (unsigned int i =0 ; i<key... | ALGO | 0.999533 | 4.694711 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2018-01-27T15:05: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": "a78c6ae20... |
5befc503-d778-4c1f-bfe6-db165019477a | ompl/ompl | demos/PlanarManipulator/PlanarManipulatorPolyWorld.h | /*********************************************************************
* Software License Agreement (BSD License)
*
* Copyright (c) 2015, Rice University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following con... | TOOL | 0.918561 | 6.765226 | {
"github_metadata": {
"branch": "main",
"commit_count": 4948,
"repo_created_at": "2014-05-20T14:22:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1776,
"forks": 636,
"issues": 80,
"pull_requests": 28
},
"file_meta": {
"content_id": "87e... |
d6e0674d-83fe-4812-b680-22b6ec3c2c02 | dajunxu777/leecode | leecode02两数相加.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* addTwoNumbe... | ALGO | 0.999976 | 6.095952 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-04-01T11:48: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": "b2bad368db46... |
cb66bbb6-f605-407e-8417-0706c24b0da9 | miguelzacca/vigenere-encoder-cpp | src/main.cpp | #include <iostream>
#include <string>
#include <stdexcept>
#include <cctype>
static const std::string LETTERS = "abcdefghijklmnopqrstuvwxyz";
void toLowerCase(std::string &str)
{
for (char &c : str)
{
c = std::tolower(c);
}
}
std::string process(const std::string &input, const std::string &key, bool encode... | ALGO | 0.999648 | 6.429646 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-05-29T12:22:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32fcce7910d... |
e81b57dc-05fe-4b3d-9ed4-032adff6c895 | akhmedov/StrMath | StrMath/main.cpp | //
// main.cpp
// StrMath
//
// Created by <NAME> on 17.02.2025.
//
// TODO: order of includes
#include "floating.hpp"
#include <iostream>
#include <chrono>
#include <ctime>
// https://www.cecm.sfu.ca/organics/papers/borwein/paper/html/local/bdigits.html
const std::string PI = "3."
"1415926535897932384626433832795... | TEST | 0.932301 | 5.83122 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-23T12:28:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2843925ed2d... |
23403a66-c45e-4447-8489-75db2cbe31ff | itohdak/Competitive_Programming | Codeforces/ECR/117/G.cpp | #include <bits/stdc++.h>
#include <print.hpp>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()... | ALGO | 0.999985 | 4.37666 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2020-10-16T18:27: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": "70207b262... |
1b543469-137f-4fa7-b32e-59180c11b798 | gnahtb/Code-Archive | CP/Codeforces/213C.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
template <typename T> void maximize(T &a, T b) { if (a < b) a = b; }
const int maxN = 305;
int n, a[maxN][maxN], f[2][maxN][maxN];
void solve()
{
for (int i = 1; i <= n; ++i)
fill(f[0][i] + 1, f[0][i] + n + 1, INT_MIN);
... | ALGO | 0.999972 | 3.764785 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2021-07-22T18:42: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": "d957bc25d9c... |
e74b9679-becd-44c0-a2f1-01bd8eff4da2 | ishandutta2007/codeforces-j | joeywheeler/normal/605/E.cpp | #include <bits/stdc++.h>
#define FO(i,a,b) for (int i = (a); i < (b); i++)
#define sz(v) int(v.size())
using namespace std;
int p[1005][1005];
double e[1005];
double a[1005], b[1005], pfail[1005];
bool proc[1005];
int n;
double ca;
double ge(int i) {
if (pfail[i] > 1-1e-9) return 1e9;
//printf("pfail[%d]=%l... | ALGO | 0.999251 | 3.465187 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42: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": "9359b00d3b4c... |
b336132a-09b1-4905-8272-a73ebb46b3ca | OpenDigitalTwin-Dev/FENGSim | toolkit/Geometry/vtk/Filters/HyperTree/vtkHyperOctreeCutter.cxx | /*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperOctreeCutter.cxx
Copyright (c) <NAME>, <NAME>, <NAME>
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed... | ALGO | 0.900395 | 4.958799 | {
"github_metadata": {
"branch": "main",
"commit_count": 1345,
"repo_created_at": "2021-12-22T12:15:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 54,
"forks": 15,
"issues": 4,
"pull_requests": 2
},
"file_meta": {
"content_id": "1a82e805... |
126a695c-bbe7-482b-a14d-ce9ff70e264f | devendranaga/c_cpp_book | c++/containers/list_remove.cpp | /**
* Author <NAME> (<EMAIL>)
*
* License apache
*/
#include <list>
#include <string>
#include <iostream>
std::list<std::string>::const_iterator
find_element(std::list<std::string> &s, std::string _s)
{
std::list <std::string> :: const_iterator it;
for (it = s.begin(); it != s.end(); it ++) {
if (... | TOOL | 0.951208 | 5.055077 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2018-11-02T13:35:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f34d7914... |
2dc3e34d-8335-4e9c-bce6-5e98e990c5c4 | danielhO9/PS | ATCODER/arc194B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N;
ll P[200000];
struct SegmentTree {
vector<ll> arr;
vector<ll> tree;
int sz;
inline ll merge(ll a, ll b) { return a + b; }
void init(vector<ll>& a) {
sz = a.size();
arr = a;
int h = (int)ceil(log2(sz));
int tree_size = (1 << (h + ... | ALGO | 0.999952 | 4.277513 | {
"github_metadata": {
"branch": "main",
"commit_count": 336,
"repo_created_at": "2024-02-08T11:38: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": "8cb896aadc... |
35e700b1-e3ef-433a-8654-2b80a1bb4df1 | morris821028/UVa | volume118/11876 - N + NOD (N).cpp | #include <stdio.h>
#include <math.h>
int p[5200], pt = 0;
int N[100000];
void sieve() {
int i, j, mark[50000] = {};
for(i = 2; i < 50000; i++) {
if(!mark[i]) {
p[pt++] = i;
for(j = i+i; j < 50000; j += i)
mark[j] = 1;
}
}
}
int NOD(int n) {
int ans... | ALGO | 0.999942 | 4.132529 | {
"github_metadata": {
"branch": "master",
"commit_count": 1197,
"repo_created_at": "2013-06-14T12:34:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 269,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "7cc... |
dcb12c3c-8a97-4f3a-aa17-2685278ee1cf | Lakori4/ESTRUCTURAS-DE-DATOS-Y-ALGORITMOS | Prácticas/Práctica 5/TADLista.cpp | //<NAME> Y <NAME>
#include <iostream>
#include <memory>
#include "TADLista.h"
using namespace std;
//------------------Clase CDato
int CDato::getVertice() const {
return vertice;
}
void CDato::setVertice(int newV) {
vertice = newV;
}
float CDato::getDistancia() const {
return distancia;
}
void CDato::s... | ALGO | 0.992026 | 4.867263 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-01-30T13: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": "743c62f5df5... |
19c5f178-d53b-43b3-b5d1-f2ead3b33567 | SesameZMT/homework_code | 算法设计作业/2111454_H4/2111454_H4_Q1.cpp | #include<iostream>
int min(int * a,int num)
{
int temp = 1000000;
int k = 0;
for(int i = 0;i < num;i++){
if(a[i] < temp && a[i] != -1){
temp = a[i];
k = i;
}
}
return k;
}
int main()
{
int day = 0;//现在的时间
int num;
int ** a = new int *[2];
... | ALGO | 0.999942 | 3.544096 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-03-02T09:47:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb3dae5eba1... |
f53a9901-2841-4aba-9ac4-5f27433e9cea | ISheepp/My_Ds_Demo | TQDS/线性表/test/链表插入删除.c++ | #include <iostream>
using namespace std;
//定义单链表结构体
typedef struct LNode
{
int data;
struct LNode *next;
} LNode;
//创建单链表(尾插法)
void createLinkListR(LNode *&head)
{
head = (LNode *)malloc(sizeof(LNode));
head->next = NULL;
LNode *p = NULL; //接收新节点
LNode *r = head; //始终指向尾结点
int n;
cout <<... | ALGO | 0.999726 | 3.734278 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2019-10-30T13:45:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cde84477... |
b7169420-435b-441c-9187-d66ed392b404 | SGColin/CodeRepo | CodeForces/1451/E2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
inline int rd() {
int x = 0;
bool f = 0;
char c = getchar();
for (; !isdigit(c); c = getchar()) f |= (c == '-');
for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
return f ? -x : x;
}
#define N 70001
#define r... | ALGO | 0.999967 | 3.421738 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-07-23T03:47:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8b304e4e1d... |
bd2a7026-c5ed-412f-a75e-28e4383094dd | nguyenanhductb23/DSA_20021336_NguyenAnhDuc | week11/Graph_Full.cpp | #include <iostream>
#include <stack>
#include <queue>
#include <map>
using namespace std;
struct Node {
int value;
vector<Node*> nextNodes;
Node() {}
Node(int val) {
value = val;
}
Node(int val, vector<Node*> nodes) {
value = val;
nextNodes = nodes;
}
... | ALGO | 0.999767 | 4.806685 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2021-09-28T11:26:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d5dde42d19... |
a96813d3-33ac-4198-95b1-a3ee4fd50957 | north-h/Match_code | 2023/Codeforces Round 731 (Div. 3)(vp)/A.cpp | /*
* =====================================
* Author : north_h
* Time : ctrl+shift+t
* =====================================
* Thirty years east, thirty years west,
* don't you dare bully me because I'm poor now.
* _ _ _
* _ __ ___ _ __| |_| |__ | |__
*| '_ \ / _ \| '__| __| '_... | ALGO | 0.999983 | 4.455363 | {
"github_metadata": {
"branch": "main",
"commit_count": 555,
"repo_created_at": "2023-08-20T03: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": "41db154626... |
f245ee8e-d6dc-4c91-926f-6ef135bd06b2 | robert-kieu/DatastructureAndAlgorithm | d_linked_list.cpp | #include<iostream>
using namespace std;
struct d_NODE {
int key;
d_NODE* pNext;
d_NODE* pPrev;
};
struct d_List {
d_NODE* pHead;
d_NODE* pTail;
};
d_NODE* createNode(int data) {
d_NODE* pnode = new d_NODE;
if (!pnode) return NULL;
pnode->key = data;
pnode->pNext = NULL;
pnode->pPrev = NULL;
return pnod... | ALGO | 0.999791 | 4.073513 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2020-12-21T03:48:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a719c488ae9e... |
2e87545a-5db3-4492-8687-eea8188f5af5 | ABKGroup/TritonPart | OpenROAD/src/par/src/Utilities.h | ///////////////////////////////////////////////////////////////////////////
//
// BSD 3-Clause License
//
// Copyright (c) 2022, The Regents of the University of California
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the f... | TOOL | 0.994338 | 5.896044 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-12-31T03:19:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 27,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "50ce52c2c27... |
36ce1f81-a9f4-4371-812c-291d7fe4760f | abhavgoel/LLD | Graph - Dijkstra/src/Graph.h | #ifndef GRAPH_H
#define GRAPH_H
#include<iostream>
#include<vector>
#include<map>
// class ShortestPath;
class Graph{
private:
int num_vertices;
int num_edges;
std::map<int, std::string> nodeNames;
std::vector<std::vector<std::pair<int,double>>>_adjList; //{u ->{v,edgeWt}}
public:
Graph(... | ALGO | 0.913142 | 3.891761 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-04-20T09:20:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "581c1c30e3b... |
ec7590b9-30f5-4960-9a71-f794e936f960 | Sabelleo/fall2019-assign1 | main.cpp | #include "dna.h"
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
using namespace std;
int main(int argc, char* argv[])
{
//constructor
dna dna1;
try {
//check for initial file added as a command line argument
if (argc > 0)
{
... | TOOL | 0.924831 | 4.077569 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-09-13T23:00:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72e1efd10f... |
e3be0c3d-f871-4f12-92dd-aee8cdce4dcc | WX-James/Numerical-Optimization-in-Robotics | Project/Project_Solution_1/Project_1/src/Topp/src/Conic-alm.cpp | # include <Eigen/Eigen>
# include <iostream>
class ConicAlm
{
private:
//Optimization variables
Eigen::VectorXd xi;
Eigen::VectorXd grad_alm;
double f_xi;
double stp;
//Objective function variables
Eigen::VectorXd c;
//SOCP CONSTRAINT VARIABLES
Eigen::MatrixXd A;
Eigen::VectorXd b;
//Augmented Lagrangian variabl... | ALGO | 0.999951 | 5.876006 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-12-06T06:13: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": "94f42f61f3... |
3bb5ad29-49a8-4cd8-b452-39462e4f1d5e | guptapranjal19/Codeforces | Collecting Coins.cpp | //By <NAME>
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAX 1000
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d\n",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(conta... | ALGO | 0.999888 | 3.806486 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-05-10T13:51:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e91df9eaeef... |
1fe08237-5818-46b1-9c36-6b143f360068 | ImTurtle35/Baekjoon | Easy_Stair_Num.cpp | // Baekjoon 10844
// Dynamic Programming
#include <iostream>
#include <algorithm>
using namespace std;
int N;
long long int answer;
long long int dp[101][10];
int main() {
cin >> N;
for (int i{ 1 }; i <= 9; i++) {
dp[1][i] = 1;
}
for (int i{ 2 }; i <= N; i++) {
for (int j{ 0 }; j <= 9; j++) {
if (j == 0)
... | ALGO | 0.99982 | 4.349844 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2019-09-16T10:28:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc2963a6... |
96b156e7-e5dd-4dfb-ba40-9bd7262066b7 | tete17/Simbolos_Cristoffel | FTensor/Tensor3_antisymmetric/Tensor3_antisymmetric_plus_Tensor3_antisymmetric.hpp | /* Adds two Tensor3_antisymmetric's together, yielding a
Tensor3_antisymmetric. */
#pragma once
namespace FTensor
{
/* A(i,j,k) + B(i,j,k) */
template<class A, class B, class T, class U, int Dim0, int Dim12,
char i, char j, char k>
class Tensor3_antisymmetric_plus_Tensor3_antisymmetric
{
co... | ALGO | 0.959322 | 6.757493 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-09-24T16:18: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": "062480e24c... |
c7338e22-4044-4bea-9415-ff80186a7f1f | abeccaro/project-euler | src/problems/151-200/152/problem152.hpp | //
// Created by <NAME> on 17/08/2022.
//
#ifndef PROJECT_EULER_PROBLEM152_HPP
#define PROJECT_EULER_PROBLEM152_HPP
#include "cstdint"
#include "vector"
#include "map"
#include "fraction.hpp"
namespace problems {
class problem152 {
private:
class group {
public:
/**
... | ALGO | 0.981217 | 4.129283 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2017-12-11T06:47: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": "969faf2d... |
12d9bbb1-71ef-4975-b8e7-4d3f9f5999f5 | srkimdev/Cpp_practice | make_Stack.cpp | #include <iostream>
template <typename T>
class Stack {
T *ptr;
int capacity;
int size;
public:
Stack(int capacity);
~Stack();
void push(const T& element);
T pop();
};
template <typename T>
void Stack <T>::push(const T& element) {
if (size < capacity) {
ptr... | ALGO | 0.965187 | 5.110583 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2023-07-31T08:18:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdbb24889... |
77e6f4e6-0767-4f14-b94d-17cea14205c5 | nigelathome/CSFundamentals | CSFundamentals/CSAlgorithmsCpp/Algorithms/StringTopic.cpp | //
// OtherTopic.cpp
// CSAlgorithmsCpp
//
// Created by Hui,Li on 2020/12/14.
// Copyright © 2020 Hui,Li. All rights reserved.
//
#include "StringTopic.hpp"
std::string Solution7::multiply(std::string num1, std::string num2) {
std::string result;
if(num1.size() < num2.size()) std::swap(num1, num2);
i... | TEST | 0.998471 | 4.463349 | {
"github_metadata": {
"branch": "master",
"commit_count": 342,
"repo_created_at": "2019-10-02T15: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": "36430580... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.