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 |
|---|---|---|---|---|---|---|---|
6819dbaa-deed-49fc-a66f-ce597d61be38 | Abusagit/DSA-problems | solutions/leetcode/array_hashing/238_Product_of_Array_Except_Self.cpp | #include <vector>
using std::vector;
class Solution {
public:
vector<int> productExceptSelf(vector<int> & nums) {
// Space: O(n)
// Time: O(n)
int n = nums.size();
vector<int> forward_product(n, 1);
vector<int> reverse_product(n, 1);
for (int i=1; i < n; i++){
... | ALGO | 0.999876 | 7.006789 | {
"github_metadata": {
"branch": "main",
"commit_count": 269,
"repo_created_at": "2022-09-17T18:47:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45acd79791... |
2aa97b20-9a18-4fec-ac7c-c63e1e8e9714 | AhmedEssamYassin/Problem-Solving | Data Structures/Graph Theory/Shortest Path/President and Roads/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define INF LLONG_MAX
/*
An edge in an undirected connected graph is a bridge if removing it disconnects the graph.
For a disconnected undirected graph, the definition is similar,
a bridge is an edge removal that increases the num... | ALGO | 0.999951 | 5.354651 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-05-02T14:49:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9187f447f47... |
15a26e1c-1887-4718-ae51-39538a175e60 | ALXlixiong/day_code | other_code/2019.8.28/str.cpp | /*包含所有常见C语言字符串函数实现*/
#include <iostream>
#if 0
//正常方式
size_t my_strlen(const char *src)
{
if (src == nullptr)
return 0;
char *tmp = (char *)src;
size_t count = 0;
while (*tmp++ != '\0')
{
++count;
}
return count;
}
#endif
#if 0
//递归
size_t my_strlen(const char *src)
{
if (src == nullptr)
return 0;
if (*s... | TOOL | 0.970363 | 4.200785 | {
"github_metadata": {
"branch": "master",
"commit_count": 215,
"repo_created_at": "2019-04-02T05:18: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": "fcc6fcc6... |
5ba6d686-b526-42bc-96e3-19867620705e | TProctor-root/Pyramid-of-Blocks | Pyramid.cpp | #include <iostream>
using namespace std;
int main() {
int row;
int height;
cout << endl << "Pyramid Level Height: ";
cin >> row;
row = row + 1;
for (int i = 1, j = 0, k = 0; i <= row; i++, j = 0, k = 0) {
cout << endl;
for (int a = 1; a <= row - i; a++) {
cout << " ";
}
if (i != r... | ALGO | 0.999778 | 4.396563 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2021-11-12T19:24: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": "32da39ba7385... |
57eacf36-ab13-4a32-8a4f-8642315ab97f | omair18/LSD-SLAM-Android | app/src/main/jni/src/Tracking/Sim3Tracker.h | /**
* This file is part of LSD-SLAM.
*
* Copyright 2013 <NAME> <engelj at in dot tum dot de> (Technical University of Munich)
* For more information see <http://vision.in.tum.de/lsdslam>
*
* LSD-SLAM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publi... | ALGO | 0.997325 | 6.892087 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-05-23T09:28:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 87,
"forks": 25,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "84cf96eb... |
35beb0cf-b5a6-47e6-8c18-8e492a4c7135 | benedond/safety-critical-scheduling | tools/src/schedule_solver/longest_tasks_first_solver.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
#include <cassert>
#include <cmath>
#include <set>
#include "longest_tasks_first_solver.h"
longest_tasks_first_solver::longest_tasks_first_solver(const environment& e, const task_map& t)
: solver(e, t), m_out_of_order_task_count(0)
{
}
void longest_task... | ALGO | 0.998528 | 6.272299 | {
"github_metadata": {
"branch": "master",
"commit_count": 485,
"repo_created_at": "2022-04-07T07:06:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a677213... |
b56654e7-2838-41ff-b6e7-7c70b2c68d99 | shashank21j/CompetitiveProgramming | Uva/1_Introduction/AdHocPart1/InterestingRealLifeProblemsHarder/11743-credit-check.cpp | #include <bits/stdc++.h>
using namespace std;
int fun(int n) {
int sum1 = 0;
while(n!= 0) {
sum1 += n%10;
n/=10;
}
return sum1;
}
int main () {
int t;
cin >> t;
while(t--) {
string card = "";
string s;
for(int i = 0; i < 4; i++) {
cin >> s... | ALGO | 0.99469 | 4.903368 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2013-11-10T20:14:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f2b08fa... |
5ac5b5d3-1084-4cc0-b7ba-d7d415ec39dc | Ethatron/squish-ccr | palettenormalfit.cpp | /* -----------------------------------------------------------------------------
Copyright (c) 2006 <NAME> <EMAIL>
Copyright (c) 2012 <NAME> <EMAIL>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation file... | ALGO | 0.987428 | 6.874165 | {
"github_metadata": {
"branch": "master",
"commit_count": 213,
"repo_created_at": "2012-06-06T06:18:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 6,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "62a5405... |
72cefc21-c15c-4765-897d-cefe9e6f7eab | watashi/AlgoSolution | leetcode/weekly-268/2080.cpp | struct BIT {
vector<unordered_map<int, int>> a;
void init(int n) {
vector<unordered_map<int, int>>(n + 1).swap(a);
}
void add(int i, int v) {
for (int j = i + 1; j < (int)a.size(); j = (j | (j - 1)) + 1) {
++a[j][v];
}
}
// [0, i)
int count(int i, int k... | ALGO | 0.999929 | 6.060239 | {
"github_metadata": {
"branch": "master",
"commit_count": 522,
"repo_created_at": "2011-10-06T10:40:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 204,
"forks": 61,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9a68... |
a4f29d7d-a5b7-476f-82c5-814a6724611a | VishalChangder00789/Go_C- | 2D_Arrays/StairCaseSearch.cpp | #include <iostream>
using namespace std;
pair<int, int> StairCaseSearch(int arr[10][10], int m, int key)
{
// For a sorted matrix
// 2 Corners are usefull
int i = 0;
int j = m - 1;
while (i > 0 || i < m || j < m || j > 0)
{
if (arr[i][j] == key)
{
return {i, j};
... | ALGO | 0.999919 | 4.65019 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2022-11-14T13:51: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": "a5fa17bc... |
33e75ca7-01ad-4312-9dd4-d070d5438a1c | hahahaMing/cmake_demo | include/huawei01.hpp | //
// Created by ming on 2020/9/2.
//
#ifndef CMAKETEST_HUAWEI01_HPP
#define CMAKETEST_HUAWEI01_HPP
#endif //CMAKETEST_HUAWEI01_HPP
#include"tools.hpp"
class Solution {
public:
std::vector<int> findThree(int N, std::vector<int> candys, std::vector<int> colors) {
std::vector<int> blue_rst = {}, red_rst =... | ALGO | 0.999892 | 4.653994 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-09-01T00:51:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e67f7bd84... |
41e5b104-dedc-4ee4-8d08-05b2edc9882a | alefchacon/pilas | X2_Pila/Pila.h | #include <iostream>
using namespace std;
class Pila{
private:
int pila[5];
int tope,fondo,cima;
bool inicializada = false;
bool estaVacia(){
if ( cima < fondo ) {
return true;
}else return false;
}
bool estaLlena(){
if ( cima == tope) {
return true;
}else return false;
}
void li... | ALGO | 0.994809 | 3.895736 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-09-09T22:07: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": "117dbb0dc73... |
a360f6dc-0b25-4a09-8689-007d0cf830de | Seathorne/recyclinator-robot | legacy/Recyclinator II/Routines/LidarHallTurn/LidarHallTurn.ino |
// ******************** 10 April 2018 **************
#include <math.h>
#include <Servo.h>
Servo LidarServo; //Left write(129); Forward write(87); Right write(45)
String cmd = ""; // the Command
float arg[3] = {0,0,0}; // you can pass up to 3 arguments in ... | ALGO | 0.997941 | 4.9417 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2021-10-19T22:31:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "43a6327bd1d... |
c3fc45e9-bae1-46b3-8532-ac89a1521512 | Shahriar-Saikat21/Problem_Solve_LeetCode | LeetCode/Array/Other/380_Insert_Delete_GetRandom.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Implement the RandomizedSet class:
RandomizedSet() Initializes the RandomizedSet object.
bool insert(int val) Inserts an item val into the set if not present.
Returns true if the item was not present, false otherwise.
bool remove(int val) Removes an item val from the ... | ALGO | 0.930904 | 5.940407 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-11-05T16:11:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ddca16baa5... |
ea4492c9-58dc-422c-ad38-2103ed68c301 | pxanthopoulos/dag-partitioning | src/Driver/include/MultilevelBisectioner.h | /**
* @file MultilevelBisectioner.h
* @brief Implementation of multilevel directed graph partitioning
*
* Orchestrates the three main phases of multilevel partitioning:
* 1. Coarsening: Cluster graph while maintaining acyclicity
* 2. Initial Partitioning: Bisect coarsest graph
* 3. Uncoarsening + Refinement: Pro... | ALGO | 0.999977 | 6.363204 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2024-12-10T17:26: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": "182bb98d40... |
3ff0b181-c5a7-4bb2-aa42-9997a47f41b0 | James-Day/LeetCode | C++/Medium/Score After Flipping Matrix.cpp | class Solution {
public:
int matrixScore(vector<vector<int>>& grid) {
int rows = grid.size();
int cols = grid[0].size();
int res = rows * (1 << (cols - 1)); //all the MSB's
for (int i = 1; i < cols; i++) {
int count = 0;
for (int j = 0; j < rows; j++) {
... | ALGO | 0.999985 | 6.414086 | {
"github_metadata": {
"branch": "main",
"commit_count": 223,
"repo_created_at": "2022-06-15T21:59: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": "3b30315d4d... |
f90bbe39-2183-4856-849b-3f961165bd14 | fciapsa/Competitive-Programming | AceptaElReto/566LaAbuelitaCaperucita.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <climits>
/*Problema conocido: min-cut
Como las trampas se colocan en los vertices, para aplicar el algoritmo de max-flow debemos
desdoblar cada vertice en 2 para poner una arista entre ellos de capacidad 1(la trampa). El r... | ALGO | 0.999923 | 4.567952 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2022-01-02T21:16: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": "5fef9027df4... |
d4b80297-c817-4c70-a48a-3712107a4794 | thucdx/algorithm-solution | OTHER/OLD_UNCLASS/I_RiffOff.cpp | #include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <queue>
#include <cstring>
using namespace std;
#define FOR(i, a, b) for (int i =... | ALGO | 0.999872 | 3.424887 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2013-06-22T18:28:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f5ee2305... |
3af3abe0-3c16-45c4-9184-b246ee8f2cd9 | Quuxplusone/AdventOfCode | 2019/07a.cc | #include <cassert>
#include <deque>
#include <iostream>
#include <vector>
struct IntcodeComputer {
std::vector<int> program;
std::deque<int> inputs;
std::vector<int> outputs;
void run();
int apply_parameter_mode(int m, int value) {
switch (m) {
case 0: return program[value];
... | ALGO | 0.999921 | 4.796402 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-12-11T13:40: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": "260c11e67... |
3081eec2-4259-41ec-b9d1-33da789554a5 | raghavkhanna18/Efficient-Frontier | main.cpp | #include <iostream>
#include <ql/quantlib.hpp>
#include <boost/format.hpp>
#include <functional>
#include <numeric>
#include <fstream>
using namespace QuantLib;
double calculatePortfolioReturn (double proportionA, double expectedReturnA,
double expectedReturnB) {
return proportionA ... | ALGO | 0.99995 | 5.69739 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-08-24T21:31:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c56bfc581... |
f37d0320-759a-4ed0-8dba-079fa0071d57 | pedrecal/grupoestudo | Paralelo/URFnumPrimos.cpp | // icpc -openmp -mavx URFnumPrimos.cpp -o URFnumPrimos.o -lm
#include <iostream>
#include <time.h>
#include <omp.h>
#include <math.h>
using namespace std;
int primeNumbers(int);
int primeNumbersParallel(int, double*, double*, int);
int main(int argc, char const *argv[]) {
int max = 0;
double startTime = 0... | ALGO | 0.999402 | 4.610762 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2015-03-31T22:02: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": "9835cebce... |
68385ade-cc03-4c74-b1d0-cef00beb5702 | moqsad/solved-problems | UVA/119_Greedy Gift Givers.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
using namespace std;
map <string, int> mm;
char arr[20][20], letter[20];
int num[20];
int main()
{
int cnt = 0, i, n, j, x, money;
while(scanf("%d", &n) == 1)
{
mm.clear();
++cnt;
if(cnt > 1)
print... | ALGO | 0.997387 | 3.016849 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-08-05T12:29:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "946e50a632... |
b904ddb6-fdf7-45ae-b7dc-7605eea5be1d | smsh0722/PS | problems/2407.cpp | #include <iostream>
using namespace std;
int gcd( int a, int b );
int main( void )
{
int n, m; // nCm
cin >> n >> m;
m = m > n - m ? n - m : m;
int* mArr = new int[1+m];
for ( int i = 0; i <= m; i++ ) mArr[i] = i;
unsigned long long result = 1;
int gcdN;
int temp;
for ( int ... | ALGO | 0.999989 | 4.677468 | {
"github_metadata": {
"branch": "main",
"commit_count": 193,
"repo_created_at": "2022-02-14T13:27: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": "f3b33d2e71... |
2da4b80f-c7eb-4aa2-9eb5-4a49c4b1e675 | tienmt/heavylasso | src/coord_update.cpp | #include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
NumericVector coordinate_descent_update(
NumericMatrix X,
NumericVector y,
NumericVector beta,
NumericVector w,
NumericVector r,
double lambda,
IntegerVector active_set // new argument
) {
int n = X.nrow();
NumericVector beta_... | ALGO | 0.999685 | 6.374576 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-06-09T13:40: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": "cf9cf86b3012... |
767a58b8-8fee-4d02-9e76-58041bdeac79 | MCKG-L/codes | 课程实验及作业/计算机系统基础/实验1/a.cc | /*
* CS:APP Data Lab
*
* <Please put your name and userid here>
*
* bits.c - Source file with your solutions to the Lab.
* This is the file you will hand in to your instructor.
*
* WARNING: Do not include the <stdio.h> header; it confuses the dlc
* compiler. You can still use printf for debugging ... | ALGO | 0.9963 | 4.3674 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-07-25T07:49:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ae9520c99a1... |
10dab48b-17aa-4ff8-80ac-3a1fb840156f | narang-madhur/CPP | CODING NINJAS QUESTIONS/DSA IN C++/RECURSION/return_permutations_string.cpp | #include <iostream>
#include <fstream>
using namespace std;
inline int factorial(int n)
{
return (n == 1 || n == 0) ? 1 : factorial(n - 1) * n;
}
int returnpermutations(string input, string output[])
{
if (input.size() == 1)
{
output[0] = input;
return 1;
}
int smalllen = returnpe... | ALGO | 0.999927 | 4.875864 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2021-10-22T14:57: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": "ecfc696e... |
a47e6c64-26d6-4a74-a100-dbbee1b26c9a | whquddn55/Algorithm_BojSolves | 1000/1507.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define INF (INT_MAX / 2)
#define endl '\n'
#define MAX_SIZE 21
struct Data {
int a, b, c;
bool operator<(const Data& other) {
return c < other.c;
}
};
int n;
int arr[MAX_SIZE][MAX_SIZE];
Data sorted[MAX_SIZE * MAX... | ALGO | 0.999983 | 3.834712 | {
"github_metadata": {
"branch": "master",
"commit_count": 1298,
"repo_created_at": "2021-03-10T14:27: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": "77358af... |
bfb1f0f3-d36e-4f1c-9da8-3f423d7c9356 | akhikolla/testpackages | fuzzedpackages/JSM/src/calc_rowsum.cpp |
#include <RcppEigen.h>
// [[Rcpp::depends(RcppEigen)]]
// [[Rcpp::export]]
Eigen::MatrixXd calc_rowsum(const Eigen::Map<Eigen::VectorXi> & v , const Eigen::Map<Eigen::MatrixXd> & M){
// This function implements:
// the computation of column sums across rows of a matrix M for each level/integer numb... | ALGO | 0.999664 | 5.797774 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "acad090c1f... |
4354a1ee-018a-4b74-9e5c-d157d85fe4ef | jemmy512/software-engineer | Algorithm/LeetCode/Tree/1214-two-sum-bsts.cc | /* Medium
Given two binary search trees, return True if and only if
there is a node in the first tree and a node in the second tree
whose values sum up to a given integer target.
Example 1:
Input: root1 = [2,1,4], root2 = [1,0,3], target = 5
Output: true
Explanation: 2 and 3 sum up to 5.
Example 2:
Input: root1 = [0,... | ALGO | 0.999981 | 6.651683 | {
"github_metadata": {
"branch": "master",
"commit_count": 1797,
"repo_created_at": "2017-05-25T07:01:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e47b9... |
585123af-22c3-4a00-95bd-f44b09e2e4bf | kas123123/qorwns | dfs와 bfs/2178/main.cpp | #include <iostream>
#include <queue>
using namespace std;
int a[1001][101];
int check[1001][101];
int n,m;
int cnt = 1;
void bfs(int x,int y){
queue<int> q1,q2;
check[x][y] = 1;
q1.push(x);
q2.push(y);
while(1){
int tmp = q1.size();
for(int i=0; i<tmp; i++){
int l = ... | ALGO | 0.999953 | 3.142746 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2021-04-21T06:20: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": "04e6c7149... |
de0a0395-df4e-4fec-99e3-11f0a5274eed | mejibyte/competitive_programming | Interview Street/Find Strings/find.2.cpp | // <NAME>
using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#includ... | ALGO | 0.99907 | 4.595332 | {
"github_metadata": {
"branch": "master",
"commit_count": 355,
"repo_created_at": "2011-10-27T01:25:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 196,
"forks": 66,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "0f73e... |
588511e0-1932-4de8-a16a-1fb924bcf282 | keshav25201/data-structure-and-algo | graph/bipartite.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct Pair{
int v;
string psf;
int lvl;
Pair(int v,string psf,int lvl){
this->v = v;
this->psf = psf;
this->lvl = lvl;
}
};
class Graph
{
public:
int V;
vector<int> *l;
Graph(int V)
{... | ALGO | 0.999895 | 4.944402 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-09-05T06:42: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": "e91cf9c4b6... |
69b850c7-14ee-41f9-a7eb-bb58def7374f | alec-z/leetcode | 1872. Stone Game VIII/main.cpp | #include <vector>
#include <limits>
using namespace std;
const int MIN_INT = numeric_limits<int>::min();
class Solution {
public:
int stoneGameVIII(vector<int>& stones) {
SubSol ss(stones);
return ss.try_max_diff(stones.size());
}
class SubSol {
int n;
vector<int> stones;
... | ALGO | 0.999848 | 4.644443 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-02-08T03:37: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": "efe5bece533... |
e07df45d-a39e-40e4-abef-d53e6fd5530f | pulkit110/Algorithms | Spoj/Complete/GARDENAR.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void calculateArea(vector <double> A, vector <double> B, vector <double> C);
int main()
{
int T;
double a, b, c;
vector <double> A, B, C;
cin >> T;
for (int i = 0; i < T; i ++) {
cin >> a >> b >> c;
a /= 10;
b /= 10;
c /= 10;... | ALGO | 0.997605 | 4.042923 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2011-06-03T19:36:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbb1193350... |
2d534474-4105-49de-bc02-b008d631141c | edsomjr/TEP | Paradigmas/problems/SPOJ_COURIER/codes/COURIER.cpp | #include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
const int MAXN { 110 }, MAXB { 13 }, oo { 1000000010 };
int dist[MAXN][MAXN];
int st[MAXN][1 << MAXB];
int tsp(int i, int mask, int N, int B, const vector<ii>& xs)
{
if (mask == (1 << N) - 1)
return dist[i][B];
if (st[i][mask]... | ALGO | 0.999541 | 4.455452 | {
"github_metadata": {
"branch": "master",
"commit_count": 2072,
"repo_created_at": "2016-07-12T18:57:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 475,
"forks": 155,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "007... |
c442e6bf-dcf7-436f-85b4-bde88fd7e8f5 | 1aman1/data-structures | Arrays-and-Strings/other-problems/2-first-and-last-index-of-element-in-sorted-array-solution-1.cpp | #include <iostream>
#include <vector>
typedef std::vector<int> Arr;
int get_first(const Arr array, int target)
{
if (target < array.front())
return -1;
if (array.front() == target)
return 0;
int left = 0, right = array.size() - 1;
while (left <= right)
{
int mid = (right ... | ALGO | 0.999874 | 5.526962 | {
"github_metadata": {
"branch": "mastercodebase",
"commit_count": 434,
"repo_created_at": "2022-04-11T10:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
a9fd206d-2add-425c-ac5e-d504693e5751 | peiyao456/Arithmetic-Exercises | 校招笔试题/查找coder.cpp | //请设计一个高效算法,再给定的字符串数组中,找到包含”Coder”的字符串(不区分大小写),并将其作为一个新的数组返回。
//结果字符串的顺序按照”Coder”出现的次数递减排列,若两个串中”Coder”出现的次数相同,则保持他们在原数组中的位置
//关系。
// 给定一个字符串数组A和它的大小n,请返回结果数组。保证原数组大小小于等于300,其中每个串的长度小于等于200。
//同时保证一定存在包含coder的字符串。
bool Compare(const pair<string, int>& l, const pair<string, int>& r) {
return l.second > r.second;
... | ALGO | 0.999968 | 4.771008 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2016-10-03T05:38: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": "a247a8d88... |
c3111631-ca0d-4761-aea8-edee493e562a | sitRyo/templateCpp_atcoder | AtCoder/virtual_contest/proA.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) f... | ALGO | 0.999619 | 3.305471 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2018-07-25T15:35: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": "a5e8a22ff... |
0004e93f-e68e-4773-9209-42d9bf828cb7 | sakiib/competitive-programming-code-library | DS & Algo Implementation/Data Structure/Hashing/cf1326D2.cpp | #include <bits/stdc++.h>
using namespace std;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* na, Arg1&& arg1, Args&&... args) {
const char*... | ALGO | 0.999987 | 4.729684 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2019-09-12T18:37:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ad95dab... |
dbd32936-5aae-4ea2-912c-7b73ed028319 | antilost/heap | cpp/combine_vectors.cpp | /*
* Взять числа, встречающиеся в обоих векторах целых чисел a, b и составить из них новый вектор.
* Исходные векторы a, b отсортированы по возрастанию.
*/
#include <iostream>
#include <vector>
using namespace std;
vector<int> combine(const vector<int>& a, const vector<int>& b)
{
vector<int> res;
if(a.emp... | ALGO | 0.999995 | 4.499673 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2016-12-20T14:51:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "df89132c0... |
89f8a190-37ef-4386-8e2e-602c97519bf6 | drrrcht/algorithms-and-data-structures | 1078.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#define sf scanf
#define pf printf
//using namespace std;
struct segment {
int dp, i;
int l, p;
int r;
bool fits_in(segment& s){
return l > s.l and r < s.r;
}
bool operator<(const segment& s) const {
return l < s.l or (... | ALGO | 0.999951 | 3.409954 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2022-03-22T13:36: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": "b66e6b9a555... |
472c5f68-a94b-432c-b629-0b4020a814c5 | schrodinger/pymol-open-source | layer1/SymOpTools.cpp | /**
* @file Tools for manipulating SymOp bonds
*
* (c) Schrodinger, Inc.
*/
#include "SymOpTools.h"
#include "CoordSet.h"
#include "SymOp.h"
#include "pymol/algorithm.h"
#include <algorithm>
namespace pymol
{
/**
* Find all symmetry operations of a PBC (periodic boundary condition) bond.
*
* Guesses the cor... | ALGO | 0.998787 | 6.594048 | {
"github_metadata": {
"branch": "master",
"commit_count": 5780,
"repo_created_at": "2018-06-19T18:32:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1414,
"forks": 314,
"issues": 92,
"pull_requests": 6
},
"file_meta": {
"content_id": "c3... |
edbb4bb1-598b-4622-8ccd-2218fd0f6acd | dkavolis/polynomials | src/polynomials/include/quadrature.hpp | /**
* Copyright (c) 2022 <<NAME>>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, ... | ALGO | 0.986868 | 7.409604 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-07-06T20:18: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": "25e94f9b2... |
d3d481a8-55e8-4ad1-a6c5-c8b460826c4b | yxzlwz/oi-code | ybtoj/Oulipo.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull power[1000001], b = 131;
ull sum[1000001];
char s1[10001], s2[1000001];
int main() {
power[0] = 1;
for (int i = 1; i <= 1000000; i++) power[i] = power[i - 1] * b;
int T;
cin >> T;
while (T--) {
scanf("%s%s",... | ALGO | 0.999856 | 4.299476 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-08-03T12:22:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3403b9937b... |
098036a6-c55c-4bd3-81c1-d8a8b27329b8 | ppremraj697/dsa-practice | LeetCode/26.cpp | #include <bits/stdc++.h>
using namespace std;
int removeDuplicates(vector<int> &nums)
{
int count = 0;
int i = 0;
int j = 1;
if (nums.size() == 1)
{
return 1;
}
while (i < nums.size() && j < nums.size())
{
if (nums[i] == nums[j])
{
nums[j] = 200;
... | ALGO | 0.999823 | 4.697357 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2023-03-10T11:59: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": "fd2282c1... |
5ceb3374-62d0-448a-a8dd-9bef268859b9 | xyyzy/LetCode-Cpp | Tree/_144_Binary Tree Preorder Traversal/Solution.h | //
// Created by Xulin on 2020/8/12.
//
#ifndef LETCODEC___RANDOMIZEDCOLLECTION_H
#define LETCODEC___SOLUTION_H
#include <stdio.h>
#include <vector>
#include <stack>
using namespace std;
/**
* 先序遍历
* */
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NUL... | ALGO | 0.999803 | 5.803912 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-06-09T02:58:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "104319404... |
b1fbbeff-d56c-49b6-bb90-297560d6134c | AliAshkaniNia/Compression | src/algorithms/LZWCompression.cpp | #include "algorithms/LZWCompression.h"
#include <cstdint>
#include <iostream>
#include <map>
#include <numeric>
#include <vector>
Algorithms::LZWCompression::LZWCompression(std::unique_ptr<Serializers::IStringSerializer<uint32_t>> serializer)
:m_serializer(std::move(serializer)){
}
int Algorithms::LZWCompressio... | ALGO | 0.96438 | 6.107985 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2023-11-26T01:05:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c5c0d968... |
805a8222-1eaf-4e88-a61d-c6eb89272987 | JJ-Tom-Li/Rendering-Techniques-and-Applications-Assignments | Homework1/HW1/HW1/HW1.cpp | // HW1.cpp : 定義主控台應用程式的進入點。
//
/*********************************
4104056004 李家駿 第一次作業 3/27
*********************************/
#include "stdafx.h"
#include "GL\glew.h"
#include "GL\glut.h"
#include "nchu\coordinates.h"
#include <stdlib.h>
#include <iostream>
using namespace std;
void pixel_reverse(float vertices[],int... | TOOL | 0.967029 | 3.815354 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-04-03T05:30:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52e5e3dbb... |
597707b6-7083-4548-bd41-5628f31dc121 | clap-0/algorithm_study | Sources/BOJ/17619_개구리점프.cpp | #include <iostream>
#include <algorithm>
using namespace std;
typedef pair<int, pair<int,int> > triple;
// woods : { k, { k번째 통나무의 왼쪽끝, k번째 통나무의 오른쪽끝 } }을 왼쪽끝을 기준으로 오름차순 정렬하여 저장한다
triple woods[100000];
int uf[100000];
bool compare(triple& a, triple& b) {
if(a.second.first != b.second.first) return a.second.first ... | ALGO | 0.999951 | 4.867669 | {
"github_metadata": {
"branch": "main",
"commit_count": 1927,
"repo_created_at": "2021-02-11T04:56:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f807793a... |
70489aaf-c2d0-4976-ad83-aad7a2ee8c46 | sqmedeiros/rouxinol | 1140-Projects/control-01/4390406.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define sortt(a) sort(a.begin(),a.end())
#define stp(x) fixed<<setprecision(x)
#define int long long int
#define pb push_back
#define PQ ... | ALGO | 0.999818 | 4.447353 | {
"github_metadata": {
"branch": "main",
"commit_count": 238,
"repo_created_at": "2024-01-31T15:39: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": "081350094d... |
bd6a8d98-0240-4d6d-918e-007bcb1d6c37 | alexditu/EGC_Tema_1 | lab2/main.cpp | /* <NAME> 333 CA */
#include "Framework/DrawingWindow.h"
#include "Framework/Visual2D.h"
#include "Framework/Transform2D.h"
#include "Framework/Transform3D.h"
#include "Framework/Line2D.h"
#include "Framework/Rectangle2D.h"
#include "Framework/Circle2D.h"
#include "Framework/Polygon2D.h"
#include <iostream>
#include <w... | TOOL | 0.981218 | 3.156765 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-03-18T22:42: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": "bd29f3e417... |
9b4a1a2e-26b9-4471-b056-d2526aa1f4d7 | h3136514/Algorithm | baekjoon/알고리즘기초/백트래킹/15650.cpp | #include <iostream>
using namespace std;
int N, M, arr[9], visitied[9];
void dfs(int num, int cnt) {
if(cnt == M) {
for(int i = 0; i < M; i++)
cout << arr[i] << " ";
cout << endl;
return;
}
// 재귀 호출에서, 현재 뽑은 원소의 이전값들은 고려하지 않게끔 보냄 => 오른차 순
for(int i = num; i <=... | ALGO | 0.999971 | 4.168349 | {
"github_metadata": {
"branch": "main",
"commit_count": 870,
"repo_created_at": "2023-08-18T08:09:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a91f377e8... |
b72ecae0-7639-4fb5-8139-277c1850fbee | alibaba/AliOS-Things | components/ai_agent/src/engine/tflite-micro/tensorflow/lite/micro/kernels/softmax_common.cc | /* Copyright 2021 The TensorFlow Authors. 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 applicable law or a... | ALGO | 0.947734 | 7.793044 | {
"github_metadata": {
"branch": "master",
"commit_count": 6765,
"repo_created_at": "2017-08-30T09:58:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4625,
"forks": 1147,
"issues": 60,
"pull_requests": 13
},
"file_meta": {
"content_id": "... |
8bf34d11-55d6-495d-a151-050ee25e1d90 | codemonkeyricky/lc | 1389.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <stack>
#include <queue>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <cmath>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
... | ALGO | 0.999992 | 5.758311 | {
"github_metadata": {
"branch": "main",
"commit_count": 126,
"repo_created_at": "2024-11-11T05:29: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": "31f029ba05... |
a270be8a-dfb4-4b77-81c0-2ff134c90253 | Atom-machinerule/OpenQbo | qbo_face_vision/qbo_face_following/src/face_follower.cpp | /*
* Software License Agreement (GPLv2 License)
*
* Copyright (c) 2012 Thecorpora, S.L.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at you... | ALGO | 0.954262 | 3.993145 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2014-03-23T13:48:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 10,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "876fabc8... |
5dff0dcd-e0ff-42ee-9416-7197cab27f37 | shadowstacker21/C-Algorithm | Who_Is_It.cpp | #include<bits/stdc++.h>
using namespace std;
class Student
{
public:
int id;
string name;
char a;
int mark;
};
Student getstudent(const vector<Student>& arr)
{
Student high=arr[0];
for (int i=0;i<3;i++) {
if (arr[i].mark > high.mark ||
(arr[i].mark == high.mark && arr[i].... | ALGO | 0.99944 | 3.5212 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-03T13:16: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": "f843612e6089... |
42e34361-222d-41c9-8693-b0bef261b2ec | LifeIsRightward/Baekjoon | Solved/Silver/Silver4_10866.cpp | #include <deque>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int testcase = 0;
int temp = 0;
string str;
deque<int> dq;
cin >> testcase;
for (int i = 0; i < testcase; i++) {
cin >> str;
if (str ==... | ALGO | 0.999022 | 4.762312 | {
"github_metadata": {
"branch": "main",
"commit_count": 389,
"repo_created_at": "2024-01-04T07:29: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": "a3f1242837... |
91d2ae06-32a3-4ca1-967f-c3299a57fe44 | fyrsta7/LLM_on_ASAC | result_api_backup/en_md/gpt-4o/Epidemic_Control.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
struct Edge {
int to, weight;
};
vector<vector<Edge>> adjList;
vector<int> troops;
vector<int> minDist;
void bfs(int start) {
queue<int> q;
vector<bool> visited(adjList.size(), false);
q.push(start);
v... | ALGO | 0.999948 | 4.868296 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-08-11T08:13: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": "8be0b260962... |
567485c9-86ca-4354-8603-7b1d7c17fed5 | icefox-saber/games101 | hw2/rasterizer.cpp |
//
// Created by goksu on 4/6/19.
//
#include "rasterizer.hpp"
#include <algorithm>
#include <math.h>
#include <opencv2/opencv.hpp>
#include <vector>
rst::pos_buf_id
rst::rasterizer::load_positions(const std::vector<Eigen::Vector3f> &positions) {
auto id = get_next_id();
pos_buf.emplace(id, positions);
return... | ALGO | 0.977176 | 6.247706 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-06-05T05:17: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": "450d3699479... |
808ba54a-623b-4701-ae36-18326aa47ea9 | ydb-platform/ydb | library/cpp/containers/sorted_vector/sorted_vector.h | #pragma once
#include <util/system/defaults.h>
#include <util/generic/hash.h>
#include <util/generic/vector.h>
#include <util/generic/algorithm.h>
#include <util/generic/mapfindptr.h>
#include <util/ysaveload.h>
#include <utility>
#include <initializer_list>
namespace NSorted {
namespace NPrivate {
templ... | ALGO | 0.997251 | 6.208178 | {
"github_metadata": {
"branch": "main",
"commit_count": 35208,
"repo_created_at": "2022-02-07T14:52:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4512,
"forks": 701,
"issues": 2263,
"pull_requests": 682
},
"file_meta": {
"content_id": ... |
e9211359-ed91-4c33-b7c5-8dcf448a83a5 | duxins/leetcode | 347-top-k-frequent-elements.cpp | // 347. Top K Frequent Elements
//
// Given a non-empty array of integers, return the k most frequent elements.
//
// For example,
// Given [1,1,1,2,2,3] and k = 2, return [1,2].
// Note:
// You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
// Your algorithm's time complexity must be better... | ALGO | 0.999786 | 6.633243 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2016-03-06T06:11: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": "c9586e0e... |
ccc36968-7f01-45c7-9fb3-e8a80d4c58c0 | msanjay05/aisle_shop | abc.cpp | #include <bits/stdc++.h>
using namespace std;
class Item{
public:
string name;
float price;
string isImported;
int category; // 0 - book, 1- medicine, 2-food, 3-other
Item(string name,float price, string isImported,int category){
this->name=name;
this->price=price;
this->isImported=isImported;
this->... | DATA | 0.918005 | 3.854278 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-06-13T07:17: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": "fbd9adfb21d7... |
56bc2de2-6b35-483b-9c40-8173a5f26c03 | khsu95/CodingTest | Programmers/Lv4/가사검색.cpp | //https://programmers.co.kr/learn/courses/30/lessons/60060
//2021.04.27
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
using namespace std;
//len of string, count
typedef pair<int, int> ii;
typedef struct _elem
{
unordered_map<int, int> m;
_elem(int len, int cnt)
{
m.insert(ii(len, ... | ALGO | 0.999985 | 4.759587 | {
"github_metadata": {
"branch": "main",
"commit_count": 148,
"repo_created_at": "2021-02-28T07:46: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": "903b676fbe... |
b829c800-c62d-4bbb-bc16-904f5250ac12 | diegojoel301/Programacion_Competitiva | juezPatito/1922/main.cpp | #include<bits/stdc++.h>
#define M 9999999
using namespace std;
vector<tuple<int, bool, bool, bool>> v;
int ans = M;
void f(int pos, bool s1, bool s2, bool s3, int money)
{
if(v.size() - 1 != pos and not (s1 and s2 and s3))
{
f(pos + 1, s1 or get<1>(v[pos + 1]), s2 or get<2>(v[pos + 1]), s3 or get<3>(v[pos + 1])... | ALGO | 0.999793 | 3.662844 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-10-27T21:10: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": "e172673b946... |
0b08ee81-ea51-4c0d-a681-1422ce847432 | straten/epsic | src/superposed.cpp | /***************************************************************************
*
* Copyright (C) 2016 by <NAME>
* Licensed under the Academic Free License version 2.1
*
***************************************************************************/
#include "sample.h"
Stokes<double> epsic::superposed::get_Stokes ... | ALGO | 0.990286 | 4.737828 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2016-11-26T05:26:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "747ca2cb... |
45591ada-83b0-4438-854b-e6875ebb1802 | JinyuChata/leetcode_cpp | leetcode/editor/cn/301_remove-invalid-parentheses.cpp | //给你一个由若干括号和字母组成的字符串 s ,删除最小数量的无效括号,使得输入的字符串有效。
//
// 返回所有可能的结果。答案可以按 任意顺序 返回。
//
//
//
// 示例 1:
//
//
//输入:s = "()())()"
//输出:["(())()","()()()"]
//
//
// 示例 2:
//
//
//输入:s = "(a)())()"
//输出:["(a())()","(a)()()"]
//
//
// 示例 3:
//
//
//输入:s = ")("
//输出:[""]
//
//
//
//
// 提示:
//
//
// 1 <= s.length <= ... | ALGO | 0.999516 | 5.363945 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-06-01T14:01:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c8b7e4a0... |
1b8889f2-eee9-41d4-a872-31e985e363b9 | PeiAllen/Code | Problems/Codeforces/D. Kefa and Dishes/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
void sc(){}
template<typename T,typename... Args>
void sc(T& a, Args&... args) {cin>>a,sc(args...);}
template<typename T>
void pr(T a){cout<<a;}
template<typename T,typename... Args>
void pr(T ... | ALGO | 0.999886 | 3.649113 | {
"github_metadata": {
"branch": "master",
"commit_count": 392,
"repo_created_at": "2019-07-31T20:11:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df688070... |
f2f1536d-3407-498d-b16d-f7212cae7c6f | hsahni55h/CPP_udacity | concepts/problem tasks/Characters-and-Strings/main.cpp | // Substitution Cipher
/*
A simple and very old method of sending secret messages is the substitution cipher.
You might have used this cipher with your friends when you were a kid.
Basically, each letter of the alphabet gets replaced by another letter of the alphabet.
For example, every 'a' get replaced with an 'X', a... | ALGO | 0.998522 | 5.087033 | {
"github_metadata": {
"branch": "main",
"commit_count": 105,
"repo_created_at": "2023-07-02T21:24:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb00e7fd1c... |
dc1424f8-d0df-4635-866e-891ca091de24 | Saharsh979/CP-Algorithms | Compiler Design Algorithms/Lexical_Analyzer.cpp | #include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// Returns 'true' if the character is a DELIMITER
bool isDelimiter(char ch)
{
if (ch == ' ' || ch == '+' || ch == '-' || ch == '*' ||
ch == '/' || ch == ',' || ch == ';' || ch == '>' ||
ch == '<' || ch == '=' || ch == '... | ALGO | 0.994608 | 3.539321 | {
"github_metadata": {
"branch": "main",
"commit_count": 94,
"repo_created_at": "2021-02-01T13:35:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6eea921f84... |
d5fb60dc-3ec4-4ab0-83b6-938f3fe5456c | ahmedfawzy98/Competitive-Programming | algorithms_practice/divide_and_conquer/maximum_subarray_sum_problem/main.cpp | #include <iostream>
#include <climits>
using namespace std;
int max_crossing_sum(int left, int mid, int right, const int array[]){
int max_sum = 0, left_sum = INT_MIN, right_sum = INT_MIN;
for (int i = mid; i >= left ; --i) {
max_sum += array[i];
if(max_sum > left_sum){
left_sum = m... | ALGO | 0.999956 | 5.644397 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-12T20:51:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d2b108f78... |
6114aa76-6bb5-4d13-8f69-d12238024619 | abhashksingh/DeletableSegmentTree | Source.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cassert>
using namespace std;
template <typename T>
class Operator
{
public:
virtual T apply(T leftValue, T rightValue) = 0;
};
template <typename T>
class MinOperator : public Operator<T>
{
public:
T apply(T leftValue, T rightValue)
{
if (leftVal... | ALGO | 0.999623 | 5.194468 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-07-23T15:07: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": "efc4246cc6d3... |
314b7b96-e0da-4387-9157-773f6ab11fde | chaomy/pfPPmpi | src/pfLmpFCC.cpp | /*
* @Author: chaomy
* @Date: 2017-11-10 14:28:37
* @Last Modified by: chaomy
* @Last Modified time: 2018-06-16 00:14:39
*/
#include "pfLmpDrv.h"
void pfHome::pfLMPdrv::calLatticeFCC() {
char cmds[100][MAXLEN];
int i = 0;
// --------------------- INITIALIZAITION ---------------------
sprintf(cmds[i+... | TOOL | 0.948626 | 4.561025 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2018-01-20T21:54: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": "1fc751a9... |
1a94f5e1-5c9a-4003-9c6c-64b6d0a71f0c | MoppelDerDegu/warping | Helper.cpp | #include "Helper.h"
#include "stdafx.h"
#include "WarpingMath.h"
#include "FileManager.h"
IplImage* Helper::getNthFrame(CvCapture* capture, int n)
{
for (int i = 0; i < n - 1; i++)
{
if (cvQueryFrame(capture) == NULL)
return NULL;
}
return cvQueryFrame(capture);
}
IplImage Helper::MatToIplImage(Mat& m)
{
I... | TOOL | 0.945573 | 5.190119 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2013-04-05T09:03: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": "815575ff... |
e0e19fc3-bc99-4c5f-8a30-cbe2b3d08e62 | Preet-jain23/Optimized-Scheduler-Detector | optimized_scheduler_detector.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pair1;
typedef pair<int,pair<int,int>> pair2 ;
typedef map<int,int> map1 ;
void testing(vector<pair2 >temp){
for(int i=0;i<temp.size();i++){
cout<<"P"<<temp[i].first<<"|"<<temp[i].second.first<<" "<<temp[i].second.second<<"|| ";
}
... | ALGO | 0.999976 | 3.940568 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-07T05:47: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": "5f3b8313a30d... |
ec19f189-1d9c-4e4e-bdaf-cd0524fe69b9 | weakson/code | zj/zj_c039.cpp | #include<iostream>
using namespace std;
long long cntlen(int num, long long len){
len++;
if (num == 1) return len;
if (num & 1) return cntlen (3 * num + 1, len);
else return cntlen (num / 2, len);
}
int main(){
int i, j;
while (cin >> i >> j){
cout << i << ' ' << j << ' ';
if (... | ALGO | 0.999965 | 4.014652 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-06-10T06:30: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": "23b50d2a2e9... |
740cbcaa-67af-4515-93db-23436c8acf59 | Shaikh1828/Semester_4 | New folder/Priority.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int numProcesses;
vector<int> burstTime, priority, arrivalTime;
freopen("input2.txt","r",stdin);
cin >> numProcesses;
for(int i=0; i<numProcesses; i++)
{
int a, b, c;
cin >> a >> b >> c;
burstTime.push_back(... | ALGO | 0.999984 | 4.295152 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-02-22T13:58:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8e9640fbd0... |
f86a88ce-1505-4061-8b11-5837789c5314 | ishandutta2007/codeforces-k | kokokostya/normal/815/A.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <iomanip>
#include <map>
#include <stack>
#include <bitset>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cstdio>
using ... | ALGO | 0.999842 | 3.050138 | {
"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": "d98424e895fd... |
bf2f0391-cbc3-415f-898a-280b9561f2f9 | leisheyoufu/study_exercise | algorithm/leetcode/8_String_to_Integer_(atoi)/main.cpp | /* String to Integer (atoi)
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.
Notes: It is intended for this problem to be specified vaguely (ie, no given input specs... | ALGO | 0.99817 | 4.888668 | {
"github_metadata": {
"branch": "master",
"commit_count": 738,
"repo_created_at": "2013-10-13T11:13:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "3e55454a... |
ce6ed379-7c03-4ff7-a7d6-8380b4e89665 | STRATEGUS-HE2022/flexman | include/flexman/pso/common.hpp | /// @file common.hpp
/// @author <NAME> (<EMAIL>)
///
/// @brief Defines common data structures for Particle Swarm Optimization (PSO).
///
/// @details
/// This file provides shared definitions for the PSO framework, including:
/// - The `SolverParameters` structure, which encapsulates key parameters
/// for controll... | CONFIG | 0.992179 | 7.279926 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-01-21T14:46:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c98e21e0622b... |
fdcf8a5e-061c-4879-90b6-9f1f534cb419 | AryanGera/cp-template | Graph/DSU.hpp | // Template: Disjoint Set Union
// Maintaining and merging sets of nodes
// O(\alpha(n)) per query, where \alpha(n) is inverse Ackermann function (basically O(1) as \alpha(10^600) < 4)
// Without path compression, O(\log n) per query
class DisjointSetUnion {
public:
DisjointSetUnion(int n, bool directed_temp = fal... | ALGO | 0.99971 | 5.950853 | {
"github_metadata": {
"branch": "main",
"commit_count": 190,
"repo_created_at": "2023-06-10T15:29: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": "22f757bd34... |
30754afd-cbc4-4e32-b1e5-5e32ea7065d9 | SamMathelete/CP | Knapsack_2_DP.cpp | /*
Knapsack 2 (0/1 knapsack):
Question at: https://atcoder.jp/contests/dp/tasks/dp_d
Hint:
Decide all states of the brute force recursive function.
Here, States can be N and v as O(100 * 10^3) = O(10^5)
Hint 2:
Iterate over all values from 1 to 10^3 and find the largest value for which minimum weight
required to bui... | ALGO | 0.999998 | 4.537893 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-12-05T15:33: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": "38de95b68114... |
ca666271-3c63-407d-91b3-afd6241824e5 | IgorRodic/MasterRad-IgreParnosti | parity_games_cnf/formula.h | #ifndef FORMULA_H
#define FORMULA_H
#include <iostream>
#include <memory>
#include <set>
using namespace std;
class BaseFormula : public enable_shared_from_this<BaseFormula> {
public:
typedef shared_ptr<BaseFormula> Formula;
virtual string getType() const = 0;
virtual void printFormula(ostream & ostr) const = 0;
... | ALGO | 0.909612 | 4.562895 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-07-18T14:32: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": "2378a0de2b... |
12aa4978-cc24-4e11-873f-d3097593a435 | jreyesg18/C_Programs | Arreglo Temperaturas.cpp | /*
Llevar el registro de las temperaturas durante M días. Por cada día se ingresa la
temperatura máxima y mínima. Se pide
a) Promedio de las temperaturas máximas
b) Indicar cuál es la temperatura más baja
c) Determinar el número de día en que hubo mayor diferencia entre la máxima
y la mínima.
*/
#include<stdio.... | ALGO | 0.999463 | 3.448146 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2015-08-06T01:28: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": "4cda7a2a59a4... |
29650133-c079-4361-b874-cbe1308d9c8a | khu-kimjunseo/DPO_for_CodeGen | dpo_train/generation_output/py-cpp/HumanEval_159_eat.cpp | ### Python version
from typing import List
def eat(number: int, need: int, remaining: int) -> List[int]:
if(need <= remaining):
return [ number + need , remaining-need ]
else:
return [ number + remaining , 0]
### C++ version
#include<assert.h>
#include<bits/stdc++.h>
#include<vector>
#includ... | ALGO | 0.999681 | 4.277883 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-12T11:58: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": "0fcafcdad5e0... |
15f76fba-bcf1-4581-bea7-cb306325c7ce | ftiasch/mithril | 2013-07-03/A.cpp | #include <cstdio>
#include <cstring>
int readCode(const char *str)
{
if (str[0] == '0') {
return -1;
}
return (str[0] - 'A') * 2 + (str[1] == '+' ? 1 : 0);
}
const int maxn = 52 * 2;
bool conn[maxn][maxn];
int n;
int input[40000][4];
int main()
{
scanf("%d", &n);
for (int i = 0; i < n; i++) {
static char ... | ALGO | 0.998741 | 3.400401 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2012-07-17T06:58:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce58547... |
75a22784-5786-44ef-9241-2fe7284ef7a0 | harshvarmora28/competitive_programming | easy_pronounciation.cpp | // Author: <NAME>
// Problem: Easy pronounciation
// Date: 17 July,2022
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)... | ALGO | 0.999891 | 3.437114 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2021-11-04T09:52: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": "5087634c... |
0f6ce8f2-da62-4c74-b0e9-98d7d857fb06 | srijon-32/CP-Library | PBDS/Ordered Set/D_Kousuke_s_Assignment.cpp | /* SRIJON
SINGHA
SAMANTA */
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
typedef long long int ll;
typedef long double ld;
#define nl "\n"
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define yes cout << "YES" << nl
#defin... | ALGO | 0.99984 | 4.614482 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-10T20:48: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": "52fee3273ea4... |
6b2789d7-4f39-4033-9a89-bb9f03310f60 | Ginakira/Code-Archive | Leetcode/LeetCode959.cpp | // LeetCode 959 由斜杠划分区域
#include <string>
#include <vector>
using namespace std;
// 并查集
// 将每一个单元格都分为四个三角形,顺时针编号分别为0-3
// 根据斜线将这些三角形进行合并
// 注意每次合并后,将1号与右边的3试图进行合并,将2号与下边的0进行合并
class UnionFind {
private:
vector<int> father;
int count;
public:
UnionFind(int n) : father(n), count(n) {
for (int ... | ALGO | 0.999819 | 5.211139 | {
"github_metadata": {
"branch": "master",
"commit_count": 2104,
"repo_created_at": "2019-11-10T06:03:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3e30d5... |
28a428f7-c191-425e-a266-cae12da7050a | lsry/LeetCode | cpp/L2500/LeetCode2529.cc | #include <algorithm>
#include <vector>
using std::vector;
class Solution {
public:
int maximumCount(vector<int>& nums) {
int positive{0}, negtive{0};
int N = nums.size();
int low = 0, high = N - 1;
while (low <= high) {
int mid = (low + high) / 2;
if (nums[mi... | ALGO | 0.999955 | 5.495067 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2020-01-04T04:46: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": "83586a83... |
e0d9eb88-3af4-4aba-beea-28c8bc22abc0 | Webolove/ArshGoyalSDEChallenge2023 | Tree/MinDistBetweenTwoNodes.cpp | #include "bits/stdc++.h"
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
Node(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
void generate_adj(Node *root, unordered_map<int, vector<int>> &mp)
{
if (root == NULL)
return;
if (... | ALGO | 0.999877 | 4.170264 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-07-27T14:44: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": "db64d14df4f... |
f4b54e3a-9cab-4382-b328-aa8dd31950a4 | maythaswang/image_gallery_builder | project_1_image_gallery_builder/lib/lin_alg/lin_alg.h | #ifndef LIN_ALG_H
#define LIN_ALG_H
#pragma once
#include "./vec3.h"
#include "./vec4.h"
#include "./mat3.h"
#include "./mat4.h"
#include "./utils.h"
/**
* LIBRARY FOR BASIC LINEAR ALGEBRA OPERATIONS FOR GRAPHICS PROGRAMMING
* Use lin_alg namespace to access types and functions provided
* The matrices are formatted... | TOOL | 0.939078 | 4.4929 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2024-11-13T15:43:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a19f99f6842... |
3985564e-ecc4-4b2f-936a-c56bdd52433b | lazzzis/uva-oj-code | Uva673/main.cpp | /*
UvaOJ 673
Emerald
Mon 1 Jun 2015
*/
#include <iostream>
#include <cstring>
#include <cstdio>
#include <stack>
using namespace std;
bool IsValid( string &str ) {
stack <char> st;
int length = str.length();
for( int i=0; i < length; i ++ ) {
if( str[i] == '(' || str[i] == '[' ) {
... | ALGO | 0.999645 | 4.936428 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2015-09-02T14:14: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": "80996f12d... |
580b7184-b0f1-432e-9333-2dffc5cd9351 | LittleYang0531/CQ-CSP-S-2022 | CQ-S00016/holiday/holiday.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=2505,M=10005;
inline long long read(){long long f=0;char c=getchar();while(!isdigit(c))c=getchar();while(isdigit(c))f=(f<<3)+(f<<1)+c-'0',c=getchar();return f;}
void write(long long x){if(x>=10)write(x/10);putchar(x%10+'0');return;}
int n,m,k,num[N],cnt[N],f[N][... | ALGO | 0.999974 | 3.591846 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-31T10:15: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": "523211cc78af... |
95548e86-a897-41fe-871b-39d3f01c2970 | PedroRonzani18/Free-Code-Camp-Classes | Data_Structures_C_CPP/Linked_List/LinkedList.h | #pragma once
/* CPP implementation of Linked List with templates */
#include <stdio.h>
#include <stdlib.h>
#include <stack>
template <typename T>
struct Node
{
T data;
Node<T>* next;
Node(T data):
data(data),
next(NULL)
{}
};
template <typename T>
struct LinkedList
{
Node<T>* hea... | ALGO | 0.999006 | 5.436071 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-02-01T13:53: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": "be32c854a41... |
a05a9cfd-4385-448f-b758-be2926e34585 | ErindiGR/LMB | src/lmb/calculators/direct_light_calculator.cpp | #include "lmb/calculators/direct_light_calculator.h"
#include "lmb/lmb.h"
#include "lmb/base_type.h"
#include "lmb/ray_spread.h"
#include <glm/glm.hpp>
#include <glm/gtx/rotate_vector.hpp>
namespace LMB
{
vec4 DirectLightCalculator::CalcPixel(
const vec3 &world_pos,
const vec3 &world_norm)
{
vec3 ... | ALGO | 0.984756 | 5.76162 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2020-12-31T22:03:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f46bcf7944b... |
806d2e73-b665-4d74-a902-5f8c533fb324 | LucasBanks/BanksLucas_48102 | Hmwk/Assignment_2/Gaddis_7thEd_Chap3_Prob4_AvgRainfall/main.cpp |
/*
* File: Average Rainfall
* Author: LucasB
* Created on September 27, 2016, 7:47 PM
* Purpose: Calculates average rainfall of each month from the given user
* input values.
*/
//User Libraries
#include <iostream> //Input/output
#include <string> //Enables the string data type
using namespace st... | TOOL | 0.986022 | 4.398086 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2016-12-09T19:37: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": "3423a5e9a... |
4a4407b5-7394-4cc3-b055-3416e2e6afa4 | WillThinkAboutNicknameLater/heads-and-hands-task | MergeSorter.h | //
// Created by <NAME> on 08.02.2022.
//
#ifndef MERGESORTER_H
#define MERGESORTER_H
#include <iostream>
#include "Array.h"
#include "Exceptions/MemoryNotAllocatedException.h"
template<typename T>
class MergeSorter {
private:
void merge(T *array, size_t size, std::function<bool(T, T)> isCorrectOrder);
public:... | ALGO | 0.99856 | 6.607449 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-02-17T05:52: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": "b9dd1d6ae76... |
96654d06-a412-4601-bb1a-7abfc1b73ea2 | shiva92/Contests | UVA/AdHoc/454_Anagrams.cpp | #include <iostream>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <algorithm>
#include <sstream>
#include <set>
#include <climits>
#include <cstdio>
#include <string>
#include <map>
#include <sstream>
using namespace std;
void removeWhiteSpace(string & str) {
int i, len = str.size();
string temp;
... | ALGO | 0.99975 | 3.609942 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-10-10T07:20: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": "2d4c40ed7... |
cc8319ef-401d-4106-b466-60435883c099 | anmoanmo/acm_exercises | week7/week7/F.cpp | //#define _CRT_SECURE_NO_WARNINGS
//#include<iostream>
//#include<cmath>
//#include<string>
//#include<vector>
//#include<list>
//#include<queue>
//#include<deque>
//#include<stack>
//#include<map>
//#include<algorithm>
//#include<iomanip>
//
//#define endl '\n'
//using namespace std;
//
//long l, rock, m;
//long rocks... | ALGO | 0.999966 | 3.657298 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2023-09-18T13:02: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": "cc312fd1229... |
a8046403-b66c-4364-a087-8ebafac45195 | PriDhingra/Dynamic-Programming | wildcardPatternMatching.cpp | #include<vector>
int f(int i, int j, string &p, string &t, vector<vector<int>> &dp) {
if(i < 0 && j < 0)
return 1;
if(i < 0 && j >= 0)
return false;
if(j < 0) {
for(int k = 0;k <= i;k++) {
if(p[k] != '*')
return 0;
return... | ALGO | 0.999992 | 4.707748 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2020-07-06T10:25:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50e577b84... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.