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 |
|---|---|---|---|---|---|---|---|
06077bdc-8da5-4c5e-b1d7-50f6e3b2c2df | ishandutta2007/codeforces-i | ivan100sic/normal/983/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
int n;
int xd[10][10][10][10], cc;
int invv[1000][4];
void initins() {
int c = 0;
for (int i=0; i<10; i++)
for (int j=i; j<10; j++)
for (int k=j; k<10; k++)
for (int l=k; l<10; l++)... | ALGO | 0.999876 | 3.324337 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "9acae6c298f3... |
689ed61d-c1dd-4933-bed0-9bf5fa972372 | aabiji/adventofcode | 2024/src/day9.cc | #include <algorithm>
#include <cmath>
#include "lib.h"
int main() {
/*
std::vector<long> nums = split_num<long>(read_file("inputs/day9.txt"), "");
long checksum = 0;
long empty_index = 1;
long block_index = nums.size() - 1;
long block_id = ceil((float)nums.size() / 2) - 1;
long checksum_index = nums[0... | ALGO | 0.999175 | 4.939168 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2022-12-08T22:01: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": "b2d1e51d8d7... |
ac1bffed-215c-449a-b0f6-71203b5f49a5 | Xen-R/ViterbiDecoder | viterbi/Trellis.cpp | #include "Trellis.h"
#include<iostream>
#include <algorithm>
Trellis::Trellis()
{
num_of_bits = 0;
}
Trellis::Trellis(ConvolutionalCode code)
{
num_of_bits = code.get_blocks_num() + 1; //получение количества бит в состоянии регистра: количество блоков + входной бит
out_size = code.get_out_size(); //получение разме... | ALGO | 0.999766 | 4.387751 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-05-24T19:47:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a48eff158a... |
16b760a3-7474-4d14-bb82-32b6c66d08e3 | cuonggpham/HUST-Applied-Algorithms | HUSTack/Chapter3/cut_material.cpp | #include <iostream>
#include <vector>
using namespace std;
int H, W, n;
vector<pair<int, int>> rects;
vector<vector<bool>> used;
// Kiểm tra xem có thể đặt hình chữ nhật vào vị trí (x, y)
bool canPlace(int x, int y, int h, int w) {
if (x + h > H || y + w > W) return false; // Vượt ra ngoài giới hạn
for (int i... | ALGO | 0.999975 | 5.140399 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-02-13T21:14: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": "42eb60d72fe... |
c5eb352e-e9bc-45e7-a3da-1384d3cd66fd | ArchishmanSengupta/lc | 63-unique-paths-ii/63-unique-paths-ii.cpp | class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
int h = obstacleGrid.size();
if(h == 0) return 0;
int w = obstacleGrid[0].size();
if(w == 0) return 0;
if(obstacleGrid[0][0]) return 0;
// first cell has 1 path
obstacleGrid[0][0] = 1;
... | ALGO | 0.999949 | 5.661638 | {
"github_metadata": {
"branch": "master",
"commit_count": 801,
"repo_created_at": "2022-02-12T09:20:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a445062... |
42c0c890-810b-431d-973f-33bbef0e2617 | RevealMind/itmo | algorithms_and_data_structures/term_2/lab_3/a.cpp | #include <iostream>
#include <vector>
using std::vector;
vector<vector<int> > g, up;
int l, timer = 0;
vector<int> in, out;
void dfs(int v, int p = 0) {
in[v] = ++timer;
up[v][0] = p;
for (int i = 1; i <= l; i++) {
up[v][i] = up[up[v][i - 1]][i - 1];
}
for (int i = 0; i < g[v].size(); i++)... | ALGO | 0.999971 | 4.562875 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-07-13T19:02:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 103
},
"file_meta": {
"content_id": "06010bb... |
cc5a9c08-914a-492c-b51d-63f3e7a70b92 | parth-1372/CP | C_Palindrome_Basis.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define ff first
#define ss second
#define fri(n) for (int i = 0; i < n; i++)
#define sortv(v) sort((v).begin(), (v).end())
#define printv(v,start_idx) for(int i=start_idx;i<v.size();i++)cout<<v[i]<<" ";
int mod = 1e9 + 7;
v... | ALGO | 0.999972 | 4.447276 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-13T07:07: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": "c380a7457f1c... |
411679ee-7103-4ff4-b853-7f6dc4ea2564 | TimeP1ayer/BlackJack | ai_simulation.cpp | //This is a ai simulatition ver 1.0,an easy version
//Dealer have time to thing,ability to express his feeling to his cards
//To use this dealer ,just need to code "dealer()" in ur code
//Don't forget to add #include "ai_simulation.cpp" :)
#include<stdlib.h>
#include <cstdlib>
#include <iostream>
#include <ctime>
#in... | TOOL | 0.958656 | 3.360177 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-11-11T12:15: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": "b80f08d6695... |
f52b9eb8-2230-4b7e-bc3a-8315d20435ed | MoOo2mini/SSUalgo | 이민희/DP/boj11659.cpp | #include<iostream>
#include<vector>
#include<cmath>
#define endl "\n"
#define MAX 100010
using namespace std;
int N, M;
int Arr[MAX];
int Sum[MAX];
vector<pair<int, int>> Cmd;
void Input()
{
cin >> N >> M;
for (int i = 1; i <= N; i++)
{
cin >> Arr[i];
Sum[i] = Sum[i - 1] + Arr[i];
... | ALGO | 0.999981 | 4.290776 | {
"github_metadata": {
"branch": "main",
"commit_count": 360,
"repo_created_at": "2022-06-19T05:32:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e41f20629... |
d8e92506-4cc8-451f-8a3f-3fac74bfc1e9 | xcfem/xc_meshing_tmp | intrepid2/src/Projection/Intrepid2_ProjectionToolsDefL2.hpp | // @HEADER
// ************************************************************************
//
// Intrepid2 Package
// Copyright (2007) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the... | ALGO | 0.992276 | 6.721388 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-09-01T08:43:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92bdd4410fc... |
1a312705-ccbf-4911-b0cc-603d1c2c3c8f | csranger/leetcode | source/classification/search/LeetCode994.cpp | //
// Created by zhaohailong on 2020/8/11.
//
#include <vector>
#include <queue>
using namespace std;
class Solution {
public:
int orangesRotting(vector<vector<int>> &grid)
{
int fresh = 0;
vector<pair<int, int>> rotVec;
for (int i = 0; i < grid.size(); i++) {
for (int j =... | ALGO | 0.999969 | 5.644142 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2020-04-25T17:52:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "110e52aaf... |
44a61b37-26e7-4c9b-83d0-eada6bf29ac4 | voidrishad11/void_on_cpp | Programs/A_Square.cpp | /*------------------------------------------------------
author : voidrishad11
created : Monday | 15 January, 2024 | 20.37.58
------------------------------------------------------*/
#include <bits/stdc++.h>
#include <string>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#incl... | ALGO | 0.998975 | 4.437678 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-11-29T17:55: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": "a283b6c2799... |
a5f594c0-460f-4a94-83ef-3ca60cd17965 | 202030481266/CP-Templates-and-Solutions | 力扣每日一题3/最大合金数.cpp | class Solution {
using ll = long long;
public:
int maxNumberOfAlloys(int n, int k, int b, vector<vector<int>>& c, vector<int>& stock, vector<int>& cost) {
vector<ll> sum(n + 1);
auto check = [&](int x, int v) -> bool {
ll u = 0;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999805 | 4.361794 | {
"github_metadata": {
"branch": "main",
"commit_count": 606,
"repo_created_at": "2023-01-27T08:36: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": "01c6bee171... |
74ef0b08-1774-4cf2-9ea3-e7b293ba65b4 | harshal-dupare/MA39011 | assignments/prog4.cpp | /*
Name : <NAME>
Roll Number : 18MA20015
Class : 4
Date : 25-9-2020
Details: 4) Overload the * operator for the class Number.
*/
#include <iostream>
#include <string.h>
using namespace std;
// function to reverse the string
void reverse(string& str)
{
int n = str.length();
for (int i = 0; i < n / 2; i++) ... | ALGO | 0.998074 | 4.442817 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2020-12-10T13:43: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": "d7245e25e27c... |
d2082ed9-de4f-4b8f-9531-5cadc8df409d | kunge233/Cobot_Servo2022_FMC | Servo_H743/Core/Servo/Controller/lqt.h | #ifndef LQT_H
#define LQT_H
#include <algorithm>
template <class T> class LQT {
public:
// LQT
T K_x;
T K_d;
// 鲁棒补偿器
T f;
T L;
T G_sigma;
T H_1_sigma;
T H_2_sigma;
T sigma;
T v;
// 输出
T u_0;
T u;
void init(T u_max) {
this->u_max = u_max;
reset();
}
void reset() {
// 还... | TOOL | 0.998833 | 5.180364 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-27T11:34:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "d5120ccf0005... |
4af1149e-eff2-401a-87c2-c575e7d4c07f | s-ley/CP3-uva-solutions | 3-level/uva10721.cpp | #include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
using ll = long long;
const int N = 53;
ll mat[N][N][N];
void init() {
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
for (int k = 0; k < N; k++) {
mat[i][j][k] = -1;
}
}
}
}
ll solve(int units, int bars, i... | ALGO | 0.999921 | 3.937484 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2017-05-28T19:52: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": "fd7a7aa03... |
85453811-7966-4c77-835e-213dd522fa77 | albertsundjaja/route_planner | src/route_planner.cpp | #include "route_planner.h"
#include <algorithm>
RoutePlanner::RoutePlanner(RouteModel &model, float start_x, float start_y, float end_x, float end_y): m_Model(model) {
// Convert inputs to percentage:
start_x *= 0.01;
start_y *= 0.01;
end_x *= 0.01;
end_y *= 0.01;
// Use the m_Model.FindCloses... | ALGO | 0.947591 | 5.132516 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-09-01T03:32: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": "3576d86e7e22... |
fb816983-1309-40ed-8c18-34b0e6ce3f2f | KhusainovAydar/codeforces | 469div2/C.cpp | #include <bits/stdc++.h>
#define times clock() * 1.0 / CLOCKS_PER_SEC
//#define pi 3.1415926535897932384626433832795
#define cntbit(x) __builtin_popcount(x)
//#define double long double
//#define int long long
#define all(x) x.begin(), x.end()
#define x1 lolkekmem
#define y1 kekmemlol
#define STRESS
// oxxxy vseravno ... | ALGO | 0.999661 | 3.461615 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-04-05T01:00: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": "d424f27a0b... |
30cd7c9b-5054-4105-9f9f-1a2bab05f261 | karmalmao/youreareliar | Warmups/LetterShifting/main.cpp | #include <iostream>
std::string shiftLetters(std::string w, int n)
{
std::string result = w;
int spacecount;
for (int i = 0; i < result.length(); i++)
{
if (true /*result[i] != ' '*/)
{
}
else;
}
return result;
}
int main(int argc, char** argv)
{
... | ALGO | 0.99702 | 4.570986 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-05-25T06:54: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": "f0edb7086e33... |
19e34408-12e4-45ed-a9a6-455e166a755a | CiaranWelsh/TestSBNWBinaries | include/sbnw/geom.h | /* MIT License
*/
//== FILEDOC =========================================================================
/** @file transform.h
* @brief 2d transform applied to canvas elements
*/
//== BEGINNING OF CODE ===============================================================
#ifndef __SBNW_MATH_GEOM_H_
#define __SBNW_MAT... | ALGO | 0.969384 | 6.088329 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-01-22T22:36:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1156d865a8... |
1b61c0a5-69f8-4d06-8cec-2999abb6fa0e | kaganndemirr/mandelbrot_set | MandelbrotSetSerial/main.cpp | #include <iostream>
#include <complex>
#include <chrono>
#include <fstream>
auto escapeTimeAlgorithm(std::complex<double> c) {
std::complex<double> z(0, 0);
for(int i = 0; i < 10000; i++){
z = std::pow(z, 2) + c;
if (std::abs(z) > 2){
return i;
}
}
return 0;
}
int ... | ALGO | 0.98508 | 4.671737 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-11-26T17:46: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": "20823b51e80d... |
98075f33-6a22-43d2-bac8-554cb2cf16e8 | chriscon24/Projects | everything_folder/Lets get an A/Conable, Christian Final Turnin/Final Exam Redo/prob2.h | #ifndef PROB2_H
#define PROB2_H
#include <cstdlib>
template<class T>
class Prob2Sort
{
private:
int *index;
public:
Prob2Sort()
{ index = NULL; }
~Prob2Sort()
{ delete []index; }
T* sortArray(const T* type, int i, bool max)
{ return type; }
T* so... | ALGO | 0.997568 | 4.095565 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2017-09-26T23:04: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": "ad4090bce... |
bf8aeeef-da4c-4c33-9f0c-5ad553ebf47e | Idontknowrithm/PS-selfDev | BOJ/BOJ-6599-The_Tower_of_Babylon.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<cstring>
typedef struct{
int x, y, z;
}block;
int N, cache[105];
std::vector<block> babylon;
bool cmp(const block &a, const block &b){
return (a.x == b.x) ? (a.y > b.y) : (a.x > b.x);
}
int DP(int start){
bool next_exist = false;
if(st... | ALGO | 0.999692 | 4.071213 | {
"github_metadata": {
"branch": "master",
"commit_count": 647,
"repo_created_at": "2020-02-17T08:34:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "788b52df... |
60701693-b405-4488-92df-74d7dca1cd8e | google/filament | third_party/dawn/third_party/dxc/lib/Transforms/Scalar/ConstantProp.cpp | //===- ConstantProp.cpp - Code to perform Simple Constant Propagation -----===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | TOOL | 0.988597 | 7.7326 | {
"github_metadata": {
"branch": "main",
"commit_count": 7301,
"repo_created_at": "2018-08-03T17:26:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18658,
"forks": 1993,
"issues": 155,
"pull_requests": 23
},
"file_meta": {
"content_id": "... |
9d66c723-dd0b-4d9b-a446-35c5041cf812 | ishandutta2007/codeforces-k | kostia244/normal/1556/F.cpp | // Problem: F. Sports Betting
// Contest: Codeforces - Deltix Round, Summer 2021 (open for everyone, rated, Div. 1 + Div. 2)
// URL: https://codeforces.com/contest/1556/problem/F
// Memory Limit: 256 MB
// Time Limit: 4000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#pragma GCC optimize("Ofast,unroll-loops")... | ALGO | 0.999912 | 4.762318 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f96407927645... |
8fdf62ca-afc7-4764-a17f-32bf9cf95a1b | CGAL/cgal | Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_dag.h | // Copyright (c) 2005,2006,2007,2008,2009,2010,2011 Tel-Aviv University (Israel).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : <NAME> <<EMAIL>>
// <NAME> <<EMAIL>... | ALGO | 0.93126 | 6.65128 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
8921a43b-bb45-4d63-be7c-8a4cfa3d6193 | ishandutta2007/codeforces-b | bluediamond/normal/487/B.cpp | #include <bits/stdc++.h>
using namespace std;
struct SegTree_Max
{
const int INF = (int) 2e9 + 100;
vector <int> t;
int len;
void init(int __len)
{
len = __len;
t.resize(4 * len + 1);
for (int i = 0; i < 4 * len + 1; i++) t[i] = -INF;
}
void upd(int v, int tl, int tr, int p, int x)
{
... | ALGO | 0.99995 | 3.474617 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fef9d2ef713f... |
d9cd80f3-47cf-4b75-8822-7a917aa50194 | ishandutta2007/codeforces-d | darkkcyan/normal/93/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define llong long long
#define ii pair<int, int>
#define xx first
#define yy second
#define len(v) ((int)v.size())
#define rep(i,n) for (int i = -1; ++i < n; )
#define rep1(i,n) for (int i = 0; i++ < n; )
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.ti... | ALGO | 0.999858 | 3.092109 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7e31246c86f... |
e9cb64e6-1781-4f26-8b0b-8addbbb79cd7 | LucilleLu/CPSC221 | project1-files/HeapPriorityQueue.cpp | //HeapPriorityQueue.cpp
#ifndef _HEAPPRIORITYQUEUE_CPP
#define _HEAPPRIORITYQUEUE_CPP
#include "HeapPriorityQueue.hpp"
#include <cassert>
#include <cstdlib>//for NULL
#include <iostream>
HeapPriorityQueue::HeapPriorityQueue() {
// Empty... nothing needs to be done.
}
HeapPriorityQueue::~HeapPriorityQueue() {
// ... | ALGO | 0.959566 | 5.031331 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-05-08T00:24: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": "26c33c16c4... |
95ee1a15-0e8f-48c6-980c-d12a7520aa06 | KabirBhae/PhitronXPSC | Week3/Day 7/tshirt.cpp | #include <iostream>
const int v = 50;
unsigned long long dp[v] = {0};
unsigned long long factorial(unsigned long long k)
{
if (k < 3)
{
return k;
}
if (dp[k] != 0)
{
return dp[k];
}
dp[k] = factorial(k-1) * k;
return dp[k];
}
int main()
{
using namespace std;
... | ALGO | 0.999963 | 4.885973 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2023-06-16T16:02: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": "58226de776d... |
9163ed62-5e5c-4f2a-b7cd-820735cee931 | BurakKaragol/CPlusPlus | hafta4/hafta4.cpp | #include <iostream>
#include <math.h>
using namespace std;
enum haftaninGunleri {Pazartesi, Sali, Carsamba, Persembe, Cuma, Cumartesi, Pazar};
enum cinsiyet {kadin, erkek};
int topla (int x, int y); //fonksiyonun prototipi buraya yazilir ve bu sayede problem cozulur
void carpim (int x, int y);
void karakterYaz(char ... | TOOL | 0.974393 | 3.037857 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-09-18T20:52: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": "ab70a86a2... |
e4153c12-b287-4312-8055-2febd2607715 | ihsuy/CodingPractice | source/toLowerCase.cpp | #include <math.h>
#include <algorithm>
#include <bitset>
#include <chrono>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#i... | ALGO | 0.997545 | 4.114243 | {
"github_metadata": {
"branch": "master",
"commit_count": 281,
"repo_created_at": "2019-03-15T09:16:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4a45fca... |
444069a1-8a5f-4ef4-809a-23771bd0d59e | Irratzo/notes | lang/cpp/AltesCppZeug/AlterETHZCppKurs/U9/daniel_binarytree.cpp | /*
* binarytree.cpp
*
* Created by <NAME> on 29.11.10.
*
* Beispiel-Aufruf des kompilierten Programms mit dem
* Baum aus der Übungsstunde:
* ./bintree 5 2 9 1 3 7 6 8
*
*/
#include <iostream>
struct node {
int value;
node * left;
node * right;
};
/*
* fuegt einen neuen Wert in den Baum ein. Dadurch... | ALGO | 0.999881 | 4.645336 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-02-16T22:14: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": "30dd818d5c... |
8fc1a329-7eb6-4f4f-8710-a42b3f347010 | aurastejeroiu/Basic-C-ALgorithms | P2.52a/main.cpp | #include <iostream>
using namespace std;
void DetSecCML(int n, int X[], int m, int Y[], int& I0, int& dr, int& J0){ ///(I0,dr) Secventa finala
for(int i=1;i<=n;i++){ /// i indice pentru X, (i,i+k) este secventa curenta
for (int j=1;j<=m;j++) { /// j indice pentru Y
int jj=j; /// j, jj indic... | ALGO | 0.999744 | 3.569706 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-01-07T10:00: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": "c2df824b8bc... |
3c9392cd-86b3-4d07-87cd-526f9c6df532 | thinkphp/computer-science-in-c | algorithms/sorting/bubblesort/bubblesort4.cpp | #include <iostream.h>
#include <conio.h>
#include <fstream.h>
/*
Sorting by exchanging -> bubblesort
*/
//prototypes
//--------------------
void read();
void display();
void bubblesort();
void swap(int i,int j);
void write();
//--------------------
//input
ifstream fin("c:\\file.in");
//output
ofstream fout("c:\... | ALGO | 0.999649 | 3.990768 | {
"github_metadata": {
"branch": "master",
"commit_count": 2852,
"repo_created_at": "2014-08-20T07:22:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "adbd438... |
be400fb9-6414-4ae3-99a9-198f189cbc0d | yunshujing/ACM | 暑期集训/25#cf/A_Find_K_Distinct_Points_with_Fixed_Center.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int xc, yc, k;
cin >> xc >> yc >> k;
int step = 1;
int point = 0;
for (int i = 0; points < k - (k % 2); ++i) { // 如果k是奇数,则循环到k-1
cout << xc + step <... | ALGO | 0.999856 | 4.273594 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2024-09-13T07:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51c375db62... |
d77852cb-bb91-4b57-b163-4d459096a575 | i-am-arvinder-singh/CP | CF-Edu-101-C-Building a Fence-Intuitive.cpp | #include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define endl "\n"
#define ll long long
#define int long long
#define ff first
#define ss second... | ALGO | 0.99999 | 3.785404 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2020-05-25T21:25: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": "c8f78b4c... |
f3682070-85bc-4fc2-ba56-d4dba0e6ca55 | huyyi/leetcode | CPP/leetcode/editor/cn/55_JumpGame.cpp | //给定一个非负整数数组 nums ,你最初位于数组的 第一个下标 。
//
// 数组中的每个元素代表你在该位置可以跳跃的最大长度。
//
// 判断你是否能够到达最后一个下标。
//
//
//
// 示例 1:
//
//
//输入:nums = [2,3,1,1,4]
//输出:true
//解释:可以先跳 1 步,从下标 0 到达下标 1, 然后再从下标 1 跳 3 步到达最后一个下标。
//
//
// 示例 2:
//
//
//输入:nums = [3,2,1,0,4]
//输出:false
//解释:无论怎样,总会到达下标为 3 的位置。但该下标的最大跳跃长度是 0 , 所以永远不可能到达最后一个... | ALGO | 0.999973 | 5.735105 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-07-09T07:45: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": "312205303a... |
249ded87-e744-4c8e-a35f-4e67ee545c46 | ishandutta2007/codeforces-u | um_nik/normal/1179/A.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
... | ALGO | 0.999951 | 3.369189 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "acc07f52f0f4... |
8d39ac03-8988-4b56-8741-ff1077fd0691 | nateshmbhat/Hackerrank | Two Characters.cpp | #include <bits/stdc++.h>
using namespace std;
bool checkstring(string s)
{
if(s.length()<2) return 0 ;
if(s.length()==2) return 1;
for(int i=2 , j=3 ; i<s.length() && j<s.length() ; i+=2 , j+=2 )
{
if(s[i]==s[j] || s[i]!=s[i-2] || s[j]!=s[j-2] ) return 0 ;
}
if(s[s.length()... | ALGO | 0.999914 | 3.454298 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-11-08T08:09:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7a8db2a5... |
980c7a20-f0b5-4537-ae91-7ae1cb86c164 | TheEmidee/UESVONavigation | Source/SVONavigation/Public/PathFinding/SVOPathFindingAlgorithmObservers.h | #pragma once
#include "SVOPathFindingAlgorithmTypes.h"
#include "SVOVolumeNavigationData.h"
#include <GraphAStar.h>
struct FSVONavigationPath;
class FSVOPathFindingAlgorithmStepper;
struct FSVOPathFinderDebugInfos;
class FSVOPathFindingAlgorithmObserver
{
public:
explicit FSVOPathFindingAlgorithmObserver( const... | ALGO | 0.982244 | 5.306942 | {
"github_metadata": {
"branch": "develop",
"commit_count": 343,
"repo_created_at": "2021-03-26T07:56:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 12,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "57b41... |
b4aaf41d-0aa4-4c4b-91bc-86c0cd400658 | egormoroz/saturn | movepicker.cpp | #include "movepicker.hpp"
#include "board/board.hpp"
#include <algorithm>
#include <cstring>
namespace {
void insertion_sort(ExtMove *begin, ExtMove *end) {
for (ExtMove *p = begin + 1; p < end; ++p) {
ExtMove x = *p, *q;
for (q = p - 1; q >= begin && *q < x; --q)
*(q + 1) = *q;
... | ALGO | 0.985819 | 6.710145 | {
"github_metadata": {
"branch": "master",
"commit_count": 178,
"repo_created_at": "2022-03-04T18:32:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7acc7e0b... |
4781da79-05e6-4282-9622-90a522f3937b | zhuguanxin/XinSTL | xin_numeric.h | #pragma once
#include<xin_iterator.h>
//数值算法
namespace XinSTL{
//***************************************************************************
//accumulate
//版本一:以初值init对每个元素进行累加
//版本二:以初值init对每个元素进行二元操作
//版本一
template<class InputIterator,class T>
T accumulate(InputIterator first,InputItera... | ALGO | 0.996031 | 6.355047 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2023-03-15T14:12: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": "2830962bf23... |
85fdf97c-2560-44d0-8314-bb2148315e5c | HEltim7/cpcode | Archive/AcWing/problems/2185.cpp | #include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<map>
using namespace std;
#define endl '\n'
#define debug(x) cout << "[debug] " #x << " = " << x << endl<<flush
const int N=110,M=1e3+10,INF=0x3f3f3f3f;
int ne[M],e[M],f[M],w[M],idx;
int h[N],q[N],d[N],pre[N],mf[N];
int n,m,S,T;
bool in... | ALGO | 0.999997 | 3.951983 | {
"github_metadata": {
"branch": "master",
"commit_count": 249,
"repo_created_at": "2022-06-06T13:55:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fc145fd... |
b2aac02f-dda7-4b3c-aa1d-e9c1599f7fa9 | MengYueqi/HIT_data_structure | list/Queuel.h | //
// Created by Meng on 2022/9/20.
//
#ifndef QUEUE_QUEUEL_H
#define QUEUE_QUEUEL_H
#include <iostream>
// TODO:运用模版类,重写队列存储结构
typedef int Elemtype;
// 队列的链表实现
template <typename T>
struct node{
T val; // 内部所含的数值
node *next;
};
template <typename T>
class Queuel {
private:node<T> *queue;
node<T> *las... | TOOL | 0.944003 | 4.303046 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-08-11T11:36:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f0c488cb92b... |
6974749b-6d05-41df-aa56-c2e342933252 | 21omkarsase/DSA | Trees/easy/BoundaryTraversalofbinarytree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.99981 | 5.8268 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2022-04-12T18:35: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": "453804bed61... |
032315a4-1f8e-4477-b017-7d0a935174df | ChairmanFMao/codeforces | contests/Round-782-div.2/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sz(c) (int)c.size()
#define all(c) c.begin(),c.end()
void solve() {
int n, k;
string s;
cin >> n >> k >> s;
vector<int> bits(n);
for (int i = 0; i < n; i++)
bits[i] = s[i] & 1;
vector<int> uses(n);
if (k & 1) {
k--;
int flip = -1... | ALGO | 0.999975 | 3.71939 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2022-01-17T22:10: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": "2502ca55d... |
65cc942f-a1c1-4df4-9309-aa9aa029b2fd | namratakaushik016/Strivers_SDE_sheet | 0004-median-of-two-sorted-arrays/0004-median-of-two-sorted-arrays.cpp | class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int m = nums1.size();
int n = nums2.size();
//need to ensure that nums1 is shorter than or equal to nums2
if(m > n){
swap(nums1, nums2);
swap(m, n);
}
... | ALGO | 0.999994 | 6.361367 | {
"github_metadata": {
"branch": "main",
"commit_count": 326,
"repo_created_at": "2023-07-04T05:58:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34d3bf937f... |
0e2b6b7a-3d53-401a-bd5a-114b4751144d | guilhermeandrd/dicionarios | dicionariochained.hpp | /**
* @file dicionariochained.hpp
* @author <NAME> | Github: (@guilhermeandrd)
* @brief Dicionário Implementado Com Tabela Hash Encadeada
* Estrutura de dados avancada - 2025.1
* @version 0.1
* @date 2025-07-17
*
* @copyright Copyright (c) 2025
*
*/
#include <iostream>
#include "estruturas_auxiliares/Chai... | TOOL | 0.911825 | 5.59324 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2025-07-04T11:59: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": "db0cf65f13... |
3d7da9b7-50c9-4a03-bd3e-adbc97c24a1b | amanraj5/CodeForces | Contests/962C_Sort.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, q;
cin >> n >> q;
string a, b;
cin >> a >> b;
vector<vector<int>> prefix_a(n + 1, vector<int>(26, 0));
vector<vector<int>> prefix_b(n + 1, vector<int>(26, 0));
// Precompute prefix frequency counts
for (int i = 0; i <... | ALGO | 0.999921 | 4.589019 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2024-03-05T11:24: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": "0eab4db4cf6... |
c7336df5-c420-4863-941f-361ebf4f85b8 | tkieras/practice | advent-of-code-2020/4/revised.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <utility>
#include <regex>
#include <set>
using namespace std;
vector<string> get_entries(string filepath) {
fstream infile(filepath, fstream::in);
vector<string> entries;
stringstream entry_buffe... | ALGO | 0.972519 | 5.825975 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-02-09T21:07: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": "bb689cd657de... |
c9740610-d0e8-4ebe-8db0-b6e4345facdf | YJ243/python_codingTest | codetree_BruteForce/strange_num_해설.cpp | /*
* 2023.12.09
* 이진수의 가장 왼쪽 자릿수부터 차례대로 바꾸고 값 비교
* 자릿수를 바꾼 뒤에는 원래대로 돌려놓아야 함
*/
#include <iostream>
#include <climits>
using namespace std;
int main(){
// 변수 선언 및 입력
string binary;
cin >> binary;
// 각 i번째 자릿수를 바꾸었을 때 십진수 값을 구해주기
int ans = INT_MIN;
for(int i=0; i<(int) binary.size(); i++){
... | ALGO | 0.999894 | 4.703287 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2023-04-11T06: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": "f37a49aa65... |
b552d647-90d8-42f1-9bf8-8a238cfb0eb0 | NTMyDung/Demo | 193/main.cpp | #include <iostream>
using namespace std;
bool songuyento ( int n){ //ham kiem tra 1 gia tri co la so nguyen to khong
if( n<=1) return false;
if( n==2) return true;
for( int i=2; i<n; i++){
if(n%i==0) return false;
}
return true;
}
int demphanb... | ALGO | 0.999976 | 4.194952 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-01-04T09: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": "1bfb79d4446... |
2c44e7b5-a3b9-48a5-8789-79221133eda8 | hhxia/Palabos-visualstudio | LBM/Palabos/complexDynamics/advectionDiffusionBoundaryCondition3D.hh | /* This file is part of the Palabos library.
* Copyright (C) 2009 <NAME>
* E-mail contact: <EMAIL>
* The most recent release of Palabos can be downloaded at
* <http://www.lbmethod.org/palabos/>
*
* The library Palabos is free software: you can redistribute it and/or
* modify it under the terms of the GNU Genera... | ALGO | 0.97909 | 6.77353 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-06-25T11:46:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81d609914... |
3fb8fd48-7c5c-4937-a932-427e45ad6edb | ryuxin/Online-Judge | Uva/Uva 100_499/Uva 164.cpp | /*基础题。动规。dp[i][j]表示将s1[i:]转化为s2[j:]需要的最少
*操作,path[i][j]表示相应采用的操作。dp可以压缩到2维。输
*出每次的操作时,要注意维护当前需要修改的字符串的位置。
*边界问题:输入的字符串最后一个字符是换行,要删掉。
*/
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <queue>
using namespace std;
#define NUM 25
#define LEN 50
char path[NUM]... | ALGO | 0.999993 | 3.428025 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2014-01-24T02:36:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "989c29b0... |
3086a7d3-c48c-4b4b-bbaa-9d0fbff5821e | BishayuG/CPP_assignment | 5.cpp | // Write a C++ program to update every array element by multiplication of the next and previous values of a given array of integers.
#include <iostream>
using namespace std;
void updateArray(int arr[], int n)
{
if (n <= 1)
return;
int prev = arr[0];
arr[0] = arr[0] * arr[1];
for (int i = 1; ... | ALGO | 0.999997 | 5.794852 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-01-28T04:12: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": "ea4a8f8d67e... |
0e486736-a35d-47ca-9444-d1485770abbb | nobuyuki83/Applied_Computer_Graphics_2024S | task01/main.cpp | #include <cstdio>
#include <iostream>
#include <cassert>
#include <vector>
#include <filesystem>
#define _USE_MATH_DEFINES
#include <cmath>
//
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
/**
* @brief compute the area of a triangle
* @return area
*/
float area_of_a_triangle(
float x0, flo... | ALGO | 0.997376 | 6.196321 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2024-02-24T10:22:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ecddace14... |
a456ca31-0214-4e3c-9772-d061f2d6865f | ibudiselic/contest-problem-solutions | tc 160+/JimmyLightning.cpp | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <utility>
using namespace std;
#define MAXTIME(P) P.first
#define VAL(P) P.second.first
#define TIME(P) P.second.second
#define MAKE(MT, V, T) make_pair(MT, ... | ALGO | 0.999495 | 4.279829 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2011-08-14T11:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "500d7cd77... |
2d6e1d63-d3a4-4e47-8a6a-ead7b2acac51 | bhowbhowbhavya/RutgersMITA_ISDClass | Feb18_DrawStar.cpp | #include "std_lib_facilities.h"
// function declaration
void starLeftTriangle(int n);
void starRightTriangle(int n);
// main function
int main()
{
char choice;
int star;
while (true)
{
cout << "Please enter if you want to draw (L)eft triangle or (R)ight triangle or (Q)uit: \n";
cin >>... | ALGO | 0.990682 | 4.533638 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-08-07T04:38: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": "74058b17b9d1... |
dd05189f-f9fc-48bd-98df-be581151f0fa | polserver/ModernDistro | scripts/ai/main/closeDistance.inc | var lastface;
var nexttry;
function CloseDistance(opponent)
var dst := 1;
var d := Distance(me, opponent);
if (d <= dst)
return 1;
elseif((d >= 25) or (opponent.concealed) or (opponent.hidden))
return 2;
else
sleepms(3);
RunToward( opponent );
sleepms(3);
RunToward( opponent );
sl... | ALGO | 0.998775 | 4.691387 | {
"github_metadata": {
"branch": "master",
"commit_count": 864,
"repo_created_at": "2018-07-22T21:41:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 18,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "342221... |
36ec3bcd-e571-4234-a0db-f834aadd3e09 | Yuuzi261/C-Cpp-Examples | Problem Solving and Program Design in C/ch5/17/17.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double trap(double, double, double, char);
double g(double);
double h(double);
int main(void){
char function;
double a, b;
int n;
printf("g(x) = x^2(sinx)\nh(x) = (4-x^2)^(1/2)\n");
do{
printf("Enter... | ALGO | 0.999421 | 4.209083 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-09-09T12:39: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": "55dcd44682c5... |
913baf6a-6a8b-4800-b6ba-d61002ec4b99 | justin-huttegger/JustinHuttegger-CSCI20-Spr2017 | lab21/lab21.cpp | /*<NAME>
CSCI 20
Feb 21, 2017
2.1 Lab - Calling Functions
The program outputs information about windchills based on what the user's inputs are.
*/
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double OldStyleWindChill = 0.0;
double NewStyleWindChill = 0.0;
double ... | ALGO | 0.958206 | 5.665857 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2017-01-24T23:38: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": "0de4c049a... |
42e9650b-76c8-4d28-9f42-beedea35cdef | songks0922/algorithm | Baekjoon/1000~1999/1979.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> parent;
vector<int> path; //여행 경로
int N,M;
int map[201][201]={0};
int find(int node) {
if (parent[node] == node) {
return node;
} else {
return parent[node] = find(parent[node]);
}
}
void union_(int x,int y){
... | ALGO | 0.999995 | 5.372235 | {
"github_metadata": {
"branch": "main",
"commit_count": 383,
"repo_created_at": "2021-06-27T06:37:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "809569f894... |
c0b43768-c254-4cd4-bf99-13eccbcdccea | MaxRev-Dev/My-Labs | Closed Labs/MatrixDistributeLawCheck/Source.cpp | #include <iostream>
#include <conio.h>
#include <Windows.h>
using namespace std;
int size; //Глобальна змінна для постійного розміру
class Matrix {
private:
int **m; // Матриця
Matrix(int x) { // Допоміжний конструктор для створення
//готової матриці з одним числом
m = new int*[::size];
for (int i = 0;... | ALGO | 0.993807 | 3.922497 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-09-09T15:42:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "5e91eb64b... |
66cfc84f-456e-41d1-b8a7-c46dd646b753 | sangram2002/Numerical-Methods-codes | Assignment_08/Q1_iii.cpp |
#include <bits/stdc++.h>
using namespace std;
// Newton Raphson Method to find roots of a equation
long double f(long double x)
{
return pow(x,6) - 9.2*pow(x,5) +34.45*pow(x,4)-66.914* pow(x,3)+70.684* pow(x,2) -38.168*x +8.112 + 0.01234*log(x);
}
long double f_derivative(long double x)
{
return 6*pow(x,5)... | ALGO | 0.999662 | 3.600671 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-02-27T15:01: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": "e5cde65b50b... |
8a7aaadb-77c1-4d2b-8c57-9485aad309b8 | apple/turicreate | src/external/boost/boost_1_68_0/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 <NAME>, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 <NAME>, Paris, France.
// Copyright (c) 2009-2012 <NAME>, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c... | ALGO | 0.998485 | 6.915452 | {
"github_metadata": {
"branch": "main",
"commit_count": 1571,
"repo_created_at": "2017-12-01T00:42:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11198,
"forks": 1137,
"issues": 502,
"pull_requests": 21
},
"file_meta": {
"content_id": "... |
f66e35f9-0f26-4b4e-b191-48e42bcf06cf | MateoCentis/AyED | Ejerciciosresueltos/tpl22013.cpp | /* COMIENZO DE DESCRIPCION
__USE_WIKI__
Contiene count-level, odd2even, y is_shift.
[Tomado en el TPL2 2013-10-12].
keywords: correspondencia, lista, arbol orientado
FIN DE DESCRIPCION */
#include <cstdio>
#include "Evaluar.hpp"
#include "./tree.h"
#include "./util_tree.h"
#include "./util.h"
//--... | ALGO | 0.999487 | 3.647022 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-20T18:54: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": "c32f88945c9b... |
30243c8e-d9cd-4475-823e-d03efc218615 | sebsgit/fractencode | thirdparty/range-v3/include/range/v3/algorithm/rotate_copy.hpp | /// \file
// Range v3 library
//
// Copyright <NAME> 2013-present
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range... | ALGO | 0.986214 | 7.747257 | {
"github_metadata": {
"branch": "master",
"commit_count": 175,
"repo_created_at": "2016-07-28T07:48:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c0b8f61... |
5f7c9a1b-f396-41d9-a769-7ba0063ff304 | colesmith54/competitive-programming | kattis/shortestpath2.cpp | // <NAME> (colesmith54)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vii = vector<ii>;
using vvii = vector<vii>;
void solve(int n, int m, int q, int s) {
int u, v, t0, p, d;
vector<vvi> adj(n, vvi());
... | ALGO | 0.999756 | 4.449089 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2024-11-30T03:15: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": "31e5996c2... |
681095ec-3630-48bc-8b45-7b64265ab1c8 | zjpgitte/zcode | 7-2leet-code/7-2leet-code/test.cpp | class Solution {
public:
int numTrees(int n) {
vector<int> dp(n + 1); // dp[i]的含义是由i个结点组成的二叉搜索树个数。与结点值没有关系
// 这i个结点值可以是任意的,只是在本题中结点值是[1,n]的。
for (int i = 0; i <= n; i++) {
dp[i] = 0;
}
dp[0] = 1; // 可以认为 0 个结点组成的二叉搜索树只有一个是空树
// dp[i] = dp[j - 1] * dp[i - j]; // j可以是[1,i]的任意值
for (int i = 1... | ALGO | 0.999995 | 5.067337 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2021-02-02T07:28: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": "610fb7370e... |
132d7448-2f36-4b23-b65c-0ec390a4b9f8 | Shahraaz/CP_S5 | codeforces/EDU_6_VC/e.cpp | // Optimise
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "/home/shahraaz/bin/debug.h"
#else
#define db(...)
#endif
using ll = long long;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
const int NAX = 4e5 + 5, MOD = 1000000007;
struct Node
{
ll val;... | ALGO | 0.99994 | 4.983296 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2019-07-15T23:57:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94712f08... |
c5dbd55f-1865-4027-96ce-a65d4452d5d5 | raincross7/code-similarity | codes/train_code/problem271/problem271_24.cpp | #include <iostream>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
double x[3], y[3], xp, yp;
double ax, ay, bx, by;
while (cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> xp >> yp) {
int posi = 0, nega = 0;
for (int i=0; i<3; ++i) {
ax... | ALGO | 0.9998 | 4.097699 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02799b09b677... |
e7a19393-8ee7-46e3-bbe7-30908df0bbe2 | ADITYAGABA1322/Daily-LeetCode-Challenge-Solution | 0719-find-k-th-smallest-pair-distance/0719-find-k-th-smallest-pair-distance.cpp | class Solution {
public:
int smallestDistancePair(vector<int>& nums, int k) {
int arraySize = nums.size();
// Find the maximum element in the array
int maxElement = *max_element(nums.begin(), nums.end());
// Initialize a bucket array to store counts of each distance
vector<... | ALGO | 0.999995 | 6.767571 | {
"github_metadata": {
"branch": "main",
"commit_count": 7843,
"repo_created_at": "2023-01-09T16:42:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a38f49a... |
1187e049-548e-4b2a-b6e5-764824b1598f | sudhirpatel2024/DSA_with_C_C-dsa | linked list/singly linked list/check loop or not/main (1).cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.999246 | 4.826646 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-03-13T16:06:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "591fa9e91f75... |
6b6b086a-68f4-4f8e-8021-410f57032934 | ScarlettHwang0108/OOP_Practice | Solve equations_0/quadratic_object.cpp | #include <stdio.h>
#include <math.h>
class quadratic_equation {
public:
quadratic_equation(float aa, float bb, float cc):a(aa),b(bb),c(cc){}
int quadratic()
{
if (fabs(a) <= 1e-6)
{
if (fabs(b) <= 1e-6)
return -1;
else
{
root1 = -c / b;
return 1;
}
}
else
{
float disc = b * b - ... | ALGO | 0.998881 | 4.045116 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-09-03T09:53:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4447c844d6... |
a6368446-1cfa-47a4-8ce4-d95a13681c16 | vector5891/School-Work | School work/Binary Search.cpp | // Binary Search.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int binary_search(int *arr, int begin, int end, int target);
int main() {
int target;
const int size = 15;
int arr[size] = { 3, 6, 19, 20, 20, 22, 30, 32, 33, 45, 60, 67, 77,... | ALGO | 0.999915 | 5.569149 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-06-02T21:20: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": "f184258292... |
087d19a0-9f51-4396-98c0-9957c51bb95d | Ly2017To/Sensor_Fusion | SFND_Lidar_Obstacle_Detection/src/environment.cpp | /* \author <NAME> */
// Create simple 3d highway enviroment using PCL
// for exploring self-driving car sensors
#include "sensors/lidar.h"
#include "render/render.h"
#include "processPointClouds.h"
// using templates for processPointClouds so also include .cpp to help linker
#include "processPointClouds.cpp"
#include ... | TOOL | 0.966356 | 5.909195 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2019-11-22T15:45: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": "28e3a3252... |
e3d48669-fa6d-498d-8e40-b04878932e2a | zinking/acmcatchups | codevs/1029.cpp | #include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
using namespace std;
class Solution{
public:
string pre;
string pos;
int count;
Solution(string pre, string pos){
this->pre = pre;
this->pos = pos;
count = 0;
}
void solve(){
decompose(pre,"","",pos);
cout << cout ... | ALGO | 0.999656 | 3.286954 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2012-06-25T14:54: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": "1ded2e04f... |
4badbbc3-ef5d-49b7-8484-30b36e73caa2 | gurodrigues-dev/bee-crowd | cpp/2493.cpp | #include "bits/stdc++.h"
#define f(inicio, fim) for(int i = inicio; i < fim; i++)
#define ff(inicio, fim) for(int j = inicio; j < fim; j++)
#define fff(inicio, fim) for(int k = inicio; k < fim; k++)
#define print(vetor) for(auto elem : vetor) cout << elem << " "
using namespace std;
int main() {
ios_base::sync_... | ALGO | 0.956667 | 3.690435 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2023-09-26T03:43:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e261686e... |
b08008fc-d2ee-4477-ab8c-a814bff0f42a | kristaaustin87/CPlusPlusAssignments | ComparePokerHands/PokerCompare.cpp | #include "PokerCompare.h"
#include "PokerHands.h"
#include <iostream>
//constructor
PokerCompare::PokerCompare() : checkThree(false), checkPair(0), highCardCounter(5), checkFour(false),
PokerHandOne(), PokerHandTwo(){
}
int PokerCompare::compareTwoHands(std::vector<std::string> handOne,
st... | ALGO | 0.977318 | 4.958103 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-05-17T20:04:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a752a4a03... |
2085ef5d-aa22-4147-9e47-960facf171e8 | Jewels2001/competition-problems | CombinatorialStanleyCupGood.cc | #include <bits/stdc++.h>
using namespace std;
long long int check(int a, int c, int d);
int main() {
long long int n;
cin >> n;
long long int a = n%4;
//long long int b = (n/4) + 1;
long long int c = n%16;
long long int d = (n/16) +1;
long long int e = (n/16);
long long int k = e%4;
long long i... | ALGO | 0.999901 | 3.144977 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2021-08-25T01:00:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "094e8aa2f21... |
f6d0e7af-07f1-4394-a548-9e936c4013c9 | takefekat/Competitive-programming | AtCoder/abc274/B/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vll>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int main(){
ll H,W;
cin >> H >> W;
vector<string> grid(H);
for (ll ... | ALGO | 0.999959 | 4.171698 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2020-06-17T12:48:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d56705fcc... |
4db1c191-15d9-4529-903b-9e51941d75aa | NVIDIA/thrust | thrust/system/omp/detail/reduce.inl | /*
* Copyright 2008-2013 NVIDIA Corporation
*
* 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... | ALGO | 0.999912 | 7.412167 | {
"github_metadata": {
"branch": "main",
"commit_count": 4758,
"repo_created_at": "2012-03-06T01:01:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4980,
"forks": 764,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "51484... |
1edd5ec5-0b2f-4848-b914-882be8b9125b | Mazen-Ghanaym/LeetCode_DailyChallenge_2024 | 06-June/26- Balance a Binary Search Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999988 | 5.837092 | {
"github_metadata": {
"branch": "main",
"commit_count": 148,
"repo_created_at": "2024-01-01T00:43: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": "c50707d66b... |
fe328465-ca46-4271-ade2-a8293b64811d | NVIDIA/thrust | thrust/system/detail/generic/unique_by_key.h | /*
* Copyright 2008-2013 NVIDIA Corporation
*
* 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... | ALGO | 0.999674 | 7.227769 | {
"github_metadata": {
"branch": "main",
"commit_count": 4758,
"repo_created_at": "2012-03-06T01:01:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4980,
"forks": 764,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "cfc71... |
2eb58fbe-6b57-4385-9bfc-da76df05041a | haozzzzzzzz/osgEarthX | environment/build/3rdParty/include/geos/geos/linearref/LocationIndexOfPoint.h | /**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2011 <NAME> <<EMAIL>>
* Copyright (C) 2005-2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions Inc.
*
* This is free software; you can re... | ALGO | 0.970915 | 6.937554 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2015-09-19T06:19:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 75,
"forks": 48,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2de4df... |
9b1ed726-69d1-4578-a831-6de6e1962e36 | brijeshvp/LeetCode-Submissions | 714-best-time-to-buy-and-sell-stock-with-transaction-fee/714-best-time-to-buy-and-sell-stock-with-transaction-fee.cpp | class Solution {
public:
// // top-down striver
// int solve(int ind,int canBuy,vector<int> &prices,vector<vector<int>> &dp,int fee){
// int n = prices.size();
// if(ind==n)return 0;
// if(dp[ind][canBuy]!=-1)return dp[ind][canBuy];
// int profit = 0;
// if(canBu... | ALGO | 0.999976 | 5.644517 | {
"github_metadata": {
"branch": "master",
"commit_count": 1151,
"repo_created_at": "2022-05-13T13:08: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": "8673632... |
2c6692fa-30d5-47c4-9874-39ae169c3352 | tsawke/OI | Exams/Exam-2022_10_17/X14J/X14J.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define PI M_PI
#define E M_E
#define npt nullptr
#define SON i->to
#define OPNEW void* operator new(size_t)
#define ROPNEW(arr) void* Edge::operator new(size_t){static Edge* P = arr; return P++;}
/******************************
abbr
******************************/
... | ALGO | 0.99998 | 4.107016 | {
"github_metadata": {
"branch": "main",
"commit_count": 166,
"repo_created_at": "2024-09-11T11:31: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": "0fce029bc0... |
bb414003-6bc3-45b3-850f-4619f26667ef | Saimouli7424/Data-Structures-Algorithms-Learning-Journey | leetcodequestions/424.cpp | // Longest Repeating Character Replacement(Medium)
//using sliding window technique
//time complexity: O(n)
//space complexity: O(1)
#include <iostream>
#include <unordered_map>
#include <string>
#include <algorithm>
using namespace std;
class Solution {
public:
int characterReplacement(string s, int k) {
... | ALGO | 0.999871 | 6.869927 | {
"github_metadata": {
"branch": "main",
"commit_count": 289,
"repo_created_at": "2025-02-01T13:21:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11961bbbe1... |
e939dcf6-bc9f-45a8-98e0-1dde4507534a | AdvaitAxiom/CPP-DSA | BasicMath/GCD.cpp | #include<bits/stdc++.h>
using namespace std;
//GCD / HCF
//Here if n1- 9 , n2- 12 then we don't need to run the rum till 12 because the hcf will ly within 9
//so will run the loop till min(n1,n2)
//TC -> O(min(n1 ,n2)) (worst case)
//ERROR ---> (0,25) and (17,0)
int checkgcd(int num1, int num2){
int gcd =1;
fo... | ALGO | 0.999876 | 4.684966 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2024-10-20T14:50: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": "0d40109d... |
00e085a4-6a1b-41cc-90b6-5682594b7363 | yooonar/univ | cpp/Construct/Complex2/Complex2.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include "Complex2.h"
using namespace std;
Complex2 Complex2::operator+(const Complex2 &c) const
{
return Complex2(rPart + c.rPart, iPart + c.iPart);
}
Complex2 Complex2::operator+(double r) const
{
return Complex2... | TOOL | 0.959129 | 4.04296 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2020-09-21T11:40: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": "93126d6a6... |
b0fe6d77-a7ec-48bd-9945-f95b97a7a43a | R3alloc/MPI_code | spawnMergeLoop.cpp | #include "mpi.h"
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <iostream>
#include <stdio.h>
#define BUFSIZE (256*1024)
#define CMDSIZE 80
#define MAXPATHLEN 100
using namespace std;
int main(int argc, char *argv[])
{
MPI_Init(&a... | TOOL | 0.959985 | 4.078005 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-08-19T05:56: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": "7ed31c4569... |
444d06d0-2015-447e-9305-f3df66edaf61 | mostafa-saad/MyCompetitiveProgramming | Olympiad/Baltic/official/boi2014_solutions/portals/portals-slow-daumilas.cpp | /**
* A solution for task PORTALS.
* Searches for a wall each time portal is fired.
* Complexity - O(RC(R+C)).
*
* Author: <NAME>
*/
#include <queue>
#include <cstdio>
using namespace std;
#define MAX_N 1000
int R, C, i, j;
char lab[MAX_N][MAX_N]; //labyrinth
int dw[MAX_N][MAX_N]; //distances to walls
int t[M... | ALGO | 0.999958 | 4.233144 | {
"github_metadata": {
"branch": "master",
"commit_count": 439,
"repo_created_at": "2017-02-05T22:26:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 415,
"forks": 85,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31ac9... |
ddd353d0-a637-4c4c-b83c-8056344df5f8 | akalils/DataStructure | chapter3/P92_2.cpp | //
// Created by 黎圣 on 2023/8/1.
//
#include "iostream"
#define MAX 10
struct Stack
{
char data[MAX];
int top;
};
bool StackEmpty(Stack s)
{
if (s.top == -1)
return true;
return false;
}
bool StackOverflow(Stack s)
{
if (s.top == MAX - 1)
return true;
return false;
}
bool EnStac... | ALGO | 0.999462 | 3.41503 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-07-26T14:20: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": "e691a275b61... |
ac0b23c0-caac-4398-8bed-5668b3260c96 | TejasAdhikari/liw | rotate.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node* next;
Node(int data){
this->data=data;
this->next=NULL;
}
};
void printList(Node* n){
while(n != NULL){
cout << n->data << " ";
n = n->next;
}
cout<<endl;
}
void rotate(Node** head,... | ALGO | 0.999949 | 5.07378 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-12-12T09:39: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": "b96384ecf9... |
b19f1d73-abae-42e4-8de3-d557591b3ea5 | qasimza/CS2028_Wednesday_Grp8 | Lab11/Lab11/submission/main.cpp | #include "Graph.h"
#include <iostream>
using namespace std;
int main() {
Graph graph(10);
bool shouldEnd = false;
string line = "----------------------------";
cout << "Graph has been created with a max vertex limit of 10, therefore pleas enter only index values between 0 and 9" << endl;
cout << line << endl;... | ALGO | 0.987283 | 4.25776 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2020-03-03T23:20:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35cbc9398... |
05f0120c-c8fb-493e-b0d6-552fc5681137 | DStrelak/xmipp | libraries/reconstruction/transform_adjust_image_grey_levels.cpp | /***************************************************************************
*
* Authors: <NAME> <EMAIL>
*
* Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as p... | ALGO | 0.909319 | 5.626568 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2018-08-16T12:29:46.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "I2PC/xmipp",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6... |
d26e67c5-687d-40a6-aef2-28bdc003f121 | OpenGameHood/lecturesC- | Lecture2/vector3class.cpp | #include <iostream>
#include <cmath>
#include <sstream>
class vec2{
public:
vec2(){
x = 0;
y = 0;
}
vec2(float _x, float _y)
{
x = _x;
y = _y;
}
float x;
float y;
};
class vec3 {
public:
//on creation:
vec3()//on a empty creation
{
x = 0;
y = 0;
z = 0;
}
vec3(co... | ALGO | 0.988455 | 4.729526 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-04-10T18:59: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": "756d34d0c... |
f691bcdc-3e42-48e8-b9c1-4b6d5fb07b98 | Yunusfahreza/UAS- | sorting-algorithm.cpp | #include <iostream>
#include <vector>
#include <algorithm> // Untuk std::sort
#include <chrono> // Untuk menghitung waktu eksekusi
using namespace std;
using namespace chrono;
// Fungsi Binary Search
int binarySearch(const vector<int>& arr, int target) {
int low = 0, high = arr.size() - 1;
while (low <= hig... | ALGO | 0.999753 | 6.720177 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-07T08:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7edf4f675dc6... |
afbc60f1-9b62-4221-9d02-dc5c581f6c20 | ardubev16/unitn-prog1 | exams/luglio2020/ex02.cc | using namespace std;
#include <iostream>
// Inserire qui sotto la dichiarazione della funzione crea_vettore
int* crea_vettore(int);
void padovan(int*, int, int);
int main(){
int N;
cout << "Dimensione: ";
cin >> N;
if (N <= 0) {
cout << "Attenzione: inserire intero positivo!\n";
return ... | ALGO | 0.998555 | 4.026961 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2021-10-05T13:17: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": "e3a71c7a8... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.