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 |
|---|---|---|---|---|---|---|---|
c864d848-569f-40d3-9aad-6e1b0381dc16 | S96EA/PATBasic | patbasic/test1055.cpp | //
// Created by neild47 on 18-4-29.
//
#include <iostream>
#include <list>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;
class Student {
public:
int tall;
string name;
Student(int tall, string name) : tall(tall), name(std::move(name)) {}
bool operator<(Student &oth... | ALGO | 0.999938 | 4.337168 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-06-02T08:47: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": "12314416d4... |
fd2df0fc-34b5-4554-9076-51f0007d69fb | zshen0x/interviews | regularExpressionMatching.cc | #include <string>
#include <vector>
#include <cassert>
using namespace std;
class Solution {
public:
bool isMatch(string s, string p) {
// DP solution
vector<vector<bool>> match(s.size()+1, vector<bool> (p.size()+1, false));
// BC: [0, 1:p.len] false
// BC: [1:s.len ,0] false
... | ALGO | 0.999416 | 4.850384 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-05-10T09:47: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": "4397a7ad7... |
ae0b6688-381a-47c5-b6a8-c58338322065 | kaifenglu/lrstat | src/logistic_regression.cpp | #include <Rcpp.h>
#include <R_ext/Applic.h>
#include "utilities.h"
#include "logistic_regression.h"
using namespace Rcpp;
// log likelihood
double f_llik_0(int p, NumericVector par, void *ex) {
logparams *param = (logparams *) ex;
int n = param->n;
int person, i;
NumericVector eta(n);
for (person = 0; per... | ALGO | 0.99995 | 3.27457 | {
"github_metadata": {
"branch": "main",
"commit_count": 237,
"repo_created_at": "2023-02-06T18:48:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c45c3a326... |
18bd9c97-c760-4874-b0a2-109bf5fe1fe4 | Wilhelmshaven/PAT | 1071.cpp | //#include <iostream>
//#include <string>
//#include <map>
//#include <algorithm>
//#include <cctype>
//
//using namespace std;
//
//int main(void)
//{
// map<string, int> passage;
// map<string, int>::iterator iter;
// string input, word;
// int begin, end = 0, cnt = 0;
//
// getline(cin, input);
// int len = input.le... | ALGO | 0.999805 | 3.414658 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-07-14T15:40: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": "6c7a29b7e... |
fa56ddbe-abbc-47fc-947a-74c73c2fcbf7 | KanishkaMishra10/Data-Structures | Graph/BFS.cpp | //
// main.cpp
// BFS Graph
//
// Created by <NAME> on 5/12/21.
//
#include <iostream>
#include <stdlib.h>
using namespace std;
int visited[20];
int visited2[20];
class Node{
public:
Node *next;
int vertex;
Node(){
next=NULL;
}
};
class graph:public Node{
Node *list[20];
int no_o... | ALGO | 0.999061 | 3.983665 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-04-20T17:13: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": "986fc876971... |
0a5edc88-3fbf-41ea-9260-3b6d3161d12f | av1shek/All-Coding-Platform-Solutions | LeetCode/18. 4Sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
vector<vector<int> > res;
if (nums.empty())
return res;
sort(nums.begin(),nums.end());
for (int i = 0; i < nums.size(); i++) {
long long target_3 = (long long)target... | ALGO | 0.999988 | 5.886053 | {
"github_metadata": {
"branch": "master",
"commit_count": 523,
"repo_created_at": "2021-10-04T13:34:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 128,
"issues": 6,
"pull_requests": 1
},
"file_meta": {
"content_id": "388dc... |
0d99550e-4e10-43ef-9736-a53c934af0d2 | misztal/GRIT | GRIT/GRIT/include/grit_default_algorithm.h | #ifndef GRIT_DEFAULT_ALGORITHM_H
#define GRIT_DEFAULT_ALGORITHM_H
#include <grit_interface_algorithm.h>
#include <grit_interface_attribute_assignment.h>
#include <grit_batch.h>
#include <quality_measures/grit_always_bad_quality_measure.h>
#include <quality_measures/grit_interface_flatness_quality_measure.h>
#include ... | ALGO | 0.988378 | 5.221573 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2017-09-30T16:55:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 16,
"pull_requests": 0
},
"file_meta": {
"content_id": "4dea9e69... |
1d54981c-8a1d-42ed-94e7-03b70f3df407 | ishandutta2007/codeforces-m | monyura/normal/261/C.cpp | #ifdef _MONYURA_
#pragma comment(linker,"/STACK:256000000")
#endif
#include <iostream>
#include <cstdio>
#include <bitset>
#include <memory>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <string>
#include <cstring>
#include <fstream>
#include <functional>
#include <stack... | ALGO | 0.999916 | 3.793446 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc5d3ed9baa6... |
2591cc50-a8df-4261-bc1e-c29110b32765 | yzh123qwer/leetcode | 127.重新排列日志文件/reorderLogFiles.cpp | /*
937. 重新排列日志文件
给你一个日志数组 logs。每条日志都是以空格分隔的字串,其第一个字为字母与数字混合的 标识符 。
有两种不同类型的日志:
字母日志:除标识符之外,所有字均由小写字母组成
数字日志:除标识符之外,所有字均由数字组成
请按下述规则将日志重新排序:
所有 字母日志 都排在 数字日志 之前。
字母日志 在内容不同时,忽略标识符后,按内容字母顺序排序;在内容相同时,按标识符排序。
数字日志 应该保留原来的相对顺序。
返回日志的最终顺序。
示例 1:
输入:logs = ["dig1 8 1 5 1","let1 art can","dig2 3 6","let2 own kit dig","... | ALGO | 0.999287 | 5.385715 | {
"github_metadata": {
"branch": "main",
"commit_count": 319,
"repo_created_at": "2021-12-05T10:24: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": "b07d5b98a1... |
820a8a72-0840-4503-834f-52a78a13885a | priyobratabiswas/CS141 | lab4_q7.cpp | // to write a c++ programme to find the area of an equilateral triangle
// include the library
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cmath>
// use namespace
using namespace std;
//introduce the main function
int main ()
{
//design the programme to ask and disply user's name
string NAME;
cout... | ALGO | 0.994793 | 4.114635 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-08-09T10:21:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "081ff98f1... |
c2449d41-4959-4bb6-8fd3-436884ce3eb5 | imhnoyon/Data-Structure | module-6/insert_at_position.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int value;
node *next;
node(int value)
{
this->value = value;
this->next = NULL;
}
};
void insert_at_tail(node *&Head, int value)
{
node *newnode = new node(value);
if (Head == NULL)
{
Head = newn... | ALGO | 0.99955 | 4.610296 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-01T06:38:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4154538ed794... |
ed5d718c-568f-4e8f-9b22-aa22305c0180 | sandeepgill73/coding-practice | linked_list-insert-a-node-at-a-specific-positio.cpp | /*
Insert Node at a given position in a linked list
head can be NULL
First element in the linked list is at position 0
Node is defined as
struct Node
{
int data;
struct Node *next;
}
*/
Node* InsertNth(Node *head, int data, int position)
{
Node *new_pos = new Node();
new_pos->data = ... | ALGO | 0.999951 | 4.741402 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-12-08T01:40: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": "da3f29626a... |
1a834b27-09c0-474f-be29-c4f0e942c0b5 | mbankhar/Webserver | src/Config.cpp | #include "../include/Webserv.hpp"
#include "../include/Config.hpp"
#include "../include/ServerBlock.hpp"
Config::Config(const std::string& conf_path) : _config_path(conf_path)
{
parseConfig();
if (_server_blocks.empty()) {
throw std::runtime_error("No server blocks found in configuration.");
}
isValid();
}
Conf... | WEB | 0.915312 | 5.40509 | {
"github_metadata": {
"branch": "master",
"commit_count": 210,
"repo_created_at": "2024-11-25T12:23:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8b3327b... |
8cd53c68-9f5f-45b0-ae77-a41661cf7791 | limou3434/work-test-code | 2023归档/my_code_2023_10_25/my_code_2023_10_25/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
class Solution
{
public:
vector<int> relativeSortArray(vector<int> arr1, vector<int> arr2)
{
//cout存储数据的重复次数
vector<int> count;
count.resize(1001, -1);//可以存储1001个数据,下标从0到1000,初始化为-1
... | ALGO | 0.999974 | 4.597952 | {
"github_metadata": {
"branch": "main",
"commit_count": 959,
"repo_created_at": "2025-04-02T08:18: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": "52a2176775... |
11cc67b0-fff0-420c-8f50-71d038f15f1a | nctu16028/LeetCode | Binary_Tree/Easy/0404_Sum_of_Left_Leaves.cpp | #include <iostream>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(righ... | ALGO | 0.99973 | 5.997673 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-03-07T14:53: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": "24f59f099... |
69c17036-9903-4c54-bbc7-0e8821019e91 | SOUI2/soui | third-part/skia/src/pathops/SkDQuadIntersection.cpp | // Another approach is to start with the implicit form of one curve and solve
// (seek implicit coefficients in QuadraticParameter.cpp
// by substituting in the parametric form of the other.
// The downside of this approach is that early rejects are difficult to come by.
// http://planetmath.org/encyclopedia/GaloisTheo... | ALGO | 0.999949 | 4.783016 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2018-06-28T11:22:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 796,
"forks": 283,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "90811... |
04d3d78a-6e66-4c10-bbfd-6b4a2e3dbe94 | zsawaf/Inpainting | partA/src/inpainting/inpainting_algorithm.cxx | //
// THIS CONTAINS THE TOP-LEVEL ROUTINES FOR
// THE INPAINTING ALGORITHM
//
// YOU NEED TO READ & UNDERSTAND THE ROUTINES HERE
// VERY WELL, BUT DO NOT MODIFY THIS FILE!!!!
//
#include "inpainting.h"
#include "inpainting_eval.h"
//
// The Exemplar-Based Inpainting algorithm
//
//
bool inpainting::compute()... | ALGO | 0.99959 | 7.082403 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-09-06T22:09:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "504819697c... |
827aebf0-662e-458e-80a5-a2969a96eef5 | yanhongjuan/Algorithm | stack_queue/stack_popu_31.cpp | /*@brief:给定两个序列,判断第二个序列是否是第一个序列弹出序列*/
/*@note:第一个序列的顺序为该序列的入栈顺序*/
#include <iostream>
#include <stack>
using namespace std;
bool Test(int *pPush,int *pPop,int n)
{
bool beStack = false;
const int *pNextpush = pPush;//下一个要压入辅助栈的元素
const int *pNextpop = pPop;//序列2中下一个弹出的值
stack<int> HelpStack;
if(pNex... | ALGO | 0.987441 | 5.307365 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-11-22T09:25: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": "7d18d323c7... |
8e92b8da-c48d-46b9-b9f5-68e0e616b131 | Creamy1137689/kyopro | solved/synthetic_kadomatsu.cpp | #include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int ... | ALGO | 0.999939 | 3.42487 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-05-22T15:25: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": "535ceb629... |
69b67baf-7111-4fab-bef7-e041a5b1fd89 | linkumokunn/code_la | NEOJ/60.cpp | /*
=============================================================================
/\ \ / /\ |\ /| |===========
/ \ \ / / \ | \ / | |
/ \ \ / / \ | \ / | |
/ \ | / \ | \... | ALGO | 0.999954 | 3.844815 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2021-11-23T02:23:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca2358c6e7... |
56474f71-60af-44bf-bd11-db9aed772001 | sqmedeiros/sblp2023-time-vs-energy | 1634-Minimizing_Coins/c++/slow/4185201.cpp | // Author: OptimalKnight
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <chrono>
using namespace std;
using namespace __gnu_pbds;
using namespace chrono;
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
//#pra... | ALGO | 0.999804 | 4.42757 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2023-07-26T18:18: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": "9cc9f8aac1... |
11d831b8-2621-4547-b759-0523c6022f08 | micmacIGN/micmac | BenchElise/bench/b_0_46_2.cpp | /*eLiSe06/05/99
Copyright (C) 1999 <NAME>
eLiSe : Elements of a Linux Image Software Environment
This program 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 2 of the License, or
(at yo... | ALGO | 0.997427 | 4.120242 | {
"github_metadata": {
"branch": "master",
"commit_count": 10879,
"repo_created_at": "2016-11-24T22:09:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 163,
"issues": 83,
"pull_requests": 30
},
"file_meta": {
"content_id": "b... |
13e73c39-632a-45ad-9065-286f9e2fff88 | lattice/quda | include/gauge_path_quda.h | #pragma once
namespace quda
{
/**
@brief Compute the gauge-force contribution to the momentum
@param[out] mom Momentum field
@param[in] u Gauge field (extended when running on multiple GPUs)
@param[in] coeff Step-size coefficient
@param[in] input_path Host-array holding all path contributio... | ALGO | 0.98923 | 4.062882 | {
"github_metadata": {
"branch": "develop",
"commit_count": 15249,
"repo_created_at": "2011-01-27T21:11:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 326,
"forks": 109,
"issues": 204,
"pull_requests": 16
},
"file_meta": {
"content_id": ... |
3190573f-1f00-4c20-963d-22bec7455a2c | jiadaizhao/LeetCode | 1301-1400/1361-Validate Binary Tree Nodes/1361-Validate Binary Tree Nodes.cpp | class Solution {
public:
bool validateBinaryTreeNodes(int n, vector<int>& leftChild, vector<int>& rightChild) {
vector<int> degree(n);
for (int i = 0; i < n; ++i) {
if (leftChild[i] != -1 && ++degree[leftChild[i]] > 1) {
return false;
}
if (rightCh... | ALGO | 0.999967 | 6.051499 | {
"github_metadata": {
"branch": "master",
"commit_count": 211,
"repo_created_at": "2017-08-08T05:57:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 38,
"forks": 21,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "8ee050... |
2290b97d-574c-4e16-8419-ccff9af892bb | Qipu1220/BaiTapMaTran | 23520493_23521082_23521462_23521604_23521672_BT04/Bai103/Bai103.cpp | #include<iostream>
#include<iomanip>
using namespace std;
void Nhap(int[][20], int&, int&);
void Xuat(int[][20], int, int);
int TonTaiHoanThien(int[][20], int, int);
int main()
{
int a[20][20];
int k, l;
Nhap(a, k, l);
Xuat(a, k, l);
cout<<TonTaiHoanThien(a, k, l);
return 0;
}
void Nhap(int a[][20], int& m, in... | ALGO | 0.999666 | 3.345594 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-10-11T15:00: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": "078015fb0ac... |
caa07d4e-f603-4f33-b180-a7f4b1345f14 | ishan-backend/data-structures | Priority Queue/InplaceHeapSort.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Inplace Heap sort:
Building Heap in given array only, not taking additional place
Assume First elem considered inside heap, Rest n-1 elements to be inserted yet into heap.
CBT is fulfilled but Heap order isnt yet
INsert: compare coming elem with parent, and as required... | ALGO | 0.999941 | 4.849221 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-04-22T17:00:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b33f064ba... |
869d1497-f7de-4191-a9a7-f7eb79069cc8 | d891320478/ACMICPC | graph/MinimumArborescence2.cpp | //HDU 2121最小树形图
#define N 1111
#define M 11111
int eu[M],ev[M]; long long ew[M],emax,in[N],ans;
int pre[N],id[N],vis[N]; int n,m,ansi;
long long directed_mst(int rt,int n,int m)
{
long long ret=0; int i,u,v;
while (1)
{
for(i=0;i<n;i++) in[i]=id[i]=vis[i]=-1;
for(i=0;i<m;i++)
{
... | ALGO | 0.999948 | 3.534745 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2013-06-26T14:50:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52e99c373... |
53b9ca0e-af7c-44d5-9fb8-97e3d8d06fd2 | Chinesezjc/Solved-Problems | CodeForces/CF1598D.cpp | // This Code was made by Chinese_zjc_.
#include <bits/stdc++.h>
// #define debug
int T, n;
long long ans;
std::map<int, int> mapA, mapB;
struct node
{
int a, b;
} a[200005];
signed main()
{
std::ios::sync_with_stdio(false);
std::cin >> T;
while (T--)
{
ans = 0;
std::cin >> n;
... | ALGO | 0.999967 | 4.469028 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2020-12-29T10:37: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": "6be177023... |
c79e48fd-6457-4376-9174-400425fa3463 | spravinkumar9952/Tech-Dose-Training | Chapters/Arrays/295. Find Median from Data Stream.cpp | The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value and the median is the mean of the two middle values.
For example, for arr = [2,3,4], the median is 3.
For example, for arr = [2,3], the median is (2 + 3) / 2 = 2.5.
Implement the MedianFinder class:
Me... | ALGO | 0.999969 | 6.265299 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2022-08-25T17:47: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": "a401dc3e057... |
8ec95d08-47b4-4f5a-97de-6c9c4182a438 | vexcode-2020/Team_23880E-Skills-Code | src/odometry.cpp | #include "odometry.h"
//CONSTANTS / Hard-Coded Values
//Radius of tracking wheels in inches
double WHEEL_RADIUS = 1.379; //was 1.379 //1.43
//Starting angle (relative to field) (RADIANS)
double THETA_START = M_PI; //imagine the field is a unit circle
//The starting x and y coordinates of the bot (INCHES)
//These d... | ALGO | 0.994596 | 4.746776 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-06-20T21:55:30.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "kevin23880E/23880E-Skills-Code",
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"... |
0ce5a0da-6479-45d7-90ce-4c0e41cd58bf | Lordetsky/C-plus-plus-2024 | week8/task02/main.cpp | ///Imagine you are conducting a survey among the residents of a city on the topic
///of "Your favorite season". The answers are collected in the form of a string,
///where each letter represents the respondent's choice:
///
///W for winter,
///S for spring,
///U for summer, and
///A for autumn.
///Your task is to analy... | ALGO | 0.999004 | 6.629059 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2024-01-10T15:11:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9911169ec3d... |
df860096-b891-4924-a182-98bd073d672f | ttap0704/c-_algorithm | algorithm/week_7_test/2342_a.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int N, n, a[100004], dp[100004][5][5];
int addScore(int here, int there) {
if (here == there) {
return 1;
} else if (here == 0) {
return 2;
} else if (here % 2 == there % 2) {
return 4;
} else {
return 3;
}
}
int go (int idx... | ALGO | 0.999837 | 4.20157 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2023-03-05T05:44: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": "4f94636b584... |
17b1f609-49f6-4132-9f69-ea925261ef02 | JesseTsou/algorithms_interview_learn | 92 reverseLinkedList2/main.cpp | #include <iostream>
using namespace std;
/*
* 反转从位置 m 到 n 的链表。请使用一趟扫描完成反转。
*/
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
/*
* 时间复杂度:O(n)
* 对于m=1的情况需要作特殊处理。
*/
ListNode* reverseBetween(ListNode* head, int m, int n... | ALGO | 0.999993 | 5.09054 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2018-07-22T16:04: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": "2278ec59... |
ec8f0361-1f45-4638-9c42-51b916177b9d | InsightSoftwareConsortium/ITK | Modules/Segmentation/LevelSets/include/itkThresholdSegmentationLevelSetFunction.h | /*=========================================================================
*
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.o... | TOOL | 0.946316 | 7.423834 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "9... |
12533964-6e0e-4087-b85c-25133459c39d | OpenTTD/OpenTTD-Deprecated | src/core/math_func.cpp | /* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD 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, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without... | ALGO | 0.996827 | 7.477239 | {
"github_metadata": {
"branch": "master",
"commit_count": 22771,
"repo_created_at": "2013-07-24T10:19:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 181,
"forks": 32,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b068... |
4c95ee3b-4890-462a-a395-70bd8e5ea715 | GaryDoooo/kaitou_codes | not_kaitou/tigao/a104/ans.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n + 5];
for (int i = 1; i <= n; i++) cin >> a[i];
int l;
cin >> l;
int q;
cin >> q;
for (int i = 0; i < q; i++) {
int s, e, res = 0;
cin >> s >> e;
int step = (e > s ? 1 : -1);
... | ALGO | 0.999986 | 4.462805 | {
"github_metadata": {
"branch": "main",
"commit_count": 255,
"repo_created_at": "2021-03-28T16:55: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": "15de60ee1b... |
042986e2-a575-4489-9d58-d8107127567a | callistusystan/Algorithms-and-Data-Structures | Codeforces/solved/731C/731C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
vi color(2e5+5), visited(2e5+5);
vector<vi> adjList(2e5+5);
void dfs(int u, vi &vertices) {
visited[u] = 1;
vertices.push_back(u);
for (int v : adjList[u]) if (!visited[v]) dfs(v, vertices);
... | ALGO | 0.999955 | 3.922096 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2017-12-08T13:00:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "970cd723a... |
4a03a63b-3c65-491f-b5ec-935d426b045a | daerong/Algorithm_Practice | hackerrank/Daeseong/sherlock_and_array_U.cpp | // start : pm 10:27
// end : pm 11 : 10
// DP로 풀이
// 왼쪽부터 SUM을 담는 배열, 오른쪽부터 SUM을 담는 배열을 준비하고
// n을 기준으로 n-1과 n+1이 같으면 YES
// 몇몇 예외에 관해서 예외처리
// 1. 배열의 끝은 한쪽이 0인경우에 해당
#include <iostream>
#include <string>
using namespace std;
int N;
int *arr_vol;
int **arrs;
void input() {
cin >> N;
arrs = new int *[N];
arr_vol... | ALGO | 0.999909 | 3.634566 | {
"github_metadata": {
"branch": "master",
"commit_count": 437,
"repo_created_at": "2020-04-02T10:11:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fe1ed23... |
81f0d97f-fe83-4245-b079-3fdace516f82 | Hari-Shankar-Karthik/AVL-RB-Trees | AVLTree.cpp | #include "AVLTree.h"
int AVLTree::getHeight(TreeNode *curr) const
{
if (!curr)
{
return 0;
}
return curr->height;
}
int AVLTree::getBalanceFactor(TreeNode *curr) const
{
return getHeight(curr->left) - getHeight(curr->right);
}
void AVLTree::calcHeight(TreeNode *curr)
{
curr->height = ... | ALGO | 0.950231 | 6.083203 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-09-27T04:05: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": "c1bad9da10... |
93dccff2-31c3-403b-93ef-d378487cb511 | DMALab/Sys-TM | src/include/model/jointlda.h | #pragma once
#include <model/word_first_base.h>
#include <set>
#include <omp.h>
namespace systm
{
class JointLDA : public WordFirstBase {
public:
JointLDA(int n_topics, float alpha, float beta, std::string dictionary_path,
int long_doc_threshold = 300, int mh_step = 2)
: WordFirstBase(n_topics, a... | ALGO | 0.982067 | 6.173681 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-06-04T11:17:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6fc4371a94... |
5cedacfe-0ca5-4b08-8e31-e1f1e9271f92 | orange-studios/ntfs-3g-for-android-9.0 | system/vold/Utils.cpp | /*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | TOOL | 0.918257 | 6.28625 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-05-09T07:51:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 10,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e08878... |
5dc148e9-a892-42ec-96d4-5d2bb51baf0d | JeongSooHyeon/Algorithm | Chapter07_DivideConquer/Ex7-4_Karatsuba/Source.cpp | #include <iostream>
#include <vector>
using namespace std;
void normalize(vector<int>& num) {
num.push_back(0);
// 자릿수 올림 처리
for (int i = 0; i + 1 < num.size(); ++i) {
if (num[i] < 0) {
int borrow = (abs(num[i]) + 9) / 10;
num[i + 1] -= borrow;
num[i] += borrow * 10;
}
else {
num[i + 1] += num[i] ... | ALGO | 0.999903 | 4.264233 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2023-06-13T15:03: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": "ae6479de8... |
4bfe7659-d587-4de7-a4f7-d56d771bf985 | Gir31/STL_---- | tu78th23/2025_1_STL/0410.cpp | //------------------------------------------------------------------------
// 2025.04.10
// 중간고사 - 4월 24일 목요일 (8주 2일)
// 과제설명 - 4월 10일 목요일
//------------------------------------------------------------------------
// class STRING - STL 정식 컨테이너처럼 동작하는 자료구조
//-------------------------------------------------... | ALGO | 0.996984 | 4.696609 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-04-12T02:34: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": "c67a4a4b112c... |
14abc92c-5b6d-4c5e-9383-273eaf6624d6 | siddhant21074/DAA | DAA_C2_Subset.cpp | // Implement Subset Sum Problem.
// Statement Given a set of non-negative integers and a
// value sum, the task is to check if there is a subset of the
// given set whose sum is equal to the given sum.
// Input: set[] = {3, 34, 4, 12, 5, 2}, sum = 9
// Output: True
// Input: set[] = {3, 34, 4, 12, 5, 2}, sum = 30
// Ou... | ALGO | 0.999844 | 5.226488 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-08-21T03:01: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": "6638738015d5... |
e24d446a-eab0-4562-a926-3bb06dbfed89 | VA-007/CPP-Code | Udemy Course Challenges/Section 8 Challenge.cpp | #include<iostream>
using namespace std;
int main()
{
const int one_dollar {100};
const int one_quater {25};
const int one_dime {10};
const int one_nickel {5};
const int one_penny {1};
cout<<"Welcome to Vishank's currency change Provider! \n \n";
cout<<"======================================= \n \n";
cou... | ALGO | 0.980209 | 3.698364 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-07-14T18:18: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": "926ea337a... |
add993de-f5b5-4b9e-a619-5c7508fc0b5b | keijak/comp-pub | atcoder/typical90/037/main2.cpp | #include <bits/stdc++.h>
using Int = long long;
template <typename T, typename U>
inline bool chmax(T &a, U b) {
return a < b and ((a = std::move(b)), true);
}
using namespace std;
Int solve() {
Int W, N;
cin >> W >> N;
vector<Int> dp1(W + 1, -1LL);
dp1[0] = 0;
for (int i = 0; i < N; ++i) {
Int l, r,... | ALGO | 0.999871 | 4.530173 | {
"github_metadata": {
"branch": "master",
"commit_count": 2362,
"repo_created_at": "2020-04-12T08:07: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": "0badd88... |
accfbc88-f683-4c50-93b9-e23f7707e644 | kateBea/FIB-PRO1-Programacion-I | Problemas de Jutge/P08 - Multidimensional Arrays/P18660.cc | // P18660 WORD SEARCH
#include <iostream>
#include <vector>
using namespace std;
typedef vector< vector<char> > Matrix;
void MakeUppercase(char& c) {
if (c >= 'a' and c <= 'z')
c += 'A' - 'a';
}
char lowerCase(char c) {
if (c >= 'A' and c <= 'Z')
return c - 'A' + 'a';
return c;
}
void testDirections (in... | ALGO | 0.999776 | 3.863189 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2022-08-13T05:28:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e3ea2217b0... |
1507224f-89f9-41a3-a2ab-c46fa77fc4b7 | rafalit/CPP_projects | lab13_mystring/mystring.h | #include <iostream>
#include<cstring>
#include <string>
#include <cctype>
#include <set>
#include <string>
#include <map>
#include <sstream>
#include <algorithm>
#include <cctype>
#include <random>
#include <algorithm>
#include <iterator>
#ifndef ZAD14MYSTRING_DLASTUDENTOW_MYSTRING_H
#define ZAD14MYSTRING_DLASTUDENTOW_... | TOOL | 0.917528 | 4.675822 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-03-04T22:51:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "499b8319fe3... |
4e913a69-0ee3-493b-a6f8-f2f69a7aff13 | Alfa614/DSA | 8c_nCr.cpp | #include <iostream>
using namespace std;
int factorial(int n)
{
int fact;
if (n == 1 || n == 0)
return 1;
else
return (n * factorial(n - 1));
}
int nCr(int n, int r)
{
cout << "Factorial of n is " << factorial(n) << endl;
cout << "r! is " << factorial(r) << endl;
cout << "n-r! i... | ALGO | 0.99975 | 5.50561 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-02T15:19: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": "669aa9d28bc... |
56651079-00ac-4354-8f5d-b872fa2dca75 | raincross7/code-similarity | codes/train_code/problem174/problem174_14.cpp | #include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for... | ALGO | 0.999911 | 4.534342 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07: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": "aba5e4172619... |
f82f80a3-ebad-4032-8ead-b6965f4107d9 | nappaillav/DSA | trie.cpp | #include <bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
using namespace std;
// Alphabet size (# of symbols)
#define ALPHABET_SIZE (26)
// Converts key current character into index
// use only 'a' through 'z' and lower case
#define CHAR_TO_INDEX(c) ((int)c - (int)'a')... | ALGO | 0.99993 | 3.505347 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-12-06T19:02: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": "2a55f75229... |
1e1d18d8-c618-4fe1-aaa3-ac2c80c094c5 | asvkarthick/Algorithms | Leetcode/Facebook/Design/program-001.cpp | /* Problem: Add and search word - Data Structure Design
* Weblink: https://leetcode.com/explore/interview/card/facebook/56/design-3/300/
* Author : <NAME>
* E-mail : <EMAIL>
*/
class Trie {
public:
Trie() : isEnd(false) {
}
void insert(string word) {
int len = word.length();
Trie *t = ... | ALGO | 0.999564 | 5.843012 | {
"github_metadata": {
"branch": "master",
"commit_count": 511,
"repo_created_at": "2018-06-25T04:53: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": "c098f81b... |
6cb0a30d-b1ec-44d5-8233-cfb8933bfc7f | valentine9510/Leetcode-Solutions | Blind75 Questions/Leetcode Problems/swap_endians.cpp | // C++ program to print the difference
// of Alternate Nodes
#include <bits/stdc++.h>
using namespace std;
// Function to swap a value from
// big Endian to little Endian and
// vice versa.
int swap_Endians(int value)
{
// This var holds the leftmost 8
// bits of the output.
int leftmost_byte;... | ALGO | 0.998906 | 4.896318 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2021-03-01T06:08:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8566296fa52... |
b6c6efa7-82bc-497a-acef-b93dadc1f3f9 | pillowpilot/problem_solving | UVa/10067 - Playing with Wheels/code.cpp | #include <cstdio>
#include <vector>
#include <queue>
#include <limits>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> v3i;
typedef vector<v3i> v4i;
vvi forbiddents;
struct par{
vi point;
int distance;
par(vi point, int distance):point(point), distance(distance){}
vo... | ALGO | 0.999836 | 4.3112 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2016-12-27T20:43: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": "30388d794... |
7aa66314-0be8-4e3f-8284-6d2317d18e5e | stevenewald/fractal-generator | source/graphics/aspect_ratio/aspect_ratio.cpp | #include "aspect_ratio.hpp"
#include "units/display_domain.hpp"
namespace fractal {
DisplayDomain calculate_rectangle_end_points(
display_coordinate start, display_coordinate current, float target_aspect_ratio
)
{
auto width = static_cast<float>(std::abs(current.x - start.x));
auto height = static_cast<f... | TOOL | 0.95273 | 6.997298 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2024-11-22T21:14:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "641debc900c... |
bbfe774a-f47a-44d9-8db1-73bd8b8506e1 | mnwanx/water_distribution_system | backup.cpp | /*
Student Name : <NAME>
Student ID : 2023680886
Project Title : Water Distribution System
*/
#include <iostream>
#include <vector>
using namespace std;
// superclass: Water System Component
class WaterSystemComponent {
protected:
string name;
double pressure, flowRate;
public:
WaterSystemCompon... | ALGO | 0.984367 | 5.952697 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2025-02-08T10: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": "e9ea3ea497... |
4c7ba92a-0cb1-442f-8369-1504d593643e | Alquama00s/Competitive-Coding | Codechef/longchallenges/21-1-janlong/p5_1.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#define ll long long
using namespace std;
void print(vector<int> a) {
for (size_t i = 0; i < a.size(); i++) {
cout << a[i] << " ";
}
cout << "\n";
}
vector<int> subsetSum(vector<int> &el, int sum) {
vector<vector<int>> dp, dp2;
... | ALGO | 0.999875 | 3.64111 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-08-17T20:18:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b6edab83... |
b6412029-cacc-4d73-99f7-287d67e4841e | AmanPachauria/DSA_SHEET | Binary_Search/Single_Element_in_a_Sorted_Array.cpp | // Solution 1
class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
if(nums.size()==1) return nums[0];
int left = 0, right = nums.size()-1;
while(left<=right){
int mid = (left+right)/2;
int a = -1, b = -1;
if(mid-1>=0){
a = nu... | ALGO | 0.999986 | 5.515538 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2023-07-27T05:13: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": "8144eae6144... |
44a9d7a3-7320-463b-89e7-b53cd731d459 | adrianaszhar/lab_desain-Analisis_Algoritma-Sorting | Tugas-2/tugas adrian merge sort.cpp | #include <iostream>
using namespace std;
void print(int arr[], int size) {
for (int i = 0; i < size; i++) {
cout << arr[i];
if (i < size - 1) cout << ", ";
}
cout << "]" << endl;
}
void merge(int arr[], int low, int mid, int high, int& comparisons, int& movements) {
int leftSize = mid... | ALGO | 0.99988 | 5.284199 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2024-03-15T13:59:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "016717f33a9... |
e46976ae-1130-41ef-94d2-81f26a619fb9 | coderinblack08/cf-atc-usaco | codeforces/451B.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n), b;
for (int i = 0; i < n; i++) cin >> a[i];
b = a;
map<int, int> mp;
sort(b.begin(), b.end());
for (int i = 0; i < n; i++) mp[b[i]] = i;
for (int i = 0; i < n; i++) a[i] = mp[a[i]];
i... | ALGO | 0.999988 | 3.440424 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-12-21T03:21:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "735c6a6f1b... |
d7d85580-6d61-4357-892f-328470045887 | llvm/llvm-project | lldb/source/Interpreter/Options.cpp | //===-- Options.cpp -------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.910658 | 7.036728 | {
"github_metadata": {
"branch": "main",
"commit_count": 545188,
"repo_created_at": "2016-12-07T09:39:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33545,
"forks": 14484,
"issues": 5000,
"pull_requests": 5000
},
"file_meta": {
"content_... |
8bf21796-09c0-4b1d-9848-204822bf25b3 | Monoswita-94/UVa-Online-Judge-problem-solving | UVa & Online judge problem solving/UVa12289.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
// Function to check if two words have at most one mismatch
bool isOneMismatch(const string& word, const string& target) {
int mismatchCount = 0;
for (size_t i = 0; i < word.size(); i++) {
if (word[i] != ... | ALGO | 0.999854 | 5.694711 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-16T14:36: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": "6818ef381a2a... |
e4ebc297-b11e-4c6e-94ed-e10690c83c86 | DraghiciAlexandru/VarinateBac | VarianteBac/Varianta20.h | #include <iostream>
#include <fstream>
using namespace std;
void SolutieS2E2()
{
int v[5][5];
for (int i = 0; i < 4; i++)
for (int j = 0; j < 4; j++)
{
if (i == j)
v[i][j] = 1;
else if (i + j == 3)
v[i][j] = 7;
else
v[i][j] = j + 1;
}
for (int i = 0; i < 4; i++)
{
for (int j = 0; j <... | ALGO | 0.999116 | 3.581438 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-09-10T16:18: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": "1aecbc64476d... |
a7cbcc41-7d82-4d74-9be4-ef610f30bd46 | BoguslawBanas/Algorithms_and_Data_Structures_II | fortel_krola2.cpp | #include <iostream>
#include <list>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <climits>
using std::cin;
using std::cout;
using std::list;
using std::queue;
using std::set;
using std::map;
class Bipartite_Graph{
public:
int size;
list<int>*adj_list;
list<int>black_paw... | ALGO | 0.999918 | 4.517366 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-05-12T09:40: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": "4429e4f2a96e... |
2b4698e0-ccb9-4393-b8a8-ebed4c3d2bfc | Team-CTK/Training | 2017Training/8.22/1005E.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<map>
#include<cmath>
#include<vector>
#include<stack>
#include<climits>
#include<ctime>
#include<queue>
#define FILEIN freopen("in.txt", "r", stdin)
#define FILEOUT freopen("out.txt", "w", stdout)
#define CLOSEIO ios::sy... | ALGO | 0.999908 | 3.370191 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-09-12T12:12:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb84f86946... |
e36a6724-9e52-4651-8632-3026a8ccd449 | ryo-manba/Kyopro_Educational_90 | Problems/014.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
struct fast_ios { fast_ios(){ cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(20); }; } fast_ios_;
const int INF = (int)1e9;
const ll INFL = (ll)1e18;... | ALGO | 0.999949 | 3.811903 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2021-03-31T11:05: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": "c5a3f425b7c... |
d3269caf-f7c1-460c-a937-e1f1e24f9e12 | ishandutta2007/codeforces-n | nehnait/normal/1314/A.cpp | //Author:xht37
#include <bits/stdc++.h>
#define ui unsigned int
#define ll long long
#define ul unsigned ll
#define ld long double
#define pi pair <int, int>
#define fi first
#define se second
#define mp make_pair
#define ls (p << 1)
#define rs (ls | 1)
#define md ((t[p].l + t[p].r) >> 1)
#define vi vector <int>
#d... | ALGO | 0.999889 | 3.550031 | {
"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": "a790e6015428... |
7eb2656c-4080-4ccc-95df-a31bffcf201f | Potato3852/HSE_learning | HSE_student/algosi/contest4/9.cpp | //-Как поймать тигра в клетку?
//-Никак, тигры бывают только в полоску.
#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <string>
#include <algorithm>
class Queue {
private:
struct Node {
int value;
Node* next;
};
Node* front;
Node* back;
int ... | ALGO | 0.999984 | 5.561611 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-12-21T11:13: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": "c713061a397... |
c2e6cd21-c7fe-4f95-94b5-c07183bf3b3f | SE-OOP/Assignment_08 | 201816040201/Ex18_04/Array.h | #include<bits/stdc++.h>
using namespace std;
template<typename T>
class Array
{
friend ostream& operator<<(ostream& output,const Array& op)
{
for (size_t i = 0; i < op.size; i++)
{
output << setw(12) << op.ptr[i];
if ((i + 1) % 4 == 0)output<<endl;
}
if (op.size % 4 != 0)output << endl;
return output;
}
frie... | TOOL | 0.907731 | 3.484926 | {
"github_metadata": {
"branch": "master",
"commit_count": 363,
"repo_created_at": "2019-12-14T14:09:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 78,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65ce7a1... |
fb76ad7d-5cd9-4d14-a1ff-d3d464cabc4e | adnanaziz/EPIJudge | epi_judge_cpp_solutions/search_for_missing_element.cc | #include <vector>
#include "test_framework/generic_test.h"
#include "test_framework/serialization_traits.h"
using std::vector;
struct DuplicateAndMissing {
int duplicate, missing;
};
DuplicateAndMissing FindDuplicateMissing(const vector<int>& A) {
// Compute the XOR of all numbers from 0 to |A| - 1 and all entr... | ALGO | 0.997982 | 5.965613 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2017-12-21T06:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2874,
"forks": 1899,
"issues": 47,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
95ae2f07-ab97-4f00-a732-1792a489781d | skb15428/Algorithms | Graph/BFS.cpp | #include <bits/stdc++.h>
using namespace std;
// Time Complexity - O(V+E)
// Space Complexity - O(V)
vector<int> bfsOfGraph(int V, vector<int> adj[])
{
bool vis[V] = {0};
vis[0] = 1;
queue<int> q;
q.push(0);
vector<int> bfs;
while (!q.empty())
{
int n = q.front();
q.pop();... | ALGO | 0.999988 | 5.430768 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2021-01-15T12:02: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": "efcc0662684... |
15688ca6-1216-49d3-820a-0994beafa144 | ishandutta2007/codeforces-k | kenaj712/normal/1666/I.cpp | #include<bits/stdc++.h>
using namespace std;
int scan(int a, int b)
{
cout<<"SCAN "<<a<<" "<<b<<'\n';
cout.flush();
int c;
cin>>c;
return c;
}
bool dig(int a,int b)
{
cout<<"DIG "<<a<<" "<<b<<'\n';
cout.flush();
int c;
cin>>c;
return c;
}
void solve()
{
int a,b;
cin>>a>>b... | ALGO | 0.999515 | 3.312172 | {
"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": "689a7322cb3d... |
11dc36ce-d74f-4a2e-9384-73075af55cd0 | RiazullJannat/DSA | Week-3/Module-9/insert-at-tail.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int value;
Node *prev;
Node *next;
Node(int val)
{
this->value = val;
this->prev = NULL;
this->next = NULL;
}
};
void print_forward(Node *head)
{
while (head != NULL)
{
cout << head->value ... | ALGO | 0.998933 | 4.246923 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2025-06-19T09:53:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "387afe0adb8... |
7577e077-ea64-4d8e-b716-7886fd45ace8 | arnav-kansal/parallelMF | source/pmf.cpp | //The name on top of each function is only of the person who wrote
//majority of that function and implemented the first version.
//Both of us worked on the whole code eventually because of debugging,
//integrating the code, and for error resolution.
#include "pmf.h"
#include "sched.h"
#include <iostream>
#include <o... | ALGO | 0.999655 | 3.576018 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2018-04-08T00:42: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": "4c5b268ac... |
18250b1c-4219-492f-b974-4d423584fdf1 | jerry25219/Sanmill | src/self_play.cpp | // SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (C) 2019-2025 The Sanmill developers (see AUTHORS file)
// self_play.cpp
#include "self_play.h"
#include "position.h"
#include "search.h"
#include "search_engine.h"
#include "engine_commands.h"
#include "thread_pool.h"
#include <iostream>
#include <thread>
#in... | ALGO | 0.996542 | 6.068097 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-07-12T08:07:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c54fcf5783... |
42edb59d-53cb-44ca-9448-39505775bc9b | the-hyp0cr1t3/Codeforces-submissions | codeforces/1372/C.cpp | /**
* the_hyp0cr1t3
* 11.07.2020 20:53:49
**/
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
// #define int long long
#define endl "\n"
#define ff first
#define ss second
#define rev(Aa) reverse(Aa.begin(),Aa.end())
#define all(Aa) Aa.begin(),Aa.end()
#define ins insert
#defin... | ALGO | 0.999905 | 3.635636 | {
"github_metadata": {
"branch": "master",
"commit_count": 1581,
"repo_created_at": "2020-12-22T13:01:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40c80a3... |
6f232875-74ab-46cb-8ce7-254ac8c593e2 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/04/0425/personal_submission/cf1114c_liketheflower.cpp | //https://codeforces.com/contest/1114/submission/258053985
#include<iostream>
#include<vector>
using namespace std;
using LL = long long;
using PLL = pair<LL, LL>;
const LL INF = 0x3f3f3f3f3f3f3f3f;
int main(){
LL n, b;
cin >> n >> b;
vector<PLL> prime_factor_cnt;
for (LL i = 2; i * i <= b; i++){
... | ALGO | 0.999776 | 4.567413 | {
"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": "4618... |
10e8e8aa-f108-473d-bcb3-7db563146fc3 | benijohn/cpp | cppProjects/udemyCppbeginTobeyond/section10_CharactersAndStrings/letterPyramidChallenge/src/main.cpp | #include <iostream>
#include <string>
using namespace std;
int main () {
string pyramid_string {};
string reverse_pyramid {};
string pyramid_copy {};
string spaces {};
cout << "Please enter a string to turn into a pyramid: " << endl;
getline(cin, pyramid_string);
for (char c: pyramid_s... | ALGO | 0.999932 | 4.934007 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2022-06-23T19:01: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": "779f3150e6b... |
7e98aa86-5865-4a01-b167-c13594da05b9 | Geant4/geant4 | source/processes/hadronic/models/inclxx/incl_physics/src/G4INCLDeuteronDensity.cc | //
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration... | ALGO | 0.926494 | 6.458714 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2016-06-21T08:25:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 705,
"forks": 340,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "bef9d2... |
ac1ee778-274b-4aac-95c6-83f20814c615 | rdkit/rdkit | Code/ForceField/UFF/Inversions.cpp | //
// Copyright (C) 2024 <NAME> and other RDKit contributors
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#include "Inversions.h"
#inc... | ALGO | 0.997639 | 5.892688 | {
"github_metadata": {
"branch": "master",
"commit_count": 8182,
"repo_created_at": "2013-05-12T06:19:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3003,
"forks": 931,
"issues": 110,
"pull_requests": 25
},
"file_meta": {
"content_id": "... |
527df82f-05bd-481c-b429-b679b57baafd | sidjha57/Coding | C++/Codechef/Optimal_Denomination.cpp | //template
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
//typedef trie<strin... | ALGO | 0.999507 | 4.356874 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-04-13T07:03: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": "ccb9a2c1e38a... |
f1967d2f-8052-4c8a-8001-eefe43440bc4 | Sudhanva-Nadiger/DSA | 1584-min-cost-to-connect-all-points/1584-min-cost-to-connect-all-points.cpp | class Solution {
public:
const static int maxN = 20001;
int par[maxN], size[maxN];
int findPar(int x) {
if(par[x] == x) {
return x;
}
return par[x] = findPar(par[x]);
}
bool merge(int u, int v) {
u = findPar(u);
v = findPar(v);
... | ALGO | 0.999987 | 5.702474 | {
"github_metadata": {
"branch": "main",
"commit_count": 1923,
"repo_created_at": "2023-05-12T05:37:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d250cf5e7... |
dd85a39c-1628-4326-b66d-ae14a175eff0 | spikebarnett/cpp-euler | 55.cpp | #include <iostream>
#include <sstream>
#include <algorithm>
using namespace std;
bool isPalindromic(const string s)
{
for(unsigned int i=0;i<s.size()/2;++i)
{
if(s[i]!=s[s.size()-i-1]) return false;
}
return true;
}
bool isPalindromic(const unsigned long i)
{
string s;
ostringstream c;
c << i;
s = c.str();
... | ALGO | 0.999467 | 4.299768 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2014-07-10T12:00: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": "442f04e0e... |
2e0219c0-9f62-4a19-a713-609e87b6b83f | Muhammad-Al-Halaby/Competitive-Programming-Submissions | codeforces/1277/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define OnlineJudge1
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define EPS 1e-7
#define modulo ll (1e9 + 7)
#define debug(x) cerr << #x << " = " << (x) << '\n'
const long double PI = 3.141592653589793238L;
typedef long long ll;
typedef p... | ALGO | 0.999226 | 4.072327 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2018-08-25T12:25:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b39670d... |
f59a7c95-2347-4227-a099-19d1718c61fd | ElyssonAlvs/Estrutura_de_Dados | CFBCursos/Vector/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> vct = {9, 2, 7, 4, 5, 6, 3, 8, 0, 1, 3, 2, 5};
vector<int> vct2;
// Funções de iteração
/*
begin aponta para o início da coleção
end aponta para o final da coleção
Começando de 1 e não de 0
*/
f... | ALGO | 0.920836 | 4.037856 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-03-08T00:46:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11f0d02a004... |
2bdbd225-bb11-4376-89c4-1a6e87e7ffff | glowisn/DSbackup | nowicx/psets/pset-final/hash2Driver.cpp | /// File: hashDriver.cpp
/// interactively tests hashing algorithms
///
/// Hashing is an important Data Structure which is designed to use
/// a special function called the Hash function which is used to map
/// a given value with a particular key for faster access of elements.
/// The efficiency of mapping depen... | ALGO | 0.925652 | 5.323509 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-04-09T03:39: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": "fd6a0d50c9f0... |
5d819779-f942-4627-8a64-2e2963884426 | Idealist226/ClassCode | OS/lab1/ALL/main.cpp | #include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
using namespace std;
const int MAX = 20;
const int SPACE = 10;
int jobNum; // 作业数量
int trackNum; // 批处理道数
int jobAlgorithmOption; // 作业调度算法编号
int processAlgorithmOption; // 进程调度算法编号
double aveWhole... | ALGO | 0.999845 | 3.572353 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-11-18T09:11: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": "769fcaae5... |
58a131db-4bc9-4e0b-ad4d-cc3eea751061 | upayanmazumder/DevJourney | CPP/VIT/Sem-2/Assessments/Week 6/Challenge Yourself/Estimate Ranges of Gas and Electric Cars/main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
class Vehicle {
public:
double fuelCapacity;
Vehicle(double fc) : fuelCapacity(fc) {}
};
class Car : public Vehicle {
public:
double fuelEfficiency;
Car(double fc, double fe) : Vehicle(fc), fuelEfficiency(fe) {}
double calculateRange(... | TOOL | 0.971993 | 6.400311 | {
"github_metadata": {
"branch": "main",
"commit_count": 609,
"repo_created_at": "2024-05-12T16:22:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3bc6b908e1... |
d37dfb82-b8f8-4a1f-9295-2319831a9d6d | MasterIceZ/IMSO | icpc/NWERC_2023/G.cpp | #include <bits/stdc++.h>
using namespace std;
const double INF = 1e18;
const int MxN = 100010;
struct point_t {
double x, y, z;
point_t(double _x=0.0, double _y=0.0, double _z=.0.0):
x(_x), y(_y), z(_z) {}
};
struct state_t {
int v;
double w;
bool operator < (const state_t &o) const {
return w > o.w;
}
s... | ALGO | 0.999914 | 4.179434 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2022-01-04T04:37:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de97f4042a... |
a8ecfecb-d5a6-463c-a549-b2adfff31890 | Smile4Blitz/Algorithms | binary-search-trees/include/tree.hpp | #ifndef _TREE_H
#define _TREE_H
#include <functional>
#include <iostream>
#include "node.hpp"
#include <concepts>
enum traversal_order
{
inorder,
preorder,
postorder
};
template <std::integral K>
class Tree
{
public:
Node<K> *root = nullptr;
Tree() {}
~Tree()
{
delete root;
... | ALGO | 0.982783 | 5.4223 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2025-02-11T20:25: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": "cd74a45d563... |
f3e49b2a-f405-4842-9a5b-6874569870ee | vietnakid/ACM-ICPC | FreeContest/93/CLAUS.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;
typedef vector<ll> vl;
typedef vector< vector<ll> > vvl;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector< vii> vvii;
#define INF 1000000007
#define INFLL 100000000000000000... | ALGO | 0.999998 | 3.4446 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-04-07T11:55: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": "6fb8f9b52... |
85026737-425e-4cd5-8ca9-23fa3e538c35 | samridhrana06/C- | Binary Search/BASIC/lowe_bound.cpp | // #include<bits/stdc++.h>
// using namespace std;
// int main(){
// int arr[] = {1,2,3,4,5,6,7,8,9,10};
// int n = sizeof(arr)/sizeof(arr[0]);
// int t = 9;
// int low = 0, high = n-1;
// int ans =n;
// while (low<=high)
// {
// int mid = (low+high)/2;
// if(arr[mid] >=... | ALGO | 0.999952 | 4.745172 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-10-27T00:26: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": "81aea38ec57... |
7df6b761-eda0-4fbd-8517-cabbbd6eaa13 | trumpetarn/AdventOfCode | 2019/cpp/day03.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <cstdint>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <numeric>
#include <unistd.h>
#include <iterator>
#include <list>
#include "helper.h"
using namespace std;
using namespace helper;
namespace day0... | ALGO | 0.999816 | 4.954111 | {
"github_metadata": {
"branch": "master",
"commit_count": 238,
"repo_created_at": "2017-12-05T22:17: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": "5113f41f... |
29f9f396-4a0b-4055-930c-5e4da58f7f05 | juancate/CompetitivePrograming | CodeChef/LongContest/2013/April/maxdiff.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cctype>
#include <cassert>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <map>
#i... | ALGO | 0.999927 | 3.92682 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2013-12-05T21:57: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": "fb97f1fdf... |
44a115ba-8abb-4610-a46b-8fab451b6f8e | bothemrun/CAP-Complete-Algorithmic-Programming | Leetcode_All_Solved/1214.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.999995 | 6.340599 | {
"github_metadata": {
"branch": "main",
"commit_count": 1606,
"repo_created_at": "2022-02-13T12:44:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b993d7d76... |
ff9b1e0f-86fb-456e-bfdc-c0248207955c | Rohitsinghkhetwal/Sorting-Algorithms | HighestLowestElem.cpp | #include<bits/stdc++.h>
using namespace std;
int HandLelem(int arr[],int n){
vector<bool>visited(n, false);
int maxFreq = 0, minFreq = n;
int maxElem = 0, minElem = 0;
for(int i = 0; i < n; i++){
if(visited[i] == true){
continue;
}
int count = 1;
for(int j... | ALGO | 0.999969 | 4.057827 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2024-03-11T19:16: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": "bd5f08475... |
1367b8c4-a8d8-43f2-a949-4198ca7ff2bf | scarlet2131/DSA | Revision/Day5/combinationSum1.cpp | // Recursion tree( dry run)
// [] (sum=0)
// ├── [2] (2)
// │ ├── [2,2] (4)
// │ │ ├── [2,2,2] (6)
// │ │ │ ├── [2,2,2,2] (8) ❌
// │ │ │ └── [2,2,2,3] (9) ❌
// │ │ └── [2,2,3] (7) ✅
// │ └── [2,3] (5)
// │ └── [2,3,3] (8) ❌
// ├── [3] (3)
// │ ├── [3,3] (6)
// │ │ └── [3,3,3] (9) ❌
/... | ALGO | 0.999972 | 6.855535 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2025-03-31T12:59: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": "f77b50b73e4... |
448cf5bd-8307-4a31-9df9-f5d2f57d1974 | rk42745417/CP-Codes | InfO1Cup/2019/consul.cpp | // 100/100
#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(0);
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using ld = long double;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const ll LINF = ll(2e18) + ll(1e15);
cons... | ALGO | 0.99987 | 3.562573 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2021-10-19T07:51: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": "db3c657466d... |
c97973cd-eb27-4b8b-9387-4ec95d21068f | zephray/ArithMax | Software/AMEv3/Eigenmath/qpow.cpp | // Rational power function
#include "stdafx.h"
#include "defs.h"
static void qpowf(void);
static void normalize_angle(void);
static int is_small_integer(U *);
void
qpow()
{
save();
qpowf();
restore();
}
#define BASE p1
#define EXPO p2
static void
qpowf(void)
{
int expo;
unsigned int a, b, *t, *x, *y;
EXPO =... | ALGO | 0.999301 | 6.151625 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2013-07-27T11:42:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 71,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75adc71... |
07e8c030-986e-4384-9b74-c6fab6013782 | DavidMorano/system | src/libuc/six/sixbrk.cc | /* sixbrk SUPPORT */
/* charset=ISO8859-1 */
/* lang=C++20 */
/* subroutine to find a character in a given string */
/* version %I% last-modified %G% */
#define CF_STRCHR 1 /* use |strchr(3c)| */
/* revision history:
= 1998-03-23, <NAME>D<NAME>
This code was originally written.
*/
/* Copyright © 1998 <NAME>. ... | ALGO | 0.994735 | 5.239965 | {
"github_metadata": {
"branch": "main",
"commit_count": 5251,
"repo_created_at": "2023-12-09T10:46:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c4dfc5c7... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.