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 |
|---|---|---|---|---|---|---|---|
681e116e-c773-4993-a43b-018e14d3e5d5 | mrklein/mousse | 0.1.0/src/core/meshes/merge_points.hpp | #ifndef CORE_MESHES_MERGE_POINTS_HPP_
#define CORE_MESHES_MERGE_POINTS_HPP_
// mousse: CFD toolbox
// Copyright (C) 2011 OpenFOAM Foundation
// Copyright (C) 2016 mousse project
#include "scalar.hpp"
#include "label_list.hpp"
namespace mousse {
//- Sorts and merges points. All points closer than/equal mergeTol get... | TOOL | 0.902112 | 6.437452 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2015-12-31T10:07:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "801e8b55... |
b78baf69-6764-4242-9ebc-9c718370b194 | 00Greenwood/AdventOfCode2024 | Solutions/Day8.cxx | #include "precompiled.hxx"
#include <Day8.hxx>
Day8::Day8() : Day(8) {
}
Day8::~Day8() {
}
void Day8::initialize() {
parse(name(), m_input);
m_height = m_input.size();
m_width = m_input.at(0).size();
for (int i = 0; i < m_input.size(); ++i) {
for (int j = 0; j < m_input.at(i).size(); ++j) {
char ch... | ALGO | 0.999406 | 5.7304 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-10-07T14:36:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89231e7490e... |
f477b1aa-18a2-4736-98d8-d991bc6e4413 | naor12345/Algorithm-DataStructure | nowcoder/binary-tree-postorder-traversal.cpp | // Given a binary tree, return the postorder traversal of its nodes' values.
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
using node = TreeNode;
... | ALGO | 0.999985 | 6.03824 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-03-12T01:31: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": "b158e6569... |
83610594-2321-460d-8ae5-1d0f638610f0 | OpenQBMM/OpenQBMM | src/quadratureMethods/momentInversion/univariate/basic/univariateMomentInversion/univariateMomentInversion.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | OpenQBMM - www.openqbmm.org
\\/ M anipulation |
------------------------... | ALGO | 0.998836 | 6.720395 | {
"github_metadata": {
"branch": "master",
"commit_count": 1295,
"repo_created_at": "2015-09-04T02:15:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 105,
"forks": 51,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "33dab... |
d7bfc07c-6c36-4c30-8f75-60e040bb68fa | Pritanjan/Leetcode | 2401 - 2600/2418. Sort the People.cpp | // APPROACH 1
class Solution {
public:
vector<string> sortPeople(vector<string>& n, vector<int>& h) {
vector<string> ans;
vector<pair<int, string>> vp;
for (int i = 0; i < n.size(); i++) {
vp.push_back({h[i], n[i]});
}
sort(vp.rbegin(), vp.rend());
for ... | ALGO | 0.999997 | 6.328849 | {
"github_metadata": {
"branch": "main",
"commit_count": 2409,
"repo_created_at": "2022-04-09T13:04:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eec0ce441... |
8fdccc74-1e5f-4757-9337-d4786a34f45c | hisinghal/LeetCode | maximum_area_of_triangle.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> position ( string str, char ch) {
vector<int> tmp;
int left = str.find(ch);
int right = str.rfind(ch);
if(left != -1 && right != -1) {
tmp.push_back(left);
tmp.push_back(right);
}
return tmp;
}
int position(int ar[], int ... | ALGO | 0.984532 | 4.613741 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-07-03T06:17: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": "d608b1a9727... |
95172342-b0cc-410a-9b2f-04fd612b3d14 | Xilinx/Vitis-AI | src/vai_runtime/vart/util/src/simple_config.cpp | /*
* Copyright 2022-2023 Advanced Micro Devices Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | TOOL | 0.961055 | 6.97443 | {
"github_metadata": {
"branch": "master",
"commit_count": 1253,
"repo_created_at": "2019-10-16T21:41:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1631,
"forks": 649,
"issues": 340,
"pull_requests": 75
},
"file_meta": {
"content_id": "... |
31265498-0647-4fdb-be1c-cbada84b0a7d | jinzcdev/PTA | PAT_(Basic_Level)_Practice_(中文)/编程题/1068 万绿丛中一点红.cpp | // https://pintia.cn/problem-sets/994805260223102976/exam/problems/type/7?problemSetProblemId=994805265579229184
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int X[8] = {-1, -1, -1, 1, 1, 1, 0, 0};
int Y[8] = {-1, 0, 1, -1, 0, 1, -1, 1};
int m, n, tol, a[maxn][maxn];
bool exceedTOL(int x, int y,... | ALGO | 0.999775 | 4.309824 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-01-23T14:11:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3735b5e4bb4... |
38056be0-5f62-4ed8-a6bc-1e55b153c546 | umma-aymon/4th-Semester_Computer-Algorithms | algorithms/travelling salesman problem.cpp | #include <bits/stdc++.h>
using namespace std;
int n = 4;
int dist[10][10] =
{
{0, 20, 42, 25},
{20, 0, 30, 34},
{42, 30, 0, 10},
{25, 34, 10, 0}};
int VISITED_ALL = (1 << n) - 1;
int dp[16][4];
int tsp(int mask, int pos)
{
if (mask == VISITED_ALL)
return dist[pos][0];
... | ALGO | 0.99997 | 3.764316 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2020-11-30T09:07: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": "1baa59fdf59c... |
4bd1224d-998e-4110-83f2-6b6d0961edeb | mimikuo365/Coding-Practice | 10066. The Twin Towers.cpp | #include <vector>
#include <iostream>
using namespace std;
int visited[101][101] = {0};
int dp[101][101] = {0};
int dynamicRecurrent(int x, int y)
{
if (x <= 0 || y <= 0)
return 0;
if (visited[x][y] == 1)
return dp[x][y];
int diagonal = dynamicRecurrent(x-1, y-1) + 1;
int left = d... | ALGO | 0.999788 | 3.865489 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2021-02-11T04:19:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "898fe24187... |
d1eb392d-56f8-4fa4-93ca-ca42da332003 | eliasorre/WWPNAI | dir-Champ/prefetcher/berti/berti.cc | #include "cache.h"
#include <iostream>
#include <ostream>
#include <cassert>
using namespace std;
#define L1D_PAGE_BLOCKS_BITS (LOG2_PAGE_SIZE - LOG2_BLOCK_SIZE)
#define L1D_PAGE_BLOCKS (1 << L1D_PAGE_BLOCKS_BITS)
#define L1D_PAGE_OFFSET_MASK (L1D_PAGE_BLOCKS - 1)
#define L1D_BERTI_THROTTLING 1
#define L1D_BURST_THR... | ALGO | 0.989161 | 4.003582 | {
"github_metadata": {
"branch": "main",
"commit_count": 118690,
"repo_created_at": "2024-06-08T21:51: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": "e4d501e... |
ac0aff25-009f-4d93-98fa-f21c74bbfc28 | zhbom25/cpp-primer- | example/example_10_1.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <list>
#include <numeric>
using namespace std;
int main(int argc, char** argv)
{
int val = 42;
int arr[] = {10,22,31,245,45,78,90,46,53,42};
vector<int> vec(arr, arr+sizeof(arr)/sizeof(arr[0]));
auto result = find(ve... | ALGO | 0.99026 | 4.365655 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-03-17T09:20: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": "49dbaf8b0f81... |
c33e258a-175a-483e-8484-626701dd9a15 | alextkalinka/linkcomm | src/linkcomm_functions.cpp | /* Miscellaneous functions for "linkcomm".
*
* Author: <NAME> (<EMAIL>)
*
* Will be loaded as a shared object into R (dyn.load('name.so')) and called from within R.
* Based on the Link communities derived from the algorithm in:
* Ahn et al. (2010). Link communities reveal multiscale complexity in networks. Nature... | ALGO | 0.96843 | 4.748103 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-03-05T22:14:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd5b394b6... |
46bc2115-65c1-413b-9284-64754b561cfb | axelu/leetcode | cpp/00000-00499/largestrectangleinhistogram.cpp |
// 84. Largest Rectangle in Histogram
// https://leetcode.com/problems/largest-rectangle-in-histogram/
// day 31 December 2020 challenge
// https://leetcode.com/explore/challenge/card/december-leetcoding-challenge/573/week-5-december-29th-december-31st/3587/
class Solution {
public:
int largestRectangleArea(vecto... | ALGO | 0.999928 | 6.387158 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2021-04-08T21:22: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": "95953faff01... |
73e0d5a0-890f-453b-94cb-1ff16994aaa0 | elifesciences-publications/bpps-sipris-code | lib/libhat/setup_gapmaps.cc | /******************************************************************************************
Copyright (C) 1997-2014 <NAME>, Cold Spring Harbor Laboratory
and the University of Maryland School of Medicine.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and... | ALGO | 0.949802 | 3.810494 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-01-08T04:44:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cacb9c1cdea... |
86368e31-1307-446e-9b0a-994a9c5daca7 | zhuango/leetCode | cppForLeetcode/756_PyramidTransitionMatrix.cpp | #include <string>
#include <vector>
#include <unordered_map>
#include <iostream>
using namespace std;
class Solution {
public:
bool pyramidTransition(string bottom, vector<string>& allowed) {
unordered_map<string, string> allowedDict;
for(string &s : allowed)
{
allowedDict[s.su... | ALGO | 0.999721 | 4.608244 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2016-02-02T11:11:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dd7cfa... |
615c4159-e945-435c-8fa3-26d4b2d8dfd2 | alanlyyy/C-Sedgewick-Data-Structures | Chapter 3/ex_3_68.cpp | #include <iostream>
#include "data_containers.h"
struct mult_list_pair {
int row = 0;
int col = 0;
mult_list_pair* next_pair;
mult_list_pair(int row_num, int col_num, mult_list_pair* next) {
row = row_num;
col = col_num;
next_pair = next;
}
};
struct mult_list_v2 {
mult_list_pair* header;
mult_list_pa... | ALGO | 0.973962 | 3.374208 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-11-15T23:02: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": "1737c5b4a3c4... |
896e2780-1567-40aa-862a-e32347f65531 | alxsoares/OI | TC/testprograms/ImportantSequence.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999968 | 4.265155 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-06-29T20:25: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": "04de7f659d... |
af1606e3-b29b-40ee-a6a7-1dac53afb1ff | DNA-B/Problem-Solving | 백준/Bronze/14456. Hoof, Paper, Scissors (Bronze)/Hoof, Paper, Scissors (Bronze).cc | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
/******** MACRO ********/
#define INT_INF 0x3f3f3f3f
#define LL_INF 1e18
#define MOD 1'000'000'007
#define PI 3.1415926535897932
#define ll long long
#define X first
#define Y second
/***********************/
/****** VARIABLEs ******/
int N,... | ALGO | 0.999914 | 4.475432 | {
"github_metadata": {
"branch": "main",
"commit_count": 1767,
"repo_created_at": "2022-09-22T10:06:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31f3a690c... |
5288bffe-a378-48de-9523-f2628263ff12 | andrewliu00/Music-Visualizer | Code/pixel.cpp | #include "ws2812-rpi.h"
#include "CSVparser.hpp"
#include <iostream>
#include <string>
#include <math.h>
#include <time.h>
#include <sys/time.h> //for gettimeofday()
using namespace std;
void findMaxMin(int maxRow, float frequencies[][16], float &min, float &max)
{
for (int i = 0; i < maxRow; i++)
{
... | TOOL | 0.926261 | 3.716141 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2018-11-29T03:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63d35ef1d... |
097c08c6-4a7d-484d-8564-1fa30bf9a84b | M-E-U-E/Current | C. Paint the Array.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve()
{
ll n, i, j, c=0, g1=0, g2=0, f1=1, f2=1;
cin >> n;
ll a[n+7];
vector<ll>v1, v2;
for(i=0; i<n; i++)
{
cin >> a[i];
if(i%2==0)
{
v1.push_back(a[i]);
}
else
{... | ALGO | 0.999989 | 3.89417 | {
"github_metadata": {
"branch": "main",
"commit_count": 551,
"repo_created_at": "2023-06-27T21:59: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": "17bf7b21d6... |
478557e4-7eee-4808-8651-9f753ada1f13 | wberdowski/SelectionSort | SelectionSort/Source.cpp | #include <iostream>
using namespace std;
int findMinIndex(int* arr, int len, int startIndex) {
int minIndex = startIndex;
for (int i = startIndex + 1; i < len; i++) {
if (arr[i] < arr[minIndex]) {
minIndex = i;
}
}
return minIndex;
}
void printArray(int* arr, int len, int currentIdx = -1) {
for (int i ... | ALGO | 0.999989 | 5.708791 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-12-21T21:05: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": "c0ad2a8696... |
d04db86a-663c-4b55-9c69-de5ddf8e6b04 | ishandutta2007/codeforces-a | anadi/normal/1684/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define st first
#define nd second
#define PII pair <int, int>
const int N = 1'000'007;
const int MOD = 1'000'000'007;
const ll INF = 1LL * MOD * MOD;
void solve()
{
int n, k;
scanf("%d %d", &n, &k);
vector <int> in(n);
long long a... | ALGO | 0.999755 | 4.385417 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4f9b137d3fc... |
9785b888-4d69-4178-a564-ddaff50bbde7 | tolerance93/LeetCode | Restore IP Addresses/Restore IP Addresses/main.cpp | /**
* Runtime: 3 ms, faster than 67.54% of C++ online submissions for Restore IP Addresses.
* Memory Usage: 6.5 MB, less than 87.80% of C++ online submissions for Restore IP Addresses.
*/
#include <vector>
#include <string>
#include <iostream>
using namespace std;
class Solution {
public:
bool isCorrectS... | ALGO | 0.999668 | 5.38876 | {
"github_metadata": {
"branch": "master",
"commit_count": 171,
"repo_created_at": "2021-01-10T07:42:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f0e157b... |
a44b6266-e2e4-488c-96e9-48ea33f42c9c | knagakura/procon | atcoder/abc158/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<... | ALGO | 0.999891 | 3.932144 | {
"github_metadata": {
"branch": "master",
"commit_count": 328,
"repo_created_at": "2018-12-14T09:52: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": "aaf4b841... |
9d796aef-7dda-40d1-a219-5cbddba0fe58 | HPAC/lammps-tersoff-vector | machines/lammps-10Mar16/src/USER-SMD/compute_smd_vol.h | /* ----------------------------------------------------------------------
*
* *** Smooth Mach Dynamics ***
*
* This file is part of the USER-SMD package for LAMMPS.
* Copyright (2014) <NAME>, <EMAIL>
* Fraunhofer Ernst-Mach Institute for High-Speed Dynamics, EMI,
* Eckerstrasse 4, D-79104 Frei... | TOOL | 0.935282 | 5.49187 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-11-12T22:21:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0450654e2... |
02043e3a-b1df-475b-be8c-676d88b85fff | nhkhai-vn/ScSLINT | Alignment.cpp | #include "Resolution.h"
#include "StreamIO.h"
#include "Utility.h"
#include <algorithm>
INT32 ComparePredicateType(PredicateInfo A, PredicateInfo B) { return A.Type < B.Type; }
INT32 ReverseComparePredicate(PredicateInfo A, PredicateInfo B) { return A.Diversity > B.Diversity; }
INT32 ReverseCompareAlignment(Alignment ... | ALGO | 0.994438 | 4.031123 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-14T12:04: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": "9d7830791f34... |
19666fba-1909-410c-822f-546d655e5c60 | anubhav811/DSA-Practice | cpp/DP/DP on Stocks/BuySellStock4_GFG_LC.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int spaceOpt(int n , int k,vector<int> & prices){
vector<vector<int>> next(2,vector<int>(k+1,0)), curr(2,vector<int>(k+1,0));
for(int i = n-1; i>=0;i--){
for(int j=0 ; j<=2;j++){
for(int t = 1;t<=k;t+... | ALGO | 0.999684 | 5.4439 | {
"github_metadata": {
"branch": "master",
"commit_count": 1613,
"repo_created_at": "2022-02-16T02:46:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10dbfa5... |
e56bec08-631f-4625-814e-1b48a9c36ff0 | HuangJingGitHub/PracMakePert_C-Cpp | leetcode/two_sum/leetcode_30.cpp | // This solution is feasible. But the speed is slow because of the manipulation of the vector like copy and erase.
// To deal with this, hashmap is better.
class Solution {
public:
vector<int> findSubstring(string s, vector<string>& words) {
vector<int> ret;
if (words.size() == 0)
retu... | ALGO | 0.999948 | 6.196248 | {
"github_metadata": {
"branch": "master",
"commit_count": 1601,
"repo_created_at": "2018-06-18T09:26:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8a6031... |
742fbe63-9657-4521-bb0c-c8b42d8e078d | Ravi-Maurya/Competitive_Programming | Google_Code_Jam/Qualifier/Esabatad.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("-O3")
void complement(vector<int>& arr){
int n = arr.size();
for(int i=0;i<n;i++){
arr[i] = arr[i]^1;
}
return;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL); cout.tie(NULL);
set<pair<int,int>> set1,set... | ALGO | 0.999507 | 3.171109 | {
"github_metadata": {
"branch": "master",
"commit_count": 243,
"repo_created_at": "2020-02-28T10:05:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3383c6ce... |
51f6460c-a63d-4ac1-910e-79dc651380d3 | Arashimu/ACM | ACM_/算法/计算几何/二维凸包有关.cpp | //二维几何常用算法
//精度判断 (留坑)
//1.判断点是否在多边形内:射线法 转角法 (常用)
//计算凸包 Andrew算法 O(nlogn)
//计算凸包,输入点数组p,个数为p,输出点数组ch。函数返回凸包的顶点数。
//输入不能带有重复点。函数执行完后输入点的顺序被破坏
//如果不希望在凸包的边上有输入点,吧两个<=改成<
//在精度要求较高时建议用dcmp比较
bool cmp(Point a,Point b)
{
if(a.x!=b.x)return a.x<b.x;
else return a.y<b.y;
}
//... | ALGO | 0.999397 | 3.377115 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-06-25T08:54: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": "90afaadc2ae4... |
7252b0b9-1b8f-4471-ba15-2808b30dc69f | sivaramakrishnan1/SDE-Preparation | Leet Code/203/RemoveElementFromLinkedList.cpp | #include <iostream>
using namespace std;
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
struct L... | ALGO | 0.999819 | 4.679517 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2022-07-04T03:18:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e48eb115110... |
103f8056-c446-42ed-a997-5c230126f503 | pingpan2013/coding-exercises | Array/find_common_elements_in_three_sorted_arrs.cc | /*
* =====================================================================================
*
* Filename: find_common_elements_in_three_sorted_arrs.cc
*
* Description: find commom elements in three sorted arrs
*
* Created: 02/06/2015 01:27:18
* Compiler: g++ 4.7.0
*
* ================... | ALGO | 0.999231 | 6.300694 | {
"github_metadata": {
"branch": "master",
"commit_count": 341,
"repo_created_at": "2014-07-08T13:38: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": "22c51263... |
7a25f983-24a4-40df-a113-53fc6201c8ca | lorrancmlopes/VehicleRoutingProblem | 3_openMP.cpp | #include <iostream>
#include <fstream>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <chrono>
#include <limits>
#include <omp.h>
using namespace std;
using namespace std::chrono;
// Função para gerar permutações
void generate_permutations(vector<int>& nodes, vector<vector<int>>& permutation... | ALGO | 0.999924 | 6.141671 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-04-11T17:03: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": "fc88d405e5ca... |
26dd20dc-514a-4648-9ddf-020568f465bb | dude123studios/USACO | USACO-Gold/Graphs/spanningtree/fenced.cpp | #include <bits/stdc++.h>
using namespace std;
struct DSU
{
vector<int> e;
DSU(int N) { e = vector<int>(N, -1); }
int get(int x) { return e[x] < 0 ? x : e[x] = get(e[x]); }
bool same(int a, int b) { return get(a) == get(b); }
int size(int x) { return -e[get(x)]; }
bool unite(int a, int b)
{
... | ALGO | 0.999973 | 3.473347 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-07-03T02:08:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c38c1cc85... |
b3b587eb-2f01-48f6-8ec9-76d217d6a521 | CERN-PH-CMG/cmg-cmssw | RecoTracker/CkfPattern/src/CkfTrajectoryBuilder.cc | #include "RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "TrackingTools/GeomPropagators/interface/Propagator.h"
#include "TrackingTools/PatternTools/interface/TrajectoryS... | ALGO | 0.991643 | 4.855337 | {
"github_metadata": {
"branch": "heppy_94X_dev",
"commit_count": 185721,
"repo_created_at": "2013-09-25T08:23:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 19,
"forks": 242,
"issues": 16,
"pull_requests": 1
},
"file_meta": {
"content_i... |
d7dc4b92-03da-4c31-84bd-cfe695d804fb | wwwwodddd/Zukunft | luogu/P7151.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
char s[1020][1020];
int d[1020][1020];
int f[1020][1020];
int g[1020][1020];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
bool in(int x, int y)
{
return 0 <= x && x < n && 0 <= y && y < n;
}
int main()
{
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++)... | ALGO | 0.999924 | 3.855381 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-12-31T17:17:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18175dc... |
2ea4544e-c1ff-4760-acda-69e4c267e223 | Masttf/XCPC | atcoder/ABC377/e.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
#define dbg(x...) \
do { \
cout << #x << " -> "; \
err(x); \
} while (0)
void err() {
cout << endl << endl;
}
template<class T, class... Ts>
void err(T arg, Ts ... args) {
cout << fixed << setprecision(10) << arg << ' ';
err(args.... | ALGO | 0.999958 | 3.722683 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2025-02-09T13:42:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3374e7c98... |
64bfaf7c-68b2-4d36-beee-ef8c44af48f5 | Beom-June/CppAlgorithmExercise | CppAlgorithmExercise/75. 최대 수입 스케쥴 (priority_queue 응용 문제).cpp | /*
문제 75. 최대 수입 스케쥴(priority_queue 응용문제)
현수는 유명한 강연자이다.N개이 기업에서 강연 요청을 해왔다.각 기업은 D일 안에 와서 강연을 해 주면 M만큼의 강연료를 주기로 했다.
각 기업이 요청한 D와 M를 바탕으로 가장 많을 돈을 벌 수 있도록 강연 스케쥴을 짜야 한다.
단 강연의 특성상 현수는 하루에 하나의 기업에서만 강연을 할 수 있다.
▣ 입력설명
첫 번째 줄에 자연수 N(1 <= N <= 10, 000)이 주어지고, 다음 N개의 줄에 M(1 <= M <= 10, 000)과
D(1 <= D <= 10, 000)가 차례로 주어진다... | ALGO | 0.999952 | 3.912809 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2022-08-15T23:11: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": "c8d31ecb1... |
4e80e26c-f6cb-49f6-86c7-be59cceb5f0d | niclad/eece5640 | hw3/p4/tedori_hw3p4_reduc.cpp | // OpenMP matrix multiplication
// <NAME>
#include <omp.h>
#include <iostream>
#include <string>
using namespace std;
const int M = 20; // the m-dimension for matrices
const int RANGE = 10; // maximum value for the random stuff
// FUNCTION DECLARATIONS
int* initVect(bool results) {
int* tempArr = new int... | ALGO | 0.999204 | 4.158659 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-02-05T23:03:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "736a323a5... |
124b2bca-d1b5-4364-ad0b-6fddca98b33f | ochubar/SRW | cpp/src/core/srpersto.h | /************************************************************************//**
* File: srpersto.h
* Description: Calculation of Stokes parameters / Spectral Flux of Undulator Radiation from a Finite-Emittance Electron Beam, collected by a finite-size rectangular aperture (header)
* Project: Synchrotron Radiation Work... | ALGO | 0.994711 | 4.575789 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2013-03-12T05:09:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 93,
"forks": 71,
"issues": 22,
"pull_requests": 8
},
"file_meta": {
"content_id": "439443... |
da586f61-0231-4b2d-9667-d7f3883d6d65 | liuyubobobo/Play-Leetcode | 0001-0500/0005-Longest-Palindromic-Substring/cpp-0005/main.cpp | /// Source : https://leetcode.com/problems/longest-palindromic-substring/
/// Author : liuyubobobo
/// Time : 2019-01-11
#include <iostream>
using namespace std;
/// Brute Force
/// Time Complexity: O(n^3)
/// Space Complexity: O(1)
class Solution {
public:
string longestPalindrome(string s) {
if(s =... | ALGO | 0.99993 | 5.413954 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "33... |
dffbc057-9f45-4611-a5f9-7e5b953be472 | LinKoKoNaing/Lin | Bubblesort.cpp | #include <iostream>
#include <vector>
using namespace std;
// Bubble Sort function
void bubbleSort(vector<int>& arr) {
int n = arr.size();
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
// Swap arr[j] and arr[j+1]
... | ALGO | 0.999966 | 6.043347 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-05T09:25:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ba7235f22c6... |
a1d26ed4-a705-456f-9b1f-dc7a9f0f2d3c | ws19999/coding | 백준/Gold/14438. 수열과 쿼리 17/수열과 쿼리 17.cc | #include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <cmath>
using namespace std;
struct node {
int minval, left, right;
};
struct node table[400000];
int dfs(int i, int j, int num) {
int val = 1000000000;
if (table[num].left >= i && table[num].right <= j)return table[num].mi... | ALGO | 0.999978 | 4.52581 | {
"github_metadata": {
"branch": "main",
"commit_count": 786,
"repo_created_at": "2024-06-17T08:26: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": "8471a3cd76... |
846000a5-7751-4dfe-9733-b45d5e4583a2 | mmi366127/Online_Judge | zerojudge/d449 垃圾信件/d449 垃圾信件.cpp | #include <stdio.h>
#define maxn 1000007
#define getchar getchar_unlocked
int rd() {
static char c; static int ret;
for(c = getchar(); c < '0'; c = getchar())
if(c == EOF) return 0;
for(ret = 0; c >= '0'; c = getchar())
ret = (ret << 3) + (ret << 1) + (c ^ '0');
return ret;
}
int p[ma... | ALGO | 0.999933 | 3.790133 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2019-06-09T14:17: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": "4fa9c59d... |
ec191c6c-0395-442f-a30f-8c459321f0cd | miaodi/leetcode_practice | 79.word-search.cpp | /*
* @lc app=leetcode id=79 lang=cpp
*
* [79] Word Search
*
* https://leetcode.com/problems/word-search/description/
*
* algorithms
* Medium (30.29%)
* Total Accepted: 249.4K
* Total Submissions: 823.4K
* Testcase Example: '[["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]]\n"ABCCED"'
*
* Given a ... | ALGO | 0.999636 | 6.668906 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-02-23T02:51: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": "518f3d351... |
865c224c-f830-46a4-97d4-3c2ddde8790e | vikram-rathore1/competitive_programming | experiments/validnumber.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
int main(){
string A = "+ ";
int state = 0;
vector< vector<int> > transition;
vector<int> row;
row.push_back(10);
row.push_back(1);
row.push_back(6);
row.push_back(9);
row.push_bac... | ALGO | 0.999539 | 3.443434 | {
"github_metadata": {
"branch": "master",
"commit_count": 407,
"repo_created_at": "2016-08-13T20:39: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": "efa2fa26... |
8623d041-1db2-4529-a232-5fc71f974d32 | Koziev/GrammarEngine | src/math/random/randu.cpp | // -----------------------------------------------------------------------------
// File RANDU.CPP
//
// (c) <NAME>, Obninsk-Cherepovets, Russia, 1995-2004
//
// Content:
// Прекрасный генератор псевдослучайных равномерно распределенных чисел с
// автоматической настройкой на процессор.
// -----------------------------... | ALGO | 0.969531 | 4.124128 | {
"github_metadata": {
"branch": "master",
"commit_count": 220,
"repo_created_at": "2014-09-14T11:18:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 75,
"forks": 20,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6e211... |
bb865df6-e55c-4264-a9b2-32d33cbfaa89 | Mallhw/CompetitiveProgramming | USACO/Jan 2025/Silver/FarmerJohnsFavoriteOperation5.cpp | #include <bits/stdc++.h>
using namespace std;
#define dbg(x) cerr << __LINE__ << ": " << #x << "=" << x << endl;
typedef long long int ll;
typedef vector<long long> vll;
ll cal(const vll& mods, ll m, ll x) {
ll ans = 0;
for(ll r : mods) {
ll d = abs(r - x);
ans += min(d, m - d);
}
... | ALGO | 0.999975 | 4.84099 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2024-12-12T22:26:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "925f8cee653... |
2624dcf9-adf1-4be4-a986-cbb7500afcf4 | NikitochkaHrum/numerical_analysis_labs | src/integration/method_log/method_info.cpp | #include "method_info.h"
// Оценка погрешности по правилу Рунге
ld error_estimation(ld s1, ld s2, ld h, int k) {
return (s2 - s1) * pow(alpha, k) / (1 - pow(alpha, k));
return ((s2 - s1) / (pow(h / alpha, k) - pow(h, k))) * pow(h, 2);
}
// Оценка порядка погрешности
ld degree_estimation(ld s1, ld s2, ld s3) {... | ALGO | 0.990404 | 3.639167 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-10-03T09:00: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": "97a05c5dabf... |
d45475d7-67b8-47a8-8a3d-a76b60f449a4 | CarIsFast/DSA | lecture-57/celebretyProblem.cpp | // // My approch
// class Solution {
// public:
// // Function to find if there is a celebrity in the party or not.
// int celebrity(vector<vector<int> >& mat) {
// // code here
// int m = mat.size();
// int n = mat[0].size();
// int presentCeleIndex = -1;
// for(int ro... | ALGO | 0.998551 | 5.344834 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-07-06T09:37: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": "16bcbea4822... |
b1420cc9-7e99-4b6a-a277-240bfc0d8bda | aditya-armal/Leet-Code | 0005-longest-palindromic-substring/0005-longest-palindromic-substring.cpp | class Solution {
public:
std::string longestPalindrome(std::string s) {
int n = s.length();
if (n <= 1) {
return s;
}
std::vector<std::vector<bool>> isPalindrome(n, std::vector<bool>(n, false));
for (int i = 0; i < n; ++i) {
isPalindrome[i][i] = true... | ALGO | 0.999958 | 6.442523 | {
"github_metadata": {
"branch": "main",
"commit_count": 1069,
"repo_created_at": "2023-11-11T18:56:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4731c72bd... |
0adbc9ec-2bc3-4792-af66-177a156027f6 | mjyplusone/PAT | PATB_34/main.cpp | #include <iostream>
#include <cstdio>
using namespace std;
long long Yue(long long a,long long b) //找两个数的最大公约数,辗转相处法
{
long long r;
r=b%a;
while(r)
{
b=a;
a=r;
r=b%a;
}
return a;
}
void print(long long a,long long b)
{
long long k,r,aabs;
if(a==0) printf("0");
else
{
... | ALGO | 0.9997 | 3.696645 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-10-23T11:27: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": "9cf21f4c16... |
6d87ef0d-205a-4fcc-9601-155c0367495d | Ashukr321/complete_data_structure_and_algorithms_for_placement | october_30_day_2k24_challange/day5/_13_binary_search.cpp | // preprocessor
#include <iostream>
using namespace std;
int binarySearch(int arr[], int size, int target)
{
int l = 0;
int h = size - 1;
while (l <= h) // changed from l < h to l <= h
{
int mid = (l + h) / 2; // changed from l + h / 2 to (l + h) / 2
if (arr[mid] == target)
{
return mid;
... | ALGO | 0.999729 | 5.401733 | {
"github_metadata": {
"branch": "master",
"commit_count": 1737,
"repo_created_at": "2024-04-28T12:42:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d665044... |
3edfd264-9837-4361-8c93-17cb8a58fd5e | jazzboysc/SwingEngine2 | SwingEngine/SEGeometricTools/ComputationalGeometry/SEQuery2Filtered.cpp | // Swing Engine Version 2 Source Code
// Most of techniques in the engine are mainly based on <NAME>'s
// Wild Magic 4 and 5 open-source game engine. The author of Swing Engine
// learned a lot from Eberly's experience of architecture and algorithm.
// Several subsystems are totally new, and others are reorganized or... | TOOL | 0.968118 | 6.180369 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2015-10-18T19:06:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7dd8c945... |
412923d9-76ce-43ba-8701-e107d85bfd87 | niharika2k00/Codechef_codes | The_One_with_All_the_Candy.cpp | /*
________________________________________
----------------------------------------
Author : <NAME>
Code Link : https://www.codechef.com/FOUR21C/problems/S07E09
Time Complexity :
________________________________________
----------------------------------------
*/
#include <bits/stdc++.h>
#include <iostream>
... | ALGO | 0.999721 | 4.140693 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2020-11-20T20:21:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf40b7aaa0... |
7a1178ce-a996-4077-b8e1-a3fcb27ca099 | aditya059/LeetCode-Solutions | 112-path-sum/112-path-sum.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.999964 | 5.714508 | {
"github_metadata": {
"branch": "main",
"commit_count": 3019,
"repo_created_at": "2021-12-02T19:29:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7580a39e5... |
48c8b244-f125-427a-be85-a8c1dddc0b37 | shakilaust/Light-Oj-Solve | 1162 - MIN MAX ROADS.cpp |
//BISMILLAHIRRAHMANIRRAHIM
/*
manus tar shopner soman boro
Author :: <NAME>
.............AUST_CSE27.........
prob ::
Type ::
verdict::
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
#include <set>
#include <algorithm>
#include <iostrea... | ALGO | 0.999962 | 4.043549 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-02-05T15:52:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 23,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2aaf2b2... |
1a51fde9-feb2-4711-b97e-f34d06841d0e | vimerlonely/Sorts | Insertion.cpp | // #############################################################################
// # FileName: Insertion.cpp
// # Author: Lonely, CS0901, HUST
// #############################################################################
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
// # sorting ... | ALGO | 0.999958 | 5.431426 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-09-18T05:22: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": "b82deee01d... |
aeb1081d-5aa5-46a7-8876-853ee9bc44d8 | vaclavblazej/codebook | solutions/data_structures/segment_tree.cpp | #include "../template.h"
/**
* Author: <NAME>
* License: CC0
* History:
* 2025-04-06 Added Segment tree
*/
/** segtree
* Title: Range minimum query & element set (Segment tree)
* Description: Short segment tree with only set element and
* range minimum query for inclusive-exclusive range [l, r).
* Time: set... | ALGO | 0.999804 | 5.176693 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-03-20T15:57: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": "4e730cbb534... |
e7f282e0-8c46-4994-9907-e4258de69e0f | ishandutta2007/codeforces-s | ssrs_/normal/1365/E.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<long long> a(n);
for (int i = 0; i < n; i++){
cin >> a[i];
}
long long ans = 0;
for (int i = 0; i < n; i++){
ans = max(ans, a[i]);
}
for (int i = 0; i < n; i++){
for (int j = i + 1; j < n; j++){
ans = m... | ALGO | 0.999936 | 4.154665 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "d3138ed5d906... |
eb634273-e106-4966-8c13-486d51e1a7af | Jaid2907/Leetcode-Submissions | Number Of Islands - GFG/number-of-islands.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class DSU{
public:
vector<int> parent;
vector<int> rank;
DSU(int n){
parent.resize(n);
for(int i = 0; i<n; i++)
parent[i] = i;
rank.resize(n,1);
}
... | ALGO | 0.999854 | 5.178596 | {
"github_metadata": {
"branch": "main",
"commit_count": 2151,
"repo_created_at": "2022-02-01T17:17: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": "2a0337d53... |
4950c61a-98c2-4864-8645-cd7a718289e6 | psigelo/NEATSpikes | src/LIFNeuron/LIFNeuron.cpp | #include "LIFNeuron.hpp"
#include <cmath> // exp fabs
#include <iostream>
using namespace std;
namespace NEAT
{
LIFNeuron::~LIFNeuron()
{
}
LIFNeuron::LIFNeuron(float samplingDelaTime) : LIFNeuron( LIFNeuronUserDefinitions(), samplingDelaTime ){}
LIFNeuron::LIFNeuron( const LIFNeuronUserDefinitions& LIFNeuronUse... | ALGO | 0.976522 | 5.833022 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-07-31T00:20: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": "3ae8b64d8... |
84621004-7053-4e5d-9e07-16e521011979 | Jday4612/Baekjoon | C++/Tetromino.cc | #include <iostream>
#include <algorithm>
using namespace std;
int N, M, ans = 0, paper[500][500], visited[500][500] = { 0 };
int dx[4] = { 0, 0, 1, -1 }, dy[4] = { -1, 1, 0, 0 };
void solve(int x, int y, int cnt, int sum);
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
cin >> N >> M;
for ... | ALGO | 0.999981 | 4.380816 | {
"github_metadata": {
"branch": "master",
"commit_count": 460,
"repo_created_at": "2021-02-16T10:32: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": "c1bf0291... |
789d98be-8ba8-4891-9808-eaf5bdcf360a | siddhant139/Coding | segmenttree.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int a[100100];
int t[400400];
void build(int index, int l, int r) {
if (l == r) {
t[index] = a[l];
return;
}
int mid = (l + r) / 2;
build(index*2, l, mid);
build(index*2+1, mid+1, r);
t[index] = t[index*2] + t[index*2+1];
}... | ALGO | 0.999734 | 5.263422 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-22T19:55:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9fc2659fa03... |
a389e6e0-760e-49e2-8e3b-3f5e1692ec80 | Aks32216/Daily-Practice | DP/maxSumPath.cpp | #include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <map>
#include <string.h>
#include <algorithm>
#include <bits/stdc++.h>
#include <vector>
using namespace std;
#define set_precision cout << fixed << setprecision(10)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repb(i, a,... | ALGO | 0.999988 | 3.046151 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2022-08-18T22:46: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": "cac54e11191... |
abb897f3-7dc2-4aae-bcc2-ce5f4effdd7d | electronicarts/CnC_Renegade | Code/Tools/LevelEdit/VisSectorSampler.cpp | /*
** Command & Conquer Renegade(tm)
** Copyright 2025 Electronic Arts Inc.
**
** 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 3 of the License, or
** (at your option) any late... | ALGO | 0.997245 | 6.11984 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-08-22T01:38:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1536,
"forks": 584,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "607b3401... |
97382013-3920-4e3e-b4ea-6f63b801cbd0 | EvgenDev09/briga-skobki | task5-1.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
// Скобки
const int BR = 3;
const char UNKN = '?';
const string BR1 = "([{", BR2 = ")]}";
// Получить тип открывающейся скобки
int get_brtype1(char c) {
for (int i = 0; i < BR; i++) {
if (c == BR1[i])
... | ALGO | 0.999983 | 4.343649 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-07-18T10: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": "2cddba52b16c... |
6ad641e4-0728-44b8-9710-2e9f8316a2e3 | AdityaPatil-AP/LeetCode-Questions-TopicWise | Leet_Code_Solutions/Sorting/2551.put-marbles-in-bags.cpp | #define ll long long int
class Solution {
public:
long long putMarbles(vector<int>& weights, int k) {
// Here we have to make k partitions of the array.
// And among them find two partitions in which the
// score is maximum and minimum.
// for that we have to create p... | ALGO | 0.999932 | 5.45385 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2022-07-24T12:59: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": "47abd11073... |
dbc378a7-de83-4d57-b40e-4252669608d0 | Annoyshah/Cp-Dsa-Solutions | B_Monsters_Attack.cpp | /*ॐ श्री गणेशाय नमः || */
/* ॐ नमः पार्वती पतये हर हर महादेव */
/* कर्पूरगौरं करुणावतारं संसारसारं भुजगेन्द्रहारम्। सदा बसन्तं हृदयारविन्दे भवं भवानीसहितं नमामि।। */
/* ॐ नमो भगवते वासुदेवाय */
#include "bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>... | ALGO | 0.999961 | 4.828715 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-06-20T10:44: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": "fbb1379e80... |
0956f0fb-65ad-41c0-ac7c-fcf25d0395df | XiaoyuHanLittlefish/Filib | src/pylike/pystr.cpp | #include "pystr.h"
#include <algorithm>
#include <cctype>
#include <cstring>
#include <iostream>
#include <sstream>
namespace pylike::details
{
void reverse_strings(std::vector<std::string> &result)
{
for (std::vector<std::string>::size_type i = 0; i < result.size() / 2; i++)
{
std... | TOOL | 0.960566 | 6.308784 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-08-29T12:17: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": "6d413b7ce... |
8b458e71-26a2-4024-95f5-001c65f4ce28 | FranciscoThiesen/OldProblems | Spoj/rota.cpp | #include <bits/stdc++.h>
using namespace std;
#define fr(i,a,b) for(int (i) = (a); (i) < (b); ++(i))
#define rp(i,n) fr(i,0,n)
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define mt make_tuple
#define mp make_pair
#define sz(a) (int)(a.size())
typedef unsigned long l... | ALGO | 0.99999 | 4.286736 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2016-07-23T23:25: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": "6e30f55cb... |
e457cda4-2ec4-42f8-88a6-3075d441f20a | mzry1992/workspace | OJ/URAL/Formula 1 最小表示法.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
struct hash_map
{
const static int mod=25943;
int head[mod];
struct hash_tables
{
long long key,val;
int next;
} ele[1000000];
int N;
int getHash(long long x)
{
return x%mod;
}
... | ALGO | 0.999949 | 3.660076 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2012-11-03T05:40:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2b03a576... |
7130a173-fc0c-44fe-b663-c20001e64931 | afk-user/Tarea-2-Algoco | dynamic.cpp | #include <iostream>
#include <chrono>
#include <algorithm>
#include <string>
#include "costos.hpp"
using namespace std;
int transform(string A, string B, int n, int m) {
vector<vector<int>> t (n+1,vector<int>(m+1,0));
int i,j,ins,del,sub,tr;
for (i=1;i<=n;i++) {
t[i][0] = costo_del(A[i-1])+t[i-1][... | ALGO | 0.999915 | 4.668478 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-10-24T13:36: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": "f53225b1c5d9... |
be44f882-41bd-401a-8978-ad4b84e2c6cb | yashbhanu/Data-Structure-and-Algorithms | C++ Concepts/Two_D_2D_Arrays.cpp | #include <iostream>
using namespace std;
//in 2d arrays while passing 2d array in function arg, you must specify atleast the column size or it would throw error //google => why to pass column size?
bool isPresent (int arr[][4], int target) {
for (int row = 0; row < 3; row++)
{
for (int col = 0; col <... | ALGO | 0.9986 | 4.443139 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2022-08-06T07:06:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62c65dfe5... |
6d4d280c-dd44-4356-a781-4d7a9511497c | kai-heine/advent_of_code | 2020/02/puzzle.cpp | #include <algorithm>
#include <array>
#include <charconv>
#include <filesystem>
#include <fmt/format.h>
#include <fstream>
#include <string_view>
#include <vector>
namespace ranges = std::ranges;
namespace fs = std::filesystem;
struct password_policy {
int first_number;
int second_number;
char letter;
};
... | TEST | 0.956653 | 5.147636 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-12-06T20:58: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": "5d78f32fb... |
5fc4a86d-2ce9-4975-ad24-df9b60cfa7cd | stden/olymp | ru-olymp-train-winter-2007/Submits/070121/09_44_02_15_C_1483.CPP | #include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
const int MAX = 262144;
struct point
{
int x, y;
int i;
};
bool operator < (point const& a, point const& b)
{
return a.x < b.x || (a.x == b.x && a.y < b.y);
}
in... | ALGO | 0.999962 | 3.390474 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2012-07-23T22:46:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5bc67da19... |
df3ffa6a-0a9b-4063-b253-2c5caab9d0b8 | ylwdream/Design-Pattern | factory_mothod_pattern.cpp | #include<iostream>
#include<time.h>
#include <stdlib.h>
#include<cmath>
#include<set>
#include<vector>
#include<string.h>
#include<deque>
#include<list>
#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;
class oper
{
protected://使用保护成员,子类可以访问。子类不能访问私有成员
double lhs;
double rhs;
publ... | ALGO | 0.99962 | 3.504668 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2014-10-28T09:20: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": "16ff44dc0... |
c5be21f9-f6ca-4dcb-a844-a003b58ee159 | Coldereac/Algorithms | Prakt4/functions.cpp | #include "functions.h"
#include <cstring>
#include <fstream>
using namespace std;
// Перевірка, чи є список порожнім
bool isEmpty(PNode head) {
return head == nullptr;
}
void refreshIndexes(PNode head, int startIndex) {
int index = startIndex; // Початкове значення індексу
PNode temp = head;
while (... | TOOL | 0.93755 | 4.17079 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-09-11T22:57: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": "3bb1b833116... |
5dd916ee-0fd3-498b-a433-cd705dda5840 | PealMazumder/Topicwise-Problems | Graph/Tree/Lowest Common Ancestor/QTREE2 - Query on a tree II.cpp | //Problem Link: https://www.spoj.com/problems/QTREE2/
#include<bits/stdc++.h>
#define nl "\n"
#define pb push_back
#define ll long long
using namespace std;
const int N = 10005;
int L[N];
ll Cost[N];
int P[N][20];
vector<pair<int, int>> adj[N];
void dfs(int node, int par, int d, ll c)
{
L[node] = d, P[node][0] = pa... | ALGO | 0.999972 | 4.346555 | {
"github_metadata": {
"branch": "master",
"commit_count": 274,
"repo_created_at": "2019-10-25T06:25: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": "6d7f94d0... |
7075a448-a949-48df-9c55-f37b792a6aae | marco-1337/Workspace-2do-UCM-videojuegos | EDA/EjerciciosJuez/Tema0/EDAV-DuplicadorB-7/EDAV-DuplicadorB-7.cpp | // Nombre del alumno <NAME>
// Usuario del Juez EDA-GDV30
#include <iostream>
#include <iomanip>
#include <fstream>
// función que resuelve el problema
void resolver(int& datos) {
datos *= 2;
}
// Resuelve un caso de prueba, leyendo de la entrada la
// configuración, y escribiendo la respuesta
bool resuelveCas... | ALGO | 0.998946 | 3.71277 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2024-09-13T19:56: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": "1dc30029a82... |
4d9eed1f-8c92-44bd-8ada-5ea4d387eb91 | IslombekTurakulov/Algorithms-and-Data-Structure | Contest 3/TaskD/main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
// https://e-maxx.ru/algo/segment_tree Дерево отрезков.
void build(const std::vector<int> &array, std::vector<int> *tree,
int index, int left_tree, int right_tree) {
if (left_tree == right_tree) {
(*tree)[index] = array[left_tree];
}... | ALGO | 0.999997 | 5.460289 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2021-10-21T21:34: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": "f7d53cef075... |
86b50f11-ae18-4883-bcf9-d5ff532d03c3 | rajkataria/ReliableResectioning | colmap-3.4/src/optim/sprt.cc | // COLMAP - Structure-from-Motion and Multi-View Stereo.
// Copyright (C) 2017 <NAME> <jsch at inf.ethz.ch>
//
// 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 3 of the License... | ALGO | 0.999537 | 7.146387 | {
"github_metadata": {
"branch": "raj.reliable-resectioning",
"commit_count": 11,
"repo_created_at": "2019-11-17T14:32:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 9,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"con... |
22577d28-36a6-4b60-8abc-133036dd6376 | armyants531/baejoon | 백준/Gold/14565. 역원(Inverse) 구하기/역원(Inverse) 구하기.cc | #include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
int gcd(int a, int b) {
return b % a == 0 ? a : gcd(b % a, a);
}
int modular_inverse(int a, int m) {
if (gcd(a, m) != 1) {
return -1;
}
int s1 = 1;
int s2 = 0;
int t1 = 0;
i... | ALGO | 0.999973 | 4.836661 | {
"github_metadata": {
"branch": "main",
"commit_count": 833,
"repo_created_at": "2022-10-29T03:26:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "505b740d39... |
25f778cd-49a3-4737-9ae2-995b5672c58d | Aschen/genetics-algo | Matingpool.cpp | #include "Matingpool.hh"
MatingPool::MatingPool(const std::vector<Chromosome*> &pop)
{
float floPart;
int intPart;
for (unsigned int i = 0; i < pop.size(); i++)
{
intPart = static_cast<int>(pop[i]->getFitness());
floPart = pop[i]->getFitness() - intPart;
for (int ... | TOOL | 0.912665 | 3.474453 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-12-04T19:53:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c788eab5b... |
880e96df-ed98-45e2-9fce-33e86add0eb5 | DamianArado/LeetCode-tracker | 718-maximum-length-of-repeated-subarray/718-maximum-length-of-repeated-subarray.cpp | /**
Approach 1: Using tabulation - O(mn) TC & SC
class Solution {
public:
// Using the logic of Longest common substring
// TC & SC: O(mn)
int findLength(vector<int>& nums1, vector<int>& nums2) {
int m = nums1.size(), n = nums2.size(), ans = 0;
vector<vector<int>> dp(m + 1, vector<int> (n ... | ALGO | 0.999965 | 6.428134 | {
"github_metadata": {
"branch": "master",
"commit_count": 4716,
"repo_created_at": "2021-10-28T18:31:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "394416f... |
1e416fea-0e2d-412c-8574-4278b0ba2db7 | NotAaronMa/CompProgramming | src/completed/acoinproblem.cpp | #include <bits/stdc++.h>
typedef long long ll;
int N,V;
int coins[2020], ans[100000];
ll dp[10002];
void tc(int j){
j++;
dp[0] = 0;
for(int i = 0; i <= 10001; i++){
if(i + coins[j] <= 10001 && dp[i] != __INT_MAX__){
dp[i + coins[j]] = std::min(dp[i] + 1, dp[i + coins[j]]);
... | ALGO | 0.999859 | 3.911131 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-10-10T14:03: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": "9017ba95d... |
54c40677-7779-4061-ad74-7523d4797cdb | google/monster-mash | third_party/libigl/include/igl/sum.h | // This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2013 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.... | ALGO | 0.985202 | 5.947316 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-01-28T21:04:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1312,
"forks": 182,
"issues": 24,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8b08a... |
8c86ce18-eebb-4e91-bf60-00875bb66d2a | codemonkeyhe/LeetCode | 0159LongestSubstringWithAtMostTwoDistinctCharacters.cpp | /**
* @file
* @brief 1st-AC
* @author MonkeyHe
* @version 1.0
* @date 2020-09-14
* @tag slidingWindow
* @similar 3 340
*/
/*
Given a string s , find the length of the longest substring t that contains at most 2 distinct characters.
Example 1:
Input: "eceba"
Output: 3
Explanation: t is "ece" which its leng... | ALGO | 0.999799 | 5.126207 | {
"github_metadata": {
"branch": "master",
"commit_count": 267,
"repo_created_at": "2018-08-10T04:31: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": "985a63e2... |
1044e60a-3e74-4cbc-a0f8-3244a2ba456d | qtfreet00/llvm-obfuscator | lib/Target/ARM/ARMISelDAGToDAG.cpp | //===-- ARMISelDAGToDAG.cpp - A dag to dag inst selector for ARM ----------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | TOOL | 0.927074 | 4.658108 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-07-30T10:08:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 138,
"forks": 54,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c19a3b4... |
c5a70334-43ec-4d2e-b343-a6222539e75f | WebKit/WebKit-http | Source/ThirdParty/libwebrtc/Source/webrtc/modules/audio_processing/agc2/saturation_protector.cc | /*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | TOOL | 0.922463 | 7.145518 | {
"github_metadata": {
"branch": "master",
"commit_count": 231005,
"repo_created_at": "2011-01-11T13:50:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4992,
"forks": 1983,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
43a41c3a-652c-48b2-b6ac-9cd860697cf9 | sgepner/Programowanie-Obiektowe-w-Cpp | 6/sample/sort1.cpp | // sort algorithm example
# include <iostream>
# include <algorithm>
# include <vector>
bool myfunction ( int i , int j ) { return (i > j ) ; }
struct myclass {
bool operator () ( int i , int j ) { return (i < j ) ;}
} myobject ;
int main () {
int myints [] = {32 ,71 ,12 ,45 ,26 ,80 ,53 ,33};
std :: vector < int ... | ALGO | 0.999747 | 5.152403 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-09-29T10:43:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17f8b758d... |
5326fb1f-efd5-41f8-9432-4ec74b7b2766 | master-hkshenoycse/CP | Contests/Codeforces/Div2_955/C.cpp | #include<bits/stdc++.h>
#include <iterator>
#include <iostream>
#include <numeric>
#include <math.h>
#define ll long long
#define ull long
#define mpa make_pair
#define pb push_back
#define ff first
#define pii pair<ll,ll>
#define dd long double
#define trace(x) cerr << #x << " : " << x << endl
#define ss second
#defin... | ALGO | 0.999878 | 3.865577 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2024-03-23T04:22: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": "72777f7487... |
41068c37-bdca-4522-96ce-e34f0aab95fd | Karuls/laboratory-1-course | ОАиП/Лабораторная работа № 2. Работа с файлами на языке С/dop10.2/dop10.2.cpp | #include <iostream>
#include <stdio.h>
#include <cctype>
int main() {
setlocale(LC_ALL, "RUS");
using namespace std;
FILE* f;
FILE* g;
char str1[50], str2[50], str3[50], str4[50], str5[50];
bool flag = true;
fopen_s(&f, "ffff.txt", "w"); // Открытие файла для записи
if (f == nullptr) ... | TOOL | 0.946447 | 3.665777 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-06-21T09:46: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": "cb5f05fa8c1b... |
a7c8cb50-d8fd-4169-81e5-41868a92996d | kohn1001/Algorithms | src/max_bw.cpp | #include <iostream>
#include <vector>
/* you are given tuples of start time, end time and a bandwidth of tv shows,
* you need to calculate the maximum bandwidth in a given time
*
*/
using namespace std;
using ii = pair<int, int>;
/*
*
* create a vector for start time of the tv show coupled with the compatible b... | ALGO | 0.999543 | 4.555357 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2017-02-04T05:36:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0827d9163... |
f8f5de8d-5fee-452a-9fbb-9cf98cd35ae4 | Duducoco/YNU-XXXY-Homework-Experience | 计算机图形学/代码/7-StrasightLineCut-2/main.cpp | #include <windows.h>
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
class wcPt2D
{
public :
GLfloat x, y;
wcPt2D(GLfloat x, GLfloat y);
wcPt2D();
};
wcPt2D *p1 = new wcPt2D(0,0);
wcPt2D *p2 = new wcPt2D(400, 400);
wcPt2D *winMin = new wcPt2D(50, 50);
wcPt2D *winMax = new wcP... | TOOL | 0.990816 | 5.196025 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-02-27T14:43:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf72692faaa... |
72c19412-f99c-4834-93ce-6d732b4660cc | bpbrianpham/CECS_341 | Lab7.cpp | /*
Fall 2017
CECS 341
Lab7
Due: 12/4/2017 11:59PM
Write down your codes only between
//Your code from here
//Your code to here
1. (20 points) Complete the 'printMemory' function in C++.
The program should output the actual bit pattern of the memory spaces.
The output format specification;
matrix[0][1](0x61fef8) = -1... | ALGO | 0.953223 | 5.066112 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2017-10-25T00:07: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": "26ea5ad0f... |
9aabf6c9-a5c3-4a97-b4e0-f9b7dacb640c | Joaco-gavernet/competitive-programming | cses/advanced-techniques/new-roads-queries.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
// neal Debugger
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
templat... | ALGO | 0.999984 | 4.445634 | {
"github_metadata": {
"branch": "master",
"commit_count": 523,
"repo_created_at": "2023-07-10T02:25:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77a3f05f... |
b8712e86-fd4f-4a3e-8206-ac06e718c0a5 | tylerjosephrose/GraphHomework | Graph.cxx | #include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;
struct Edge {
Edge(int vertex1, int vertex2){ v1 = vertex1; v2 = vertex2; }
int v1;
int v2;
};
struct Graph {
Graph(int vs) {
numOfVertices = vs;
distanceMatrix.resize(vs);
adjacencyMatrix.res... | ALGO | 0.999001 | 4.344181 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-05-11T20:19: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": "de29d33afa... |
113f2996-4ee5-4226-adf2-069eaa76d178 | Tugamer89/IP | Lab05/6.2/rectanglesIn.cpp | #include <iostream>
#include <cmath>
using namespace std;
struct Point {
double x;
double y;
bool operator==(const Point& other) const {
return x == other.x && y == other.y;
}
};
struct Rect {
Point topLeft;
Point bottomRight;
bool operator==(const Rect& other) const {
r... | ALGO | 0.999016 | 4.898884 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2023-10-06T12:24:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5caec8922e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.