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 |
|---|---|---|---|---|---|---|---|
ffff9c64-e1e7-43f2-9b34-a25ca0a25265 | mlqcmlmc/PAT_AdvancedLevel_Practise | PAT1043_IsItaBinarySearchTree/IsItaBinarySearchTree.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
using namespace std;
vector<int> post;
struct Node
{
Node(int val) :data_(val), lchild(nullptr), rchild(nullptr){}
int data_;
Node *lchild;
Node *rchild;
};
bool isBinarySearchTree(const vector<int>& tree, Node* proot, bool mirror)
{... | ALGO | 0.999995 | 3.84107 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2015-06-15T05:06: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": "7ca327bbf... |
be90015a-24d3-400d-9250-51d20a6e4e67 | yijerjer/reinforcement_learning | 04_dynamic_programming/policy_iteration.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <tuple>
#include <cmath>
#include <chrono>
using namespace std;
class PolicyIteration {
vector<vector<double>> state_values;
vector<vector<double>> policy;
int n_cars;
double theta;
bool modified;
public:
double gamma;
... | ALGO | 0.999159 | 5.124577 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-07-28T15:57:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35aa1e884... |
b75119c3-075f-4ee9-a8d4-a37709e4c499 | ahnaf1118/cp | sol/codeforces/1433D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
bool bfs(vector<ll> &vertices, vector<pair<ll, ll>> &edges) {
vector<bool> vis(vertices.size(), false);
deque<pair<ll, ll>> q;
q.push_back({0, vertices[0]});
vis[0] = true;
while(!q.empty()) {
pair<ll, ll> cur = q.front(... | ALGO | 0.999987 | 3.9038 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-05-22T16:06: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": "3cc51ffb4ad... |
1648e65b-1d45-4d83-9179-227a289d1245 | abhavgoel/TribeVibe | Leetcode/Cousins_in_Binary_Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999979 | 5.925196 | {
"github_metadata": {
"branch": "main",
"commit_count": 350,
"repo_created_at": "2021-10-03T15:00:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 50,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f60329c63... |
a88097a7-fa61-46e5-ab6b-363a4ca147a2 | Sim0nLien/RICE | code/src/src.hpp | #ifndef SRC_HPP
#define SRC_HPP
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include "../utils/utils.hpp"
template <class T> std::vector<T> int2bin(const T in, const T k){
T val = in;
std::vector<T> result(k, 0);
for (int i = k - 1; i >= 0; i--) {
result[i]... | ALGO | 0.995928 | 5.893978 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-05-10T18:14:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c4be52b12d1... |
b52354a1-412c-447c-80fd-754cc798cc05 | iyashu/Competitive-Programming | Spoj/NITT2.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll ar[10],len;
char st[60000];
ll H[] = {1,3,2,-1,-3,-2};
bool divisibleBy1()
{
return true;
}
bool divisibleBy2()
{
ll temp = st[len-1]-48;
if(temp&1)return false;
return true;
}
bool divisibleBy3()
{
ll sum = 0;
for(ll i=0;i<l... | ALGO | 0.9997 | 3.95402 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2015-06-26T12:36: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": "8fdcea57... |
72e8387d-d3e1-4b81-87c0-ca12c2f1dff0 | hindungWang/MyLearning | c/ListNode/单链表.cpp | /****
C++ 单链表数据结构 常用算法
******/
#include<iostream>
#include<vector>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListNode* swapPairs(ListNode* head)//链表前后位置调换:1->2->3->4 ==> 2->1->4->3
{
if(head == NULL)return NULL;
if(head->nex... | ALGO | 0.999935 | 4.742811 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-11-19T12:57:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c9bec6752... |
41870a7a-f3ff-40d8-aea9-1cfff267c4d8 | wangxing0608/leetcode | 21.merge-two-sorted-lists.cpp | /*
* @lc app=leetcode id=21 lang=cpp
*
* [21] Merge Two Sorted Lists
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
... | ALGO | 0.999964 | 6.211454 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2018-07-31T05: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": "4591d0c17... |
beec1a57-e1bf-4315-8419-981339540ce8 | albertwang2004/projects | Codeforces/Codeforces/PS1464/E.cpp | /*#include <bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define p push
#define ins insert
#define t top
#define fr front
#define T1 10
#define T2 100
#define T3 1000
#define T4 10000
#define T5 100000
#define T6 1000000
#define H1 11
#define H2 105
#define H3 1010
#define... | ALGO | 0.999584 | 3.707394 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-10-24T05:40: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": "a2bcebcf1574... |
432dfe9a-8469-4025-b609-3091869d9e40 | teacow2/fortugnn_AlgoSims2106 | Assignment#6/PathFollowTest/PathFollowTest/Vehicle.cpp | #include "Vehicle.hpp"
Vehicle::Vehicle()
{
radius = 20;
size = 10;
step = 10;
speed = .3;
cap = .01;
}
void Vehicle::setup() {
pos = ofPoint(0, ofRandom(0 + size, ofGetHeight() - size));
cout << pos << endl;
vel = ofPoint(ofRandom(1, 3), ofRandom(-3, 3));
}
void Vehicle::update(ofPoint _start, ofP... | TOOL | 0.907363 | 4.952856 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2016-09-08T21:59: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": "0c8b3e0c8... |
8b222082-ce46-424e-9ef9-e643746ad18d | Autobonics/boa | esp_code/servo_control/servo_control.ino | //Servos
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
// called this way, it uses the default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
#define SERVOMIN 100 // this is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX 600 // this is the 'maximum' pulse length count ... | TOOL | 0.919837 | 5.946967 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-01-27T05:14: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": "f7989d646e... |
3c67d905-4dae-4e1a-b579-18fa16d8de35 | davidstutz/daml-shape-completion | data/shapenet/libsimplifymesh/remesher/libremesh/delaunayflips.cc | #include <iostream>
#include "delaunayflips.h"
REMESHER_NAMESPACE_BEGIN
bool
DelaunayFlips::check_flip_edge (std::size_t v1idx,
std::size_t v2idx, std::size_t v0idx, std::size_t v3idx,
std::size_t /* face1 */, std::size_t /* face2 */)
{
MeshVertexList const& verts = this->mesh->get_vertices();
/* Check ... | ALGO | 0.951081 | 6.713769 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-05-15T15:58:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "243bf74b8... |
7719c715-3d17-4a61-b152-b61a0e9f4c56 | POeticPotatoes/cpp | cf_893/D.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include </home/poeticpotato/work/cpp/debug.h>
#else
#define deb(x...)
#endif
#define IO cin.sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define FOR(i, a, b) for (ll i = (a); (i) < (b); (i)++)
#define FORN(i, a, b) for (ll i = (a); (i) <= (b); (i)++)... | ALGO | 0.99995 | 4.470591 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2022-08-25T02:48:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d49911f8... |
f6509b11-3275-4107-a055-aa04abfa9f52 | Hunterdii/GeeksforGeeks-POTD | October 2024 GFG SOLUTION/October-30.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
int countPairsWithDiffK(vector<int>& arr, int k) {
unordered_set<int> numSet(arr.begin(), arr.end()); // Using set for unique elements
int count ... | ALGO | 0.993024 | 6.358992 | {
"github_metadata": {
"branch": "main",
"commit_count": 3732,
"repo_created_at": "2024-03-09T09:48:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 202,
"forks": 54,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed30ab... |
53d8e8b4-10b8-4d66-a387-8ab63a2a008c | fkjslee/leetcode | 400/400.cpp | class Solution {
public:
long long int nine(int p) {
if (p == 0) return 1;
--p;
long long int ten = 1;
for (int i = 0; i < p; ++i) ten = ten * 10;
return 9 * ten;
}
long long int ten(int p) {
long long int ten = 1;
p--;
for (int i = 0; i < p;... | ALGO | 0.999844 | 3.910427 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2021-03-03T10:08: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": "ec5e5adde... |
100c90a5-77d3-4427-a374-1bb2acf1d7b9 | zz9629/.leetcode | 504.base-7.cpp | /*
* @lc app=leetcode id=504 lang=cpp
*
* [504] Base 7
*/
#include "string"
using namespace std;
// @lc code=start
class Solution {
public:
// 递归
string convertToBase7_(int num) {
if (num < 0) return "-" + convertToBase7_(-num); // 这里要加一个“-”
if (num < 7) return to_string(num);
return... | ALGO | 0.996356 | 5.252007 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-05-06T05:13:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a36cccbbb9... |
3cf97446-f508-4cc6-bbf0-ca1ef919d1ad | haru210/atcoder | ABC411/B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using pint = pair<int,int>;
using pll = pair<long long, long long>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i,n) for (int i = 1; i <= (int)(n); i++)
#define YesNo(bool) if(bool) cout << "Yes" << endl; else cout << "No" <<... | ALGO | 0.999847 | 4.03804 | {
"github_metadata": {
"branch": "master",
"commit_count": 439,
"repo_created_at": "2023-05-18T08:20: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": "af8fc32e... |
fdb1682c-eb0e-4706-9754-182e4c20d98f | gusah009/Algorithm | 2021-1/baekjoon/11723_집합.cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.996283 | 4.882487 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2021-04-14T02:49: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": "82f66f6665... |
371779c0-d4c3-4144-855f-84a70947ed17 | terlinator/falling-balls | ball/ball.cpp | //Group Twelve Names: <NAME>, <NAME>,
//<NAME>, <NAME>, <NAME>
//Project Name: Falling Balls
//Assignment Description: Create definitions
//for the ball functions
//File Name: ball.cpp
//File Created: 11/14/2023
//File Last Edited: 12/05/2023
#include "ball.h"
#include "constants.h"
#include "force.h"
using namespace... | ALGO | 0.967578 | 5.327858 | {
"github_metadata": {
"branch": "main",
"commit_count": 278,
"repo_created_at": "2023-11-15T22:21:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92a996b04a... |
6fc5cc60-e104-497a-b453-af4d0df4c358 | kellymyrs/NN-Range_Search | Search.cpp | #include "Search.h"
void Range(vector<int>& c,unordered_map<int,vector <Item<int>*>>& hashtable,int& metric,double& R,int& M,int& probes,int& concat,vector<struct Item <int>*>& range){
struct Item <int>* temp_item = NULL;
double temp_dist;
cout << "Range Search" << endl;
//search bucket
auto search = hashtable.... | ALGO | 0.998887 | 3.982115 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-10-21T08:40: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": "0124ae26f... |
090e3c9c-5337-4f47-8f18-66794c4de25b | alexei-tchervinsky/tp_2025 | narumov.diyar/T3/Commands.cpp | #include <numeric>
#include <algorithm>
#include <iomanip>
#include <limits>
#include "Commands.hpp"
#include "iofmtguard.hpp"
namespace narumov {
using namespace std::placeholders;
std::map<std::string, std::function<void(const std::vector<Polygon>&, std::istream&, std::ostream&)>> commandsList = {
{... | TOOL | 0.980837 | 5.74253 | {
"github_metadata": {
"branch": "main",
"commit_count": 1031,
"repo_created_at": "2025-03-22T08:08:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 21,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "c1c1f918... |
d9a605de-5dcf-4a63-9635-577b360d4d78 | thewarriofish/alex-central-code | University Work/CS302/lab4/matrix_enum.cpp | //<NAME> - CS302
//Lab 4: Enumeration
//February 17th, 2022
/*This lab focuses on the use of recursion to implement enumeration of matrices. Both permutations and combinations are implemented in this manner.*/
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <cstdlib>
using namespac... | ALGO | 0.998726 | 4.270844 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-10-25T23:10:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f7422ad3be... |
82d4c32a-3265-4d83-b9d8-56cfc49ad04c | littlesam95/BaekjoonPractice | 구현/Gold 4/Baekjoon20057.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <algorithm>
#define FIRST cin.tie(NULL); cout.tie(NULL); ios::sync_with_stdio(false);
#define MAX 506
#define INF 2e9
using namespace std;
int N;
int MAP[MAX][MAX];
pair<int, int> Start;
int moveY[4] = { 0,1,0,-1 };
int ... | ALGO | 0.999174 | 3.86451 | {
"github_metadata": {
"branch": "main",
"commit_count": 188,
"repo_created_at": "2021-05-03T09:23:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c1e2848d7... |
6c9c829e-cd94-4754-884e-60de929dbbcc | BachiLi/lajolla_public | src/shape.cpp | #include "shape.h"
#include "intersection.h"
#include "point_and_normal.h"
#include "ray.h"
#include <embree4/rtcore.h>
struct register_embree_op {
uint32_t operator()(const Sphere &sphere) const;
uint32_t operator()(const TriangleMesh &mesh) const;
const RTCDevice &device;
const RTCScene &scene;
};
... | ALGO | 0.96066 | 7.35235 | {
"github_metadata": {
"branch": "main",
"commit_count": 350,
"repo_created_at": "2021-12-26T17:36:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 97,
"forks": 57,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "53ad6139... |
053f5888-cee3-47a6-b5c3-f84cb34da87b | svalenti52/Praxis | penny_beta.cpp | // penny.cpp
#include <iostream>
// #include <fstream>
#include <vector>
#include <set>
#include <map>
#include <functional>
#include <tuple>
#include <stack>
std::map<int, char> alpha_map
{
{0, 'A'},
{1, 'B'},
{2, 'C'},
{3, 'D'},
{4, 'E'},
{5, 'F'},
{6, 'G'},
{7, 'H'},
{8, 'I'},
{9, 'K'},
{10,... | ALGO | 0.997561 | 3.914858 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2019-05-19T20:14:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32a502f07... |
79b523ac-513d-4333-8a9f-c586eb34d426 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/12/1219/personal_submission/cf1056c_lengli.cpp | /*
lengli_QAQ
Hope there are no bugs!!!
*/
#include <bits/stdc++.h>
#define fastio std::ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0)
#define all(x) x.begin(),x.end()
#define pb push_back
#define i64 long long
void solve(){
int n,k;
std::cin>>n>>k;
std::vector<int> a(n*2+2);
for(int i=1;i<... | ALGO | 0.999937 | 3.832207 | {
"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": "bc67... |
3135dc6a-649d-4552-95f6-ea82c52fb3fb | roccodebellis/ASD | src/bintree_list.h | #ifndef BINTREE_LIST_H_
#define BINTREE_LIST_H_
#include "bintree_node.h"
#include "binary_tree.h"
#include "exceptions.h" //empty_bintree
template <class T>
class bintree_list : public binary_tree<T, bintree_node<T> *> {
public:
typedef typename binary_tree<T, bintree_node<T> *>::value_type value_type;
typedef typ... | TOOL | 0.960098 | 5.065837 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-01-10T15:32: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": "916444293... |
8f3a367d-b06e-4210-ae63-b406dd5ae230 | seanwarren/open-ebsd | segmentation.cpp | /**
\file segmentation.cpp
\brief Functions for segmenting the dataset into grains
*/
#include "ebsd.h"
#define push(x) stack[stack_top++] = x
#define pop() stack[--stack_top]
#define gl_add(i) grain_list_free->index = i; \
grain_list_free->next = grain_list_free+1; \
grain_list_free++
#define C... | ALGO | 0.955464 | 4.53967 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-03-13T02:36: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": "62d0a5bdf... |
f64a892a-4608-491b-847c-bf20a379f805 | BitMechanic/Stanford-CS106b | pathfinder/cmpfn.h | //
// cmpfn.h
// pathfinder
//
// Created by Robbie on 08/06/2013.
//
//
#ifndef pathfinder_cmpfn_h
#define pathfinder_cmpfn_h
#include "path.h"
/*
* Function: operatorCmp
* Usage: int sign = operatorCmp(v1, v2);
* --------------------------------------
* This template function is a generic function that comp... | TOOL | 0.944833 | 5.571465 | {
"github_metadata": {
"branch": "complete",
"commit_count": 2,
"repo_created_at": "2013-07-06T21:30:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0282d41d... |
48499ce7-f837-4b2e-a242-3d22f58b682a | Word2VecT/BUPT-Algorithm-Design-and-Analysis-Lab | Lab 2/src/aco.cpp | #include <cmath>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <limits>
#include <vector>
const int NoEdge = std::numeric_limits<int>::max();
const double alpha = 1.0; // 信息素重要程度
const double beta = 5.0; // 启发式信息重要程度
const double rho = 0.5; // 信息素挥发系数
const double Q = 100.0; // 常数用于信息素更新
const ... | ALGO | 0.999994 | 5.377858 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-10-20T17:43: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": "de87387d1cc1... |
cc3b803f-cd2d-45ea-abfd-a4923cf7df34 | vnguyen162/CS301_Bootcamp | Day 2/Arrays/Summing_and_Averaging.cpp | #include <iostream>
using namespace std;
int main()
{
// This code finds the average and sum of an array.
const int SIZE = 5;
int myArray[SIZE] = {1, 2, 3, 4, 5};
int sum = 0; //initialize summing variable
cout << "Calculating sum and average of the array containing: ";
for (int i = 0; i < S... | ALGO | 0.999447 | 4.458852 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2023-01-07T14:48:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c267bdb3a... |
566bceb1-4112-4e3f-8483-30ad2070641b | alexfrasson/ChromaRenderer | chroma-renderer/core/space-partition/bvh.h | #pragma once
#include "chroma-renderer/core/space-partition/i_space_partitioning_structure.h"
#include "chroma-renderer/core/types/mesh.h"
#include <memory>
#include <vector>
struct BvhNode
{
BoundingBox bbox{};
std::unique_ptr<BvhNode> child[2] = {nullptr, nullptr};
std::int32_t start_id{0};
std::in... | ALGO | 0.970934 | 6.896026 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2014-10-05T01:27:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe1c0067... |
7333abcc-b03a-405f-bfa1-2e0de5bb8a59 | aayush4vedi/MyCompetitiveCoding | editdist.cpp | #include<bits/stdc++.h>
//#include <string.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> > ... | ALGO | 0.999986 | 4.17475 | {
"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": "54535f7d... |
80ead378-505c-4d7f-83ef-ab92a697073c | jxx-sx/BOJ_Study | solved/lca/15481.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#define N 200001
#define pb push_back
using namespace std;
struct Edge {
int s, e, w, i;
bool mst;
Edge() : s(0), e(0), w(0), i(0), mst(false) {}
bool operator<(const Edge &t) const { return w < t.w; }
};
struct Seg {
int tree[800000];
... | ALGO | 0.999993 | 4.524698 | {
"github_metadata": {
"branch": "main",
"commit_count": 715,
"repo_created_at": "2022-11-23T13:54:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "672c0146fb... |
ca59e7fb-9b6b-44d8-aab3-7df9d449573b | vectorclass/version2 | dispatch_example1.cpp | /************************* dispatch_example1.cpp ***************************
Author: <NAME>
Date created: 2012-05-30
Last modified: 2020-02-25
Version: 2.02.00
Project: vector class library
Description: Example of automatic CPU dispatching.
This shows how to compile vector code ... | TOOL | 0.962299 | 6.025059 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2019-08-01T10:25:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1375,
"forks": 153,
"issues": 4,
"pull_requests": 2
},
"file_meta": {
"content_id": "c3a30... |
d54d33af-6163-43e0-af4c-546c29ae9b09 | borekking/CP | graph/shortest_path/floyd_warshall_backtracking.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef tuple<int, int, ll> edge;
const int MAXN = 200+2;
const ll INF = 1e18;
vector<edge> edges;
vector<vector<ll>> dist(MAXN, vector<ll>(MAXN, INF));
vector<vector<int>> pars(MAXN, vector<int>(MAXN, -1));
int n;
void floyd_warshall() {
int ... | ALGO | 0.999965 | 4.144958 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-02-11T17:57:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf4897af423b... |
3420c2b7-9fc0-4486-afea-90b82f4a055e | Stephenhua/CPP | interview_Code/Code/Huisu-26-LeetCode294-canWin.cc | #include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string.h>
#include <unordered_map>
using namespace std;
/*
294. 翻转游戏 II
你和朋友玩一个叫做「翻转游戏」的游戏,游戏规则:给定一个只有 + 和 - 的字符串。你和朋友轮流将 连续 的两个 "++" 反转成 "--"。 当一方无法进行有效的翻转时便意味着游戏结束,则另一方获胜。
请你写出一个函数来判定起始玩家是否存在必胜的方案。
示例:
输入: s = "+... | ALGO | 0.999993 | 4.620144 | {
"github_metadata": {
"branch": "master",
"commit_count": 204,
"repo_created_at": "2020-02-07T04:36: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": "e2780f11... |
75366416-057e-4d41-821b-88c8b3cf0cf1 | Ye-zixiao/Libfm | net/http/HttpContext.cpp | //
// Created by Ye-zixiao on 2021/4/30.
//
#include "net/http/HttpContext.h"
#include <algorithm>
#include "libfm/fmnet/Buffer.h"
using namespace fm;
using namespace fm::net;
using namespace fm::net::http;
bool HttpContext::parseRequest(Buffer *buffer, time::TimeStamp receivedTime) {
bool ok = true, hasMore = tru... | WEB | 0.925979 | 4.800011 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2021-04-09T08:14:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b0a2ed8b... |
41b3e5b6-5c04-4324-a648-2eec6a0e301f | bulat1337/Ray_Tracing | src/perlin.cpp | #include "perlin.h"
#include <cmath>
#include <algorithm>
#include <memory>
Perlin::Perlin()
{
size_t point_amount = static_cast<size_t>(point_count);
rand_vec = std::make_unique<Vec3[]>(point_amount);
for(size_t id = 0 ; id < point_amount ; ++id)
{
rand_vec[id] = unit_vector(Vec3::random(-1, 1));
}
... | ALGO | 0.975567 | 5.711154 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-07-13T12:12: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": "03f38579de3... |
88bb59ff-b05f-4dea-b8c5-4e9eab87ed4a | chungn18/SWCP | Grind_75/46.Permutations/main.cpp | #include <bits/stdc++.h>
using namespace std;
void rec(int ind, vector<int>& can, vector<int>& ares, vector<vector<int>>& ans, int target){
if (ind >= can.size() || target < 0) return;
cout << "cani: " << can[ind] << endl;
if (target == 0){
ans.push_back(ares);
return;
}
//take c... | ALGO | 0.999885 | 5.419611 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2022-10-08T09:08: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": "9f8fe97e36f... |
9c9f4040-4766-4702-bec5-416c7d62cdc0 | MabullahK/learing-c- | Magic 8 Ball.cpp | #include <iostream>
#include <cstdlib>
/*this program is making a very unusual magic 8 ball */
int main() {
std::cout << "Magic 8 ball:\n\n";
srand(time(NULL));
int answer = std::rand() % 10;
if (answer == 0) {
std::cout << "Very doubtful\n";
}
else if (answer == 1) {
std::cou... | TOOL | 0.992365 | 3.361928 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-05-10T20: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": "a8290da5bc96... |
87da90e4-dd5d-4431-8de3-fa012c0718e9 | xavierbeast68/TUF-Tree-Series | 1. Binary Trees/Part-2 Medium Problems/L21 Vertical Order Traversal of Binary Tree/987-Vertical-Order-Traversal.cpp | //* https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/
//* https://youtu.be/q_a6lpbKJdw
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x)... | ALGO | 0.999996 | 6.450023 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-06-06T05:25:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a34ecac2c... |
b5048a1b-c774-4b9c-8652-ba083e0fa722 | jcksber/CMU_15-418_hw3 | code/wireroute.cpp | /**
* Parallel VLSI Wire Routing via OpenMP
* <NAME> (jkasbeer), <NAME> (qcai)
*/
#include "wireroute.h"
#include <chrono>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <assert.h>
#include <omp.h>
#include "mic.h"
static int _argc;
static const char **_argv;
////////////////... | ALGO | 0.999885 | 4.314871 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2018-07-04T11:56:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ceda6ba... |
30d737f9-7ece-4956-a15b-511bb038ddad | Svetlozar-Stefanov/FMI | Semester3-SDA/NonCompulsoryTasks/05_HungerGames/05_HungerGames.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <climits>
using namespace std;
void Ver01(vector<int> &arr, int N) {
int count = 0;
bool isEliminated = false;
queue<int>* roundSurvivors = new queue<int>();
for (int i = N - 1; i >= 0; i--)
{
if (i >= 1 && ar... | ALGO | 0.999972 | 5.047541 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2021-10-18T16: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": "06818397... |
421d5c41-4be2-4fc2-92b3-b9f8fdfdbe76 | google/monster-mash | third_party/libigl/include/igl/mat_to_quat.cpp | // This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2013 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.... | ALGO | 0.983885 | 6.327176 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-01-28T21:04:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1312,
"forks": 182,
"issues": 24,
"pull_requests": 0
},
"file_meta": {
"content_id": "209384... |
356337fd-fd43-4af6-98b4-3510675baee7 | sunhao2014/UvaOnlineJudge | BruteForce(I)/Backtracking(Easy)/167TheSultan'sSuccessors.cpp | #include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
void GetMaxScore (vector<int>& currentResult, const vector< vector<int> >& data, int current, int n, int& maxScore) {
if (current == n) {
int currentScore = 0;
for (int i = 0; i < 8; i++) {
currentScore += data[i][currentResult[i]];
... | ALGO | 0.999439 | 4.283334 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2013-11-13T01:40: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": "7ebb81b7b... |
c8f20da4-3213-4d6d-a9d2-359c1ecbe0d4 | dqyi11/SVNBackup | Proj/MOO/NSGA-III-cpp/alg_mutation.cpp |
#include "alg_mutation.h"
#include "alg_individual.h"
#include "aux_math.h"
#include "problem_base.h"
#include <cstddef>
#include <algorithm>
using std::size_t;
// ----------------------------------------------------------------------
// The implementation was adapted from the code of function real_mutate_ind() in m... | ALGO | 0.999748 | 5.61349 | {
"github_metadata": {
"branch": "master",
"commit_count": 1203,
"repo_created_at": "2018-08-15T17:31:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "066eb1d... |
0c7b92aa-2475-4c9f-a0cc-cbbb4282786c | Pattern387/coding_prac | BeautifulSeq/seq2.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n;
cin >> n;
vector<int> l(n);
vector<int> ts(n);
vector<int> to;
vector<int> tt;
int tcount = 0;
long long ans = 0;
for (int i = 0; i < n; i++)
{
cin >> l[i];
if (l[i] == 2)
{
t... | ALGO | 0.999933 | 4.587251 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2025-03-10T21:50: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": "b16f3d295e... |
e580ae44-beee-4c98-9815-394037f56157 | AndrejStojkovic/OOP | Exercises/Kolokvium1/kol1_4.cpp | // 1 - 4
#include <iostream>
#include <cstring>
using namespace std;
class Patnik {
char ime[100];
int klasa;
bool velosiped;
void copy_patnik(const Patnik& other) {
strcpy(this->ime, other.ime);
this->klasa = other.klasa;
this->velosiped = other.velosiped;
}
public:
... | ALGO | 0.982025 | 3.883703 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2023-02-27T23:36: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": "a65ebe689... |
26d0bafe-5f22-4c5e-bfbc-d5981603ff3d | punkryn/SWEA | main.cpp | #include <iostream>
using namespace std;
int arr[] = {3, 2, 2, 1, 8, 1, 4, 5, 9, 1, 1, 1, 1, 1};
int sorted[10];
void merge(int left, int mid, int right){
int l = left;
int r = mid + 1;
int k = left;
while(l <= mid && r <= right){
if(arr[l] <= arr[r]){
sorted[k++] = arr[l++];
}
else{
sorted[k++] = ar... | ALGO | 0.999964 | 3.735103 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-07-19T08:36: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": "76eeb4546bb... |
51d5b6f9-7a45-4f7d-9abb-2c9bc94b3a8f | philippds-learn/Programming-Principles-and-Practice-Using-Cpp_Bjarne-Stroustrup_Chapter-12-15 | p485_11_ellipseFoci.cpp | // <NAME>
// <NAME>'s PP
// Chapter 13 Exercise 11
#define _USE_MATH_DEFINES
#include "Simple_window.h"
#include "Graph.h"
#include <cmath>
using namespace Graph_lib;
ostream& operator<<(ostream& out, Point& a) {
out << "(" << a.x << "," << a.y << ")";
return out;
}
Point ptOnEllipse(Graph_lib::Ellipse& e, dou... | ALGO | 0.928914 | 5.890846 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-06-17T08:23:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d8530385ff... |
0b6affda-8cae-4497-a4ab-5b4a26027a52 | th-ch/adventofcode-2023 | day-22/part-1/skasch.cpp | #include <array>
#include <chrono>
#include <iostream>
#include <ostream>
#include <queue>
#include <span>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
static constexpr int kNBoxes = 2048;
struct Interval {
int l;
int r;
};
struct Box {
Interval x;
... | ALGO | 0.997782 | 5.059396 | {
"github_metadata": {
"branch": "main",
"commit_count": 515,
"repo_created_at": "2023-11-27T21:53:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "7cf8b9002b... |
45eb9473-2bf4-49eb-a8fc-8317bfbe7a83 | haotianmichael/algorithm | Acwing/0primaryAlgorithm/chp4/combinationIV.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
const int N = 5010;
int primes[N], cnt;
int sum[N];
bool st[N];
/*
分解因式
高精度乘法
*/
void get_primes(int n) {
for(int i = 2; i <= n; i ++) {
if(!st[i]) primes[cnt ++] = i;
for(int j = 0; primes... | ALGO | 0.999977 | 3.662021 | {
"github_metadata": {
"branch": "master",
"commit_count": 205,
"repo_created_at": "2020-03-02T13:48:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 23,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ceb48e... |
9a2b64b7-6acd-4081-a122-b31afb229f87 | fuyuoo/Play-LeetCode | leetcode题库/994. 腐烂的橘子/Solution.cpp | // 先遍历一遍,然后多源bfs
class Solution {
private:
vector<int> xoffset = { 1,0,-1,0 };
vector<int> yoffset = { 0,-1,0,1 };
public:
int orangesRotting(vector<vector<int>>& grid) {
int n = grid.size();
if (n == 0) return 0;
int m = grid[0].size();
int sumTime = 0;
queue<vector<int>> q;
int finecount = 0;
for (in... | ALGO | 0.999977 | 5.350488 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2020-02-28T00:48: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": "6cf1ea928... |
dcc33a41-4381-4f5b-9630-c4b529812d17 | xvepkj/cp_files | uva/10507.cpp | #include <cstdio>
#include<iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include<queue>
using namespace std;
typedef long long int ll;
typedef vector< int > vi;
typedef pair< int, int > ii;
typedef vector< ii > vii;
typedef vector< ... | ALGO | 0.999862 | 3.456612 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-20T04:15: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": "6cedd67f8328... |
be19804a-e05a-41e5-b5cd-dac53ef0cfcb | NewReStarter/Training | 3391/168.cpp | // kruskal
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
inline void read(int& x)
{
char c = getchar(); x = 0;
while(c < '0' || c > '9') c = getchar();
while(c <= '9' && c >= '0') x = x*10+c-48, c = getchar();
}
struct edge{
int u,v,c;
edg... | ALGO | 0.999965 | 4.049436 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2017-07-13T03:42: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": "e316a0670... |
cc3278f5-f6f1-4d75-a031-7a15b135fbdf | helehto/advent-of-code | 2021/4.cc | #include "common.h"
namespace aoc_2021_4 {
struct Board {
std::array<uint8_t, 25> nums;
std::array<int8_t, 100> index;
uint32_t mask = 0;
};
// clang-format off
static constexpr uint32_t win_masks[] = {
0b0000000000000000000011111,
0b0000000000000001111100000,
0b0000000000111110000000000,
... | ALGO | 0.998962 | 6.630487 | {
"github_metadata": {
"branch": "master",
"commit_count": 537,
"repo_created_at": "2023-12-01T09:44:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a14f58f... |
32562951-87de-4c20-9f2e-4bfa005360da | Viswa-teja-pathala/Leetcode_Problems | 0421-maximum-xor-of-two-numbers-in-an-array/0421-maximum-xor-of-two-numbers-in-an-array.cpp | struct Node {
Node* links[2];
Node() {
links[0] = links[1] = nullptr;
}
bool containsKey(int bit) {
return (links[bit] != nullptr);
}
Node* get(int bit) {
return links[bit];
}
void put(int bit, Node* node) {
links[bit] = node;
}
};
... | ALGO | 0.999951 | 6.076057 | {
"github_metadata": {
"branch": "main",
"commit_count": 277,
"repo_created_at": "2024-07-11T10:56:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3cb184f36f... |
5ad12921-55c3-4dc1-b4ac-3ee2f88b9ed8 | Aditya20743/Leetcode | 0004-median-of-two-sorted-arrays/0004-median-of-two-sorted-arrays.cpp | class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int n= nums1.size();
int m= nums2.size();
int idx=-1, idx2= -1;
if((n+m)%2==1 ){
idx = (n+m)/2;
}
else{
idx = (n+m)/2 -1;
idx2... | ALGO | 0.999993 | 6.13865 | {
"github_metadata": {
"branch": "main",
"commit_count": 2671,
"repo_created_at": "2023-01-15T05:20: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": "7626e7c2f... |
638eacdf-4f36-49ca-bab0-48e036185d06 | yunlai-wustl/PSF_GPU_recon_linux | PenaltyReg/penalty.h | #ifndef PENALTY_H
#define PENALTY_H
#include "../Solution_Items/ImageArray.h"
#include "../Solution_Items/PET_geometry.h"
#include "../Solution_Items/global.h"
class Penalty
{
public:
float ComputeFullPenalty(ImageArray<float>& Image);
void ComputeNewtonMethodValues(ImageArray<float>& Image, float mu_free, int ... | ALGO | 0.99919 | 5.896471 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2022-12-04T22:13:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28f692e62... |
c8f083c2-e113-4367-8a0f-1108d453980c | tianyicaii/leetcode | raw/2024/leetcode/cpp/0109-convert-sorted-list-to-binary-search-tree.cpp |
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;
TreeNode() : val(0), left(nullptr), rig... | ALGO | 0.999989 | 5.182335 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-12-18T00:34:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cdbc11387ae... |
541af1a0-0e98-4fc2-a6ee-98c626f52803 | 453251/Horse-treads-on-the-chessboard | chessboardproblem.cpp | #include"chessboardproblem.h"
#include<stdlib.h>
#include<stdio.h>
#include<iostream>
#include<queue>
#include<string.h>
#include<string>
#include<time.h>
using namespace std;
/***********栈的操作**********/
void ChessBoardProblem::InitStack(Stack& s)
{
if (!(s.elem)) {
s.elem = new point[MAX_STACK_SIZE];
}
s.top = 0... | ALGO | 0.999833 | 3.526265 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-12-02T13:50:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0347f8520e6d... |
1f7c2764-3cd3-4421-b739-5d68c8f90dc5 | Devang-soni/GFG | Easy/Find maximum volume of a cuboid/Find-maximum-volume-of-a-cuboid.cpp | /*
You are given a perimeter & the area. Your task is to return the maximum volume that can be made in the form of a cuboid from the given perimeter and surface area.
Note: Round off to 2 decimal places and for the given parameters, it is guaranteed that an answer always exists.
Examples
Input: perimeter = 22, area =... | ALGO | 0.995018 | 5.540408 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2024-06-01T08:59: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": "1487490d... |
3932c67c-f8e1-41a0-8208-49b05d8c8463 | smara97/CompetitiveProgramming | Codeforces/CF-ACodeforces Round #366 (Div. 1) .cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define m3lsh return 0;
typedef long long ll;
typedef unsigned long long ull;
ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int dix[]... | ALGO | 0.998355 | 3.877744 | {
"github_metadata": {
"branch": "master",
"commit_count": 338,
"repo_created_at": "2018-02-26T20:36:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9e81a143... |
c632a669-6490-40e8-8f07-a3ca8821560e | cran/ClusPred | src/ClusPred.cpp | #include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace arma;
using namespace std;
colvec GdensV(const colvec x){
return exp(-0.5 * x % x) / sqrt(2 * M_PI);
}
double Gdens(const double x){
return exp(-0.5 * x * x) / sqrt(2 * M_PI);
}
Col<double> Gdensbis(Col<double> x)... | ALGO | 0.999877 | 5.888236 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-06-18T15:45:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbdaf194008... |
9eedcfd2-a3a8-4fd4-86a1-f77f7f357818 | evlad/nnacs | dcontrp/NaNNCPL.h | //-*-C++-*-
//---------------------------------------------------------------------------
#ifndef NaNNCPLH
#define NaNNCPLH
#include <NaPetri.h>
#include <NaPNSum.h>
#include <NaPNCmp.h>
#include <NaPNFIn.h>
#include <NaPNFOut.h>
#include <NaPNTran.h>
#include <NaPNStat.h>
#include <NaPNTchr.h>
#include <NaPNBu21.h>
#... | ALGO | 0.917098 | 4.41999 | {
"github_metadata": {
"branch": "master",
"commit_count": 226,
"repo_created_at": "2013-10-20T21:22:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 15,
"pull_requests": 0
},
"file_meta": {
"content_id": "bab78ca... |
51e6170e-942d-4561-ab7f-39131f97b371 | swarajpanmand/DSA | geeksforgeeks/linked list/reverse_list.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int data){
this->data= data;
next = NULL;
}
};
class LinkedList{
public:
Node* head;
LinkedList(){
head =NULL;
}
void reverse() {
Node* current = head;
Node* prev =... | ALGO | 0.999871 | 5.650118 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-01-30T14:37: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": "488c3c3692b... |
d2306ac5-830c-43b1-97b7-b7939024bc37 | klementc/microservices_simgrid_reproducibility | Elasticity/ElasticPolicyHybrid1.cpp | #include <vector>
#include <iostream>
#include <numeric>
#include <algorithm>
#include <simgrid/s4u/Actor.hpp>
#include "simgrid/s4u/Engine.hpp"
#include "ElasticPolicy.hpp"
#include "ElasticTask.hpp"
// using namespace simgrid;
// using namespace s4u;
namespace sg_microserv {
/**
* Policy trying to reproduce Algor... | ALGO | 0.985931 | 7.212726 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-06-28T07:19:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "ed6c1830e140... |
6063a9c8-2a3f-4ebf-8140-30aeb363a246 | Ivanovsyukov/Homework-Practice-for-computer-Ovsyukov-Ivan | triangle.cpp | #include <iostream>
double myabs(double df){ // модуль
if (df<0){
return -df;
}
return df;
}
void out(bool answer){ // вывод ответа
if (answer){
std::cout << "Point in our place" << std::endl;
} else {
std::cout << "Point not in our place" << std::endl;
}
}
int main(){... | ALGO | 0.993307 | 4.114111 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-10-13T10:42: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": "69ab8480001... |
97ac1df2-4a2f-4f97-bade-38042e5ddceb | ivangalbans/leetcode | src/0224.cpp | // https://leetcode.com/problems/basic-calculator/description/
class Solution
{
public:
int calculate(string s)
{
int result = 0;
int sign = 1;
int num = 0;
stack<int> st;
for (auto ch : s)
{
if (ch == ' ')
continue;
if (is... | ALGO | 0.99984 | 5.199331 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2022-02-19T17:50:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9188e75... |
4958ffb7-6834-4760-8175-77397ca8ed0b | walkccc/LeetCode | solutions/906. Super Palindromes/906.cpp | class Solution {
public:
int superpalindromesInRange(string left, string right) {
int ans = 0;
const long l = stoll(left);
const long r = stoll(right);
for (long i = sqrt(l); i * i <= r;) {
const long palindrome = nextPalindrome(i);
const long squared = palindrome * palindrome;
if ... | ALGO | 0.99988 | 5.886845 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2019-02-23T15:46:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1254,
"forks": 437,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "955a133... |
d41dfa32-e45d-4432-80c8-2d55812b3918 | ishandutta2007/codeforces-n | natsugiri/normal/620/F.cpp | #include<cassert>
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=... | ALGO | 0.99999 | 4.219174 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9dd099eb572... |
9d617149-8d47-44e7-be55-fffccd2bc6f5 | franv314/competitive | olinfo/OIS/monuments/monuments.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ifstream in("input.txt");
ofstream out("output.txt");
int N, K, L; in >> N >> K >> L;
vector<int> A(N);
for (auto &x: A) {
in >> x;
x %= K;
}
if (N == 0) {
out << 0 << '\n';
return 0;
}
sor... | ALGO | 0.999864 | 4.309206 | {
"github_metadata": {
"branch": "soluzioni",
"commit_count": 263,
"repo_created_at": "2023-06-30T15:30:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85f5c... |
c08f93e2-ada9-40db-b26a-3c65af431cf1 | hrachyahakobyan/Network-Simulator-C- | NetworkQT/DiseaseSimulationSIR.cpp | #include "stdafx.h"
#include "DiseaseSimulationSIR.h"
DiseaseSimulationSIR::DiseaseSimulationSIR(const GraphBuilder::GraphOptions& g_options, const DiseaseSimulation::DiseaseOptions& options) :
DiseaseSimulation(g_options, options)
{
(*graph_p_).properties().broadcast_type_ = description();
initializeData(... | ALGO | 0.992661 | 6.84356 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2016-03-27T13:04:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cea936d53... |
bd968dd3-d0f7-4799-99b4-c888d319d51d | wiwitrifai/competitive-programming | codechef/ltime62a/prmdiv.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int s[N];
vector<int> ok[N];
int cnt[N], a[N];
int main() {
for (int i = 2; i < N; ++i) {
if (s[i]) continue;
for (int j = i; j < N; j += i)
s[j] += i;
}
for (int i = 2; i < N; ++i) {
for (int j = i+i; j < N; j += i) {
... | ALGO | 0.999825 | 3.67205 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2016-05-21T12:11:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfeefdb... |
e48313af-bdad-4173-ada8-0b7624091404 | rehanashraf/CodingPractice | C++/src/sort/selectionsort.cpp | /*
* selectionsort.cpp
*
* Created on: Oct 23, 2020
* Author: rehanashraf
*/
#include "utility.h"
#include "print.h"
// C++ program for implementation of selection sort
#include<iostream>
using namespace std;
void selectionSort(int arr[], int n)
{
int i, j, min_idx;
// One by one move boundary of... | ALGO | 0.999958 | 5.514188 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2019-09-26T05:57: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": "17ef61c5c... |
fe703ba0-21e4-4ce9-9242-c7cf5304b538 | shauryas1ngh/codes | COVID19B TRY.cp | #include<bits/stdc++.h>
#define pi 3.14159265359
#define ll long long
#define wh(t) int t;cin>>t; while(t--)
#define speed ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define f(i,a,b) for(int i=a;i<b;i++)
using namespace std;
#include<string.h>
//<NAME>- phoenix_aditya
void solve()
{
int ... | ALGO | 0.999513 | 3.262191 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2020-09-30T18:24:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c027c95... |
d616216d-a42f-446a-88cf-bfb2da88b542 | deep-bansal/HACKER-BLOCKS | HB MED EXPEDI/expedi.cpp | #include<bits/stdc++.h>
using namespace std;
bool compare(pair<int, int> p1, pair<int, int> p2)
{
return p1.first > p2.second;
}
int main(int argc, char const *argv[])
{
int n;
int flag = 0, ans = 0;
cin >> n;
vector<pair<int, int> > v;
priority_queue<int>pq;
for (int i = 0; i < n; ++i)
{
int d, f;
cin >>... | ALGO | 0.999989 | 3.612875 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2020-06-25T05:04:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "432b9416f... |
1626b5e4-acd4-410b-aa93-d0909fe3c70b | JinbaoWeb/ACM | Genemardon/20150820多校第十场/1002.cpp | #include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<cmath>
using namespace std;
#define INF 0x3fffffff
typedef long long LL;
//const LL maxn = 1e6+7;
const LL maxn = 200;
const LL mod = 1e9+7;
LL dp[maxn], arr[maxn];
LL gcd(LL a, LL b)
{
return ... | ALGO | 0.999915 | 3.966666 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-06-13T03:50: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": "973b4f44b0... |
c8871e70-55fc-4940-9ea7-7ec4e755d52e | andongfan/diwoCG | mat.h | #ifndef MAT_H
#define MAT_H
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
using namespace std;
#define IDX(a, b) ((a * 3) + b)
#ifndef M_PI
#define M_PI 3.1415926535
#endif
class vec3 {
public:
float data[3];
vec3() = default;
vec3 operator~() const {
float length... | TOOL | 0.988656 | 4.460443 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2020-06-08T00:30: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": "5e48904a... |
b907a66a-da4b-4f96-8bee-3c6dce22b029 | aktemur/rtpg4llvm | spMVlib-rtpg4llvm/unrolling.cpp | #include "spMVgen.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include "llvm/Analysis/Passes.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Vectorize.h"
#include "llvm/Transforms/IPO.h"
using namespace codeGen;
using namespace spMVgen;
Matrix* Unrolling::getMatrixForGeneration() {
... | ALGO | 0.998565 | 3.742916 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-05-03T05:58: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": "ab8977709c... |
88055810-4f0b-4dd3-b39c-9f45374f8c58 | 8fm/openw3 | dev/src/common/engine/QuadraticBezier_Segment2.cpp |
#include "build.h"
/*
#include "QuadraticBezier_Segment2.h"
namespace QuadraticBezierNamespace
{
float2 QuadraticBezier_Segment2::Evaluate(const float2 & p0, const float2 & p1, const float2 & p2, float t)
{
float2 A = p0-2*p1+p2;
float2 B = 2*p1-2*p0;
float2 C = p0;
return (t*t)*A+t*B+C;
}
float2 Quadrat... | ALGO | 0.994716 | 4.15787 | {
"github_metadata": {
"branch": "main",
"commit_count": 159,
"repo_created_at": "2024-08-04T03:03: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": "199e41c1df... |
bfa526c7-618e-4dd4-9999-c7db07264f09 | emoki/rf-phreaker | src/rf_phreaker/common/frequency_bin_calculator.h | #pragma once
#include <vector>
#include "rf_phreaker/common/ipp_array.h"
#include "rf_phreaker/common/common_types.h"
#include "rf_phreaker/common/fft_helper.h"
#include "rf_phreaker/common/moving_window_calculator.h"
#include "rf_phreaker/common/raw_signal.h"
namespace rf_phreaker {
class frequency_bin_calculator
{... | ALGO | 0.98634 | 6.747369 | {
"github_metadata": {
"branch": "main",
"commit_count": 3311,
"repo_created_at": "2024-04-21T21:25:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f953e087... |
eadf4d75-c3d9-40f8-b1be-881879e66c9f | eolt/Shortest-Path | graph.h | #pragma once
#define INT_MAX 2147483647
#include "linkedList.h"
#include <fstream>
#include <sstream>
#include<iostream>
#include<vector>
#include<queue>
#include<string>
using namespace std;
class graph
{
private:
void printPath(int*, int j, string&);
protected:
linkedList<pair<int, int>>* adjacentVertices;
int nu... | ALGO | 0.990495 | 3.525733 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-07-06T01:04:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf003f65f1... |
61a5f469-7b62-4230-acf1-baeaae03f3eb | hengyinayo/Algorithm | 백준/Gold/백트래킹/15686. 치킨 배달/치킨 배달.cpp | /*
접근 방법:
- 각 치킨집으로부터 집들의 치킨 거리를 구함,
- 각 집의 최소의 치킨 거리의 합을 구함
- 배열 2개 사용 1. 원본, 2. 치킨 거리
*/
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
#define MAX_INT 987654321
#define MAX_N 50
#define MAX_M 13
vector<pair<int, int>> house;
vector<pair<int, int>> chicken;
vector<vector<int>> dist;
vec... | ALGO | 0.999965 | 3.889497 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2024-02-02T09:57: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": "5354ad56e5... |
a7cc24c7-bb1a-4441-8c82-e24f6f10ffa4 | aseglorstw/parallel_search_algorithms | src/main.cpp | #include <iostream>
#include <memory>
#include <chrono>
#include <algorithm>
#include "state.h"
#include "domains/hanoi.h"
#include "domains/maze.h"
#include "domains/sat.h"
#include "domains/sliding_puzzle.h"
#include "bfs.h"
#include "iddfs.h"
using search_fn = state_ptr (*)(state_ptr);
void evaluate(state_ptr&... | ALGO | 0.999949 | 5.165862 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-04-11T14: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": "eaea6b20b65... |
9c23e0a6-3ed1-4173-9411-edec384092f4 | hartbeatnt/learningcplusplus | numberguess.cpp | #include <iostream>
using namespace std;
int main()
{
int max, guess;
int offset = 0;
int min = 0;
cout << "I wiLl guess your number \n";
cout << "Give me a max: ";
cin >> max;
while (offset != 3) {
if (offset == 1) {
min = guess;
} else if (offset == 2) {
max = guess;
} else if ... | ALGO | 0.93181 | 3.271045 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-04-18T16:19:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "112356d9f... |
18d72cd2-877d-4a06-aec0-4294b25cd060 | thinking-bzf/Cpp-coding | CppCourse/9-15.cpp | #include <iostream>
using namespace std;
template <class T>
void Downsort(T a[], int n)
{
int i = n - 1;
int cnt = 1;
while (i > 0)
{
int k = 0;
for (int j = 0; j < i; j++)
{
if (a[j] > a[j + 1])
{
T temp = a[j + 1];
a[j + ... | ALGO | 0.999955 | 4.651722 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2020-12-03T10:54:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8822ae39cac... |
6993bb29-0f76-438b-9af1-0c4e411fda90 | H-Shen/My_Code_Collection | Kattis/junk.cpp | // https://open.kattis.com/problems/junk
//
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t;
cin >> t;
int x1,x2,y1,y2,z1,z2,r1,r2,vx1,vx2,vy1,vy2,vz1,v... | ALGO | 0.999816 | 4.71556 | {
"github_metadata": {
"branch": "master",
"commit_count": 1586,
"repo_created_at": "2019-04-11T06:48:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b0bd25... |
17d0ea68-1225-402f-9e84-034b8338becc | Just1045523143/CamLaserCalibraTool | lClibra/src/LaseCamCalCeres.cpp | //
// Created by heyijia on 18-12-11.
//
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include "ceres/ceres.h"
#include "LaseCamCalCeres.h"
class CamScanPointsErr
{
private:
Eigen::Vector4d planar_;
Eigen::Vector3d point_;
public:
CamScanPointsErr(Eigen... | ALGO | 0.936351 | 4.162133 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-18T04:14: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": "5dc24d7d93... |
103b9d26-4933-40ba-89ec-b17785f555c6 | kzzz-jpg/CP | cpp/themeCP/4_d.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k;
int c[26], d[26];
string s, t;
void solve() {
for (int i = 0; i < 26; i++)
d[i] = c[i] = 0;
cin >> n >> k >> s >> t;
for (auto x : s)
c[x - 'a']++;
for (auto x : t)
d[x - 'a']++;
for (int i = 0; i < 26; i++)
if (c[i] != d[i])
return... | ALGO | 0.999971 | 4.052477 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2024-10-25T10:44: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": "6ed6b5d1b1... |
afac80a1-b7d4-4fa4-92d1-75dc5ddcbf1c | cocokechun/Programming | College/LeetCode/wordBreak2.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <utility>
#include <queue>
#include <stack>
#include <cstring>
#include <set>
#include <cstdlib>
#include <cstdio>
#include <functional>
#include <map>
#include <tr1/unordered_set>
#include <string>
using namespace std;
typedef long long ll;
class Solu... | ALGO | 0.999727 | 4.504538 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-09-02T17: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": "648c039454... |
39644172-a1d1-4fc6-aa81-4ff2bdf3dde4 | Yefri97/Competitive-Programming | Training/UVa/CP3/Problem Solving Paradigms/Greedy/10037 - Bridge.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
int main() {
int t; cin >> t;
while (t--) {
int n; cin >> n;
vector<int> velocity(n);
for (int i = 0; i < n; i++)
cin >> velocity[i];
sort(velocity.begin(), velocity.end());
vector<ii> path;
int ans = 0;
int a = 0, b = 1, x = ... | ALGO | 0.999901 | 3.414934 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2016-06-01T01:51:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f28e31d... |
d3f899d6-50f7-4692-b701-ebfb5acc23ec | AmrARaouf/algorithm-detection | graph-source-code/374-C/5469886.cpp | //Language: GNU C++
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <ctime>
#define inf 0x3f3f3f3f
#define Inf 0x3FFFFFFFFFFFFFFFLL
#define ... | ALGO | 0.999902 | 3.549098 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2015-11-10T10:51: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": "e9488e78ac... |
6d0b1d89-d9a8-46bc-a108-aed21e8d5ffa | PkuRainBow/leetcode-mianjing | strobogrammaticNumber.cpp | class Solution {
public:
bool isStrobogrammatic(string num) {
unordered_map<char, char> m {{'0', '0'}, {'1', '1'}, {'8', '8'}, {'6', '9'}, {'9', '6'}};
for (int i = 0; i <= num.size() / 2; ++i) {
if (m[num[i]] != num[num.size() - i - 1]) return false;
}
return true;
}... | ALGO | 0.999843 | 5.856864 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-07-17T13:39: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": "be17de8472... |
ae8d1bd4-efd6-4745-a7b1-861b3f9f7c14 | GabrielSpdf/CompetitiveProgramming | CodeForces/Rounds/Round887/c.cpp | // Not solved yet
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define FORI(sti, n) for(int i=(sti); i<(n); i++)
#define FORJ(stj, n) for(int j=(stj); j<(n); j++)
#define FORK(stk, n) for(int k=(stk); k<(n); k++)
#define tvi(v) FORI(0, (v).size()) cerr... | ALGO | 0.999964 | 3.780432 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2023-12-08T07:20: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": "ec1e3403b2... |
50bb44c3-a299-4c90-a603-fa7ffeffdaec | CoderSwarup/DSA_Mastery | 19_REVISION/1_ARRAY/3_HARD_PROBLEMS/8_Repeating_Missing_Num.cpp | #include<iostream>
using namespace std;
#include <bits/stdc++.h>
// Brute Force
// Time Complexity
// O(N2)
vector<int> RepeatingMissingNum(vector<int>arr){
int repeat =-1;
int miss = -1;
for(int i= 1 ; i<= arr.size() ;i++){
int count =0;
for(int j= 0 ; j< arr.size() ;j++){
... | ALGO | 0.999874 | 4.576911 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2024-01-02T14:47:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce35d8ca26... |
83635f4b-3a3c-4b38-b180-84f18716a1ac | khushigarg1/Problem-Solving-DSA | abdul_bari/treebst_revision.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public :
int data;
Node *left;
Node *right;
Node(int data)
{
this->data = data;
this->left = nullptr;
this->right = nullptr;
}
};
void inorder(Node *root)
{
if... | ALGO | 0.999961 | 5.109383 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-11-29T07:04: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": "93ce6226a988... |
b9cbcb56-ca02-43d1-a1de-64a0bd111152 | The-Streamliners/Data-Structures-and-Algorithms | DataStructures/String/isPalindrome.cpp | // A Simple C++ program to check if the
// given word is a Palindrome
#include <bits/stdc++.h>
using namespace std;
// Function to check Palindrome
bool isPalindrome(string str)
{
int n = str.length();
// Start checking if the letters at symmetrically
// opposite place is the same
for (int... | ALGO | 0.995995 | 5.081675 | {
"github_metadata": {
"branch": "main",
"commit_count": 545,
"repo_created_at": "2020-09-29T13:00:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23,
"forks": 103,
"issues": 20,
"pull_requests": 1
},
"file_meta": {
"content_id": "46a834d... |
cda74dae-cfcd-4ddd-a215-abefa53af8f6 | ndwannafly/Algorithm-and-CP | ADHOC/14 11/NUMPOLY.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define NMAX 100005
ll a[NMAX],b[NMAX];
int n;
ll sum[NMAX];
const ll base=1e5;
int main(){
freopen("NUMPOLY.inp","r",stdin);
freopen("NUMPOLY.out","w",stdout);
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
sort(a+1,a+n+1)... | ALGO | 0.999967 | 3.627783 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-03-31T19:08: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": "a6c1d8c3eb4b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.