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 |
|---|---|---|---|---|---|---|---|
98e59296-a1f6-42bb-9c6e-1710e4960c65 | omar-abdel-fattah/Intelligent-Tennis-ball-Collector-Motor-and-sensors-Code | Intelligent Tennis ball Collector Motor and sensors Code/arduino_code.ino | #include <PID_v1.h>
#include <Wire.h> // Library for I2C communication
#include <LiquidCrystal_I2C.h> // Library for LCD
//define pins for 2 encoders
#define ENCA 2
#define ENCB 13
#define ENCC 3
#define ENCD 12
//define pins for communication between arduino and rasbperry PI
#define recieve A3
#define face_rec A2
... | TOOL | 0.983072 | 5.168169 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-10-16T12:47: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": "0985fc50342d... |
1922313f-a766-4bc1-9dab-5119cbbd7a3a | ishandutta2007/codeforces-x | xellos/normal/1276/B.cpp | // iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 123456... | ALGO | 0.999904 | 3.606769 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38: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": "98556d01b7a6... |
33632de9-6f2c-4947-bc42-d68e9edf470d | ShafaetUllah032/Cpp-ProblemSolving | learnProgramming/SortCPP/insertionSort.cpp | #include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i, n) for (i = 0; i < n; i++)
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define pb push_back
#define mp make_pair
#define F first
... | ALGO | 0.999907 | 4.513217 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-12-20T18:40: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": "0b00e004e0a... |
c1963bab-6645-40be-ad35-05055e829d83 | alexeydergunov/cses-solutions | solved/1724_Graph_Paths_II.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)((v).size()))
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
const ll INF = ll(3e18); // higher than 1e9*1e9 + 1e9*1e9
vector<vector<ll>> mult(const vector<vector<ll>>& a, const vector<vect... | ALGO | 0.999993 | 4.538685 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2020-09-27T08:21: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": "c006f4e1... |
6f8e6dd7-9daf-4e04-bd77-6af64b41696c | MCAR43/Chess | games/chess/board.hpp | #ifndef GAMES_CHESS_BOARD_HPP
#define GAMES_CHESS_BOARD_HPP
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <random>
#include <ctime>
#include "constants.h"
struct Move {
//Numbers corresponding to the board location
int row;
int col;
int nRow;
int nCol;
//Index into t... | ALGO | 0.944612 | 5.339059 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-11-07T00:07: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": "c8fb5249fc... |
7399a1ec-410e-4954-a5c5-31bc0e122de0 | vxl/vxl | v3p/clipper/clipper.cpp | /*******************************************************************************
* *
* Author : <NAME> *
* Version : 6.4.2 *
* D... | ALGO | 0.999954 | 3.202909 | {
"github_metadata": {
"branch": "master",
"commit_count": 42154,
"repo_created_at": "2013-05-02T18:32:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 250,
"forks": 157,
"issues": 49,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d... |
cf26a110-1d2b-4121-afc9-13e6e099bbd2 | dariusbrinzan/All-Pairs-Shortest-Path | Roy.cpp | #include "algo.h"
std::vector<std::vector<int> > shortest_path_all(const std::vector<std::vector<edge> >& graph) {
int i, j, k;
int n = graph.size();
std::vector<std::vector<int> > result(n, std::vector<int>(n, INT_MAX));
for (i = 0; i < n; i++) {
for (j = 0; j < graph[i].size(); j++) {
... | ALGO | 0.999511 | 4.823416 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-09-08T12:29: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": "1c17369b3226... |
be925415-021e-4909-a9ca-81a47552eccc | apple/turicreate | src/toolkits/nearest_neighbors/distance_functions.hpp | /* Copyright © 2017 Apple Inc. All rights reserved.
*
* Use of this source code is governed by a BSD-3-clause license that can
* be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
*/
#ifndef TURI_NN_DISTANCE_FUNCTIONS_H_
#define TURI_NN_DISTANCE_FUNCTIONS_H_
#include <string>
#incl... | ALGO | 0.992655 | 7.471895 | {
"github_metadata": {
"branch": "main",
"commit_count": 1571,
"repo_created_at": "2017-12-01T00:42:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11198,
"forks": 1137,
"issues": 502,
"pull_requests": 21
},
"file_meta": {
"content_id": "... |
a1747d1f-f658-4606-a06b-3406b344ec0c | CarterZ1997/CPP-Fordham | HW4/HW4Q2/HW4Q2/main.cpp | //
// main.cpp
// HW4Q2
//
// Created by <NAME> on 9/24/19.
// Copyright © 2019 <NAME>. All rights reserved.
//
#include <iostream>
using namespace std;
int z = 1;
int main() {
while (z) {
char boo;
cout << "Do you wanna play(Y/N)?" << endl;
cin >> boo;
s... | ALGO | 0.999457 | 3.72673 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-05-25T18:45: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": "9bd0c44c56... |
6cd850fc-db27-4be3-b1e5-3790b403e7c4 | AldoEZ/CPCFI | Sexta_Generacion_CPCFI/contests/contest10/A.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int k, q;
cin >> k >> q;
vector<int> ki(k);
vector<int> qi(q);
for (int i = 0; i < 1; i++) {
cin >> ki[i];
}
for (int i = 0; i < q; i++) {
cin >> qi[i];
}
for (int i = 0; i < q; i++) {
if (qi[i] < ki[0]) cout <<... | ALGO | 0.999862 | 3.331084 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-12-12T06:41:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45954091b59... |
3435c1e9-1c74-495c-9db2-ea4d892b17c7 | Zhu-Bei-Jian/ACM-Template | Template/其他/约瑟夫环.cpp | // 约瑟夫环
int josephus(int n, int k) { //O(klogn)
if (n == 1) return 0;
if (k == 1) return n - 1;
if (k > n) return (josephus(n - 1, k) + k) % n; // 线性算法
int res = josephus(n - n / k, k);
res -= n % k;
if (res < 0)
res += n; // mod n
else
res += res / (k - 1); // 还原位置
re... | ALGO | 0.999951 | 3.434403 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-07-08T12:55:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2f8d4d4b... |
90caa584-3b86-46c0-a539-86a7da7452ed | ornfelt/c_core | matrix/matrix_spiral_dfs.cpp | #include <bits/stdc++.h>
using namespace std;
// https://www.geeksforgeeks.org/print-a-given-matrix-in-spiral-form/
/**
Given a 2D array, print it in spiral form.
Another recursive approach is to consider DFS movement within the matrix
(right->down->left->up->right->..->end). We do this by modifying the matrix i... | ALGO | 0.999961 | 5.639807 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2023-07-11T08:24: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": "0fe0d2f1a... |
7e4acf96-e312-4095-98d4-f2179975ea7f | DQSSSSS/Scotty3D-HW | src/rays/bsdf.h |
#pragma once
#include <variant>
#include "../lib/mathlib.h"
#include "../lib/spectrum.h"
#include "../util/hdr_image.h"
#include "samplers.h"
namespace PT {
struct Scatter {
Spectrum attenuation;
Vec3 direction;
void transform(const Mat4& T) {
direction = T.rotate(direction);
}
};
struc... | ALGO | 0.963244 | 7.02345 | {
"github_metadata": {
"branch": "main",
"commit_count": 277,
"repo_created_at": "2021-11-04T15:12:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5140f4d164... |
cd21c78c-a5be-478b-8590-0a75e2d8e416 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/0_0_3161.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m, q;
cin >> n >> m >> q;
vector<vector<int>> matrix(n, vector<int>(m, 0));
for(int i = 0; i < q; i++) {
int ti;
cin >> ti;
if(ti == 1) {
int ri;
cin >> ri;
ri-... | ALGO | 0.999952 | 4.835613 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "6f4ee7ee40f... |
98a3a70c-224a-481d-ba88-53e4726ccced | mhaoli/ACM-Source-Code | Problems/contest/ACDream群赛(13)/G.cpp | /*
* Author: Plumrain
* Created Time: 2014/6/9 15:00:29
* File Name: G.cpp
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <list>
#include <deque>
#include <queue... | ALGO | 0.999729 | 3.566518 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2015-04-15T04:55: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": "8d6f436f... |
7d426cfa-93ae-4782-9a81-129acb6cca60 | mzry1992/workspace | OJ/CDOJ/I - Transit search.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
#include <queue>
using namespace std;
char tmp[30];
string stmp;
int sx,sy,ex,ey,tx,ty,tx1,ty1,totb,totline,totg,line[40];
struct Point
{
int x,y;
}b[5010];
map<string,int> BusStop;
struct graph
{
int to,next,dis;
}g[5010+5010*40];
void G... | ALGO | 0.999689 | 3.701716 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2012-11-03T05:40: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": "9b74de1dc... |
5e657c13-1ea4-4898-aecc-04165cd82453 | Man1exter/thread.cpp | thread.cpp | #include <iostream>
#include <array>
#include <vector>
#include <map>
#include <set>
#include <iomanip> //setw..
#include <list>
#include <forward_list>
#include <typeinfo>
#include <string>
#include <ctime>
#include <algorithm>
#include <deque>
#include <functional>
#include <typeinfo>
#include <iterator>
#include <... | TOOL | 0.911939 | 3.731433 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-02-21T14:31:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4960c538f1ef... |
b2a9cdee-5e07-43d7-8911-6627dd998d54 | King0625/leetcode-practice | cpp/binary_tree/1367.Linked_List_in_Binary_Tree/main.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) {}
};
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNo... | ALGO | 0.999985 | 4.442197 | {
"github_metadata": {
"branch": "main",
"commit_count": 338,
"repo_created_at": "2025-05-30T12:39: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": "03af0b2133... |
28f64c70-e6fe-4d83-b53b-58a15fb79c09 | stranxter/lecture-notes | samples/03_sdp/2020-21-is/stack/lab.cpp | #include <iostream>
#include <stack>
const int labSize = 8;
int lab[labSize][labSize] = {0, 1, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 1, 0, 1, 0, 0,
0, 0, 0, 0, 0, 1, ... | ALGO | 0.999901 | 5.084489 | {
"github_metadata": {
"branch": "master",
"commit_count": 745,
"repo_created_at": "2015-08-11T12:27:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 29,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2b748... |
004b895e-951f-443b-b110-e54a8fd708e7 | spfrood/CPP-references | Examples/RANDOMS-LOOPS/DiceStats/main.cpp |
/*
* File: main.cpp
* Author: <NAME>
* Created on January 18, 2017, 10:35 AM
* Purpose: Statistics for Throwing 2 Dice
*/
//System Libraries
#include <iostream> //input output libraries
#include <ctime> //time for setting random seed
#include <cstdlib> //random number functions
using namespace std;
//User L... | ALGO | 0.988895 | 5.16271 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-03-30T19:58: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": "e629c8eea6... |
49a79860-33f0-43ed-b0d9-9ad78ef61e24 | cuong02n/CodeArena | codeforces/archive/1873/1873E.cpp | /*
author : cuong2905say
created : 21-09-2023 22:05:49 UTC: +7
*/
#include <bits/stdc++.h>
#define all(A) (A).begin(), (A).end()
#define sc scan_single()
#define int long long
using namespace std;
using ll = long long;
using ull = unsigned long long;
template <class T1, class T2>
ostream& operator<<(ostream&... | ALGO | 0.999978 | 5.556995 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-02-07T13:48:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e7022cdda9... |
8835f6e4-40ab-4862-9849-e448ea59d8f2 | Toufik-Islam/XPSC_Phitron | Week 7/Day 3/Mountain.cpp | /*\~~~~~~~~~~~~~~~~~\
\ TOUFIK \
\ ISLAM \
\~~~~~~~~~~~~~~~~~\*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define FastIO \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
v... | ALGO | 0.999869 | 3.358178 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2023-06-16T05:30: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": "76a15e6831... |
d1d33ed5-e573-453d-8a96-6008918c9ea0 | anidub/CPP | BinaryTree/ConnectNextNodes.cpp | #include <iostream>
#include <climits>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <math.h>
using namespace std;
/*https://leetcode.com/problems/populating-next-right-pointers-in-each-node/
* You are given a perfect binary tree where all leav... | ALGO | 0.999856 | 5.106106 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2021-10-25T04:13: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": "ac40d1b15... |
90a9b59c-a774-49b0-ae0f-4704d5915b9f | soju-jsh/CSES | Introductory Problems/permutations.cpp | /*
Author: soju-jsh
Created: 03.28.24
Problem: https://cses.fi/problemset/task/1070/
Result: AC
*/
#include <bits/stdc++.h>
using namespace std;
// Datatype Shortcuts
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using pll = pair<ll, ll>;
// Chars
#define nl '\n'
#defin... | ALGO | 0.999861 | 4.239264 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-03-11T07:20: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": "e932fc8c28e... |
e035cde3-919f-4537-9290-9014340ea605 | Charlieofdestruction/Mini-Car | Obstacle_Avoider.ino | //basic obstacle avoiding car
//<NAME>
// Left motor truth table
// ENA IN1 IN2 Description
// LOW Not Applicable Not Applicable Motor is off
// HIGH LOW LOW Motor is stopped (brakes)
// HIGH HIGH LOW Motor is on a... | ALGO | 0.997353 | 4.885497 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-02-03T19:18: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": "cfe3a04a08af... |
5aef8d03-8f25-476e-a729-5dbd5f8e2d03 | randombit/botan | src/lib/pubkey/xmss/xmss_privatekey.cpp | /*
* XMSS Private Key
* An XMSS: Extended Hash-Based Siganture private key.
* The XMSS private key does not support the X509 and PKCS7 standard. Instead
* the raw format described in [1] is used.
*
* [1] XMSS: Extended Hash-Based Signatures,
* Request for Comments: 8391
* Release: May 2018.
* https... | ALGO | 0.940482 | 6.666593 | {
"github_metadata": {
"branch": "master",
"commit_count": 17880,
"repo_created_at": "2013-03-06T16:51:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2976,
"forks": 599,
"issues": 211,
"pull_requests": 39
},
"file_meta": {
"content_id":... |
f2413214-a9de-4fe9-a394-9b50b6519ea7 | abufarhad/Codeforces-Problems-Solution | 214B Hometask.cpp | //! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. <NAME> ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define scl(n) scanf("%ll... | ALGO | 0.999961 | 3.458786 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-02-14T18:54:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 32,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f64960e... |
8ec0c0d8-80a5-4a50-b6ea-598c7a4a2e10 | juarezpaulino/coderemite | problemsets/Topcoder/SRM 460 (DIV2)/TheQuestionsAndAnswersDivTwo.cpp | /**
*
* Author: <NAME>(coderemite)
* Email: <EMAIL>
*
*/
// BEGIN CUT HERE
// END CUT HERE
#line 5 "TheQuestionsAndAnswersDivTwo.cpp"
#include <cmath>
#include <cstdio>
#include <ctime>
#include <cctype>
#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
... | ALGO | 0.996034 | 3.948402 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-12-12T21:51: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": "d8b256aba85b... |
82f00948-4d4f-4fe3-b3fa-128aa48b7be7 | manideepreddy13/DSA | LinkedList/Algos/doublylinkedlist.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct node
{
int data;
node *prev, *next;
};
node *createnode(int k)
{
node *ptr = new node();
ptr->data = k;
ptr->next = NULL;
ptr->prev = NULL;
return ptr;
}
node *head = NULL;
// Time Complexity : O(1)
v... | ALGO | 0.999731 | 4.598194 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2022-06-24T16:02: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": "641c1603e22... |
4c8ac91e-e1a1-4b3f-9dd6-35a688900137 | himanshu-pareek/codechef-problems | LTIME77B/BOXGAM97.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
template < typename T >
void min_self (T & a, T b) {
a = min (a, b);
}
template < typename T >
void max_self (T & a, T b) {
a = max (a, b);
}
void solve () {
int N, K, P;
scanf ("%d %d %d", &N, &K, &P);
vector < int > A (N);
... | ALGO | 0.999913 | 4.152802 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-03-06T17:13:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "161ea0e0d7... |
115089ed-2231-45c0-b86a-259dbe78c86c | daniel-ankit/DSA | Sliding Window/SW008 Pick Toys.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
struct TreeNode {
int val;
TreeNode *left;
... | ALGO | 0.999956 | 5.628995 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2021-12-08T19:12:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46a3b72d... |
bcaea823-e8c6-41ad-9404-667b99494902 | StoneInHisWorld/BaslerCameraController | SequenceIdentifier/sequence_identifier.cpp | #include "declaration.h"
namespace fs = std::filesystem;
double calculateMean(const cv::Mat& image) {
cv::Scalar mean = cv::mean(image);
return (mean[0] + mean[1] + mean[2]) / 3.0;
}
// Function to split a string by a delimiter
std::vector<std::string> splitString(const std::string& str, char delimiter) {
... | DATA | 0.9986 | 5.594729 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2025-04-02T03:25: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": "cd1b883bc... |
6ab5b1eb-9b64-427e-9dbd-969ae9be75a3 | ivanavd11/-Introduction_to_programming | Practicum by plamena-ilieva/Pract05/task_7.cpp | #include <iostream>
void transferLastKDigits(int& a, int& b, int k) {
int power = 1;
// Изчисляваме 10^k, за да извлечем последните k цифри от `a`
for (int i = 0; i < k; ++i) {
power *= 10;
}
// Извличаме последните k цифри от `a`
int lastKDigits = a % power;
// Премахваме последн... | ALGO | 0.998002 | 4.078589 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2024-07-03T21:31: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": "b8fb64136c... |
55f9ba37-2116-46ba-abbc-1ff0f12b7ac2 | tsehl/42projects | webserv/parserConfig.cpp | #include "webserv.hpp"
#include "Server.hpp"
int is_double(std::string line, std::vector<std::string> tab_keys)
{
for (size_t i = 0; i < tab_keys.size(); i++)
{
if (line.compare(tab_keys[i]) == 0)
return (1);
}
return (0);
}
int is_server(std::string line)
{
std::string first_... | WEB | 0.945851 | 3.44495 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-06-05T08:26: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": "658b087e4175... |
440eb4fd-1115-4e0a-9526-8d5ee7ce61f2 | Vector-013/CP-Vector013 | Codeforces/CONTEST/helvetic/B1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <cstdlib>
#include <string>
#include <numeric>
#include <map>
#include <queue>
#define pb push_back
#define pop pop_back
using namespace std;
typedef long long ll;
using i64 = long long;
typedef unsigned long long ull;
t... | ALGO | 0.999966 | 3.123925 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2023-10-02T08: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": "768f2329f... |
e32a5320-ceea-42ea-b0c9-cea170316efa | jiwon824/codetree-TILs | 240727/hashmap 기본/hashmap-basic.cpp | #include <iostream>
#include <unordered_map>
using namespace std;
int n;
unordered_map<int, int> m;
void Add(int k, int v){
// 키 값이 해시 맵에 이미 있다면 아무런 행동을 취하지 않음
//m.insert({k, v});
// 키 값이 해시 맵에 이미 있으면 기존의 값을 value로 바꾸고, 없으면 해당 키 값에 value를 추가
m[k]=v;
}
void Remove(int k){
m.erase(k);
}
int Fin... | ALGO | 0.99946 | 5.509109 | {
"github_metadata": {
"branch": "main",
"commit_count": 1826,
"repo_created_at": "2024-03-07T07:30: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": "9bfa721d4... |
57a26209-2fb1-4134-a26d-f9107c1dfbec | WhoAmI-Chan/data-structures-cpp | doublyLinkedList/List.cpp | // Copyright 2018 <NAME>
#include "List.h"
#include "main.h"
int Node::count=0;
List::List(int sizeOfList){
// Seed a random generator from time
srand(static_cast<unsigned int>(time(nullptr)));
for (int i=0; i<sizeOfList; ++i) {
int randomInt=rand()%8999+1001;
Node *temp=new Node(random... | ALGO | 0.94611 | 4.228158 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-06-23T13:03: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": "0f7d970655... |
549a08f3-1293-4099-99de-328ed21e4490 | weiii8708271688/UVA | UVA/10972/34230105_AC_20ms_0kB.cpp | #include <iostream>
#include <map>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <set>
#include <deque>
#include <vector>
#include <sstream>
#include <stack>
#include <queue>
#include <unordered_set>
using namespace std;
struct vertex{
int d = 0, low = 0, p = -1, child = 0;
vector <int> adj... | ALGO | 0.999757 | 3.884538 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-10-19T12:29:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c900021c6... |
42c97c91-1536-4dc4-a2da-a5dac88f7845 | NielsHolst/UniSim | src/plugins/insecticide/topsoilvolatilization.cpp | /* Copyright (C) 2009-2012 by <NAME> [<EMAIL>] and co-authors.
** Copyrights reserved.
** Released under the terms of the GNU General Public License version 3.0 or later.
** See www.gnu.org/copyleft/gpl.html.
*/
#include "topsoilvolatilization.h"
#include <cmath>
#include "publish.h"
using namespace UniSim;
namespace... | ALGO | 0.994176 | 4.153495 | {
"github_metadata": {
"branch": "master",
"commit_count": 207,
"repo_created_at": "2010-01-19T15:20:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ece93c9c... |
310359d7-de87-46df-b32d-5778f402ac90 | dhyanesh/randomdev | topcoder/algorithm/SortMaterials.cpp | // BEGIN CUT HERE
// PROBLEM STATEMENT
//
// Your shipping company has just delivered some materials to
// you, and you'd like to find out how many of these
// materials are useful. All materials are packed into
// cubical boxes. The information about each box will be
// given to you in a vector <string> data, wit... | ALGO | 0.951903 | 5.46092 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2016-02-20T06:57: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": "235597dd7... |
ea123596-770b-4e58-bc83-8d60513e2f97 | maheshjainckd/Hacktoberfest2022-for-everyone | CPP/binary tree/zigzag traversal.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int data ;
struct Node* left ;
struct Node* right ;
Node ( int val )
{
data = val ;
left = NULL ;
right = NULL ;
}
};
vector <int> zigZagTraversal(Node* root)
{
// Code here
vector<int> vec ;
... | ALGO | 0.999999 | 5.429883 | {
"github_metadata": {
"branch": "main",
"commit_count": 1700,
"repo_created_at": "2021-10-22T16:00:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 147,
"forks": 719,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "a9e0c... |
4a3b08ed-4987-4530-a32f-d5b274ea3dd3 | leisiji/leetcode-solution | src/695-max-area-of-island.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class Solution
{
private:
int m_, n_;
vector<vector<bool>> visited_;
vector<vector<int>> *grid_;
void dfs(int m, int n);
int area_;
public:
int maxAreaOfIsland(vector<vector<int>> &grid);
};
void Solution::dfs(in... | ALGO | 0.999824 | 5.903309 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-04-30T13:16: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": "7d5362b8a... |
ac00f0d0-80a8-4b9a-847f-e06c0c0bb1df | 3agwa/CompetitiveProgramming | SPOJ/SPOJ UCBINTC.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define pii pair<int, int>
#define vii vector<pii>
#define vb vector<bool>
#define vi vector<int>
#define vvi vector< vector<int> >
#define vvii vector< vector< pii > >
#define mapii map<int, int>
#define ld long double
#define ... | ALGO | 0.999976 | 4.062967 | {
"github_metadata": {
"branch": "master",
"commit_count": 603,
"repo_created_at": "2017-04-19T19:59:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ab4f7aa... |
fb18ff23-a8c2-42c2-b140-e201dea6c832 | kangweicheng/dsp_homework3 | mydisambig.cpp | #include <iostream>
#include <stdio.h>
#include <fstream>
#include <wchar.h>
#include <sstream>
#include "Ngram.h"
#include "Vocab.h"
#include <map>
#include <stack>
class Proba{
public:
char* word;
VocabIndex wid;
double prob;
short jumpfrom;
bool used;
Proba(){
prob = -1e50;
word = new char[2];
... | DATA | 0.992252 | 3.627005 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-07-07T09:19: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": "c673c8f6bb... |
068ba15f-01ac-426e-a6ec-9a74b18511db | FahimAbrar0112/CP-Codes | LeetCode/57.cpp | #include <bits/stdc++.h>
using namespace std;
// O( N )
class Solution
{
public:
/**
* Inserts a new interval into a sorted list of non-overlapping intervals and merges if necessary.
*
* @param intervals A vector of intervals sorted by start time.
* @param newInterval A single interval to be i... | ALGO | 0.99999 | 6.066092 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-11-19T20:39:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2cc9232cb6c... |
b9d4ac92-959d-4647-8c81-5a843abcbb67 | WEGFan/Algorithm-Contest-Code | contests/2018-NEERC-Southern-Subregional-Qualification-Stage/Gym 101911E E.cpp | #include <iostream>
#include <deque>
using namespace std;
#define lson (root << 1)
#define rson (root << 1 | 1)
const int N = 3e5 + 7;
int n, m, vis[N];
int arr[N];
deque<int> que[N];
struct SegTree
{
int l, r;
int color, same;
} tr[N * 4];
void pushdown(int root)
{
if (tr[root].same)
{
tr... | ALGO | 0.999994 | 4.306157 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-19T11:49:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c18906431... |
e9b47828-4e60-46dd-bbba-75c459f6c0b4 | Paradoxicaly/CompetitiveProgramming | CALICO Fall 24'/p5_bridge.cpp | /*
Derrick (Tomato_Cultivator)
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define pb push_back
const int MAXN = 1e5 + 5;
int b, n;
int arr[MAXN];
bool check(int h) {
int cost = 0;
rep(i, n) {
... | ALGO | 0.999955 | 4.584479 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2025-03-13T01:25:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae95f14acfe... |
bd5ccbf6-cf4c-41e5-bf38-bf5a99301229 | prateeksharma21/Competitive-Programming | Contest/Codeforces/Codeforces LATOKEN Round 1 (Div. 1 + Div. 2)/B.cpp | #ifdef Prateek
#include "Prateek.h"
#else
#include <bits/stdc++.h>
using namespace std;
#define debug(...) 42
#endif
#define int ll
#define all(c) begin(c),end(c)
using ll = long long;
const int MOD = 1e9+7, N = 1e5 + 10;
void test(){
int n;
cin >> n;
vector<int> a(n + 2);
for (int i = 1; i <= n; +... | ALGO | 0.999496 | 4.414792 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2019-09-30T19:06:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35e10d2a7... |
82ca6c37-4883-442d-9276-03b30acb58dc | 2050109/-why-2024 | 项目作业四则运算器/ExpressionEvaluator.h | #ifndef EXPRESSION_EVALUATOR_H
#define EXPRESSION_EVALUATOR_H
#include <string>
#include <cmath>
#include <stdexcept>
#include <algorithm>
namespace ExpressionEvaluator {
// 自定义栈类模板
template <typename T>
class Stack {
public:
// 构造函数,初始化栈的容量和栈顶索引
Stack(size_t capacity) : maxSize(capacity), topIndex(0) {
... | ALGO | 0.99815 | 6.420521 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-09-12T15:20:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdda10ae79e... |
1767c1f2-d4b9-48a1-af13-136ae07cd6c9 | TanviKapurwan23/DSA_series | Sorting/DFS.cpp | /*
Depth First Search (DFS)
Algorithm Steps:
Start by pushing the starting node onto a stack.
Pop the top item from the stack and print it.
Push all its unvisited adjacent nodes onto the stack.
Repeat steps 2 and 3 until the stack is empty.
*/
#include <iostream>
#include <vector>
#include <list>
class Graph {
... | ALGO | 0.999997 | 6.263279 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2024-03-03T12:13:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c416089474... |
f1e31d7c-308a-451d-9523-0aec196dca00 | dazzle-me/Arithmetic-Coding | src/ari.cpp | //
// Created by eduard on 30/09/2020.
//
#include <iostream>
#include <vector>
#include <cassert>
#include <fstream>
#include <stdexcept>
#include "globals.h"
#include "ari.h"
#include "BitIo.h"
#include "Encoder.h"
#include "Decoder.h"
using namespace globals;
void compress_ari(const char *ifile, char *ofile) {
... | DATA | 0.952077 | 5.300027 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-09-30T18:03:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d31012957... |
fbd17776-8a5e-45ae-baf7-fed28a125f1a | CGAL/cgal | Optimal_bounding_box/include/CGAL/Optimal_bounding_box/Oriented_bounding_box_traits_3.h | // Copyright (c) 2018-2019 GeometryFactory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : <NAME>
//
#ifndef CGAL_OPTIMAL_BOUNDING_BOX_BOUNDING_BOX_TRAITS_H
#define CGAL_O... | TOOL | 0.924272 | 7.677768 | {
"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... |
50c5bbf3-10f5-4457-8b43-9bfb418c756b | Ryry525/ESE224Fall2023_Midterm_Project | robot.cpp | #include "robot.h"
#include <iostream>
#include <string>
#include <fstream>
#include <algorithm>
//INITIALIZE ROBOT CONSTRUCTOR
Robot::Robot()
{
// Initialize member variables
robotName = "";
robotID = -1;
for (int i = 0; i < 5; i++) {
robotData[i] = -1;
}
robotAverage = -1.0;
}
Robo... | TOOL | 0.946805 | 4.360734 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-10-22T23:32: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": "fc183c7bcf... |
48b5bbac-4b72-44f0-9d52-75283656bffd | qrno/templatemengo | code/math/fft.cpp | // FFT {{{
using cd = complex<double>;
const double PI = acos(-1);
void fft(vector<cd> &A, bool invert) {
int N = size(A);
for (int i = 1, j = 0; i < N; i++) {
int bit = N >> 1;
for (; j & bit; bit >>= 1)
j ^= bit;
j ^= bit;
if (i < j)
swap(A[i], A[j]);
}
for (int len = 2; len <=... | ALGO | 0.999896 | 5.7239 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2022-10-28T01:45:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e366eab605... |
0c7d1951-d561-4e42-93e1-d90f30d2b93c | madhavseth512/DSA_CP | Recursion_Backtracking/rec_Level1/printCounting.cpp | #include<iostream>
using namespace std;
//Here we have printed the counting through recursion both in the ascending and descending order.
//Notice how in both functions the position of recursive call and processing are swapped to get different results
//Also if we were given a number of who's digits we have to print... | ALGO | 0.999614 | 4.811488 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2024-05-22T10:18: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": "eabf2aab5bc... |
a4ce8084-15e3-4b28-a610-57ff0fee0408 | Sri-dhar/test | codes_DSA/KthSmallest.cpp | #include <iostream>
#include <vector>
#include <algorithm>
int partition(std::vector<int> &arr, int low, int high) {
int pivot = arr[high];
int i = low - 1;
for (int j = low; j <= high - 1; j++) {
if (arr[j] < pivot) {
i++;
std::swap(arr[i], arr[j]);
}
}
st... | ALGO | 0.999997 | 5.658751 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2023-08-26T06:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61bb15461... |
05a947b9-cd54-4a60-a56d-e0e42459c846 | alevar/AdaptiveVision | src/test/testVecMax.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool IsGreater (int i,int t) {
return (i>t);
}
// vector<int> test = {0,0,1,0,2,6,4,10,9,15,23,35,57,36,30,26,14,7,5,2,0,0};
int test[22] = {0,0,1,0,2,6,4,10,9,15,23,35,57,36,30,26,14,7,5,2,0,0};
int main( int argc... | ALGO | 0.994033 | 3.142922 | {
"github_metadata": {
"branch": "master",
"commit_count": 189,
"repo_created_at": "2015-11-09T00:52:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3437012d... |
3a7256a7-506b-4413-82f9-47169f2961b8 | laboshinl/but_calibration_camera_velodyne | src/Similarity.cpp | /*
* Similarity.cpp
*
* Created on: 8.1.2014
* Author: ivelas
*/
#include "but_calibration_camera_velodyne/Similarity.h"
using namespace std;
using namespace cv;
namespace but_calibration_camera_velodyne
{
void Similarity::computeEntropies()
{
vector<float> histogram_X(INTENSITIES, 0);
vector<float> ... | ALGO | 0.994199 | 5.051491 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-04-06T16:18:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "439a6405e... |
6a111918-96db-40ef-8427-961b6e608109 | NTNU-HPC-Lab/LS-CAT | data/kernels/1127/6/parser_helpers.h | // ==============================================================================
// This file is part of THOR.
//
// THOR is free software : you can redistribute it and / or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of t... | TOOL | 0.918673 | 5.63994 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-06-28T09:48:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4311d1b2c58... |
83075ef8-d72a-4458-933c-25efaea57520 | hotSixRedBull/algorithmic-problem-solving-strategies | 3. paradaim of algorithm planning/Arctic_yh.cpp | #include <stdio.h>
#include<math.h>
void quickSort(int first, int last);
double findMST(int* parent, int N);
int checkCycle(int u, int* parent);
double dist[10000 + 3][3];
int main() {
int tc, N;
double pos[100 + 3][2];
int parent[100 + 3];
freopen("input.txt", "r", stdin);
scanf("%d", &tc);
for (int t = 1... | ALGO | 0.99982 | 4.31404 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2017-11-21T11:47:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "386e1deb0... |
302a96dc-e8c9-4504-a0ed-57ada3c35609 | cmiyachi/CygWinAlgorithms | Leetcode/wallsAndGates.cpp | class Solution {
public:
void wallsAndGates(vector<vector<int>>& rooms) {
if(rooms.size() == 0 || rooms[0].size() == 0) return;
int m = rooms.size(), n = rooms[0].size();
vector<vector<int>> directions = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
queue<pair<int, int>> q;
for(int i ... | ALGO | 0.999977 | 5.957985 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2019-03-09T23:53:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b30e6cc91... |
b9675e0a-f8e7-4aa2-92f5-b611b561c919 | songdaegeun/ps_backjoon | backjoon/week24/2979.cpp | #include <iostream>
using namespace std;
int cost[3][102];
int a, b, c;
int last_en, min_en;
void disp_cost()
{
cout << '\n';
for (int j = 0; j < 3; j++)
{
for (int i = 0; i <= last_en + 1; i++)
{
cout << cost[j][i] << ' ';
}
cout << '\n';
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);... | ALGO | 0.999059 | 3.976579 | {
"github_metadata": {
"branch": "master",
"commit_count": 283,
"repo_created_at": "2023-03-17T07:45: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": "82448c22... |
f13dc94d-827c-458b-9eb8-90964887b788 | thanospol/DEMCEM | src/c++/Examples/Example_WS_EA_RWG.cpp | //
// Example_WS_EA_RWG.cpp
//
// Created by <NAME> on 2/17/15.
// Copyright (c) 2015 <NAME>. All rights reserved.
//
#include <iostream>
#include <iomanip>
#include <complex>
#include <ctime>
#include "demcem_ws_ea_rwg.h"
#include "demcem_constants.h"
void demcem_ws_ea_rwg (const double r1[],const double r2[],co... | ALGO | 0.979218 | 3.562539 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-02-09T11:09:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "723db3a47... |
c440066c-bbc7-40df-b6df-cb77248e210b | tsai8890/LeetCode-Practice | tagged/sprint/graph/743. Network Delay Time/743-1.cpp | #include <utility>
#include <queue>
#include <vector>
using namespace std;
struct Node {
int id;
int cost;
Node(int id, int cost) {
this -> id = id;
this -> cost = cost;
}
Node() {
}
};
class CompareNode {
public:
bool operator()(Node& node1, Node& node2) {
... | ALGO | 0.99997 | 5.561406 | {
"github_metadata": {
"branch": "main",
"commit_count": 228,
"repo_created_at": "2022-03-11T10:49:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b70d137f9d... |
850e3fc1-c2db-4c34-8136-1b009136574b | eff3ct/Baekjoon-Online-Judge-Problem-Solving | 25317/25317.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using pii = pair<int, int>;
using ppii = pair<int, pii>;
#define ordered_set tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_stati... | ALGO | 0.999893 | 4.446281 | {
"github_metadata": {
"branch": "main",
"commit_count": 185,
"repo_created_at": "2021-07-05T06:02: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": "567bd2a52d... |
3322b42a-2cb2-4628-b66d-b74e95c3b967 | ishandutta2007/codeforces-y | yasugongshang/normal/1375/G.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define mp make_pair
#define PI pair<ll,ll>
#define poly vector<ll>
#define mem(a) memset((a),0,sizeof(a))
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(... | ALGO | 0.991496 | 3.374592 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "768af7a1bb85... |
89edff9b-c164-49ca-a498-e23f75ca7dc3 | ylkky/PreparePAT | 1025.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int N;
class Testee {
public:
string id;
int score, local, local_rank;
Testee(string idd, int s, int l) :id(idd), score(s), local(l) {};
void localRank(int r) {
local_rank = r;
};
};
bool ranking(Testee &t1, Testee ... | ALGO | 0.999915 | 3.692423 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2017-01-29T15:20: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": "d0b19009c... |
f57a42ee-f4c7-49a5-99e9-591e80f23990 | ksercs/algo_labs | 3 sem/2/E/E.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <iomanip>
#include <set>
#include <map>
#include <utility>
#include <queue>
#include <climits>
#include <string.h>
#define SZ size()
#define VEC vector
#define PB push_back
#define MP make_pair
#de... | ALGO | 0.999653 | 3.400762 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-25T11:41: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": "393fb5bd93... |
9b2d4269-7b58-401c-b554-2d8f5547fd32 | Dzzirt/OOP | MLITA/Squares/Squares/Squares.cpp | // Squares.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <fstream>
#include "string"
#include "vector"
#include <algorithm>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
ifstream in("input.txt");
ofstream out("output.txt");
string sourceStr;
getline(in, ... | ALGO | 0.993573 | 3.06155 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2015-11-06T10:07:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "eff274e9... |
77c6d292-ba79-400b-a428-4bad64b6ba2e | rahulnagurtha/Mycode | codeforces/ec-6-3.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "../debug.hpp"
struct debugger dbg;
#else
#define debug(args...) // Just strip off all debug tokens
#endif
#define si(i) scanf("%d",&i)
#define si2(i,j) scanf("%d %d",&i,&j)
#define si3(i,j,k) ... | ALGO | 0.999232 | 3.500828 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2015-10-06T14:14: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": "6d4e76986... |
c5429987-303d-4841-92db-04634ac00db9 | JamersonWalderson/Exercicios-URI | 1118.cpp | #include <iostream>
#include <cstdlib>
#include <iomanip>
using namespace std;
/*
URI Online Judge | 1118
Faça um programa que leia as notas referentes às
duas avaliações de um aluno.
Calcule e imprima a média semestral.
Faça com que o algoritmo só aceite notas válidas
(uma nota válida deve pertencer ao intervalo [0,1... | TOOL | 0.989193 | 4.278021 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-02-28T02:31: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": "8e67afa12... |
4980cb8e-7327-41bc-a923-2d59212f7c15 | kohakus/leetcode-solutions | 0001-Two-Sum/lc0001.cc | // C++ solution.
// Efficient one pass method with search tree.
// using iteration loop
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
map<int, int> posMap;
for (vector<int>::iterator it = nums.begin(); it != nums.end(); it++) {
map<int, int>::iterator posI... | ALGO | 0.999972 | 6.153069 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-12-22T07:22: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": "a618fb2ca... |
e529174e-4ea9-4c8b-ac96-a95390ba6b47 | madeelshabbir/1D-SquareMatrix-Class | 1D Square Matrix.cpp | #include<iostream>
using namespace std;
class SquareMatrix
{
private:
int size;
int *arr;
public:
SquareMatrix()
{
size = 0;
arr = NULL;
}
SquareMatrix(int n)
{
size = n;
arr = new int[n*n];
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
arr[i*size + j] = i*size + j + 1;
... | ALGO | 0.998244 | 3.74946 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-07-03T12:15: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": "69c16a2072... |
0257b1d0-2092-428f-ae0e-56775d2ccd31 | HomeletW/daily_leetcode | 100_199/q135.cpp | /**
* 135. Candy
* https://leetcode.com/problems/candy
*
* Date: 2024-07-26
*/
#include "my_util.hpp"
using namespace std;
class Solution {
public:
int candy(vector<int> &ratings) {
// This is an O(n) time and O(n) space solution
// O(1) space solution is possible.
vector<int> c_(rat... | ALGO | 0.999998 | 6.749517 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2024-07-21T14:24: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": "9fae4b0b62... |
2a1ad58b-4f42-41a6-938a-8e592bdaa006 | svetlanasieber/SoftUni-Upskill-Courses | Module C++/PROGRAMMING BASICS WITH CPP - JAN 2024/Regular-Exam/03.Excursion Calculator_v2.cpp | #include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main() {
int numberOfPeople;
string season;
cin >> numberOfPeople >> season;
double excursionPrice = 0.0;
if (numberOfPeople <= 5) {
if (season == "spring")
excursionPrice = ... | TOOL | 0.987506 | 4.898606 | {
"github_metadata": {
"branch": "main",
"commit_count": 5924,
"repo_created_at": "2023-11-24T19:25:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df725812e... |
7242fd56-8660-42eb-9aee-6897fe8ae2ac | MingzhenY/code-warehouse | CodingWebsites/LeetCode/CPP/Volume2/143.cpp | #include <cstdlib>
#include <cstdio>
#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>
#include <cstring>
#include <list>
#include <cmath>
#include <queue>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(){}
ListNode(int x) : val(x), next(NULL) {}
};
... | ALGO | 0.999993 | 5.402423 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2018-05-16T16:24: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": "b865a6069... |
39b49001-3c24-4311-8fbd-0575c2427491 | Glorf/polibuden | PTSZ/genetyk/solver.cpp | //
// Created by mbien on 14.12.2019.
//
#include <iostream>
#include <algorithm>
#include <random>
#include <chrono>
#include "solver.h"
#include "helpers.h"
#define POPULATION_SIZE 100
#define BEST_THRESHOLD 0.01
#define SURVIVAL_THRESHOLD 0.2
#define OUTSIDERS_RATIO 0
#define MUTATION_CHANCE 0.6
#define ALLEL_DAM... | ALGO | 0.999845 | 5.032145 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2017-05-08T07:56:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46a075270... |
fa5c1549-eb41-4022-b4f1-b566f1b7378b | Miju-Ahmed/code | DataStructure/Binary_Tree/print.cpp | // C++ Program to print binary tree in 2D
#include<bits/stdc++.h>
using namespace std;
#define COUNT 10
// A binary tree node
class Node
{
public:
int data;
Node* left, *right;
/* Constructor that allocates a new node with the
given data and NULL left and right pointers. */
Node(int data){
this->data = data... | ALGO | 0.999916 | 6.484512 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2022-05-31T04:15:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4f0f2b9a... |
2fa7e7b7-a8ab-480d-ab41-f4be3f623b56 | hycinth22/ccf-csp-problems-solutions | 201912-3/main.min.cpp | #include <bits/stdc++.h>
using namespace std;
using element = string;
map<element, int> &operator+=(map<element, int> &a, const map<element, int> &b) {
for (const auto &p : b) {
a[p.first] += p.second;
}
return a;
}
map<element, int> operator*(int coef, const map<element, int> &b) {
map<element... | ALGO | 0.999431 | 4.87181 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-12-10T07:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c4adc5d3... |
911f63eb-14d3-4575-bd70-17a25a174d02 | Shriya-Jaiswal/DSA_POTD_Questions_solving | 728_Flip_Equivalent_Binary_Trees_Leetcode_951.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node* next;
Node(int data){
this -> data = data;
left = NULL;
right = NULL;
next = NULL;
}
};
Node* buildTree(){
... | ALGO | 0.999982 | 5.060524 | {
"github_metadata": {
"branch": "main",
"commit_count": 768,
"repo_created_at": "2023-10-01T15:53:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d1c39db3d... |
6ff4866d-67b4-4670-9610-3bbed39716df | md-sohrab-hossain/UVA-ONLINE-JUDGE | 10140 - Prime Distance.cpp | /*
Md.<NAME>
Daffodil International University
*/
#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long int
#define mx 9999999
#define pb push_back
bool mark[mx];
bool seg[mx];
vector< ll >prime;
void sieve()
{
mark[0]=true;
mark[1]=true;
for(int i=4; i<=mx; i+=2)mark[i]=true;... | ALGO | 0.999935 | 3.711262 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-01-12T18:58:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "309613646d... |
2e7061e6-7d28-4cb2-a988-2be7ed445291 | amov-lab/Prometheus | Modules/uav_control/include/Position_Controller/pos_controller_NE.h | #ifndef POS_CONTROLLER_NE_H
#define POS_CONTROLLER_NE_H
#include <ros/ros.h>
#include <math.h>
#include <Eigen/Eigen>
#include <bitset>
#include <prometheus_msgs/UAVState.h>
#include <Filter/LowPassFilter.h>
#include <Filter/HighPassFilter.h>
#include <Filter/LeadLagFilter.h>
#include "geometry_utils.h"
#include "co... | ALGO | 0.99475 | 4.352695 | {
"github_metadata": {
"branch": "main",
"commit_count": 1572,
"repo_created_at": "2019-12-03T06:28:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2835,
"forks": 441,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "93533... |
7e550ed1-13c8-434e-a962-bc2e93c8e8a8 | hariharsubramanyam/6829lab2 | datagrump/controller_sarsa.hh | #ifndef CONTROLLER_HH
#define CONTROLLER_HH
#include <cstdint>
#include <vector>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <deque>
/* Congestion controller interface */
class Sarsa {
private:
size_t num_states_;
size_t num_actions_;
double alpha_;
double epsilon_;
dou... | ALGO | 0.991719 | 6.043031 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2016-10-15T15: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": "61a3fec98... |
3ea8e41f-2071-4a59-b703-9981d6431a72 | Kiritow/OJ-Problems-Source | HDOJ/5410_autoAC.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1005;
int w[N], a[N], b[N];
int dp[N][2005][2];
int main(){
int t; scanf("%d", &t);
while (t--){
int m, n; scanf("%d %d", &m, &n);
for (int i = 1; i <= n; i++){
scanf("%d %d %d", w + i, a + i... | ALGO | 0.999952 | 3.031552 | {
"github_metadata": {
"branch": "master",
"commit_count": 939,
"repo_created_at": "2016-04-10T01:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f5d3d9... |
4de52586-0d70-4f6a-962d-3d57efa8edfa | ishandutta2007/codeforces-k | kort0n/normal/1151/C.cpp | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
template<class T>
inline bool chmin(T &a, T b) {
... | ALGO | 0.999967 | 4.848153 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d32adb88bd8... |
eb54c096-b08e-4362-9a96-b480d35d5cd0 | thanhvk/Algorithm | lesson_08/wetlands/main.cpp | #include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#define pb push_back
using namespace std;
struct toado {
int h, c;
};
toado huong[8] = {-1, 0
, -1, 1
, 0, 1
... | ALGO | 0.999829 | 3.616004 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2016-03-15T16: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": "83dceb868... |
e27da5b4-85f3-4964-a775-cb4d9105c997 | lucas-silveira/cpp-fundamentals | algorithms/challenges/easy/product-sum.cpp | /*
Product Sum
Write a function that takes in a "special" array and returns its product sum.
A "special" array is a non-empty array that contains either integers or other
"special" arrays. The product sum of a "special" array is the sum of its
elements, where "special" arrays inside it are summed themselves... | ALGO | 0.999248 | 6.029025 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2021-07-09T02:13: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": "b71dd435... |
ce6c430f-5603-4f8d-bc58-a98eb75730e1 | thegamer1907/Code_Analysis | Codes/AC/3784.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define rep1(i, a, b) for (int i = (a); i < (b); ++i)... | ALGO | 0.999539 | 3.258185 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2019-05-24T10:35:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "329cffc9a... |
b2ce3b6e-0b33-48b5-97f2-2b3d497a1f92 | HC-Chang/LeetCode | complete/979.distribute-coins-in-binary-tree.cpp | /*
* @lc app=leetcode id=979 lang=cpp
*
* [979] Distribute Coins in Binary Tree
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : va... | ALGO | 0.999992 | 6.60505 | {
"github_metadata": {
"branch": "master",
"commit_count": 1238,
"repo_created_at": "2018-09-11T16:45: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": "d5ab0de... |
f9e6dee0-1062-442f-89f1-75734f40ed1a | coolyuyuyu/leetcode | algorithm_3000-3999/3154-Find Number of Ways to Reach the K-th Stair/main.cpp | class Solution {
public:
int waysToReachStair(int k) {
// Alice can go up to (1 << jump) purely by op2
// Alice can use op1 ((1 << jump) - k) times to go down from (1 << jump) stairs to k
// There are at most (jump + 1) chances to use op1
std::function<int(int, int)> comb = [](int n... | ALGO | 0.999954 | 5.069299 | {
"github_metadata": {
"branch": "master",
"commit_count": 4422,
"repo_created_at": "2017-03-26T16:52: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": "caefc75... |
9bf109b6-b688-4a80-b712-0cfe04c33a4d | MaxTrgb/HW_OOP_1109 | 040923/040923/040923.cpp | #include <iostream>
#include <ctime>
#include "Node.h"
using namespace std;
// Function to add a new node with a character value to the end of the linked list
void putNodeToTail(Node*& head, char value) {
Node* n = new Node(value);
// If the linked list is empty, set the new node as the head
if (head == n... | ALGO | 0.999461 | 5.595101 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-09-07T08:22: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": "f763193a1f9f... |
1949b309-7843-45aa-abb3-c1a2458bf3af | yozlet/interface | libraries/hfm/src/hfm/HFMModelMath.cpp | //
// HFMModelMath.cpp
// model-baker/src/model-baker
//
// Created by <NAME> on 2019/10/04.
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "HFMModelMath.h"
#includ... | TOOL | 0.95387 | 6.330274 | {
"github_metadata": {
"branch": "master",
"commit_count": 82294,
"repo_created_at": "2012-11-01T23:45:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 500,
"issues": 0,
"pull_requests": 11
},
"file_meta": {
"content_id": "24... |
9b2ce0a0-39ef-487e-87e4-c5b9dc026bc5 | fsq/leetcode | 1091. Shortest Path in Binary Matrix.cpp | class Solution {
public:
vector<int> dx = {-1, -1, -1, 0, 1, 1, 1, 0};
vector<int> dy = {-1, 0, 1, 1, 1, 0, -1, -1};
int shortestPathBinaryMatrix(vector<vector<int>>& a) {
int n = a.size(), m = a[0].size();
if (a[0][0] || a[n-1][m-1]) return -1;
vector<vector<int>> vis(n, v... | ALGO | 0.99999 | 5.518508 | {
"github_metadata": {
"branch": "master",
"commit_count": 1935,
"repo_created_at": "2018-01-18T01:31:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5c47ff... |
d234d87d-ec5f-4589-af89-5a0ee6dff656 | JanDziuba/ASD | kinwersje/main.cpp | #include <iostream>
#include <vector>
#define DIVIDER 1000000000
using namespace std;
void getInput(int &sequenceLength, vector<int> &sequence, int &inversionLength) {
cin >> sequenceLength;
sequence.resize(sequenceLength);
cin >> inversionLength;
for (int i = 0; i < sequenceLength; i++) {
... | ALGO | 0.999988 | 4.332745 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-09-13T20:23: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": "a53caec3b2... |
d19d2daf-c5d0-4e45-9d6f-10fa969f8ce4 | mg4603/DSA | codewars/bit_letters/code.cpp | #include <iostream>
#include <assert.h>
#include <string>
#include <vector>
#include <cmath>
#include <map>
std::string getBitRep(unsigned char n)
{
std::string res;
while(n != 0)
{
res = std::to_string(n % 2) + res;
n /= 2;
}
if(res.length() < 8)
{
res = std::string(8 ... | ALGO | 0.996209 | 3.925221 | {
"github_metadata": {
"branch": "master",
"commit_count": 2111,
"repo_created_at": "2022-07-09T00:05:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d6b230... |
f46073ed-d063-486e-98c2-6b32d922c86a | ICS3U-Programming-IoanaM/Unit4-01-CPP | sumOfNumbers.cpp | // Copyright (c) 2022 <NAME> All rights reserved.
// Created By: <NAME>
//
// Date: Nov. 11, 2022
// a program that displays the sum of all the numbers leading
// up to the user's imputed number
#include <iostream>
int main() {
// variables
std::string userNumString = "";
int userNumInt, counter, totalPr... | ALGO | 0.932628 | 4.197127 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-11-11T00:41:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35468a711316... |
643bef65-450b-4bed-a0ad-0ddcb4083c80 | JohnnyMarlison/tech-prog-labs | lab12.cpp | #include <iostream>
#include <cmath>
using std::cout;
using std::cin;
/*Fucntion count prime num*/
bool primeNum(unsigned long long int nums){
int count = 0, count_prime = 0, count_perfect = 0;
bool prime = true;
for (int iter = 2; iter <= (sqrt(nums)); ++iter){
if (nums % iter == 0){
... | ALGO | 0.999607 | 4.083776 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2019-09-29T18:22: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": "b9c0f5aa... |
c42d4617-6fa4-4dcf-822e-b2ffd461774a | wzmw-zr/Code-Archive | 2020/8/27/1.LeetCode332.cpp | /*************************************************************************
> File Name: 1.LeetCode332.cpp
> Author:赵睿
> Mail: <EMAIL>
> Created Time: 2020年08月27日 星期四 00时23分30秒
************************************************************************/
#include<iostream>
#include<string>
#include<vector>
#include<q... | ALGO | 0.999993 | 4.635036 | {
"github_metadata": {
"branch": "master",
"commit_count": 1859,
"repo_created_at": "2019-11-28T12:33:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a83bac7... |
a5e72db1-efd1-4dfe-9272-8208ad9dae30 | Kiritow/OJ-Problems-Source | HDOJ/1556.cpp | /// General includes
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
/// 延迟更新: 区间运算更新(加法), 区间运算(求和)
namespace LazySegmentTree
{
const int MAXN = 100100;
const int MAXTREENODE = MAXN << 2;
struct node
{
int lt,rt;
int val;
int add;
};
node tree[MAXTREENOD... | ALGO | 0.999833 | 3.61982 | {
"github_metadata": {
"branch": "master",
"commit_count": 939,
"repo_created_at": "2016-04-10T01:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c1403f... |
639d9d47-7450-47ee-9a74-81484de8e1df | Slamur/competitive-programming | SortMe/Task26.cpp | //#pragma GCC optimize("conserve-stack")
#include <bits/stdc++.h>
#include <sys/resource.h>
void init_stack_size() {
const rlim_t kStackSize = 256 * 1024 * 1024; // min stack size = 16 MB
struct rlimit rl;
int result = getrlimit(RLIMIT_STACK, &rl);
if (result == 0)
{
if (rl.rlim_cur < kSt... | ALGO | 0.999987 | 4.506235 | {
"github_metadata": {
"branch": "master",
"commit_count": 423,
"repo_created_at": "2020-04-16T17:14:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4bcd09... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.