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 |
|---|---|---|---|---|---|---|---|
0c4e8e10-bb0a-4e9c-b457-c8887b64137e | Mu-L/TracerInteractiveUE4Plugins | Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/Implicit/ImplicitFunctions.h | // Copyright Epic Games, Inc. All Rights Reserved.
// Port of geometry3Sharp's CachingMeshSDFImplicit
#pragma once
#include "MathUtil.h"
#include "SegmentTypes.h"
#include "BoxTypes.h"
template<typename RealType>
struct TImplicitFunction3
{
TUniqueFunction<RealType(FVector3<RealType>)> Value();
};
template<typena... | ALGO | 0.996449 | 4.489568 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-03-24T02:30:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 11,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "92dea7d... |
a9ec1327-80ca-4149-8e6e-943cc0ea762d | goodboybeau/data_structures | bintree/binary_tree.hpp | #ifndef _BINARY_TREE_HPP_
#define _BINARY_TREE_HPP_
#include "include_c11.h"
#include <scoped_lock.hpp>
#include <memory>
#include <atomic>
#include <mutex>
#include <iostream>
#define DEBUG(s) std::cout << s << std::endl; std::flush(std::cout);
template <typename T>
struct node
{
node() = delete;
node(const ... | ALGO | 0.997453 | 4.909423 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-01-29T17:18: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": "6414c19df7... |
9224c8ee-70b3-48d5-8b0e-61326e775faf | amusecode/amuse | src/amuse_etics/src/ic.cpp | /**
* @file ic.cpp
* @author <NAME> <<EMAIL>>
* @brief Functions to generate initial conditions.
*
* These are functions to generate a Hernquist or a Plummer sphere. In both
* cases the model has a total mass of 1 and the total energy is -0.25 Henon
* energy units. The Hernquist model generator was adapted... | ALGO | 0.999535 | 5.465748 | {
"github_metadata": {
"branch": "main",
"commit_count": 9742,
"repo_created_at": "2014-04-07T12:35:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 172,
"forks": 107,
"issues": 164,
"pull_requests": 26
},
"file_meta": {
"content_id": "353... |
c7fe32d7-8f73-4741-8d79-34c2974fd9c6 | ustcyyw/algorithm | luogu/sliding_window/CF190D.cpp | /**
* @Time : 2024/1/30-3:32 PM
* @Author : <EMAIL>
* @E-mail : <EMAIL>
* @Github : https://github.com/ustcyyw
* @desc :
*/
#include<bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
int n, k, nums[N];
void solve() {
int lo = 0, hi = 0;
long long res = 0;
unordered_map<int, int> map;
wh... | ALGO | 0.999964 | 4.707019 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2024-11-11T07:09: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": "36a585cf46... |
8b1eafe2-bf1a-425b-a996-1f7e8025a9b6 | farmerboy95/CompetitiveProgramming | Timus/TIMUS 1501.cpp | /*
Template Version: 1.0.0 - 20220620
Author: <NAME>
Status: AC
Idea:
- Let dp[i][j][k] = 1 if we can move prefixes s[1..i] and t[1..j] to the new piles
of 0 and 1, such that if the 2 new piles have the same number of elements, k = 1,
if the new piles of 0 has 1 more element than... | ALGO | 0.999998 | 4.675473 | {
"github_metadata": {
"branch": "master",
"commit_count": 867,
"repo_created_at": "2019-09-04T15:35:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44449a93... |
ea34aa50-8faa-4a31-af20-d75c2a8fb315 | L-Si-Won/BOJ-code | 구현/25943.cpp | #include <iostream>
using namespace std;
int n, w[10000], scale[2];
int main(){
cin.tie(NULL);
cout.tie(NULL);
ios_base::sync_with_stdio(false);
//input
cin >> n;
for (int i = 0; i < n; i++){
cin >> w[i];
//put on scale
if (i == 0)
scale[0] += w[i];
... | ALGO | 0.999982 | 3.642081 | {
"github_metadata": {
"branch": "master",
"commit_count": 634,
"repo_created_at": "2022-03-27T09:47: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": "89288e27... |
cf15457f-a52a-4e70-ad78-2774fff9f7d9 | hanil12/DX2022_20 | WIN_API/WIN_API_2220/Algorithm/DP(2).cpp | #include <iostream>
#include <vector>
#include <windows.h>
#include <algorithm>
using namespace std;
// LIS (Longest Increasing Sequence) : 수열이 주어졌을 때 제일 긴 부분증가수열의 길이 찾기
// 부분 증가 수열
// 1 4 3 2 6 8
// 부분 수열
// 순서는 지키되, 인접하지 않을 수도 있는 수열
// 1 4 6 (o)
// 1 3 6 8 (o)
// 4 1 8 2 (x)
// 부분 증가 수열
// 부분 수열이면서 원소들이 늘어나는 형태의... | ALGO | 0.99955 | 4.528798 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2022-12-09T11:37:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac0d86f486f... |
f0dc4709-33ab-4406-bf8a-a96d122e9c27 | wonda-tea-coffee/kyo_pro | hoj/204/c.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define REP(i,n) for (int i = 0; i < (n); ++i)
#define SORT(a) ... | ALGO | 0.999991 | 3.847143 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-03-03T10:16: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": "1cb5a720d... |
9a39c1d9-0726-4f51-8ef1-7077d7907d46 | Abhishek2533/DSA | LeetCode-Problem's-Solution/Easy/Problem_1295.cpp | /*
1295. Find Numbers with Even Number of Digits
Given an array nums of integers, return how many of them contain an even number of digits.
Example 1:
Input: nums = [12,345,2,6,7896]
Output: 2
Explanation:
12 contains 2 digits (even number of digits).
345 contains 3 digits (odd number of digits).
2 contains 1 digit... | ALGO | 0.999073 | 6.01371 | {
"github_metadata": {
"branch": "master",
"commit_count": 442,
"repo_created_at": "2023-05-28T01:08: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": "650b45a0... |
481c610c-30a9-4cdb-b49b-c709560f8162 | cheerconi/online-judge | codeforces/Codeforces Round #423 based on VK Cup Finals/B. Black Square/main.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
// freopen("test.txt", "r", stdin);
int n, m;
int left = INT_MAX;
int right = -1;
int top = INT_MAX;
int bottom = -1;
scanf("%d%d", &n, &m);
char tmp;
int cnt = 0;
for (int i = 0; i < n; i++) {
getc... | ALGO | 0.999882 | 3.251953 | {
"github_metadata": {
"branch": "master",
"commit_count": 407,
"repo_created_at": "2017-07-19T16:20:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2bc545b... |
86272de5-691e-42ce-8e60-e006683ea838 | ncbi/ncbi-cxx-toolkit-public | src/algo/blast/proteinkmer/pearson.cpp | /* $Id: pearson.cpp
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United St... | ALGO | 0.997442 | 5.849237 | {
"github_metadata": {
"branch": "main",
"commit_count": 103944,
"repo_created_at": "2021-07-26T19:41:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 73,
"forks": 35,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "18f65b... |
6d1792ad-dbcf-43b8-8c18-b3286e5beaf0 | ilya9503/stepik_c_course | chapter_10/structures_cpp/tag_time_EASY.cpp | #include <iostream>
struct tag_time {
unsigned char hours;
unsigned char minutes;
unsigned char seconds;
char* get_time(char* str, size_t max_length) {
snprintf(str, max_length, "%02hhu:%02hhu:%02hhu", hours, minutes, seconds);
return str;
}
static tag_time sum_time(const tag_time& t1, const tag_... | ALGO | 0.979421 | 4.834954 | {
"github_metadata": {
"branch": "main",
"commit_count": 149,
"repo_created_at": "2024-09-27T12:41:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6e994b07b... |
41feb1c2-9077-4acc-9147-212caaf642f4 | AuroTB/RoBorregos_TMR_SoccerLight-2k17 | Ajuste_Angular.ino | //Acomoda al robot de frente mientras esta caminando
int top=210;
int bottom=190;
void ajusteAngular(float d){
if(d>2 && d<358){
switch(direccion){
case 1:
igualadorV(v1, v3, vc1, vc3, d, top, bottom);
break;
case 5:
igualadorV(v3, v1, vc3, vc1, d, top, bottom);
break;
case 2:... | TOOL | 0.952764 | 4.060487 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-01-28T17:33:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0413e6836... |
2ab419a1-7668-465e-b3c6-22ad5790ef49 | axellokrantz/advent-of-code-2023 | day03/part2.cpp | #include <fstream>
#include <iostream>
#include <set>
#include <string>
#include <vector>
int getFullNumber(const std::string& line, int pos, int& start, int& end) {
start = pos;
end = pos;
while (start >= 0 && isdigit(line[start])) {
start--;
}
start++;
while (end < line.length() && ... | ALGO | 0.999877 | 5.863276 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-10-28T14:21: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": "9a62fa0d977... |
da7ce9e3-51bb-4bd3-9704-b499d7c8e78d | DCTewi/CodeWorkspace | Contests/Virtual Judge/XunlianSai 20190909/f.2.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 5;
int n, m;
template <class T> T read()
{
T x = 0; int ch = getchar();
while (!isdigit(ch)) ch = getchar();
while (isdigit(ch)) x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
return x;
}
int father[MAXN]... | ALGO | 0.999527 | 3.553973 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2019-03-12T11:11: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": "0857a46e... |
324c7a15-d71d-4a58-baaa-b3d795cb8f6d | Ipagaxi/AoC_2023 | day_4/day_4_1.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
using namespace std;
int getValueOfCard(vector<int> left_numbers, vector<int> right_numbers) {
float value = 0.5;
for (int right_num : right_numbers) {
for (int left_num : left_numbers) {
if (right_num == left_num) ... | ALGO | 0.99868 | 5.276615 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-12-08T09:18: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": "3a266b2f0be... |
8231443b-5bd7-4206-8bc9-090d701923e1 | Kimayak/Leetcode | Easy/Contains Duplicate.cpp |
// Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
// Example 1:
// Input: nums = [1,2,3,1]
// Output: true
// Example 2:
// Input: nums = [1,2,3,4]
// Output: false
// Example 3:
// Input: nums = [1,1,1,3,3,4,3,2,4,2]
// ... | ALGO | 0.999771 | 5.582123 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-10-10T00:47: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": "9473f280084... |
3d861e69-f070-4fd5-b46a-b65a26194c88 | akshaynikam/hello-world | byte_by_byte/substring_wth_concat_words.cpp | #include <iostream>
#include <vector>
#include <map>
#include <string>
void substring_with_concat_words(std::string str, std::vector<std::string>& list) {
std::map<std::string, int> hash;
int words_count = list.size();
int word_size = list[0].size();
int words_length = words_count * word_size;
fo... | ALGO | 0.992633 | 4.744478 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2015-03-26T12:01:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cf8c6de5... |
ccc21da6-d4d1-4b39-825f-46c06d4171f2 | Aditya-Mishra9670/c-plus-plus | DivisonByBitoperation.cpp | // Here I have written code with proper comments to understand every step.
int division(int n, int m) {
if (n == 0 || m == 0) {
return 0; // Division by zero, return 0
}
// Determine sign of the result
bool sign = (n > 0) ^ (m > 0);
// Take absolute values of n and m
unsigned int un = ... | ALGO | 0.999977 | 6.455154 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-03-02T20:10: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": "78429b12db7... |
85c3a074-c646-436e-8759-8470eb686952 | to-amit/Leetcode | Subarray with given sum - GFG/subarray-with-given-sum.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find a continuous sub-array which adds up to a given number.
vector<int> subarraySum(int a[], int n, long long s)
{ int j=0;
int sum=0;
for(int i=0;i<n;i++... | ALGO | 0.999683 | 5.647848 | {
"github_metadata": {
"branch": "main",
"commit_count": 728,
"repo_created_at": "2022-02-15T16:15:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f709eac8a... |
f295e20f-9bef-4ef7-ad5c-674c48b33f92 | ngthvan1612/OJCore | TestModule/HK1/Users/19133054/BAI3.cpp | #include<stdio.h>
void xuat(int kq);
void nhap(int arr[], int& n);
bool soChan(int n);
int kiemtra(int arr[], int n);
int main()
{
int arr[100];
int n;
nhap(arr, n);
int kq = kiemtra(arr, n);
xuat(kq);
}
void nhap(int arr[], int& n)
{
scanf_s("%d", &n);
for (int i = 0; i < n; i++)
{
scanf_s("%d", &arr[i]);
}... | ALGO | 0.99985 | 3.554487 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2021-04-13T16:03: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": "d1a552576... |
cfae45be-82d2-4f59-a26a-294860bbfc6a | CitrusSin/AlgorithmProblemAnswers | nowcoder/ACM57355M.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
int gcd(int a, int b) {
return b ? gcd(b, a%b) : a;
}
i64 exgcd(i64 a, i64 b, i64 &x, i64 &y) {
if (!b) {
x = 1, y = 0;
return a;
}
i64 d = exgcd(b, a%b, y, x);
y -= a/b*x;
return d;
}
i64 solve(i64 a, i64 b, ... | ALGO | 0.999689 | 5.239928 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2023-01-08T13:54: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": "9e6b64d06c... |
8614635c-18cf-4f5e-b1a5-6a3c371b2f4b | Denver2002620/Examen-Parcial-3-Vinculante- | ejercicio/ejercicio.cpp | #include "ejercicio.h"
#include <iostream>
#include <queue>
#include <unordered_map>
bool calculateSchedule(const std::vector<Task>& tasks, int max_time) {
std::unordered_map<std::string, int> indegree;
std::unordered_map<std::string, int> taskDuration;
std::unordered_map<std::string, std::vector<std::stri... | ALGO | 0.999876 | 5.574986 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-28T10:29: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": "81df8216ae50... |
17b6dbc6-1119-4989-a75a-379515c978bf | LamChiho/Codeforces_exp | JunePractices/epic/b.cpp | using namespace std;
#include <iostream>
#include <string.h>
#include<vector>
#include<unordered_map>
#include<unordered_set>
#include <queue>
#include <algorithm>
#include <array>
#include <functional>
#include <iostream>
#include <string_view>
#include<cmath>
typedef long long ll; // 使用 typedef 创建别名
using namespace s... | ALGO | 0.999837 | 5.265555 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-06-10T00:38:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdd0ce0ea95... |
392cdb43-0a98-4ded-ba5c-801f3f29ec08 | DiligentPanda/Scalable-Imitation-Learning-for-LMAPF | lmapf_lib/MAPFCompetition2023/inc/LaCAM2/SUO2/SpatialSUO.h | #pragma once
#include "SharedEnv.h"
#include <omp.h>
#include "LaCAM2/SUO2/CostMap.h"
#include "LaCAM2/SUO2/SpatialSearch.h"
#include "util/HeuristicTable.h"
namespace SUO2 {
namespace Spatial {
class SUO {
public:
SUO(
const SharedEnvironment & _env,
const std::vector<float> & _weights,
... | ALGO | 0.991992 | 4.747167 | {
"github_metadata": {
"branch": "static_guidance",
"commit_count": 31,
"repo_created_at": "2025-05-18T19:24:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id":... |
70362111-0a3e-4351-b637-bfde7aa55013 | victor-istomin/CodeWars | cpp-cgdk/GoalDefendHelicoptersFromRush.cpp | #include <algorithm>
#define PI 3.14159265358979323846
#define _USE_MATH_DEFINES
#include <cmath>
#include <typeinfo>
#include "goalDefendHelicoptersFromRush.h"
#include "GoalMixTanksAndHealers.h"
#include "GoalCaptureNearFacility.h"
#include "goalUtils.h"
#include "goalManager.h"
#include "state.h"
#include "model... | ALGO | 0.972613 | 5.298743 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2017-11-07T00:28: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": "63c18b40... |
ccabfb8f-33aa-4e1b-8edb-511f85d38391 | abhisehekkumr/tree | findNinja.cpp | #include<iostream>
#include<string>
using namespace std;
void makeFalse(bool **visited, int n, int m){
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++)
visited[i][j] = false;
}
}
bool found(char **graph, int n, int m, int i, int j, bool **visited, string pattern){
if(pat... | ALGO | 0.999893 | 4.066255 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-07-20T13:03: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": "1910b4f783... |
009289a1-24e1-4430-b916-9260affca93f | Mato00KAN/Dolphin-MMJR2 | Source/Core/Common/Crypto/bn.cpp | // Copyright 2007,2008 <NAME> <<EMAIL>>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "Common/Crypto/bn.h"
#include <cstdio>
#include <cstring>
#include "Common/CommonTypes.h"
static void bn_zero(u8* d, int n)
{
std::memset(d, 0, n);
}
static void bn_copy(u8* d, const u8* a, int n)
{
std::memcpy(d, a... | ALGO | 0.998502 | 5.603738 | {
"github_metadata": {
"branch": "master",
"commit_count": 35482,
"repo_created_at": "2022-06-17T15:37:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "851a... |
71720c3a-14c4-4cc3-b1c2-0fcbd114a576 | ydb-platform/ydb | contrib/libs/highwayhash/highwayhash/example.cc | // Minimal usage example: prints a hash. Tested on x86, ppc, arm.
#include "highwayhash/highwayhash.h"
#include <algorithm>
#include <iostream>
using namespace highwayhash;
int main(int argc, char* argv[]) {
// Please use a different key to ensure your hashes aren't identical.
const HHKey key HH_ALIGNAS(32) = {... | ALGO | 0.925055 | 6.90573 | {
"github_metadata": {
"branch": "main",
"commit_count": 35208,
"repo_created_at": "2022-02-07T14:52:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4512,
"forks": 701,
"issues": 2263,
"pull_requests": 682
},
"file_meta": {
"content_id": ... |
5c7b6633-ac81-484a-a42a-ccdbc41da09b | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0606/personal_submission/cf1561d1_yawn_sean.cpp | #include <bits/stdc++.h>
using namespace std;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, mod;
cin >> n >> mod;
vector<int> dp(n + 1), dp_acc(n + 1), prime_factor(n + 1);
for (int i = 2; i <= n; i ++) {
if (prime_factor[i] == 0) {
... | ALGO | 0.999876 | 4.418937 | {
"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": "5530... |
b485650d-9fa3-4bcc-a8f6-ed18de75e37d | JiHyeok-Kim/SAF-STUDY | 2022-08/220810 - DFS, BFS/220810_2조_스터디_김용식/3차 배열에서 MAX MIN 찾기.cpp | #include <iostream>
using namespace std;
int main(){
int arr[2][2] = {{2,4},{1,5}};
int arr2[2][2] = {{2,3},{3,6}};
int arr3[2][2] = {{7,3},{1,5}};
int n;
cin >> n;
int max = 0;
int max2 = 0;
int max3 = 0;
int min = 2e8;
int min2 = 2e8;
int min3 = 2e8;
if (n == 0) {
for (int i = 0; i < 2; i++) {
for (... | ALGO | 0.999824 | 3.174321 | {
"github_metadata": {
"branch": "main",
"commit_count": 488,
"repo_created_at": "2022-08-02T15:03:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afceb6a65a... |
5aa49525-d53a-4046-869f-d8f95f10f8a2 | Lee-Duck-03/template_cp | codetumlumtala/826_A_B.cpp | ///* ________ _______ _______ _____ _______
// | _____| | \ | \ / \ | \
// | |_____ | 0 | | 0 | | _ | | 0 |
// | _____| | _ / | _ / | |_| | | _ /
// | |_____ | | \ \ | | \ \ | | | | \ \
// |________| |__| \__\ ... | ALGO | 0.999965 | 4.24074 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-28T04:16: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": "a0bc73bb74b1... |
16c5cbfa-4de7-4fad-9a1b-5e34d6b0b5cd | Domacles/MyCXXode | CampusLife/Math/矩阵快速.cpp | struct Matrix
{
int val[8][8] =
{
// 0 1 2 3 4 5 6 7
{0, 0, 0, 0, 0, 0, 0, 1},//0
{0, 0, 0, 0, 0, 0, 1, 0},//1
{0, 0, 0, 0, 0, 1, 0, 0},//2
{0, 0, 0, 0, 1, 0, 0, 1},//3
{0, 0, 0, 1, 0, 0, 0, 0},//4
{0, 0, 1, 0, 0, 0, 0, 0},//5
{0, 1, 0, 0, 0, ... | ALGO | 0.999979 | 3.874639 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-12-07T16:18: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": "6a45583433... |
fb630899-59e9-454b-92a1-687f6111d88e | ishandutta2007/codeforces-d | duality/normal/1322/B.cpp | #define DEBUG 0
#include <bits/stdc++.h>
using namespace std;
#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printA... | ALGO | 0.999911 | 3.784374 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c3585c7b573... |
7d367b92-d418-4440-b766-102ea836b596 | seakers/ExtUtils | dakota-6.3.0.Windows.x86/include/EfficientSubspaceMethod.hpp | /* _______________________________________________________________________
DAKOTA: Design Analysis Kit for Optimization and Terascale Applications
Copyright 2014 Sandia Corporation.
This software is distributed under the GNU Lesser General Public License.
For more information, see the README file in t... | ALGO | 0.986877 | 6.576101 | {
"github_metadata": {
"branch": "hgGitConversion",
"commit_count": 9,
"repo_created_at": "2020-02-28T18:32:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81... |
b063aad9-85be-456f-a9b1-57923c3d8d5b | tofergregg/CodeReview | course/cs106b/1176/midterm/p5/student_120.cpp | void bestRoute(Grid<double> &distance, int startCity, set<int> remainingCities, Vector<int> &bestPath, Vector<int> currentPath, double pathDistance, double &shortest)
Vector<int> bestRoute(Grid<double> &distance, int startCity) {
// create data structure with all of the cities but the start one
set<int> allCities;
... | ALGO | 0.999938 | 5.757652 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2017-05-17T15:52:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1cc37df74... |
5114388b-ab05-493e-b62f-271db51a466d | simagren/Kattis_Problems | Kattis_Cpp/Höfundaleit.cpp | #include <iostream>
#include <stdlib.h>
#include <string>
#include <ranges>
#include <string_view>
#include <vector>
#include <map>
#include<unordered_map>
#include <algorithm>
static void Run()
{
std::string nInput, yInput;
std::cin >> nInput >> yInput;
int n = std::stoi(nInput);
int q = std::stoi(yIn... | ALGO | 0.999587 | 4.441308 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2025-06-04T12:20: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": "90eee7723... |
a0335ae2-da04-4c35-8b35-4acf1cd7263a | JaspreetSingh2110/DataStructures | Algorithms/String/CountOpsToConvStr1ToStr2.cpp | /*
* Description:
* Program to count numbers of operations to convert string1 to string2.
*
* Approach #1: Recursive.
* TC: O(3^m)
*
* Approach #2: Recursion with memoization.
* TC: O(mxn)
*
* Created on: 18/11/24
* @author: <NAME>, <EMAIL>.
*/
#include <iostream>
#include <string>
#include <vector>
//App... | ALGO | 0.999613 | 6.670091 | {
"github_metadata": {
"branch": "main",
"commit_count": 158,
"repo_created_at": "2024-08-22T16:30: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": "f763da331e... |
b672f1ec-eb32-4eed-9096-1f20fbd67266 | mrjmac/competitive-programming | USACO/milkingOrder.cpp | #include <bits/stdc++.h>
using namespace std;
bool usedCow[100], usedPos[100];
int pos[100];
int n, m, k;
int order[100];
int c[100];
int p[100];
bool valid()
{
for (int i = 0; i < n; i++)
{
usedCow[i] = usedPos[i] = 0;
}
for (int i = 0; i < k; i++)
{
if (usedCow[c[i]] && pos... | ALGO | 0.999997 | 4.341454 | {
"github_metadata": {
"branch": "main",
"commit_count": 241,
"repo_created_at": "2022-05-03T03:14: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": "5308439d26... |
ec36797f-6e42-47b1-abe0-dee416927e27 | PP-FM/ZKSMT-pub | zkchecker/roram.h | //
// Created by anonymized on 12/7/21.
//
//
// Created by anonymized on 10/4/21.
//
#pragma once;
#include "emp-zk/emp-zk.h"
#include "emp-zk/extensions/ram-zk/ostriple.h"
#include "polynomial.h"
#include "commons.h"
#define RULE_ARRAY_SIZE 1024
// starting index where roram timing information is stored in array ... | TOOL | 0.957252 | 4.216687 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-19T18:59:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1b92483b03d0... |
68a55b3e-c305-45a7-93a4-1d16d3836c7c | Yatharth51/DSA-Striver | ArrayQues/medium/setmatzeroes.cpp | #include <iostream>
using namespace std;
void print(vector<vector<int>> matrix){
for (int i = 0 ; i<matrix.size(); i++){
for (int j = 0 ; j< matrix[0].size() ; j++){
cout<<matrix[i][j]<<" ";
}
cout<<endl;
}
}
void markzeroesbrute(vector<vector<int>> &matrix){
... | ALGO | 0.999769 | 5.552569 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-07-21T09:54:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4428b9f2eca... |
8115aac7-0171-4a2b-87ad-3521910490eb | theDreamBear/algorithmn | leetcode2/1420.build-array-where-you-can-find-the-maximum-exactly-k-comparisons.cpp | /*
* @lc app=leetcode.cn id=1420 lang=cpp
* @lcpr version=30204
*
* [1420] 生成数组
*/
// @lcpr-template-start
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#... | ALGO | 0.999986 | 5.287254 | {
"github_metadata": {
"branch": "master",
"commit_count": 1074,
"repo_created_at": "2019-02-24T04:03: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": "18f973f... |
e21f4de5-2766-44c6-b86e-6592991fe072 | iAdam368/river-guesser-prototype | 2024Project/Source (DO NOT EDIT).cpp | #include "Game.h"
#include <iostream>
#include <sstream>
#include <list>
#include <iomanip>
#include <thread>
#include <limits>
#ifdef _WIN32
#include <Windows.h>
void setConsoleVTMode() {
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD dwMode = 0;
GetConsoleMode(hConsole, &dwMode);
dwMode |= ENABLE_VIRTU... | TOOL | 0.916301 | 3.71397 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2023-12-04T14:32:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fce4450bd... |
b66565eb-03ff-4c4c-9411-f5aa37d48aa8 | underscoreanuj/Codes | codingame/Easy/pirate_s_treasure.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
int W, H;
bool isValid(int i, int j) {
if(i < 0 || j < 0 || i>=H || j >=W) return false;
... | ALGO | 0.999837 | 3.404554 | {
"github_metadata": {
"branch": "master",
"commit_count": 715,
"repo_created_at": "2020-01-03T04:02: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": "bb98d32d... |
4dc7fdc2-f985-4c26-8e04-e1a2640ba277 | gourav-kadyan/advanceCpp | Week2Harshit/Day3Harshit/sample4.cpp | #include <iostream>
#include <functional>
#include <array>
/*
objective :
design an adaptor function that accepts a container of function wrappers and a container of data values
Map each function on each item in data container and print the output
#all function must accept only an integer and... | TOOL | 0.960722 | 6.248034 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2024-02-21T15:48: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": "3e8b5e1400... |
9042e46c-2a3b-443e-8eff-6aad8a7cf9be | m0rphtail/College | SEM-IV/Computer_Graphics/CircleAlgorithm.cpp | //<NAME>
//SE-IT
//S2 Batch
//8016
//Circle Algorithm
#include<GL/glut.h>
#include<iostream>
#include<math.h>
using namespace std;
#define w 600
#define hei 600
void myInit()
{
glClearColor(1.0,1.0,1.0,1.0);
glColor3f(1.0f,1.0f,1.0f);
glPointSize(3.0f);
glMatrixMode(GL_PROJECTION);
glLoadIdenti... | ALGO | 0.999129 | 4.464413 | {
"github_metadata": {
"branch": "main",
"commit_count": 181,
"repo_created_at": "2019-07-16T05:37: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": "929e27eeeb... |
953442d7-3934-455a-99ae-f701bec1fc59 | ATaylorCEngFIET/Hackster | Sobel/solution1/syn/systemc/Sobel.cpp | // ==============================================================
// RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2017.4_AR70530_AR70530
// Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved.
//
// ===========================================================
#include... | ALGO | 0.950144 | 3.241058 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-03-25T20:19:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 146,
"forks": 78,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "1199d5... |
9d8b4428-0e17-42dd-b147-bbda7c1c84c9 | fhan90521/BaekJoon | 백준/Gold/17387. 선분 교차 2/선분 교차 2.cc | // 17387.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include <iostream>
using namespace std;
long GetCCW(long x1, long y1, long x2, long y2, long x3, long y3)
{
long result = (x1 * y2 + x2 * y3 + x3 * y1) - (x2 * y1 + x3 * y2 + x1 * y3);
if (result > 0)
{
return 1;
}
else if (result == 0)
{
r... | ALGO | 0.999962 | 4.084406 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2023-10-19T07:04: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": "cc5d72daf0f... |
650418b8-6b5f-4eb4-9d39-a5f4e5067331 | deepbrook/nls-cppGround | structurist/hashstack.cpp |
#include <iostream>
#include <string>
#include<cstdlib>
#include<cstdint>
using namespace std;
#define HASH_DEFAULT_LENGTH 128
#define WIDTH (8 * sizeof(crc))
#define TOPBIT (1 << (WIDTH - 1))
#define POLYNOMIAL 0xD8 /* 11011 followed by 0's */
typedef uint8_t crc;
//Start of hashing magic
crc crcTable[256];
void... | ALGO | 0.997294 | 4.480407 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2015-06-05T19:52:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "88686970a... |
26ece379-adb4-414c-8ca2-b7ba5127d65f | 2016317200404/DS_easytosaylove | 1604/924lizhimin/数据结构作业/聊表的链式储存.cpp | /*
title: 线性表的链式储存
description:
author:averyboy
time:2017/3/17
version:1.0,0
*/
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<cctype>
#include<ctime>
#define INF 0x3f3f3f3f3
#define PI acos(-1.0)
using ... | ALGO | 0.999965 | 3.554951 | {
"github_metadata": {
"branch": "master",
"commit_count": 1163,
"repo_created_at": "2017-09-09T13:17:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 52,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "87f20f... |
13e214d9-54de-4850-ad34-04e16bf34e65 | bestrauc/RNAMotif | folding_utils/ipknot/ip.h | /*
* Copyright (C) 2012 <NAME>
*
* This file is part of DAFS.
*
* DAFS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DA... | TOOL | 0.953489 | 6.249811 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2018-07-20T11:36:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a4595429... |
3cde3d7b-dd59-4952-a100-d55abeadb083 | Blackhol3/kholgen | solver/Objective/EvenDistributionBetweenTeachersObjective.cpp | #include "EvenDistributionBetweenTeachersObjective.h"
#include <ortools/sat/cp_model.h>
#include <QString>
#include <ranges>
#include "ObjectiveComputation.h"
#include "../State.h"
#include "../Teacher.h"
#include "../Trio.h"
#include "../Week.h"
using operations_research::sat::BoolVar;
using operations_research::sat... | ALGO | 0.998782 | 6.036842 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2019-08-20T21: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": "66637ea2... |
780ae27b-dcb5-41e5-835a-5b6d01c79fcc | strategist614/ACM-Code | 刷题比赛/LUOGU/P1231 教辅的组成.cpp | /*
独立思考
一个题不会做,收获5%,写了代码10%,提交对了30%,总结吃透了这个题才是100%.
*/
#include<bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x)
{
x = 0;
char c = getchar();
int sgn = 1;
while (c < '0' || c > '9') {if (c == '-')sgn = -1; c = getchar();}
while (c >= '0' && c <= '9')x = x * 10 + c - '0',... | ALGO | 0.999802 | 3.741444 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-24T07:35: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": "9ef767cdd6... |
ee6f6718-4af9-43ee-88ac-be59f86c4de9 | Ujjwalmittal1907/data-structure-and-algorithm | c++/q Binary Tree/12_spiral_transversal.cpp | /* two stack lenge s1 and s2 root ko s1 mai daalo
jab tak s1 khaali naa ho --> print karte jao and s2 mai daalo pehle left then right
jab tak s2 khaali naa ho --> print karte jao and s1 mai daalo pehlr right then left */
class Solution {
public:
vector<vector<int>> zigzagLevelOrder(TreeNode* root) {
... | ALGO | 0.999999 | 5.846735 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-07-27T13:11: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": "a472dab667... |
1514b634-7e9e-43bf-a43b-5bb6a49f2ab6 | nikhil0139/Binary-Tree | countNodes_CompleteBT.cpp | #include <bits/stdc++.h>
using namespace std;
class Tree
{
public:
int data;
Tree *left;
Tree *right;
Tree(int d)
{
data = d;
left = NULL;
right = NULL;
}
};
Tree *buildTree()
{
int x;
cin >> x;
if (x == -1)
return NULL;
Tree *n = new ... | ALGO | 0.999967 | 4.299249 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-04-05T15:32: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": "2336c7ab552a... |
66c39ceb-b721-4372-9a1b-a26e33f99907 | VidhanAgrawa-l/DSA_90Days | Lecture-003/10_Pattern_2.cpp | #include <iostream>
using namespace std;
int main() {
/*
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
*/
int n;
cout<<"Enter the value of n : ";
cin>>n;
int i = 1;
while(i <= n) {
int j = 1;
while(j<=n) {
cout<<i<<" "; // ... | ALGO | 0.999951 | 4.529068 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-01T16:58: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": "0394ccae9c3... |
a2897f40-8f4d-4431-a322-5f3f6538306e | svn2github/framewave | trunk/Framewave/domain/fwSignal/include/StatisticsDotProduct.h | /*
Copyright (c) 2006-2009 Advanced Micro Devices, Inc. All Rights Reserved.
This software is subject to the Apache v2.0 License.
*/
#ifndef __STATISTICS_DOTPRODUCT_H__
#define __STATISTICS_DOTPRODUCT_H__
#include "fex.h"
#include "SSE2Intrinsic.h"
namespace OPT_LEVEL
{
SYS_INLINE STATIC void _mm_mul_16sc_32sc(cons... | ALGO | 0.995832 | 5.792978 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2013-06-19T11:02:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3b7af52... |
8b5e549c-0b42-4f6f-9f2b-abeb2e39b8fb | AyushSama/Problem-Solving | Feb 19 , 2023/OquiwerutAndTheCity.cpp | #include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
void solve(){
int n;
cin>>n;
int arr[n];
for(int i = 0 ;i < n; i++){
cin>>arr[i];
}
int left = 0;
int right = 0 ;
for(int i = 1 ; ... | ALGO | 0.999535 | 4.398949 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-01-08T18:12: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": "1b7ee9ba536... |
18e63a2c-eb89-4143-b077-d80ee917c62d | SamongZ/Design-Patterns | 策略模式/tt.cpp | #include <iostream>
#include <math.h>
using namespace std;
// 计费抽象基类
class CashBase
{
public:
virtual double acceptCash(double money) = 0;
};
// 正常收费类
class CashNormol : public CashBase
{
public:
double acceptCash(double money) override
{
return money;
}
};
// 打折类
class CashDiscount : public Cas... | ALGO | 0.96987 | 4.69256 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-06-02T02:02: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": "87b5d81ff... |
ddaefc07-7a53-4cbb-a053-88ff359b0438 | serna37/asakatu | 20240103/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, K, X;
cin >> N >> K >> X;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A[i];
}
long long sum = 0, can_use = 0;
for (int i = 0; i < N; i++) {
sum += A[i];
can_use += A[i] / X;
}
if (K <... | ALGO | 0.999979 | 4.276703 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-01-02T11:09: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": "61f4465fbc8... |
f4f8a8a4-c95f-4d27-94f8-999effcea752 | BatuhanKertmen/Matrix | Matrix.cpp | #include "Matrix.h"
// creates an empty object but only allocates memory
Matrix::Matrix(int row, int column, bool automatic) : row(row), column(column), matrix(new float[row * column]) {}
// creates a matrix with user entered inputs
Matrix::Matrix(int width, int length) : row(width), column(length), matrix(nullptr)
... | ALGO | 0.94656 | 3.673867 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-06-17T12:14:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f0050b0d6... |
082bf32f-34c7-4e84-955d-ae14adab90e2 | Akanksha2403/codes | C_Minimum_extraction_a.cpp | #include <bits/stdc++.h>
// Uncomment them for optimisations
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#define GET_MACRO(_1, _2, _3, _4, NAME, ...) NAME
#define range(...) \
GET_MACRO(__VA_ARGS__, r4, r3, r2, r1) \
(__VA_ARGS__)
#define r4(var, start, stop, ste... | ALGO | 0.999632 | 4.704719 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2021-09-24T22:26: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": "2eba578c8... |
277dce5b-143b-4e18-bc51-c845441b4ccf | vNaonLu/leetcode-daily | src/q_1901_1950/q1935.cc | // Copyright 2023 <NAME>
//
// This file describes the solution of
// Maximum Number of Words You Can Type
//
// https://leetcode.com/problems/maximum-number-of-words-you-can-type/
//
// Question ID: 1935
// Difficult : Easy
// Solve Date : 2023/06/11 13:57
#include <iosfwd>
#include <string>
// -- This header must ... | ALGO | 0.991732 | 5.743533 | {
"github_metadata": {
"branch": "main",
"commit_count": 2477,
"repo_created_at": "2021-09-06T15:30:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "649d98873... |
49afa87e-bc26-4c87-a1d8-9fd3fb0b4217 | deyou123/corejava | corejava第12版/v1ch09/sieve/sieve.cpp | /**
* @version 1.22 2021-06-17
* @author <NAME>
*/
#include <bitset>
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
const int N = 2000000;
clock_t cstart = clock();
bitset<N + 1> b;
int i;
for (i = 2; i <= N; i++)
b.set(i);
i = 2;
while (i * i <= N)
{
... | ALGO | 0.998666 | 4.497043 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2019-05-22T11:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 291,
"forks": 169,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "eea75... |
01c2013d-819d-409a-a088-e44a285b3377 | flyseyesgang/Long-Neck | visual/src/BottleDetector.cpp | // // // -------- src/BottleDetector.cpp (accept 8400×5 OR 5×8400) ------------
// // #include <rclcpp/rclcpp.hpp>
// // #include <sensor_msgs/msg/image.hpp>
// // #include <cv_bridge/cv_bridge.h>
// // #include <opencv2/opencv.hpp>
// // #include <onnxruntime_cxx_api.h>
// // #include <vision_msgs/msg/detection2_d_ar... | TOOL | 0.92322 | 5.107671 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2025-02-26T01:17: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": "e7a38572aae... |
5ec2ed08-482e-44dd-bdfe-5d88a667e89c | ekhew/Data-Structures-and-Algorithms | Sorting Algorithms/heapSort.cpp | /*
Title: Heap Sort
Author: <NAME>
Description: Using heap sort to sort a given array.
Date Created: 6/25/2021
*/
#include <iostream>
/*
checks to see if the specified root node satisfies the conditions of a heap by checking with its children
@param arr[], array where the heapifying will take place
@para... | ALGO | 0.99999 | 6.074999 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2021-05-29T03:54: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": "0347cfd00... |
0fd4c3cb-e867-457f-ac95-5bf7574c8e41 | sourav295/AP | 11_411/11_411.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <string>
#include <stack>
#include <limits>
#include <sstream>
#include <algorithm>
#include <iomanip>
using namespace std;
const int c_limit = 47;
//const int n_limit = 1000000000;
... | ALGO | 0.999378 | 3.460571 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2017-01-17T03:42:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "597c50fd... |
736167af-5111-4134-93a8-b20537cb348e | litain23/boj_code | 11046.cpp | //11046.cpp
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> v;
int a[2000005];
int main(){
int n; scanf("%d", &n);
v.resize(n*2+1);
v[0] = -1;
for(int i=1;i<n*2+1;i++){
if(i%2 == 1) scanf("%d", &v[i]);
else v[i] = -1;
}
int L = 0, R = 0;
for(int i=1;i<n*2+1;i++){
... | ALGO | 0.99999 | 4.094183 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-11-27T15:55: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": "3c7c4b331... |
abbf33fc-6cf9-4080-8289-4435e3f33891 | ECAM-Brussels-Embedded-Systems-Robotics/rl4t-2022 | Balboa_1_Maze/Balancer_Balboa_1_DS/Balancer_Balboa_1_DS.ino | // Maze solving algorithm
// CAREFULL, PLEASE USE SUPPORT TO KEEP THE BALBOA UP OR CHANGE THE CODE ACCORDINGLY !!!!!!!!!
#include <Balboa32U4.h>
#include <Wire.h>
#include <LSM6.h>
#include "Balance.h"
LSM6 imu;
Balboa32U4Motors motors;
Balboa32U4Encoders encoders;
Balboa32U4Buzzer buzzer;
Balboa32U4ButtonA buttonA;
... | ALGO | 0.999287 | 5.092805 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-01-31T16:01:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08104e9fcc912... |
d9739eac-b599-4d50-8098-71c2481ad7d6 | resource-disaggregation/jiffy | libjiffy/src/jiffy/storage/hashtable/hash_slot.h | /*
* Copyright 2001-2010 <NAME> (www.menie.org)
* Copyright 2010 <NAME> (adapted to Redis coding style)
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source cod... | ALGO | 0.982863 | 6.840015 | {
"github_metadata": {
"branch": "master",
"commit_count": 1003,
"repo_created_at": "2018-03-09T21:27:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 48,
"forks": 15,
"issues": 25,
"pull_requests": 4
},
"file_meta": {
"content_id": "427fc... |
efc90574-d60a-4970-a011-61b9a6406b1a | ishandutta2007/codeforces-y | yuma_/normal/877/D.cpp | #include "bits/stdc++.h"
using namespace std;
struct aa {
int x;
int y;
int flag;
int cost;
};
class Compare {
public:
bool operator()(const aa&l, const aa&r) {
return l.cost > r.cost;
}
};
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,1,0,-1 };
int main() {
int H, W, K; cin >> H >> W >> K;
vector<v... | ALGO | 0.999756 | 4.130133 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62158daf8856... |
fecbcd15-4c9f-4662-abba-d81880b0a676 | SiJun-Yoo/Algorithm | 17132.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef queue<int> qi;
typedef queue<pair<int, int>> qii;
typedef priority_queue<int> pqi;
typedef priority_queue<ll> pql;
typedef v... | ALGO | 0.999704 | 3.947202 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2020-07-22T13:10:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebe62878... |
e34c34fb-33e4-40d9-9664-639acae6955d | schrodinger/pymol-open-source | layer0/Util2.h | /*
* Utility functions
*
* (c) 2015 Schrodinger, Inc.
*/
#pragma once
#include <algorithm>
#include <array>
#include <string>
#include <vector>
#include <string.h>
#include <sstream>
#include "pymol/type_traits.h"
#include "pymol/zstring_view.h"
std::vector<std::string> strsplit(const std::string &s, char deli... | TOOL | 0.958816 | 3.006976 | {
"github_metadata": {
"branch": "master",
"commit_count": 5780,
"repo_created_at": "2018-06-19T18:32:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1414,
"forks": 314,
"issues": 92,
"pull_requests": 6
},
"file_meta": {
"content_id": "63... |
f8ab51cd-b2ce-444f-aa06-cd847d34c94f | maxweis/Hackerman-3.0 | src/cipher.h | #pragma once
#include "maths.h"
#include <string>
#include <vector>
const std::vector<std::string> PASSWORD_STRS = {"save", "gaping", "leap", "please", "dusty",
"attract", "hospital", "quiet", "comfort", "probable",
"comp... | TOOL | 0.975568 | 4.684155 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-02-13T00:39:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28187030b... |
54ea6c7a-d024-4406-899b-82767b77f25f | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0802/personal_submission/cf888d_lengnian.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using i128 = __int128;
using ull = unsigned long long;
#define pll pair<ll, ll>
#define pii pair<int, int>
#define vi vector<int>
#define fir(i, a, b) for (int i = a; i <= b; i++)
#define pqi priority_queue<int> // 优先队列
#define all(x) x.begin(), x.... | ALGO | 0.999977 | 4.679257 | {
"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": "60e8... |
8f9b7117-e1fc-457d-8236-30170af87fef | ishandutta2007/codeforces-w | will_dearborn/normal/1220/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef pair<double, double> pdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef vector<int> vi;
typedef vector<vi> ... | ALGO | 0.999902 | 3.936593 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34: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": "2dcb5e8c0b27... |
eabd8bad-b952-4e3c-9cb9-8f86170e4cfa | bingzhangdai/online_judge | leetcode/401 - 500/494. Target Sum.cpp | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
// Another solution
class Solution {
public:
int findTargetSumWays(vector<int>& nums, int S) {
int sum = accumulate(nums.begin(), nums.end(), 0);
if (S > sum || S < - sum)
return 0;
sum += S;
i... | ALGO | 0.999977 | 5.696223 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2015-06-04T14:48: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": "bd495768... |
8415e8c4-38e9-43c4-9457-20eda1712c01 | JAGASABARIVEL/C-_Practice | 150_day_plan/Hashing/word_pattern.cpp | #include "iostream"
#include <map>
#include <vector>
#include <sstream>
using namespace std;
vector<string> split(string str, char delimiter) {
vector<string> result;
stringstream ss(str);
string token;
while (getline(ss, token, delimiter)) {
result.push_back(token);
}
return result;
... | ALGO | 0.982421 | 3.738936 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-31T07:49: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": "d86ec5e94012... |
0f8ba9e5-4f1d-478a-9446-221406d9e8d8 | arjkashyap/competitive-coding | leetcode/easy-questions/merge-two-bin-trees.cpp | // Given two binary trees, merge them to one
// If two nodes overlap, the resulting node should be the sum of
// both the trees
class Solution {
public:
TreeNode* mergeTrees(TreeNode* t1, TreeNode* t2)
{
if(t1 == nullptr && t2 == nullptr)
return nullptr;
if(t1 == nullptr && t2 != n... | ALGO | 0.999982 | 6.114352 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2019-07-05T17:57: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": "9b8a7236... |
d52b9b3c-aa7e-49f2-a254-03965893bfd6 | matifontes/DStructures-Algorithms1 | EjerciciosObligatorio/ListaOrdIntImp2.cpp | /*<NAME> - 248142*/
#include "ListaOrdInt.h"
#ifdef LISTA_ORD_INT_IMP_2
struct NodoABB {
int dato;
unsigned int auxiliar; //para saber si hay repetidos y cantidad.
NodoABB* izq;
NodoABB* der;
NodoABB() {}
NodoABB(int d) : dato(d), izq(NULL), der(NULL), auxiliar(0) {}
};
struct _cabezalListaOrdInt {
NodoABB* r... | ALGO | 0.99958 | 4.841709 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2020-08-27T15:15: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": "1bdbcb4ea... |
7e5a0926-2db4-41a6-a8ec-70310693d6c8 | joaovitorgfs/c-mais-mais | exercicio-28.cpp | /* Faça um Programa que pergunte em que turno você estuda. Peça para digitar M-matutino ou V-Vespertino ou N- Noturno.
Imprima a mensagem "Bom Dia!", "Boa Tarde!" ou "Boa Noite!" ou "Valor Inválido!", conforme o caso. */
#include <stdio.h>
#include <ctype.h>
#include <cmath>
#include <cstring>
#include <locale.h>
int... | TOOL | 0.98947 | 3.903394 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-04-07T17:33:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12c9ce185247... |
6c4926dd-79c5-48cb-8b0c-b74a62c61fc6 | foocoder/HihoCoder | Doodle/FindMinimalSqare/FindMinimalSqare.cpp | // ---- Program Info Start----
//FileName: FindMinimalSqare.cpp
//
//Author: <NAME>
//
//Email: <EMAIL>
//
//CreatedAt: 2016-08-23 16:57:22
// ---- Program Info End ----
#include <iostream>
using namespace std;
int findSqrt( int val ){
int lo = 0, hi = val;
while( lo < hi ){
int ... | ALGO | 0.999564 | 4.249624 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2016-03-15T13:57: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": "c472f551b... |
40b86b31-7dc5-4292-bb98-f2c35f6c116e | tastaslim/Cplusplus | 2.Data Structures and Algorithms/LinkedList/MergeSortOnLinkedListAndresulatantisReverseSorted.cpp | #include <iostream>
using namespace std;
//Take Input Code
class node
{
public:
int data;
node *next;
node(int data)
{
this->data = data;
this->next = NULL;
}
};
node *TakeInput()
{
int value;
cin >> value;
node *head = NULL;
node *tail = NULL;
while (value != -1... | ALGO | 0.999983 | 5.087259 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-08-27T14:30:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0aa07416a0... |
ebd2d02f-805a-4c19-8d87-e9c6ede7a5ec | jishnupramod/Leetcode-May-Challenge-2020 | 18_permutation_in_string.cpp | /*
Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1.
In other words, one of the first string's permutations is the substring of the second string.
Example 1:
Input: s1 = "ab" s2 = "eidbaooo"
Output: True
Explanation: s2 contains one permutation of s1 ("ba").
Example ... | ALGO | 0.999968 | 6.44427 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-05-03T08: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": "3ca7ed361... |
30f8cfe2-adc6-41ff-9b79-ec9c59de5111 | AnirudhLather/Computer-Graphics | BezierCurve/main.cpp | #include <windows.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include<stdio.h>
#include<math.h>
void init()
{
gluOrtho2D(-500,500,-300,300);
}
void BitmapText(char* string, float xc, float yc)
{
char c;
int i = 0;
glRasterPos2f(xc, yc);
for (i = 0; string[i] != '\0'; i++)
{
c = s... | ALGO | 0.996192 | 4.299582 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-11-25T10:02: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": "42bd0ae9a2... |
5a795167-d047-4142-a94c-14856fddbeee | krylelena/Standart_streams | main.cpp | #include "List.h"
int main() {
setlocale(LC_ALL, "");
List ob;
int menu;
int index;
string number;
bool flag = true;
while (flag) {
system("cls");
cout << "1 - Добавить элемент" << endl;
cout << "2 - Удалить элемент" << endl;
cout << "3 - Вывод людей на экран" << endl;
cout << "4 - Поиск человека по... | TOOL | 0.968942 | 3.855823 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-13T18:28:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e0f9c6ef3... |
aabe1be3-5adb-4cc2-8fbe-48e1facb701a | clebail/imagereco | CGeneticDigest.cpp | #include <math.h>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include "CGeneticDigest.h"
CGeneticDigest::CGeneticDigest(CIndividuDigest **population, int taillePopulation, int step, double seuil) : CGenetic(population, taillePopulation) {
oldScore = 0.0;
_step = step;
_seuil = seuil;
}
void CG... | ALGO | 0.999456 | 4.301734 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-08-31T07:28: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": "8b40a152b... |
6dbca340-2370-44c7-815d-e516be1c07d3 | yuvrajeyes/DataStructures | MergeSortTree.cpp | #include<bits/stdc++.h>
using namespace std;
#define all(a) a.begin(), a.end()
class MergeSortTree {
private:
vector<vector<int>> seg;
int N;
int combine(int a, int b) {
return a + b;
}
void build(int ind, int low, int high, vector<int> const& arr) {
if (low == high) {
... | ALGO | 0.999988 | 5.507119 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2023-12-07T14:19: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": "94aabc2ac... |
35312036-f047-43cd-b7f1-e11b0bb2866c | xSeanliux/CompetitiveProgramming | 0J/q340/q340.cpp | #include <iostream>
#include <string.h>
using namespace std;
bool visitedStr[1005];
bool visitedAns[1005];
int N;
string ans, currentStr;
void f(string str){
for(int i = 0; i < 2*N; i++){
visitedStr[i] = false;
visitedAns[i] = false;
}
int A = 0;
int B = 0;
//cout << "Comparing " <... | ALGO | 0.999792 | 3.208205 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-11-18T06:45: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": "64f090aa4... |
96c80bbf-6714-419d-88e8-e87d37e2646c | cbshiles/KALX-xllpwflat | pwflat.cpp | // pwflat.cpp - Piecewise flat forward curve.
// Copyright (c) 2011 KALX, LLC. All rights reserved. No warranty made.
#include "xllpwflat.h"
using namespace xll;
static AddInX xai_pwflat(
ArgsX(CATEGORY)
.Documentation(
xml::Conceptual(_T("Bootstrap yield curve that uses piecewise flat continuously compounded for... | ALGO | 0.989002 | 7.172627 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-10-27T10:07: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": "99537b4b9c... |
4009420e-e28b-42d2-a0e7-2d128ba3941d | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/0_0_7664.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> logo(3);
for (int i = 0; i < 3; i++) {
cin >> logo[i];
}
sort(logo.begin(), logo.end());
int side = max(logo[2], logo[0] + logo[1]);
if (side < logo[0] + logo[1] + logo[2]) {
... | ALGO | 0.999905 | 4.280036 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8a5e306515... |
7ba62eed-6090-4766-b29f-ec680e8eca65 | Cellul4r/Comp_Programming | AtCoder/ABC387-D.cpp | #include<bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void ... | ALGO | 0.999897 | 3.631434 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2024-09-26T13:58:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7608e263... |
f5a5d22b-878b-49a2-9855-1be4491795aa | ThatDNS/UVa-solutions | UVA/Ch 4. Graph/10986 - Sending email.cpp | // Problem: 10986 - Sending email
/**
* Author: DNS-404
**/
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define EPS 1e-9
#define pb push_back
#define INF 1000000000
int main(){
int test, n, m, s, t, u, v, w, cur=0;... | ALGO | 0.999902 | 4.804218 | {
"github_metadata": {
"branch": "master",
"commit_count": 285,
"repo_created_at": "2018-08-29T12:08: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": "50a4258f... |
7aae0155-f306-42c1-808d-5904480e61e0 | FlaxEngine/FlaxEngine | Source/ThirdParty/PhysX/vehicle2/suspension/PxVehicleSuspensionHelpers.h | // Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary... | ALGO | 0.948341 | 6.717855 | {
"github_metadata": {
"branch": "master",
"commit_count": 11694,
"repo_created_at": "2020-12-09T15:02:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6267,
"forks": 614,
"issues": 623,
"pull_requests": 114
},
"file_meta": {
"content_id":... |
146821b8-2641-49ed-9177-035a340d7c85 | JenniferBuehler/urdf-tools-pkgs | urdf_traverser/src/DependencyOrderedJoints.cpp | /**
* <ORGANIZATION> = <NAME>
* <COPYRIGHT HOLDER> = <NAME>
*
* Copyright (c) 2016 <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must ... | ALGO | 0.993567 | 6.99334 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2016-05-19T11:05:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0330497f... |
ead41084-a752-482f-92a8-d6fc372e0e80 | airfranceklm/lucenekit | Pod/Libraries/Header/SpanNearQuery.h | /////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2009-2014 <NAME>. All rights reserved.
// Distributable under the terms of either the Apache License (Version 2.0)
// or the GNU Lesser General Public License.
/////////////////////////////////////////////////////////////////... | ALGO | 0.923053 | 7.152653 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2015-09-16T14:14:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b1e35a8ac... |
ab78ea78-4e37-4ca4-bfae-344423169883 | ykdy3951/Baekjoon | 5985.cpp | #include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl '\n'
#define ll long long
#define INF 987654321
#define sc1(a) scanf("%c", &a)
#define ss1(a) scanf("%s", s)
#define sd1(a) scanf("%d", &a)
#define sd2(a, b) scanf("%d %d", &a, &b)
#define sd3(... | ALGO | 0.999976 | 3.292161 | {
"github_metadata": {
"branch": "main",
"commit_count": 815,
"repo_created_at": "2020-12-20T10:17: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": "4365e1e0ee... |
66664ebb-c11a-4857-ac77-c56d0013cb78 | symforce-org/symforce | symforce/slam/imu_preintegration/imu_factor.h | /* ----------------------------------------------------------------------------
* SymForce - Copyright 2022, Skydio, Inc.
* This source code is under the Apache 2.0 license found in the LICENSE file.
* ---------------------------------------------------------------------------- */
#pragma once
#include <vector>
#... | ALGO | 0.930819 | 5.620416 | {
"github_metadata": {
"branch": "main",
"commit_count": 1111,
"repo_created_at": "2022-01-05T17:55:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1500,
"forks": 161,
"issues": 136,
"pull_requests": 15
},
"file_meta": {
"content_id": "4d... |
4b262ac2-333d-4f26-894a-a9a3680343c1 | marvenlee2486/competitive-programming | cp_contests/Manila17/L.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll solve(vector<ll>& a){
int n = a.size();
ll ans = 0;
for(int i = 0 ; i < n; ++i){
if(a[i] < 0) return -1;
if(a[i] % 2 == 1){
if(i + 2 < n){
a[i]--, a[i+1]--, a[i+2] --;
ans++;
... | ALGO | 0.999868 | 4.234636 | {
"github_metadata": {
"branch": "main",
"commit_count": 225,
"repo_created_at": "2021-01-01T07:31: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": "7617bcb7c6... |
3e5e690b-3680-4115-ba58-049bc1b97532 | luk036/graphx | graphx/utils/mapped_queue.hpp | /** Priority queue class with updatable priorities.
*/
// import heapq
// __all__= ["MappedQueue"];
class _HeapElement {
/** This proxy class separates the heap element from its priority.
The idea is that using a 2-tuple (priority, element) works
for sorting, but not for dict lookup because priorities ... | ALGO | 0.97859 | 5.159839 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-10-22T11:30:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0abae30d3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.