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 |
|---|---|---|---|---|---|---|---|
230a55d5-b331-4f79-bf6a-5dacd114073e | kamyu104/LeetCode-Solutions | C++/intersection-of-two-arrays.cpp | // Time: O(m + n)
// Space: O(min(m, n))
// Hash solution.
class Solution {
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
if (nums1.size() > nums2.size()) {
return intersection(nums2, nums1);
}
unordered_set<int> lookup{nums1.cbegin(), nums1.cend()... | ALGO | 0.999989 | 6.568036 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
34d57a61-8291-49c3-a656-6319bdfa7187 | alexluscan/Cpp-algorithms | Algoritmica/Paduri de multimi disjuncte/31.01/Showroom_ONI_X/showroom/PC_showroom.cpp | //Code by <NAME>
//Time complexity: O(nrCars * log(nrCars) + nrCompanies * maxCarsInACompany)
//Space complexity: O(nrCars + maxCarsInACompany)
//Method: Combinations with prime factors
//Implementation time: 1 h 30 min
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <bitset... | ALGO | 0.999476 | 3.960969 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-29T14:48: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": "4ea590920f7d... |
821cd811-2a38-49e1-ba10-4dc17d712df4 | joaopaulocastilho/aBNT-Codes | URI/1104-TIMMY.cpp | #include <stdio.h>
#include <string.h>
#define MAX 112345
int main(void){
int a, b, countx, county, tx[MAX], ty[MAX], temp, max;
while(scanf("%d %d", &a, &b) && (a != 0 || b != 0)){
memset(tx, 0, sizeof(tx));
memset(ty, 0, sizeof(tx));
countx = county = 0;
for(int i = 0; i < a; i++){
... | ALGO | 0.999707 | 3.100701 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2017-09-19T17:43:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a8679e4a... |
e3a69e66-c338-40b1-a86b-18c13e9fd95d | VictorL000/CompetitiveProgrammingSolutions | oly20practice29.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M, T;
int matrix[302][302];
int main(){
cin >> N >> M >> T;
for(int i = 0; i <= N; i++){
for(int j = 0; j <= N; j++){
matrix[i][j] = 99999999;
}
matrix[i][i] = 0;
}
for(int i = 0; i < M; i++){
int a, b, c;
cin >> a >> b >> c;
matrix[a][b] = c;
... | ALGO | 0.999944 | 4.576564 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-05T22:49:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73e8b1c57e92... |
1213861e-ee98-4df6-b4ca-49f23811ba5f | codemistic/Data-Structures-and-Algorithms | CPP/Problems/add-two-numbers.cpp | /**
* 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) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbe... | ALGO | 0.999943 | 6.347393 | {
"github_metadata": {
"branch": "main",
"commit_count": 1337,
"repo_created_at": "2022-09-30T20:57:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 513,
"forks": 380,
"issues": 51,
"pull_requests": 65
},
"file_meta": {
"content_id": "330f... |
d565bfd1-f415-4085-b93e-a06477aa8b8a | LYJ0126/data-structures_and_algorithms | 数论/约数个数/求所有数的约数个数/求所有数的约数个数/factor_num2.cpp | #include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
//求所有数的约数个数
//分三类
//1.质数,约数个数为2
//2.最小质因子指数为1,num[i*p]=num[i]*num[p](积性函数)
//3.最小质因子指数大于1,num[i*p]=num[i]/exp[i*p]*(exp[i*p]+1)=num[i]/(exp[i]+1)*(exp[i]+2)
//其中exp[i]为i的最小质因子指数(因为此时exp[i*p]=exp[i]+1)
const int maxn=1000000;
int num[maxn+1];//约数... | ALGO | 0.999619 | 3.877336 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2024-02-22T10:14: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": "9ce8d68d1... |
818ded07-5cf6-4e01-be6c-8a7440826b84 | LBOUDHAR/MultiLayerPerceptron_01 | mlpnetwork.hpp | // mlpnetwork.h for Multi Layer Perceptron network:
// Program created on 21.06.2022 by <NAME>
// Modified on 31.07.2022 at 21:44
#ifndef MLPNETWORK_H
#define MLPNETWORK_H
#include <vector>
using namespace std;
#define SEGMOID 01
#define TANH 02
#define RELU 03
#define SOFTMAX 04
#define GELU 05
#define ELU 06
#de... | DATA | 0.970571 | 4.037457 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-03-29T13:36: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": "f0b2aba090... |
767a89c9-2f14-468a-b9b1-b7b4f37fda38 | Dup4/Google-Coding-Competitions | CodeJam/2022/Round-1A/b/b.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fi first
#define se second
#define all(x) begin(x), end(x)
#define rall rbegin(a), rend(a)
#define bitcnt(x) (__builtin_popcountll(x))
#define complete_unique(a) a.erase(unique(begin(a), end(a)), end(a))
#def... | ALGO | 0.999891 | 3.837615 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2020-08-11T02:03:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fde390e9fd... |
c8096407-98b4-4a03-bed8-29630fab02b4 | MadinaB/BinarySearchTrees | AVLTree.txx | //
// Implementation
//
template <typename E> // constructor
AVLTree<E>::AVLTree() : ST() { }
template <typename E> // node height utility
int AVLTree<E>::height(const TPos& v) const
{ return (v.isExternal() ? 0 : (*v).height()); }
template <typename E> // set height utility
void AVLTree<E>::set... | ALGO | 0.971379 | 5.641039 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-08-30T11:08:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7692817b83... |
1d379394-d0d2-4ddb-816d-ebf2c6bb2cf3 | luyuncheng/Exercise | OpenCV/高斯滤波.cpp | ////
//// 高斯滤波.cpp
//// testOpenCv
////
//// Created by 鲁蕴铖 on 15/6/13.
//// Copyright (c) 2015年 鲁蕴铖. All rights reserved.
////
///*
//#include <iostream>
//#include <vector>
//#include <opencv2/opencv.hpp>
//#include <opencv2/core/core.hpp>
//#include <cv.h>
//#include <highgui.h>
//#include <algorithm>
//#include... | TOOL | 0.993394 | 3.795685 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2016-03-24T05:22: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": "69b61435a... |
a7b256ac-4927-4291-8617-f40cf5a644d3 | RitikTiwary519/Data-Structure-Algorithms-and-Competitive-Programming | contest/random_contests/C_Removing_Smallest_Multiples.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
int n; cin >> n;
string s; cin >> s;
s = ' ' + s; // 1-based indexing (pad a dummy char)
vector<char> gone(n + 1, 0); // 0 = present, 1 = already removed
ll ans = 0;
... | ALGO | 0.999943 | 4.205788 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2025-01-11T10:14: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": "8f55e2750db... |
a1046fe5-5910-4976-8700-b6d962c78a3a | Alexandra182/hydroponics-arduino | main/main.ino | /************************pH Sensor***************************/
#define phSensorPin A0 //pH meter Analog output to Arduino Analog Input 0
#define VREF 5.0
#define phOffset -0.15 //deviation compensate
#define phNoSamples 40 //times of collection
float phTotal = 0;
float ... | TOOL | 0.905621 | 5.051503 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-05-29T13:19:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79ea57f4b0... |
ca741db7-74aa-43f2-98fb-54ead0738a3a | xinyuang/9_chapter_cpp_algorithm | 9.4 DP Key Points & Coordinate DP/backpack/92. Backpack(max value,no item size).cpp | // 01 Backpack reverse order
// complete backpack left to right order
// get the max sum value
class Solution {
public:
/**
* @param m: An integer m denotes the size of a backpack
* @param A: Given n items with size A[i]
* @return: The maximum size
*/
int backPack(int m, vector<int>& A) {
// write your co... | ALGO | 0.99999 | 5.299509 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-08-08T00:44:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a686e7348... |
8ff860cf-afa0-427c-a62e-cc91f811f9bd | lxlenovostar/algorithm | leetcode/offer_ii_88/main_v2.cc | #include <vector>
#include <iostream>
using namespace std;
class Solution {
private:
void helper(vector<int>& cost, int index, vector<int>& dp) {
if (index < 2) {
std::cout << "what1 index: " << index << std::endl;
dp[index] = cost[index];
}
else if (dp[index] == 0)... | ALGO | 0.999913 | 5.146347 | {
"github_metadata": {
"branch": "master",
"commit_count": 474,
"repo_created_at": "2016-06-12T10:50: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": "b434dd0b... |
b9053f35-7d11-4829-a19c-2ced883004a1 | yashkumar2603/CompetiPro | F_Valuable_Cards.cpp | #include <cmath>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
vector<int> prime_factors(int x) {
vector<int> factors;
for (int i = 2; i * i <= x; ++i) {
if (x % i == 0) {
factors.push_back(i);
while (x % i == 0) {
x /= i;
... | ALGO | 0.999765 | 4.862173 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2023-12-09T11:40: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": "a84ed4d7e9e... |
b951aea9-c0ab-41a8-8adc-60a996fce8db | nmendiboure/matrix-cpp | matrix.cpp | //
// Created by nicolas on 23/12/23.
//
#include "matrix.h"
#include <fstream>
#include <sstream>
/*
* Matrix class
* A core is a 2D array of elements of type T
* The core is implemented as a vector of vectors
* The first vector represents the rows, the second the columns
* The core is stored in row-major order... | TOOL | 0.982756 | 6.627877 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-14T15:47:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "627284f65dca... |
f15649f5-9c79-47ec-bce0-d4ecc3cceb30 | eloygarcia/niftysim | source/tledNarrowConeSelfCollisionBVH.h | // =========================================================================
// File: tledNarrowConeSelfCollisionBVH.h
// Purpose:
// Package: NiftySim: Nonlinear finite element program
// Author: <NAME>
// Language: C++
// Created: April 2012
//
// Copyright (c) 2012, University College London. ... | TOOL | 0.9672 | 6.142963 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-11-15T09:42:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad3c7a4cd5a... |
360a7384-ac58-47c0-825d-0c338b4f8a35 | DeepakKumarKhatri/All-You-Should-Know-About-Stack | menuBasedStack.cpp | #include<iostream>
using namespace std;
struct Stack{
//Size of stack
int size;
//Top most pointer which will initially be -1
int top = -1;
//An array which will have same size as stack
int *stackArray;
};
void push(Stack *st,int element);
int pop(Stack *st);
int peek(Stack st,int position);
in... | ALGO | 0.984443 | 4.09401 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-03-27T19:18: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": "61e55c4fb3b... |
61a3283e-a683-4179-91f8-c79c650846f5 | danielgolconda/30dayChallenge | HappyNumber.cpp | class Solution {
public:
// Initialise empty set to keep track of the digits because
// in the question it is said that there is a possibility of forming a loop
set <int> st;
bool isHappy(int n)
{
// Base Condition
if(n == 1)
{
return true;
}
// S... | ALGO | 0.999978 | 5.598351 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-04-02T19:56:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96e51adfa... |
3791fd78-cb80-4438-a710-e9a0cf44ed9b | Sai7828/Sai | mahasena.cpp | /*
Kattapa, as you all know was one of the greatest warriors of his time. The kingdom of Maahishmati had never lost a battle under him (as army-chief), and the reason for that was their really powerful army, also called as Mahasena.
Kattapa was known to be a very superstitious person. He believed that a soldier is "lu... | ALGO | 0.999957 | 4.567154 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-05-26T10:27: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": "1cff40c9c38... |
0b7c4be9-2ff3-4db5-891c-185bdd19598f | EduardoAmaro/vm-2.1-RDO | source/merging.hh | /* merging.hh */
/* Author: <NAME> */
/* <<EMAIL>>*/
#ifndef MERGING_HH
#define MERGING_HH
#include "view.hh"
void init_warping_arrays(
const int N,
unsigned short **&warped_texture_views,
unsigned short **&warped_depth_views,
float **&DispTargs,
const int nr,
const int nc,
const int ncom... | TOOL | 0.961781 | 5.151412 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-13T16:39:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b324fd98e8... |
d578cef9-3a3b-4020-8ae2-f8b4880ee163 | daichi0812/GeneralizedHybridGrainsResearch | src/cpp/MPM2D/PolygonTemplate2D.h | //
// PolygonTemplate2D.h
// rigidbody2dsim
//
// Created by <NAME> on 2022/04/08.
// Copyright © 2022 <NAME>. All rights reserved.
//
#ifndef __POLYGON_TEMPLATE_2D_H__
#define __POLYGON_TEMPLATE_2D_H__
#define _USE_MATH_DEFINES
#include<math.h>
#include <Eigen/Core>
#include <vector>
#include <map>
#include <io... | ALGO | 0.973802 | 6.69096 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-07-05T17:41: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": "2677fe8e1528... |
c5863b57-9518-4176-98b8-12ba262b7a89 | GetSomeSleepBro/codes | DSA/v2/D1-OBST.cpp |
#include <iostream>
#include <climits>
using namespace std;
// Function to compute sum of frequencies using prefix sum array
int sum(int prefix[], int i, int j) {
if (i == 0)
return prefix[j];
return prefix[j] - prefix[i - 1];
}
// Function to construct the Optimal BST
int optimalSearchTree(int keys[... | ALGO | 0.999993 | 5.589291 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2024-07-06T16:09:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab7f991c37... |
539808fd-1a6f-4905-bf26-1e806eda13ee | jordandong/myleetcodes | LC_00774_MinimizeMaxDistanceToGasStation.cpp | /*
On a horizontal number line, we have gas stations at positions stations[0], stations[1], ..., stations[N-1], where N = stations.length.
Now, we add K more gas stations so that D, the maximum distance between adjacent gas stations, is minimized.
Return the smallest possible value of D.
Example:
Input: stations = [... | ALGO | 0.999756 | 5.847281 | {
"github_metadata": {
"branch": "master",
"commit_count": 2338,
"repo_created_at": "2012-11-19T10:18:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa5a0ae... |
e9cdc837-0ab1-4bd4-b954-35047720e31a | hmazhar/physbam_public | PhysBAM_Geometry/Basic_Geometry/POINT_2D.h | //#####################################################################
// Copyright 2007, <NAME>, <NAME>
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Cla... | ALGO | 0.942678 | 5.821114 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-04-02T21:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 13,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "549ec5a... |
7ba0d829-c7cc-4227-9c7c-d70936aec2bc | polyfem/polyfem | src/polyfem/solver/ALSolver.hpp | #pragma once
#include <polyfem/solver/NLProblem.hpp>
#include <polysolve/nonlinear/Solver.hpp>
#include <polyfem/solver/forms/lagrangian/AugmentedLagrangianForm.hpp>
#include <polyfem/Common.hpp>
#include <Eigen/Core>
#include <functional>
#include <vector>
namespace polyfem::solver
{
class ALSolver
{
using NLS... | ALGO | 0.976682 | 6.484778 | {
"github_metadata": {
"branch": "main",
"commit_count": 5525,
"repo_created_at": "2018-08-30T16:20:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 555,
"forks": 88,
"issues": 32,
"pull_requests": 9
},
"file_meta": {
"content_id": "77ee4b... |
8e4fcf2a-7843-4c7e-91ae-a64a6a4d23f5 | wencfy/leetcode | src/0445.cpp | /**
* Add Two Numbers II
*
* You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
*
* You may assume the two numbers do not contain any lead... | ALGO | 0.999972 | 6.550542 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2022-10-23T16:30: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": "7e2fc80d... |
50d7153d-7fda-44b0-936f-78718ebd8a7f | IgorJoaquimn/2022-Competitive-Programming | Lista 1/1340/1340.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define INF 0x3f3f3f
#define MAX 26
#define _ \
ios_base::sync_with_stdio(false); \
std::cin.tie(0);
int main()
{
_ int ttt;
while (cin >> ttt)
{
list<int> v;
int op;
... | ALGO | 0.999862 | 4.34272 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-07T00:01: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": "5cc13c6fe1de... |
b4c3c4ec-c3b2-421e-9f45-bb0855cb5492 | rishabh644/Daily_Challenge | Standard_DSA/Graph/Remove_subfolder_from_file_system.cpp | class Solution {
public:
vector<string> removeSubfolders(vector<string>& folder)
{
unordered_map<string,int>idc;
for(string st:folder)
{
for(string st1:folder)
{
string temp="";
for(int i=0;i<st1.size();i++)
{
... | ALGO | 0.999262 | 5.215271 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-05-06T13:59: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": "edfcce6d345... |
844557e2-4c7a-43bf-a845-c6938aeebb16 | dasys-lab/cnc-msl | msl_worldmodel/src/obstaclehandler/SimpleCluster.cpp | /*
* SimpleCluster.cpp
*
* Created on: Feb 11, 2016
* Author: <NAME>
*/
#include "obstaclehandler/SimpleCluster.h"
namespace msl
{
SimpleCluster::SimpleCluster(shared_ptr<geometry::CNPoint2D> p)
{
this->x = (int)(p->x + 0.5);
this->y = (int)(p->y + 0.5);
this->linearSumX = this->x;
this->l... | ALGO | 0.931973 | 6.155613 | {
"github_metadata": {
"branch": "master",
"commit_count": 4880,
"repo_created_at": "2014-05-22T14:45:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f861baa9... |
276201a4-2fc4-459f-8bd4-4003810194bc | 2nagatomo2/AtCoder | 295/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define rep(i,n) for (int i=0; i<(n); i++)
int main() {
int r, c;
cin >> r >> c;
string b[r];
vector<pair<int, int> > bomb;
rep(i, r) cin >> b[i];
int power;
rep(i, r) rep(j, c) {
if(... | ALGO | 0.999887 | 3.948047 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2023-12-01T08:26: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": "504bcc622a... |
b65af509-422d-4249-b2e9-54b25ed219dc | eklavyaK/codeforces-solutions | MashaForgetful.cpp | #include<bits/stdc++.h>
#define endl "\n"
#define F first
#define S second
#define int long long
typedef long long ll;
typedef long double ld;
using namespace std;
struct node{
int l,r,c;
};
void code(){
int n,m; cin>>n>>m;
node f2[100]{}, f3[1000]{};
int f[m]{}, ans[m]{};
for(int i=0;i<n;i++){
... | ALGO | 0.999232 | 3.710577 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-09-03T06:56:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e82c349129... |
e1feedba-e353-4bb0-ada7-f3af2e2b5f69 | RicCost4/faculdade | C++/2° Periodo/06 04.05.cpp | #include<iostream>
using namespace std;
int main(){
string nome;
float HT, SB;
int cargo, turno;
cout<<"\t\tAtividade 35 da apostila LOGICA de PROGRAMACAO pg 73";
cout<<"\n\n-----Calculo Salarial da PADARIA DA JUCRECIA-----";
cout<<"\nDigite seu nome: ";
cin>>nome;
co... | ALGO | 0.969688 | 3.507559 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-01T14:52: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": "68d5b3610808... |
6151e2c7-4418-41a0-a8ea-060ccfa25f46 | phutruonnttn/CPP_Code_Giai_Thuat | PEACE_2/PEACE.cpp | #include <bits/stdc++.h>
#define nmax 100007
using namespace std;
typedef pair <long, long> ii;
long n,m,d[nmax],tr[nmax];
vector <ii> adj[nmax];
void dijkstra(long uu)
{
priority_queue <ii> pq;
fill(d,d+n+1,1e9);
d[uu]=0;
pq.push(ii(0,uu));
long u,du;
while (!pq.empty())
{
u=pq.t... | ALGO | 0.999993 | 4.092446 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-08-09T07:11: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": "fcac182d18... |
b087bd0d-3c7c-4254-96ca-696d3bb0f8ea | samir176520/oop-sheets | sheet4/homework.cpp | #include <iostream>
using namespace std;
int factorial (int number);
class Data
{
private:
double D[20], Fact[20];
int n;
public:
// Function to read data
void read()
{
cout << "Enter the number of elements (n <= 20): ";
cin >> n;
cout << "Enter " << n << " elements of D... | ALGO | 0.999509 | 6.461453 | {
"github_metadata": {
"branch": "source",
"commit_count": 82,
"repo_created_at": "2024-10-05T12:47: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": "275079ee7... |
2459a569-7466-4d3d-988f-59c885b057e6 | zacswolf/CompSciProjects | C++(Adv_CompSci)/AdvCompSci/Libraries/LinkedList/LinkedList.cpp | #include <iostream>
#include <stdexcept>
class LinkedList {
friend class LLIterator;
class Node {
friend class LLIterator;
public:
int value;
void setNext(Node* n) {
next = n;
}
void setPrev(Node* n) {
prev = n;
}
Node* next;
Node* prev;
};
public:
LinkedList() { // Initial empty list con... | TOOL | 0.995799 | 5.076532 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2016-09-12T03:39: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": "490271e3b... |
22b15876-4784-4ae8-9d5a-131be612cb5e | Kaminyou/MyLeetcode | cpp_solutions/3243.cpp | class Solution {
public:
int shortestPath(int n, vector<vector<int>>& graph) {
queue<int> q;
q.push(0);
int res = 0;
vector<bool> visited(n, false);
visited[0] = true;
while (!q.empty()) {
int m = q.size();
while (m--){
int node... | ALGO | 0.999975 | 5.722043 | {
"github_metadata": {
"branch": "main",
"commit_count": 1983,
"repo_created_at": "2022-04-30T05:11:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb2d0b93... |
049235cf-213a-49c6-b2d4-6e6b7ab2b786 | JHU-NI-LAB/OpenLPT_Shake-The-Box | ShakeTheBox/inc/libMath/linterp.h |
//
// Copyright (c) 2012 <NAME>
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notic... | ALGO | 0.998808 | 6.688566 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2019-07-11T09:30:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 44,
"forks": 21,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "fbd8e3... |
f734cc9e-49dc-4257-a4f8-7733da7d35a4 | zh-hadi/Cracking-Coding-Interview | Module 1/task2.cpp | #include<iostream>
using namespace std;
int sumBetweenNumber();
int main() {
sumBetweenNumber();
return 0;
}
// this function
// time complexity: O(n)
// space complexity: O(1)
int sumBetweenNumber(){
int a, b, sum = 0, i;
cout << "Enter number a and b : ";
cin >> a >> b;
cout << "... | ALGO | 0.922064 | 3.968475 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-12-04T13:31:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "481630b432e... |
375ad2f2-e213-4a50-a2fc-21eb558c3ed9 | hargadem/traveling_salesman | tsp.cpp | /***********************************************
* Function definitions for travelling salesman
* <NAME>
* CS 420
* Winter 2019
* *********************************************/
#include "tsp.hpp"
#include <iostream>
#include <cmath>
#include <vector>
#include <bits/stdc++.h>
#include <set>
#include <ctime>
using... | ALGO | 0.999722 | 4.526712 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-03-21T20:36: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": "ccc93916149a... |
990c002d-53fd-4f90-91b9-b051d802f489 | GTAteemo/GrantProject | Legend/violent.hpp | #pragma once
Vector2 PredictViewAnagle;
FVector Prodiction;
void Prediction(Player closetPlayer)
{
//prediction
float FlyDistanceVertical = closetPlayer.headPosition.z - Globals::Player::MyFirePortPos.z;
float FlyDistanceHorizontal = float(sqrtf(powf(closetPlayer.headPosition.x - Globals::Player::MyFirePortPos.x, 2... | ALGO | 0.99002 | 3.548259 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-07-26T17:09: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": "0e566b9f8... |
1419a2f4-199c-43d5-ae98-5623a358abf6 | prashanthimudepaka/LEETCODE | DAILY_QUESTIONS-FROM-SEPT-18/QUESTION-189RotateArray.cpp | /*189. Rotate Array
status:medium
date: 27-09-24
Given an integer array nums, rotate the
array to the right by k steps, where k is non-negative.
Input: nums = [1,2,3,4,5,6,7], k = 3
Output: [5,6,7,1,2,3,4]
Explanation:
rotate 1 steps to the right: [7,1,2,3,4,5,6]
rotate 2 steps to the right: [6,7,1,2,3,4,5]
rotate 3 s... | ALGO | 0.999958 | 5.863246 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2024-09-20T01:39: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": "12fabc08fee... |
5f1c4953-4194-488d-bb1d-a183c7c2a67e | ishandutta2007/codeforces-c | colchoneta/normal/1654/B.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <queue>
#include <set>
#include <unordered_map>
#include <map>
#include <vector>
#include <stack>
#include <algorithm>
#define MOD 1000000007
#define forn(a, n) for(tint a = 0; a<(int) (n); ++a)
#define forsn(a, s, n) for(tint a = (s); a... | ALGO | 0.999984 | 3.730535 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01: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": "4cc0e034394d... |
1feeeee6-d564-47dc-a1df-570e6e409b0f | dmlc/dgl | src/graph/transform/compact.cc | /**
* Copyright 2019-2021 Contributors
*
* 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 applicable law ... | ALGO | 0.965394 | 6.708526 | {
"github_metadata": {
"branch": "master",
"commit_count": 4416,
"repo_created_at": "2018-04-20T14:49:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13984,
"forks": 3049,
"issues": 444,
"pull_requests": 134
},
"file_meta": {
"content_id"... |
108f1169-ed0c-4626-89d4-4de4fbd90403 | kazi031/CodeForces | taxi2.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int *p=new int[n];
int c1=0,c2=0,c3=0,c4=0;
for(int i=0;i<n;i++)
{
int k;
cin>>k;
p[i]=k;
if(p[i]==1)
{
c1++;
}
if(p[i]==2)
{
c2++;
... | ALGO | 0.99994 | 3.555798 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-02-17T05:41: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": "906b5afab0... |
1fd5b080-7bb7-4f5c-b36d-25530d583e2c | yashk9293/Striver-A2Z-Sheet | Step 10 - Sliding Window/Lec 2/03_Minimum_Window_Substring.cpp | // Question Link :- https://leetcode.com/problems/minimum-window-substring/
// Minimum Window Substring (Hard)
//T.C : O(m+n) where m = length of s and n = length of t
//S.C : O(n)
class Solution {
public:
string minWindow(string s, string t) {
int m = t.size();
if(m > s.size()) {
retur... | ALGO | 0.999987 | 7.259526 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-05-19T17:36: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": "5e5b967f3b87... |
1762d4d2-56c9-47d8-ac57-8bfe992d9c14 | peihanlee/test | 35.search-insert-position.cpp | /*
* @lc app=leetcode id=35 lang=cpp
*
* [35] Search Insert Position
*
* https://leetcode.com/problems/search-insert-position/description/
*
* algorithms
* Easy (41.52%)
* Likes: 1936
* Dislikes: 229
* Total Accepted: 546.2K
* Total Submissions: 1.3M
* Testcase Example: '[1,3,5,6]\n5'
*
* Given a ... | ALGO | 0.999981 | 6.532045 | {
"github_metadata": {
"branch": "master",
"commit_count": 238,
"repo_created_at": "2020-03-27T17:35: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": "70e12587... |
3284b80a-107d-49c8-9740-0f8cfd996cf8 | Team-CTK/Training | 2017Training/8.17/1002B.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<map>
#include<cmath>
#include<vector>
#include<stack>
#include<climits>
#include<ctime>
#include<queue>
#define FILEIN freopen("in.txt", "r", stdin)
#define FILEOUT freopen("bigout.txt", "w", stdout)
#define CLOSEIO ios:... | ALGO | 0.999913 | 3.503822 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-09-12T12:12:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e72507b3de... |
9ac40ca3-b2b9-46ea-be24-8ee998b3d8de | THE-DEEPDAS/CodeForces_Journey | Erasing_Zeroes.cpp | // we need a string which has continuous ones
// to make it a one we can eliminate zeroes
// return how many zeroes to be deleted
#include <bits/stdc++.h>
using namespace std;
int main()
{
int testcases = 0;
cin >> testcases;
for(int i = 0; i < testcases; i++){
string s;
cin >> s;
... | ALGO | 0.999956 | 4.65952 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2024-07-14T23:17: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": "01f1a732b... |
6b3d9f1b-ccda-47b2-8109-8ef6b05488aa | Hidden-Forest/LeetCode | Day_5_/Day_5_/源.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<unordered_map>
#include<map>
using namespace std;
//class Solution {
//public:
// vector<int> maxInWindows(const vector<int>& num, unsigned int size) {
// vector<int> ans;
// int i = 0, max;
// for (i... | ALGO | 0.999942 | 5.096168 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2021-01-05T10:39: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": "f996f7421... |
12864e5d-f7ba-4c1f-8a57-510dbdd18c72 | KurogA49/SSAFY_Git | Embedded_training/code_test/달팽이문제.cpp | #include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
struct node {
int y;
int x;
};
int dy[4] = { -1, 1, 0, 0 };
int dx[4] = { 0, 0, -1, 1 };
int arr[10][10];
int N;
void bfs(node start)
{
queue<node> q;
q.push(start);
arr[start.y][start.x] = 1;
while (!q.empty())
{
... | ALGO | 0.999576 | 4.178494 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2023-01-13T08:30: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": "38fa69e4e... |
4a2538de-797b-43a5-830f-00c939efd9c2 | shreydevep/DSA | Array Pair Sum Divisibility Problem - GFG/array-pair-sum-divisibility-problem.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool canPair(vector<int> nums, int k) {
unordered_map<int,int> mp;
for(int i=0;i<nums.size();++i){
nums[i] = (nums[i] + k) % k;
}
for(auto x : nums){
... | ALGO | 0.999494 | 5.624856 | {
"github_metadata": {
"branch": "main",
"commit_count": 1952,
"repo_created_at": "2022-01-09T05:23: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": "341666e00... |
cbf19841-4085-4c1e-b75d-161f2bf795ea | aeremin/Codeforces | alexey/Solvers/6xx/659/Solver659A.cpp | #include <Solvers/pch.h>
#include "algo/io/baseio.h"
#include "iter/range.h"
using namespace std;
// Solution for Codeforces problem http://codeforces.com/contest/659/problem/A
class Solver659A
{
public:
void run();
};
void Solver659A::run()
{
int n, a, b;
cin >> n >> a >> b;
auto res = ( a + b ) % n;... | ALGO | 0.999932 | 4.233818 | {
"github_metadata": {
"branch": "master",
"commit_count": 741,
"repo_created_at": "2014-12-20T14:30:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "75c5c5bc... |
8ae88f2f-4dac-4dff-a7a1-44881b14071f | ishandutta2007/codeforces-e | eecs/normal/1614/D2.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxa = 20000010;
int n, tot, cnt[maxa], pr[maxa];
long long f[maxa];
int main() {
ios::sync_with_stdio(0), cin.tie();
cin >> n;
while (n--) {
int x;
cin >> x, cnt[x]++;
}
fill(pr, pr + maxa, 1);
for (int i = 2; i < maxa; i... | ALGO | 0.999802 | 4.079185 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "f27ef620d61c... |
ad430c39-c59b-425b-9e38-1d29f3d397ec | PhiuTheWind/DSA_MNIST-Data-Processing-and-k-Nearest-Neighbors-kNN-Optimization-using-k-D-Tree | kDTree.hpp | #include "main.hpp"
#include "Dataset.hpp"
/* TODO: Please design your data structure carefully so that you can work with the given dataset
* in this assignment. The below structures are just some suggestions.
*/
struct kDTreeNode
{
vector<int> data;
int label;
kDTreeNode *left;
kDTreeNode *r... | ALGO | 0.997988 | 5.094508 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-11-02T16:27: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": "366ef4723dc... |
c77c3fa7-76b3-4d97-9650-d2ed8bb7447f | vfolunin/archives-solutions | Kattis/damagedequation.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int a, b, c, d;
cin >> a >> b >> c >> d;
bool found = 0;
for (char abSign : strin... | ALGO | 0.999859 | 4.008919 | {
"github_metadata": {
"branch": "master",
"commit_count": 2367,
"repo_created_at": "2017-11-27T10:19:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "209961e... |
014e54cc-394f-40c2-8ceb-69d6555a17a8 | Chaichai438/Study_Note | 算法/LuoGu/模拟和高精度/A+B高精度.cpp | #include <iostream>
#include <string>
#include <algorithm>
#define MAX 520
using namespace std;
int a[MAX], b[MAX], c[MAX];
int main()
{
string A, B;
cin >> A >> B;
int len = max(A.length(), B.length());
for (int i = A.length() - 1, j = 1; i >= 0; --i, ++j)
{
a[j] = A[i] - '0';
}
... | ALGO | 0.999995 | 3.893654 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-11-26T10:24:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebf6564f16a... |
3409eab6-3683-4679-8235-34e1b089b26e | wizzhangquan/algorithm | alg_primer_classic/nowcoder/accumulate_sum_questions/subarr_pn_num_equal.cc | #include <iostream>
#include <map>
/*
* 给定一个无序数组arr, 其中元素可正可负可0.
* 求arr所有的子数组中正数与负数个数相等的最长子数组长度
*/
using namespace std;
const int MAXSZ = 100;
int lens = 0;
int maxr = 0;
int maxl = 0;
class neg_pos_trans {
public:
int operator()(const int num) {
if (num>0) return 1;
if (num<0) return -1;
... | ALGO | 0.999471 | 3.918739 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2016-07-26T09:11: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": "cd0c44f8e... |
2a73aa79-b02b-4d75-a8da-6e30090a3260 | vamsinath5553/operating-systems | WORST FIT.cpp | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
// Structure to represent a memory block
struct memory_block {
int size;
int allocated;
};
// Function to find the worst-fit memory block for a given size
int worst_fit(struct memory_block* blocks, int n, int size) {
int index = -1;
int max_si... | ALGO | 0.989271 | 6.157969 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-04-28T03:02: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": "558465cc4b7... |
421d092f-6bef-422b-a3d2-f24d7dcb28c6 | HeZez/Algorithm-Question-Solution | leetcode/52N皇后2.cpp | /*
n 皇后问题研究的是如何将 n 个皇后放置在 n×n 的棋盘上,并且使皇后彼此之间不能相互攻击。
上图为 8 皇后问题的一种解法。
给定一个整数 n,返回 n 皇后不同的解决方案的数量。
示例:
输入: 4
输出: 2
解释: 4 皇后问题存在如下两个不同的解法。
[
[".Q..", // 解法 1
"...Q",
"Q...",
"..Q."],
["..Q.", // 解法 2
"Q...",
"...Q",
".Q.."]
]
*/
/*
... | ALGO | 0.999923 | 6.067533 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2019-03-03T10:48: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": "0a332ba05... |
92b32f3c-0439-484f-a14f-cead73648dc8 | awietek/hydradoc | pages/examples/src/tj_random_all_to_all.cpp | #include <hydra/all.h>
int main() {
using namespace hydra;
using namespace arma;
int n_sites = 8;
// Create the Hamiltonian
BondList bonds;
auto T_mat = mat(n_sites, n_sites, fill::randn);
auto J_mat = mat(n_sites, n_sites, fill::randn);
for (int i = 0; i < n_sites; ++i) {
for (int j = 0; j < n_s... | ALGO | 0.983859 | 4.840782 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-10-19T21:57: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": "47198d0875b... |
86df9613-3579-45dd-8c57-e91f5f1146d7 | metridia/LIGGGHTS_B | LIGGGHTS-PUBLIC-master/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp | /* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
<NAME>, <EMAIL>
This software is distributed under the GNU General Public License.
See the README file in t... | ALGO | 0.998465 | 6.266513 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-10-24T09:26:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "022b11a0e4... |
798b9d56-7902-4b0b-98d0-2e5beccf3cac | Shitaibin/leetcode-2016 | 200.NumberofIslands.cpp | // 公司:Facebook
// 从1扩张,把1变成0.
// v1: O(M*N)。DFS
class Solution {
int m;
int n;
void numIslandsDFS(vector<vector<char>>& grid, int i, int j) {
if (i < 0 || i >= m) return ;
if (j < 0 || j >= n) return ;
if (grid[i][j] == '1') {
grid[i][j] = '0';
numIslan... | ALGO | 0.99997 | 5.84913 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2016-01-25T04:13:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13593ab2... |
07df535a-ed35-493a-a282-ae197bcb9089 | KausBoss/G3_Codes | advance_keypad.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
string searchIn [] = {
"prateek", "sneha", "deepak", "arnav", "shikha", "palak",
"utkarsh", "divyam", "vidhi", "sparsh", "akku"
};
string keypad[] = { " ", ".+@$", "abc", "def", "ghi", "jkl" , "mno", "pqrs" , "tuv... | ALGO | 0.998566 | 3.048729 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-04-20T15:56: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": "1d1467349... |
fde5d30a-2913-43f9-a1ab-5246bb65b856 | ray-jk-hong/examples | algo/数据结构/排序/堆排序/示例/main.cpp | #include <iostream>
#include <limits.h>
#include <stdio.h>
using namespace std;
static inline int left(int id)
{
return id * 2;
}
static inline int right(int id)
{
return id * 2 + 1;
}
static inline void swap(int *x, int *y)
{
int tmp;
tmp = *x;
*x = *y;
*y = tmp;
}
static int get_max_id(in... | ALGO | 0.999874 | 3.652164 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2024-08-01T23:38:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47a750eff7d... |
afe26bfb-2bf8-4f63-b594-67e58ccec844 | Aziz-755/CP-2022-2023 | Lajmi Yessmine/data structure/disjointSets/Petya and Repairment of Roads.cpp | #include <bits/stdc++.h>
using namespace std;
const size_t N = int(1e5)+1;
class disjointSets{
size_t* parent = new size_t[N];
size_t* sz = new size_t[N];
size_t nbrOfSets;
public:
disjointSets(size_t n): nbrOfSets(n){
for(size_t i=0;i<nbrOfSets;++i){
pa... | ALGO | 0.999906 | 3.722068 | {
"github_metadata": {
"branch": "main",
"commit_count": 145,
"repo_created_at": "2022-10-02T12:58:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffb34402e3... |
3ccc398f-9281-4df1-954e-2281db18d89f | bagelguy24/LeetCode_practice | LeetCode_Practice/Linked_List/6_Remove_Nth_Node/Remove_Nth_Node.cpp | /**
* 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) {}
* };
*/
class Solution {
public:
ListNode* removeNthFr... | ALGO | 0.999993 | 5.81189 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-09T14:04: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": "8208865ab68b... |
fa1c4a69-790b-40a0-b5d2-32f526e4fd10 | Aryankarma/My-DSA-progress | Lecture49/merge2sortedLL.cpp | #include<bits/stdc++.h>
using namespace std;
// Merge Two Sorted Lin
class Node{
public:
int data; // integer data
Node *next; // pointer variable "add" that stores the address of object
// constructor
Node(int data){
this->data = data;
this->next = NULL;
}
};
void inser... | ALGO | 0.999955 | 4.960226 | {
"github_metadata": {
"branch": "main",
"commit_count": 164,
"repo_created_at": "2023-06-26T07:30: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": "3d51a47c5a... |
080b5dfd-522a-4953-b921-f54648481378 | ShubhamBrody/Dynamic-Programming-Practice-Questions | 001_01Knapsack/SimilarQuestions/05TargetSum.cpp | //This is the same problem as Num Of Subset Givn Diff
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> W(n, 0);
int target = 0;
for (int i = 0; i < n; i++)
{
cin >> W[i];
target += W[i];
}
int difference;
cin >> difference;
... | ALGO | 0.999973 | 3.732205 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-11-22T05:14:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a3d1ed24... |
36fba034-7587-469b-8c6f-742df2cb171c | Jordod/ALGO4 | LAB5/PARTC/quick.cpp | #include <iostream>
using namespace std;
void swap(int* a, int* b)
{
int t = *a;
*a = *b;
*b = t;
}
int partition(int arr[], int low, int high)
{
int pivot = arr[high]; //last element as pivot
int i = (low - 1); // Index of smaller element
for (int j = low; j <= high - 1; j++)
{
if (arr[j] < pivot)
{
... | ALGO | 0.999946 | 5.121405 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-01-27T15:16: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": "1a8c10457... |
2227cfb7-62a8-456f-a739-bd01d5be168b | dqiong/CUDA-TP | sourceCode/auxfun.h |
#ifndef __AUXFUN_H__
#define __AUXFUN_H__
#include "includes.h"
void end(int status = 0);
/****************************************************************
Gets a list of k sets (each set is a list of ints)
return k lists of length n (for position i this is the cross
product i) for the n posisble cross products
*... | TOOL | 0.933016 | 4.531035 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-10-15T04:25:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f88b821ea8... |
d97eafe8-9934-4cc2-af2b-6a74db454189 | vickyguptaa7/Competetive_Programming | Codechef/Long Nov/EXor.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <unordered_map>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
long long n;
cin >> n;
long long arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
lo... | ALGO | 0.999807 | 4.196494 | {
"github_metadata": {
"branch": "master",
"commit_count": 584,
"repo_created_at": "2022-02-06T16:46: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": "872bbc42... |
5efc44e0-7b64-4b6b-aae9-0d4751722813 | CyrilSharma/CP | Codeforces/Problems/E_Doremy_s_Number_Line.cpp | #include <bits/stdc++.h>
using namespace std;
#define dbg(x) cerr << #x << " = " << x << endl;
#define fastio std::ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using pii = pair<int,int>;
void s... | ALGO | 0.999864 | 4.049333 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-08-29T15:38: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": "0c949b84e41b... |
58f2252f-01d9-4143-a12f-7481a367ceca | vuquangsang/VQS | camera.cpp | #include <bits/stdc++.h>
using namespace std;
#define TASK "camera"
#define lg(x) log2(x)
#define alla(a,n) a+1,a+n+1
#define el "\n"
#define all(x) x.begin(),x.end()
#define pb push_back
#define ll long long
#define fi first
#define se second
#define MASK(i) (1ll<<(i))
#define ... | ALGO | 0.999945 | 3.875699 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-02-15T18:54: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": "e5d013121afb... |
67aa5e3e-465f-4cde-9727-1d2121c7a07b | AthulJoseph27/Codeforces | 1700/1485C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define all(v) v.begin(), v.end()
void __print(int x)
{
cerr << x;
}
void __print(long x) { cerr << x; }
void __print... | ALGO | 0.999688 | 4.529579 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2021-04-03T18:12: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": "128fa52647... |
5dc7b7fe-304f-4e24-810c-fc4aff5a49e6 | IEIAuto/AutoDRRT | src/autodrrt.application/planning/behavior_path_planner_common/include/behavior_path_planner_common/utils/occupancy_grid_based_collision_detector/occupancy_grid_based_collision_detector.hpp | // Copyright 2022 TIER IV, Inc. All rights reserved.
//
// 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 applicab... | ALGO | 0.980748 | 6.847054 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-08-11T02:20:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 14,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "0b9441a6b... |
7906401b-2633-454f-a5b4-12f4f5986290 | souravtiwary/codeLibrary | binary tree/left_view_tree.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *left, *right;
Node (int data){
this->data = data;
this->left = this->right = nullptr;
}
};
/* int height(Node *root){
int hl=0, hr=0;
Node *temp = root;
if (temp == nullptr)
return 0;
el... | ALGO | 0.999977 | 4.52899 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-09-23T18:14: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": "34d2a57f902d... |
180cbc60-acc3-4a57-8b7a-58f6a6d4fef0 | zerodawn1802/VS | CPPSTR11.cpp | #include<bits/stdc++.h>
using namespace std;
bool subSofs(string s, string subs)
{
map<char, int> mps, mpsubs;
for (int i = 0; i < s.length(); i++) mps[s[i]]++;
for(int i = 0; i < subs.length(); i++) mpsubs[subs[i]]++;
for(map<char, int>::iterator it = mpsubs.begin(); it != mpsubs.end(); it++)
{
... | ALGO | 0.999964 | 4.388182 | {
"github_metadata": {
"branch": "GitTest",
"commit_count": 39,
"repo_created_at": "2020-10-25T09:31:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9269d7f0... |
67e57c7e-e886-4242-a688-c2378d9fe448 | lilelr/gcj-2017-Round-C | gcj 2017 Round C/C.cpp | //字符串处理 + 拓扑排序,判断是否存在环,有则失败;否则,成功
// https://code.google.com/codejam/contest/6274486/dashboard#s=p2
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using ... | ALGO | 0.999259 | 4.278547 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-09-21T15:08: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": "263ef04a74... |
c78f85e4-81a3-42af-b220-c0a8de1b2f88 | GYPpro/MathModel_cppCode | cacu.cpp | #pragma GCC optimize(2)
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include "cacu.h"
using namespace std;
ld Rad2Deg(ld rad) // 弧度制转角度制
{
return rad * 180 / pi;
}
ld Deg2Rad(ld deg) // 角度制转弧度制
{
return deg * pi / 180;
}
ld Nm2m(ld nm) // 海里转米
{
return nm * 1852;
}
ld m... | ALGO | 0.99926 | 3.358231 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-09T12:09: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": "e676e88ad90f... |
8d90fd5d-3706-4ada-b872-e76e9a1851f4 | sfilippo/spoj | BRKSTRING_naive.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 2e9+5;
const ll LLINF = 1LL << 60;
/*
filippos
SPOJ
Task : BRKSTRING
O(N³) solution, coded only as reference ... | ALGO | 0.999905 | 3.844651 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-09-03T22:28: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": "37e2161aa... |
2e379927-8555-4f84-96ac-9565252ae13c | VidurAgarwal25/Leetcodes | The Celebrity Problem - GFG/the-celebrity-problem.cpp | // { Driver Code Starts
//Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution
{
public:
//Function to find if there is a celebrity in the party or not.
int celebrity(vector<vector<int> >& m, int n)
{
//... | ALGO | 0.999795 | 5.561856 | {
"github_metadata": {
"branch": "main",
"commit_count": 657,
"repo_created_at": "2021-04-05T07:32: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": "4e973d86a5... |
b0646333-23e3-4503-bbb5-9c891894bb11 | girishlande/CPlusPlus | leetcode/29CombinationSum.cpp | // ConsoleApplication16.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
void findNumbers(vector<int> ar, int sum, vector<vector<int>>& res, vector<int>& r, int i) {
... | ALGO | 0.999816 | 5.545907 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2019-08-21T10:27: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": "6be0cb828... |
e3bb839c-3b8f-45e9-a6a0-d036fc25542f | luppiterw/LabAlgorithm | Sort/S003_InsertionSort.cpp | //
// Created by Hughie on 2018/11/26.
//
#include <TextUtils.hpp>
#include <iostream>
#include "S003_InsertionSort.h"
/**
* 1、索引0元素默认为已排序
* 2、从索引1元素开始,curIndex为当前需要处理的索引,curData为当前处理开始时索引对应的值
* 3、将curData与curIndex-1索引中的值比较,小于后者则交换(感觉这里有点儿不像插入了……)
* (其实交换是不必要的,因为交换的值,始终是一开始处理位置索引对应的值)
* 4、循环结束
* */
void S003_In... | ALGO | 0.999734 | 5.130904 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-11-25T01:42: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": "4831a3674... |
062d5cfb-ffbe-4640-9681-7b07d40cd109 | Joseph516/csu_oj | 2018/cola.cpp | /*
1028: 可乐
提交: 1188 解决: 329
- 题目描述
猪年快乐!在这个快乐的日子里我们当然要去超市买可乐喝啦!
现在超市有n种可乐,第 i 种可乐的价格为C[i] ,体积为 2^(i-1) 毫升,
每种可乐都是无限供应的,现在你想买至少 L毫升的可乐 ,
作为一个省钱小能手,聪明的你能够想到最少要花多少钱吗?
- 输入
输入包含多组测试用例。
每组测试用例第一行包含两个数字 n 和 L (1 ≤ n ≤ 30; 1 ≤ L ≤ 10^9),
n是可乐的种类数, L是我们最终要买的可乐体积。
第二行包含 n 个数字 C1,C2,...Cn n (1 ≤ ci ≤ 10^9),代表每一种可乐的价格。
- 输出
输出一... | ALGO | 0.999926 | 4.403746 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-02-27T17:37:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8923859e... |
044f1c4f-153d-4d8d-bc53-750a57ce48a7 | omkaranu04/CP_DSA | Codeforecs/2009/2009B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
void solve()
{
ll n;
cin >> n;
char a[n][4];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < 4; j++)
{
cin >> a[i][j];
}
}
for (int i = n - 1; i >= 0; i--)
{
for (int j =... | ALGO | 0.999195 | 3.969689 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2025-01-09T08:35: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": "e2369fb93... |
fa44c32a-4d4a-4314-bccf-0b59ae8a40d3 | SanthoshDheerajThota/Students-SGPA-and-CGPA-analyser | mainCode.cpp | #include <iostream>
#include <vector>
using namespace std;
class Student{
private :
string name;
int rollNumber;
float sgpa[8];
float cgpa;
public :
void setData(){
cout<<"enter the name of the student :"<<endl;
cin>>name;
cout<<"enter ... | TOOL | 0.992326 | 3.682545 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-06-11T09:33:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4ede8975eb4... |
fd5de513-0cbd-4757-8248-90b78d68fcab | dooli1971039/Algorithm | Sort/BOJ_10431.cpp | #include <iostream>
#include <vector>
using namespace std;
int sorting(vector<int> &arr) {
int cnt = 0;
int idx = arr.size() - 1;
while (idx != 0) {
if (arr[idx] < arr[idx - 1]) {
int tmp = arr[idx];
arr[idx] = arr[idx - 1];
arr[idx - 1] = tmp;
idx-... | ALGO | 0.999901 | 4.544834 | {
"github_metadata": {
"branch": "main",
"commit_count": 516,
"repo_created_at": "2021-12-22T16:50:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a07b733304... |
c2a1330c-23ad-4575-82f2-97898ebe9b9d | GrozniyToaster/MAI_SP | kp1/coin21.cpp | /* NID */
#include "mlisp.h"
extern double VARIANT/*2*/;
extern double LAST__DIGIT__OF__GROUP__NUMBER/*3*/;
extern double KINDS__OF__COINS/*4*/;
double first__denomination/*6*/ (double kinds__of__coins);
double count__change/*18*/ (double amount);
double cc/*39*/ (double amount, double kinds__of__coins);
bool pier_Q... | ALGO | 0.993542 | 3.160518 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-03-11T14:10: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": "368b4efd0c... |
6f876124-118c-4df9-a1bc-7ebc210b955b | nguyentrongvanviet/competitive-programming | 2022/CP/MATRIX/astr2.cpp | /*
author : <NAME>
class 11T2 Le Khiet High school
Nick name : Billyisme
My life have changed so much since I met you.
May be I am not the one who is suitable for you , I know how stupidly I am but please give me a chance I won't let you down. Believe me :( I hate the moment I lost you so much .
*/
#include<bits/st... | ALGO | 0.9999 | 3.628604 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2023-11-07T16:18:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c45dabe4ea... |
acdad88e-1b5e-4d7a-bb95-9391575b55f0 | dralves/sp1-sp2-galois | lonestar/experimental/ordered/bh_odg/ForceComputation.h | /*
* This file belongs to the Galois project, a C++ library for exploiting parallelism.
* The code is being released under the terms of the 3-Clause BSD License (a
* copy is located in LICENSE.txt at the top-level directory).
*
* Copyright (C) 2018, The University of Texas at Austin. All rights reserved.
* UNIVER... | ALGO | 0.999925 | 7.076308 | {
"github_metadata": {
"branch": "master",
"commit_count": 7804,
"repo_created_at": "2018-09-11T20:57:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "8cda4c4... |
e927643e-38fb-4b6c-a9aa-51d52ed92e81 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/number-of-paths-with-max-score-Solution.pathsWithMaxScore/177809_Bypass.cpp | restore_page_device(i_ctx_t *i_ctx_p, const gs_gstate * pgs_old, const gs_gstate * pgs_new)
{
gx_device *dev_old = gs_currentdevice(pgs_old);
gx_device *dev_new;
gx_device *dev_t1;
gx_device *dev_t2;
bool samepagedevice = obj_eq(dev_old->memory, &gs_int_gstate(pgs_old)->pagedevice,
&gs_int_g... | ALGO | 0.996768 | 4.391676 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-22T14:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccc500831310... |
2ebfab31-7a0d-4191-b7f5-80ac960e73c2 | ishandutta2007/codeforces-n | nikgaevoy/normal/1142/B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int up(int n)
{
int r = 1;
while (r < n)
r <<= 1;
return r;
}
class segtree
{
vector<int> arr;
int segmin(int l, int r, int cl, int cr, int v) const
{
if (r <= cl || cr <= l)
return numeric_limits<int>::max();
if (l <= cl && cr ... | ALGO | 0.99999 | 3.70167 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03dc28475802... |
89154663-1482-44d1-bdb1-c5938833a92b | verb55nta/leet_code | 0023/solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeKLists(vector<ListNode*>& lists) {
map< int,int,greater<int> > m;
if(lists.size()==... | ALGO | 0.999985 | 6.000315 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2019-03-17T13:39: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": "153698b42... |
60d4c24a-5bde-41ac-ab65-9495fe2d2e50 | KiCad-RU/kicad-gost-committers | gerbview/evaluate.cpp | /**
* @file evaluate.cpp
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2017 <NAME> <jp.charras at wanadoo.fr>
* Copyright (C) 1992-2017 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it ... | ALGO | 0.999496 | 6.501752 | {
"github_metadata": {
"branch": "master",
"commit_count": 9286,
"repo_created_at": "2021-05-06T19:31:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f70a975... |
d8ed482c-353d-48e4-83e2-dbb73f890273 | OctaviPascual/FIB-LI | Practica1/versio3/SATv3.cpp | #include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
// defines
#define UNDEF -1
#define TRUE 1
#define FALSE 0
#define CLAUSE_SIZE 3
// typedefs
typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VLL;
// structs
st... | ALGO | 0.99992 | 4.873391 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2016-03-02T23:27: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": "90c4318e3... |
e5cf25f9-ab58-4e44-a081-46f1a0b0986f | kameshkotwani/june2021-leetcode | 02.interleaving-string.cpp | class Solution {
public:
bool solve(string s1, string s2, string s3, vector < vector < vector <int>>>& dp, int i, int j, int k){
if(i ==0 && j == 0 && k == 0)return true;
if(dp[i][j][k] !=-1)return dp[i][j][k];
bool ans = false;
if(i > 0 && k >= 0 && s1[i] == s3[k]){
ans = solve(s1... | ALGO | 0.999941 | 5.439649 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2021-06-01T03:03: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": "e0ace08c885... |
bfa00c8c-80d3-4571-96f0-a086f7912ff7 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1244/Standings3/28934868_62467600.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>
#include <bitset>
#include <numeric>
#include <cassert>
#ifdef DEBUG
#include... | ALGO | 0.999973 | 3.986731 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "04e3c2dc0... |
09f4005e-aacc-46d9-af79-f93fb6827054 | lizmoscow/polar-codes-with-bch-kernel | out/external/Codec.cpp | #include <algorithm>
#include "Codec.h"
using namespace std;
//construct a generator matrix in packed form
//pGenMatrix must have size >=m_CodeDimension*ceil(GetLength/(8*sizeof(Word)) if GetExtension()==1
//Otherwise, >=m_CodeDimension*GetLength
Word* CBinaryEncoder::GetGeneratorMatrix()
{
tBit* pEncodingBuffer... | ALGO | 0.99974 | 5.156502 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-09-24T19:49:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afeb18cf95... |
05b8fd7f-7102-43f5-99b2-9931fb917e9b | cathery/aoc2022 | day 09/part 2/main.cpp | #include <fstream>
#include <iostream>
#include <vector>
#include <unordered_map>
int main()
{
std::ifstream Input("input.txt");
std::vector<std::vector<bool>> VisitedTiles;
// Just make the starting point large enough so that the coordinates won't ever go negative
constexpr std::size_t StartingPointX = 500;
co... | ALGO | 0.999585 | 5.575735 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-12-01T20:42: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": "570e0b4bcf0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.