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 |
|---|---|---|---|---|---|---|---|
4f30b9a3-ae49-4846-aadc-63083889f016 | hotbig/letmetry | leetcode/search_for_a_range.cpp | #include<iostream>
#include<vector>
#include<string>
using namespace std;
class Solution{
public:
int findLow(vector<int>& nums, int target, int low, int high)
{
int left = low;
int right = high;
int mid = left+(right-left)/2;
while(left<=right)
{
if(nums[mid] == target)
{
if((mid-... | ALGO | 0.999978 | 5.752579 | {
"github_metadata": {
"branch": "master",
"commit_count": 167,
"repo_created_at": "2015-06-05T12:58: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": "a2c745f7... |
fc1ed8eb-6a95-4b48-b4f4-846e2a293608 | XiaoBaiRuler/xb_algorithm | dynamic/dynamic07.cc | #include "..//common//common.h"
/**
* @brief 583. 两个字符串的删除操作
* https://leetcode-cn.com/problems/delete-operation-for-two-strings/
*
* 求两个字符串删除最少个字符后相同
* => n1 + n2 - 2 * 两个字符串的最多公共部分
* => 两个字符串的最多公共部分
* => 第一个字符串,以i结尾的最多部分[0, n)
* => 第二个字符串,以j结尾的最多部分[0, n)
* => dp[i][j] = word1[i - 1] == word2[j - 1]
* ... | ALGO | 0.999895 | 5.715961 | {
"github_metadata": {
"branch": "main",
"commit_count": 245,
"repo_created_at": "2022-04-23T15:14:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18c218aeab... |
d0baf7bc-7ff9-405b-b31f-bc9f303a8483 | qruiger/programming-exercise | codeforces/740B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a;
for (int i = 0; i < n; i++) {
int a_val;
cin >> a_val;
a.push_back(a_val);
}
vector<int> ans;
for (int i = 0; i < m; i++) {
int l, r;
cin >> l >> r;
l--, r--;
int sum = 0;
for... | ALGO | 0.999983 | 5.181708 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2017-12-31T20:10: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": "452c78789... |
2bc4a1c9-6508-4773-83cb-b005dc6963f5 | kiwibang/kattis-uva | uva11559.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (!cin.eof()) {
int n, b, h, w;
cin >> n >> b >> h >> w;
if (cin.eof()) {
return 0;
}
int price;
int res = 3000000;
while (h--) {
cin >> price;
int availabilit... | ALGO | 0.999503 | 3.588562 | {
"github_metadata": {
"branch": "main",
"commit_count": 637,
"repo_created_at": "2024-05-07T00:52: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": "525fe98019... |
802ca286-9fb4-4198-af50-7d17d8c3bff5 | WuyangPeng/ProgrammingBooksCode | C++/初级/C++ 核心思想/ch8/sqrtest2.cpp | #include <iostream>
#include <cmath>
using namespace std;
/**
Tests whether two floating-point numbers are
approximately equal.
@param x a floating-point number
@param y another floating-point number
@return true if x and y are approximately equal
*/
bool approx_equal(double x, double y)
{
const ... | ALGO | 0.998774 | 4.902896 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2022-08-02T03:48:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46e68e8921b... |
e2f15a50-0a53-4a80-9238-1bfa8677b468 | AnnHarvard/algosTP | Module_1/HomeWork_1/3_2/main.cpp | // Задача № 3 (4 балла)
// Во всех задачах из следующего списка следует написать структуру данных,
// обрабатывающую команды push* и pop*.
// Формат входных данных.
// В первой строке количество команд n. n ≤ 1000000.
// Каждая команда задаётся как 2 целых числа: a b.
// a = 1 - push fro... | ALGO | 0.999801 | 4.729711 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-10T19:20: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": "9a676b607fb5... |
c42cb577-c1bf-4198-a808-36c26574a550 | tit-darek/palindrom_2 | main.cpp | #include <iostream>
#include <fstream>
using namespace std;
int palindromy=0, parzyste=0, nieparzyste=0, w, x, a, aaa;
string s;
fstream znaki, odpowiedz;
bool sprawdz (string s)
{
int dl=s.size();
for (int i=0; i<dl/2; i++)
if (s[i]!=s[dl-i-1])
return false;
return true;}
void sprawdznad()
{
z... | ALGO | 0.992509 | 3.41993 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-05-24T14:19: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": "9e54d74730... |
bdfcf3c5-0ca9-4573-b28c-b7e7514bff76 | GodtoL/minichallenges-codepro-cpp-python-java | bfs.cpp | #include <iostream>
#include <vector>
#include <queue>
void BFS(int startNode, const std::vector<std::vector<int>>& adjList) {
std::vector<bool> visited(adjList.size(), false);
std::queue<int> q;
visited[startNode] = true;
q.push(startNode);
while (!q.empty()) {
int node = q.front();
... | ALGO | 0.999864 | 6.263162 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-07-09T15:47:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae68bc137ce... |
32557bc5-d005-407c-a59c-bca4cc9fe381 | dustin-wu/cpp-game-engine | Engine/Systems/collisionsystem.h | #pragma once
#include "Engine/Components/collisioncomponent.h"
#include "Engine/gameobject.h"
#include <memory>
#include <Engine/system.h>
#include "glm/glm.hpp"
#include "glm/ext.hpp"
struct CollisionInfo {
GameObjectID otherID;
glm::vec3 mtvToMove;
};
struct CollisionData {
float t;
glm::vec3 norma... | ALGO | 0.998177 | 7.052582 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-08-30T23:20:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0cc32d921f... |
50a19e75-350e-4fc6-a587-a6364178be20 | JetBrains/kotlin | kotlin-native/runtime/src/main/cpp/polyhash/common.h | /*
* Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
#ifndef RUNTIME_POLYHASH_COMMON_H
#define RUNTIME_POLYHASH_COMMON_H
#include <array>
#include <cstdint>
#include "polyhash/naive.h"
#include "../Common.h"
constexpr u... | ALGO | 0.94964 | 6.915216 | {
"github_metadata": {
"branch": "master",
"commit_count": 127079,
"repo_created_at": "2012-02-13T17:29:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 50969,
"forks": 5962,
"issues": 0,
"pull_requests": 182
},
"file_meta": {
"content_id"... |
c2b84a93-c17d-4b74-902a-f6ee2d73dd09 | theabbott/Until-All | BC15092014b/Export/ios/BC15092014b/haxe/build/Release-iphoneos/src/motion/easing/CubicEaseOut.cpp | #include <hxcpp.h>
#ifndef INCLUDED_motion_easing_CubicEaseOut
#include <motion/easing/CubicEaseOut.h>
#endif
#ifndef INCLUDED_motion_easing_IEasing
#include <motion/easing/IEasing.h>
#endif
namespace motion{
namespace easing{
Void CubicEaseOut_obj::__construct()
{
HX_STACK_PUSH("CubicEaseOut::new","motion/easing/Cub... | ALGO | 0.919068 | 3.46032 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-09-16T09:25: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": "72a75551be... |
6cd696ce-b440-430b-9438-0a172297369b | khanhlong247/Chuong-trinh-dich | BaiTapThucHanh2_Buoi3_1_2_2024/Bai3.cpp | #include <iostream>
#include <string>
using namespace std;
string checkRelationalOperator(const string& input) {
char state = 0;
for (char c : input) {
switch (state) {
case 0:
if (c == '<') {
state = 1;
}
else if (c == '=... | ALGO | 0.999724 | 4.126952 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2025-01-02T00:35:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4aac70ebd72... |
48e8d15f-27f5-44fe-8a89-402e101dede0 | Upsurge-11/DSA | Graphs/kosarajuAlgorithm.cpp | #include <bits/stdc++.h>
using namespace std;
void dfs(int node, vector<int> adj[], vector<int> &vis, stack<int> &st)
{
vis[node] = 1;
for (auto it : adj[node])
{
if (!vis[it])
dfs(it, adj, vis, st);
}
st.push(node);
}
void dfs2(int node, vector<int> adj[], vector<int> &vis)
{
vis[node] = 1;
... | ALGO | 0.999807 | 4.877718 | {
"github_metadata": {
"branch": "main",
"commit_count": 311,
"repo_created_at": "2022-08-20T14:09: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": "404e9cde01... |
ae9760d1-7ecf-4d2e-a74a-9b6cc11b133e | gilShamai/3D-Shape-Matching | laplace_beltrami/laplace_beltrami_from_grad.cpp | /* Compute the Laplace-Beltrami cotangent weight matrix
* Copyright 2011 <NAME>
*/
#include <iostream>
#include <list>
#include <vector>
#include "mex.h"
#include <math.h>
#include "matrix.h"
#include <string.h>
#include <set>
using namespace std;
#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
#define MAX(X, Y) ((X)... | ALGO | 0.99985 | 4.70304 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-09-30T17:13:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "548dd556... |
35e0246c-3251-486c-a59b-8a5e397655be | sahiljagtap08/metro-app-dijkstras | Main.cpp | #include <iostream>
#include "Graph.cpp"
using namespace std;
int main() {
Graph metroMap;
// Add vertices (stations) to the metro map
metroMap.addVertex("Station A");
metroMap.addVertex("Station B");
metroMap.addVertex("Station C");
metroMap.addVertex("Station D");
metroMap.addVertex("S... | ALGO | 0.999595 | 5.710718 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-09-20T18:09: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": "7a42ddb5ffc... |
450d9c1a-a9a4-441b-9c8f-d8f27ac630ae | pranavkrishnayadav/AltiustASK | Problem1/question1.cpp | #include<bits/stdc++.h>
using namespace std;
//Brute Force Approach iF ALL Elements are positive then max sum will be Sum of all numbers
//Space Compexity - O(n)
//Space Complexity - O(1)
int solve1(vector<int>&arr){
int sum = INT_MIN;
int n = arr.size();
for(int i=0;i<n;i++){
sum+=arr[i];
... | ALGO | 0.999961 | 4.490446 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-05T11:21: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": "03b58d29f714... |
d57e4216-fc6a-459a-bc62-1664a431578b | NVIDIA/tensorflow | tensorflow/compiler/tf2tensorrt/segment/union_find.h | /* Copyright 2018 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.987894 | 7.702134 | {
"github_metadata": {
"branch": "r1.15.5+nv23.03",
"commit_count": 64202,
"repo_created_at": "2020-05-13T21:34:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1146,
"forks": 178,
"issues": 41,
"pull_requests": 9
},
"file_meta": {
"conten... |
3b0303b6-d1e0-42ad-b9b0-eeb57758ac91 | 5p00kk/cellular_automata | src/main_single.cpp | #include "rule_bin.h"
#include "rule_tct.h"
#include "visualizer.h"
#include <stdio.h>
#include <opencv2/core/mat.hpp>
#include <opencv2/imgcodecs.hpp>
int main()
{
/* Create the world */
cv::Mat world = cv::Mat::zeros(800, 800, CV_8UC1);
world.at<uint8_t>(0, 400) = 1;
/* Printouts */
printf("\nS... | ALGO | 0.999606 | 4.765676 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2022-04-06T08:16:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17d78aae238... |
6df39b68-d456-4581-9b1a-e2f230fd32f2 | rysh25/atcoder | past201912-open/f.cpp | #include <iostream>
#include <iomanip>
#include <sstream>
#include <list>
#include <utility>
#include <string>
#include <bitset>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <climits>
#include <cstring>
// #include <cstdlib>
#include <limits>
#include <algorithm>
#include <functional>
#include <vector>
... | ALGO | 0.999964 | 4.093354 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2022-08-14T16:25: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": "c973d2b509... |
b901f94a-63f5-4051-8f3a-a49a02443704 | arrows-1011/CPro | AOJ/Volume11/1135.cpp | #include <iostream>
using namespace std;
int main(){
int n,year,ope,bfmoney,tax,interest,max,get,tempmoney=0;
double up_yatta,temp;
cin >> n;
for( int i = 0 ; i < n ; i++ ){
max = 0;
cin >> bfmoney;
cin >> year >> ope;
tempmoney = bfmoney;
for( int j = 0 ; j < ope ; j++ ){
get = 0;... | ALGO | 0.999593 | 3.452686 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2015-11-18T15:08:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a81e1ef2... |
595c6080-3030-4bb8-a46d-f64dfd90f740 | ayushrakesh/Data-Structures-and-Algorithms | bit-manipulation/learning/binary-operators.cpp | #include <bits/stdc++.h>
using namespace std;
void swapVariables(int &a, int &b)
{
a = a ^ b;
b = a ^ b;
a = a ^ b;
}
int findKthBit(int n, int k)
{
if (((1 << k) & n) == 0)
return 0;
else
return 1;
}
int setKthBit(int &l, int k)
{
return (l | (1 << k));
}
int clearKthBit(int l, int k)
{
return (... | ALGO | 0.998453 | 3.442316 | {
"github_metadata": {
"branch": "main",
"commit_count": 601,
"repo_created_at": "2024-01-16T05:09: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": "2e18ed3c74... |
6dc3ddbc-865c-4b75-b3fe-53975047edc9 | xiecaiyang/Grokking-the-Coding-Interview-Patterns | 02_pair_with_target_sum.cpp | /* Easy
Problem Statement
Given an array of sorted numbers and a target sum, find a pair in the array whose sum is equal to the given target.
Write a function to return the indices of the two numbers (i.e. the pair) such that they add up to the given target.
Example 1:
Input: [1, 2, 3, 4, 6], target=6
Output: [1, 3]
Ex... | ALGO | 0.999941 | 6.171142 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-06-07T07:47:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44dd47811e6... |
6aed79ab-8904-4d03-975a-b4744a12c93c | Human-translation/code | c++/HashMap/hashmap.cpp | #include <iostream>
#include <vector>
using namespace std;
enum State
{
EXIST,
DELETE,
EMPTY
};
template <class K,class V>
struct Node
{
pair<K, V> _value;
State _state;
};
template <class K,class V>
class HashTable
{
typedef Node<K, V> Node;
public:
HashTable(size_t N = 10)
{
_table.resize(N);
for (size... | ALGO | 0.998087 | 4.778202 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2020-07-05T01:37:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b953701a0... |
e0ba70db-c849-4422-839b-f5b659eae9c3 | ArtHaxPr0/UniqueLeetCodeSolutions | Arrays_and_Hashing/C++/49_group_anagrams.cpp | /*
* RUNTIME: 39 ms - Beats 23.18% of submissions
* MEMORY - 21.3 MB - Beats 28.90% of submissions
*/
#include <vector>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
/* Thoughtprocess:
* 1. Create a map of sorted strings to a vector of strings
* 2. Iterate through the input vector and ... | ALGO | 0.999995 | 6.541115 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-11-22T11:42:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19ff055b4e1... |
7da0299d-9950-477e-bb55-b781db1d48f2 | akram8540/DataStructure-and-Algorithms | Sorting/naivePartionQucikSort.cpp | // Below written partition function only works if the pivot is choosen as the last element
// if the first is choosen as the pivot traverse the array from the last
// because according to the following function if first element is choosen as the pivot
// no element smaller than the pivot come before the pivot
#include... | ALGO | 0.999983 | 6.198603 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-09T19:44: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": "9dba321d950d... |
dd219d90-a223-4e11-8031-e4a832342cb5 | sahilkumar100/WWC-DSA | area.cpp | // Medium:
// 1) Function Overloading for Calculating Area.
// Objective
// Write a program to calculate the area of different shapes using function overloading. Implement overloaded functions to compute the area of a circle, a rectangle, and a triangle.
// Input Format
// The program should accept:
// 1. Radiu... | ALGO | 0.996194 | 5.580907 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-19T16:23: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": "44d052d2fdfc... |
d52a19d3-4757-456d-ad54-1dcc0fad4d0d | waynemitchell/mfem | miniapps/gslib/findpts.cpp | // Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
// This file is part of the MFEM library. For more information and source code
// availability visit ht... | ALGO | 0.984851 | 6.074674 | {
"github_metadata": {
"branch": "master",
"commit_count": 17182,
"repo_created_at": "2019-04-03T14:24: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": "69b451... |
3d064537-dad0-4057-a52e-26567a591f1b | eerrjhj/CP-Solutions | CodeForces/GNU C++20 (64)/218B | Airport/146693516.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define debug(x) cout << x << endl;
#define ll long long
#define mod 1000000007
#define pb push_back
#define fs first
#define sec second
//fast factors
//count distinct array
// fast prime
// XOR(num & string)
int odd(int n)
{
if(n%2!=0) return 1;
... | ALGO | 0.999996 | 3.086886 | {
"github_metadata": {
"branch": "main",
"commit_count": 1392,
"repo_created_at": "2022-06-23T12:12: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": "eebb3351d... |
8ee7a929-8a7f-49c6-919b-e18e53d04c1f | coleiroc/RocketDodge | RocketDodge.cpp | #include "splashkit.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <ctime>
using namespace std;
// Constants
const int SCREEN_WIDTH = 800;
const int SCREEN_HEIGHT = 600;
const string ROCKET_BITMAP = "rocket";
const string ASTEROID_BITMAP = "asteroid";
// Load resources
void load... | TOOL | 0.971938 | 6.684378 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-12T00:26:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c64ac0892cf... |
c7ebb1a0-ddf0-45f3-aa2a-0b9692a538d1 | arosusti/FJCU-CPC-2020 | Day2/K.cc | #include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
const int NMAX = 200000;
vector<int> A[2];
int boz[NMAX];
int siz[NMAX];
vector<int> E[NMAX];
int Find(int x) {
while (boz[x] != x) x = boz[x];
return x;
}
bool Union(int a, int b) {
a = Find(a);
b = Find(b);
if (a == b) return ... | ALGO | 0.999939 | 4.199138 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-09-02T10:57:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e5ca4d191... |
f358aa3e-df3e-4acb-8cb2-8a9dd98c0829 | kamyu104/LeetCode-Solutions | C++/reconstruct-original-digits-from-english.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
string originalDigits(string s) {
const vector<string> numbers{"zero", "one", "two", "three",
"four", "five", "six", "seven",
"eight", "nine"};
vector<vector<int>> cnts(n... | ALGO | 0.999669 | 5.808646 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
b906da46-3159-4c85-9d3f-a0f44815c099 | Samshersingh1/Dynamic-programing | Knapsack pattern/target-sum.cpp | // RPOBLEM :: You are given an integer array nums and an integer target.
// You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers.
// For example, if nums = [2, 1], you can add a '+' before 2 and a '-' before 1 and concat... | ALGO | 0.999995 | 5.156436 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2025-01-18T12:01: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": "b76a84b3047... |
074a4301-f7af-434b-a916-072d9da982a6 | AyushAcharya07/CNSL | Go_Back_N.cpp | # include <iostream>
# include <ctime>
using namespace std;
class ARQ
{
public:
int n,size;
int frames[50];
bool acknowleged[50];
void input()
{
cout<<"\nEnter the no. of frames : "<<endl;
cin>>n;
cout<<"\nEnter the frames : "<<endl;
for (int i=0;i<n;i++)
... | ALGO | 0.985167 | 3.994594 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-08-11T14:05: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": "3726689e6d2... |
020868ca-38e5-417f-9033-f4961fd07aa1 | YannisLamp/crypto-recommendation | lib/crypto_rec.hpp | #ifndef CRYPTO_REC_HPP
#define CRYPTO_REC_HPP
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <cmath>
#include <ctime>
#include "./data_structures/cust_vector.hpp"
#include "./data_structures/tweet.h"
#include "lsh_cube.hpp"
/*
* Different essential functions used for cryp... | ALGO | 0.993983 | 7.302256 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-01-03T15:36: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": "6d3889673... |
7843e2ec-0c1b-496c-be71-4aa82930be69 | FSwordArt/CPP_learn | Cpp_learn/模板STL/27_常用的集合算法.cpp | //#include <iostream>
//#include <vector>
//using namespace std;
//#include <numeric>
//#include <algorithm>
//
///*
//set_intersection(iterator1 begin(), iterator1 end(), iterator2 begin(), iterator2 end(), iterator vTarget.begin())
//求两个容器交集
//返回交集后最后一个元素的迭代器
//
//set_union(iterator1 begin(), iterator1 end(), iterat... | ALGO | 0.967803 | 4.43181 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-08-15T03:17: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": "9cdcca67d9... |
12ffb749-bed8-40f7-af80-e33f74d0aed9 | AlexLeungZ/EE-Notes | EE2331_2021B/Test/test2/sample1/test02_sub.cpp | /*
*
* Instructions:
*
* 1. Only complete the functions specified below.
* - Do not create any additional function.
* - Do not include any additional header or library.
* 2. Use Visual Studio 2019 to build, test and run your code.
* 3. Some test cases are provided for testing but not exhaustive. You may n... | ALGO | 0.973742 | 5.372239 | {
"github_metadata": {
"branch": "before-2324",
"commit_count": 36,
"repo_created_at": "2022-12-13T20:13:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7adb... |
b805534e-9bf5-4b98-bd60-3f35ca448d14 | classy-giraffe/unipr | solutions/t01.cpp | /*
* Author: <NAME>
*/
#include <iostream>
using namespace std;
int main() {
char a, b, c;
cout << "Inserire tre caratteri: " << endl;
cin >> a >> b >> c;
a = (a >= 'a' && a <= 'z') ? (a >= 'x' && a <= 'z') ? a - 23 : a + 3 : '*';
b = (b >= 'a' && b <= 'z') ? (b >= 'x' && b <= 'z') ? b - 23 : b ... | ALGO | 0.999763 | 4.079007 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-09-20T11:20:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6ecce07b6f2... |
1ddecef0-5286-4af8-b324-95abc5d970aa | sergarb1/Competitive-Programming-Solved-Problems | ACM-UVA/642/642.cpp | #include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
struct p
{
int orden;
char palabra[20];
}palabras[200];
int ordena_palabras(const void *a,const void *b)
{
ch... | ALGO | 0.995767 | 3.570776 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-06-17T21:52:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78ab2602e... |
8e4bd019-6b72-466a-8360-d68cbbc9e531 | shaihitdin/CP | Olymp/KBTU_OPEN_2017_SPRING/H.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int ans[N], l[N], r[N];
int main () {
freopen ("collect.in", "r", stdin);
freopen ("collect.out", "w", stdout);
ios_base :: sync_with_stdio (0);
cin.tie (0);
int n, s;
cin >> n >> s;
int amount = 0;
vector <pair <int, int> > q1;
v... | ALGO | 0.999992 | 3.02665 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2017-01-22T16:38: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": "22a56e7e9... |
c43977cb-fe83-4c70-af69-d1930ea560de | StanfordAHA/Halide-to-Hardware_archive | apps/hardware_benchmarks/apps/unet/process.cpp | #include <cstdio>
#include "conv_3_3/conv_3_3.h"
#include "conv_2_2/conv_2_2.h"
#include "conv_1_1/conv_1_1.h"
#include "down_sample/down_sample.h"
#include "up_sample/up_sample.h"
#include "hardware_process_helper.h"
#include "coreir_interpret.h"
#include "halide_image_io.h"
using namespace Halide::Tools;
using nam... | ALGO | 0.977309 | 4.47873 | {
"github_metadata": {
"branch": "master",
"commit_count": 19679,
"repo_created_at": "2019-01-23T19:25:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 81,
"forks": 13,
"issues": 30,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7eb... |
7dfb4e46-3a4f-4851-9d7f-c27e4d43434b | Sree0211/Warping-Image | main.cpp | // File to bend image on to a cylindrical projection
#include<iostream>
#include<opencv2/opencv.hpp>
#include<cmath>
using namespace std;
class WarpImage
{
private:
cv::Mat out_img;
public:
WarpImage(){}
cv::Point2f projection_point(cv::Point2f& pt, int width, int height)
{
cv::Poi... | ALGO | 0.978561 | 5.442084 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-12-29T15:03: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": "840e7da0d0b... |
2859adb9-3e5a-4253-b486-de021eaf75e3 | shivamkr022/my-codes | codeforces/codeforces/1285B.cpp | /*
------------------------------------------
| |
| Code Crafted by Shivam |
| |
------------------------------------------
\ , , /
\ | | /
\ \_/ /
\ ----- /
... | ALGO | 0.999849 | 4.803288 | {
"github_metadata": {
"branch": "main",
"commit_count": 346,
"repo_created_at": "2024-06-25T08:23: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": "2dc8d42654... |
7403296b-2bbe-4e63-8432-16dc06b4f669 | lhcezx/LeetCode_note | 哈希表/黑名单中的随机数.cpp |
// 该题目我们的目的是,从0-white_sz中等概率的随机抽取一个数字(对应题目要求的选取任意一个不在黑名单中的整数),如果选区的数字num在黑名单中,则通过哈希表保存的映射获取其对应的某个白名单数字,达到既能等概率抽取数字,又能保证不抽取到黑名单中的数字
class Solution {
int white_sz; // 我们实际上希望从白名单中等概率的选取一个随机数
unordered_map<int, int> hash_map; // 哈希表,用于保存某个黑名单的数字所应该映射到的白名单数字,用于一旦碰到该黑名单数字,直接提取其对应的白... | ALGO | 0.99931 | 5.599759 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-07-08T17:43: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": "5a745e0dcbe... |
523fc81b-9139-44d2-9859-ac9b7e895722 | Shantanu-prog/DSA | Cppbasics/TUFpatterns/pattern13/pattern13.cpp | #include<iostream>
using namespace std;
void printstar(int n)
{
int spc = 0;
for(int i = 0; i < n; i++)
{
//star
for(int str = 1; str <= n - i; str++)
{
cout << "* ";
}
//space
for(int j = 0; j < spc; j++)
{
cout << " ";
... | ALGO | 0.999939 | 4.004604 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2025-06-22T08:11: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": "3c782f439e... |
2b6db012-253f-4289-a27f-ccde9a5459fd | pranavsindura/CompetitiveProgramming | icpcarchive/2935.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl ... | ALGO | 0.999979 | 4.358337 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-01-26T05:15:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc69e3915... |
1ae43dc7-f051-451d-94a1-0943b762738a | HhTtLllL/algorithm | 图论/tree/最近公共祖先.cpp | //##################################################################
// File Name: 最近公共祖先.cpp
// File Effect:
// Author: tttt
// mail: <EMAIL>
// Created Time: 2019年11月25日 星期一 21时31分59秒
//=============================================================
//!/usr/bin/python
#include <stdio.h>
#include <stdlib.h>
#include ... | ALGO | 0.999987 | 3.603821 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2019-08-21T10:40:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd373497... |
30a27f64-09da-473a-a221-052a0043047b | tanb33r/cp-codes | assignment/2018-3-60-123 merge sort and quick sort.cpp | /*
<NAME>
2018-3-60-123
CSE241 SEC 1
*/
#include <bits/stdc++.h>
#define deb(x) cerr<<"\n"<<(#x)<<" is "<<(x)<<endl
#define ps(x) cout<<(#x)<<endl
using namespace std;
const int n = 1e5;
int arr[n],brr[n];
void printarr(int a[], int N) {
for (int i = 0; i < N; i++)
p... | ALGO | 0.99988 | 4.475504 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-03-19T08:28: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": "42a90a16d77... |
19b702d3-68c1-429c-ab2b-99a253d94b97 | AbhinavKumaar12/ModuloCounter | Lab1_Ex2_Abhinav/myCode/ModuloNCounter.cpp | /*
* @file ModuloNCounter.cpp
* @brief Implements the ModuloNCounter class methods for N digits counting
* Created on: 15 Nov 2024
* Author: <NAME> <NAME>
*/
#include "ModuloNCounter.h"
#include <iostream>
/*
* @brief Constructor for ModuloNCounter class
* It initializes values for the base and digits variable... | TOOL | 0.952782 | 6.356087 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-16T10:57: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": "07b6f18774d3... |
5bf8bf08-9da7-4549-b154-ecbe4e64d81a | QiuBiuBiu/LeetCode | C++/Jianzhi Offer/20.cpp | // 剑指 Offer 20. 表示数值的字符串
/*
诸字符判断
*/
class Solution {
public:
bool isNumber(string s) {
string str = excludeSpacing(s);
int decimalPos = getDecimalPos(str);
int ePos = getEPos(str);
if (decimalPos >= 0)
{
if (ePos >= 0) return checkDecimal(str.substr(0, ePos... | ALGO | 0.988843 | 4.777919 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2018-09-12T11:22: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": "0b672556f... |
0180b990-68db-43d4-b01a-a791d4fce050 | dannysmson/codingTestStudy | BruteForce/Q10.cpp | #include <bits/stdc++.h>
using namespace std;
// 2020 카카오 신입 공채
// 자물쇠와 열쇠 (Brute Force Alg.)
// https://programmers.co.kr/learn/courses/30/lessons/60059
// (문제는 기본 코드가 제공되므로 상기 링크를 통해서 문제를 풀어야 함)
int K, L;
// 2차원 배열 회전
void rotate_key(vector<vector<int>> &key) {
vector<vector<int>> tmp(K, vector<int>(K, 0));
... | ALGO | 0.999871 | 5.498782 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2024-03-19T05:46: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": "740f441f2a9... |
28619a90-b3d4-44c7-8965-e46100c1a041 | rjray/mscs-thesis-project | src/C++/dfa_gap.cpp | /*
C++ implementation of the (tentatively-title) DFA-Gap algorithm for
approximate string matching.
*/
#include <array>
#include <string>
#include <vector>
#include "run.hpp"
// Rather than implement a translation table for the four characters in the DNA
// alphabet, for now just let the alphabet be the full ASC... | ALGO | 0.999818 | 7.280049 | {
"github_metadata": {
"branch": "main",
"commit_count": 482,
"repo_created_at": "2022-05-26T21:37:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f29c4461d4... |
293677d9-898d-4882-b0d4-ef686ec398e3 | TimonKnigge/Competitive-Programming | ACM/cerc-2013-k.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <numeric>
#include <iterator>
#include <algorithm>
#include <cmath>
#include <chrono>
#include <cassert>
using namespa... | ALGO | 0.999986 | 3.671226 | {
"github_metadata": {
"branch": "master",
"commit_count": 430,
"repo_created_at": "2014-10-20T17:54:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 20,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0eb26... |
e9453a2a-efb3-4972-80be-168d0b68bc96 | TanushParkashVerma/Lab5 | rpn_calculator.cpp | //
// Created by tanus on 2019-10-18.
//
#include <sstream>
#include "rpn_calculator.hpp"
#include "addition_operation.hpp"
#include "subtraction_operation.hpp"
#include "multiplication_operation.hpp"
#include "division_operation.hpp"
using namespace std;
/*operation_type function*/
abstract_operation *rpn_calcula... | ALGO | 0.951356 | 4.06494 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-19T09:36: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": "93cddb5e37... |
40dbc1ed-32ca-4115-beb6-fb07fe1373d7 | atubo/online-judge | luogu/P3119.cpp | // https://www.luogu.org/problemnew/show/P3119
// [USACO15JAN]草鉴定Grass Cownoisseur
#include <bits/stdc++.h>
using namespace std;
class TarjanSCC {
struct Edge {
int to, next;
bool sign; // bridge?
};
public:
class Graph {
private:
int edgenum;
public:
const int N;... | ALGO | 0.999955 | 4.194119 | {
"github_metadata": {
"branch": "master",
"commit_count": 2295,
"repo_created_at": "2013-10-03T04:23:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "971a10e... |
7829c653-9a3b-4647-b4b8-d1379f12b8c4 | kumaran-14/cp | leetcode.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define db(x) cout << '>' << #x << ':' << x << endl;
#define all(v) v.begin(), v.end()
#define pii pair<int, int>
#define mxN 1e7
#define newl cout << "\n"
#define vi vector<int>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (en... | ALGO | 0.999962 | 4.322718 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2019-05-12T12:33:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a0bc6d12... |
02759928-5bd7-4abe-accd-c4afff5a10f1 | marko-nikolic01/DS-A_leetcode | Problems/3142. Check if Grid Satisfies Conditions/3142_check_if_grid_satisfies_conditions_cpp/main.cpp | #include <iostream>
#include <vector>
using namespace std;
bool satisfiesConditions(vector<vector<int>>& grid) {
int m = grid.size();
for(int n = grid[0].size() - 1; n > -1; --n) {
if(n > 0 && grid[0][n] == grid[0][n - 1]) {
return false;
}
for(int i = 1; i < m; ++i) {
... | TEST | 0.999836 | 6.193541 | {
"github_metadata": {
"branch": "main",
"commit_count": 717,
"repo_created_at": "2024-08-06T11:25: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": "a14f5d3cf1... |
ca64bcc5-168e-4f2e-9e46-52c180635471 | jackloera5/jack | main (34).cpp | #include <iostream> // Incluye la biblioteca para entrada/salida estándar.
// Función que suma tres enteros y devuelve el resultado.
int add(int x, int y, int z)
{
return x + y + z;
}
// Función que multiplica dos enteros y devuelve el resultado.
int multiply(int x, int y)
{
return x * y;
}
int main()
{
... | ALGO | 0.99938 | 5.239533 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-09-07T03:14:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3949927ff8e... |
d2996c28-c995-4bde-acea-2a63f2993b1b | varunswing/Leetcode | dailyChallenge/MinimumOperationstoMaketheArrayAlternating.cpp |
bool compare(const pair<int, int>&a, const pair<int, int>&b){
return a.second<b.second;
}
class Solution {
public:
int minimumOperations(vector<int>& nums) {
int ans = 0;
int sizee = 0;
int sizeo = 0;
int n = nums.size();
if(n%2 == 0){
sizee = n... | ALGO | 0.999985 | 4.934352 | {
"github_metadata": {
"branch": "main",
"commit_count": 1238,
"repo_created_at": "2022-02-28T15:37:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "762c96a27... |
a19f36d6-9545-4260-a590-9197d6928087 | 5014NG3/my_leetcode_sols | valid_parens_20.cpp | class Solution {
public:
bool isValid(string s) {
//if there is an odd number of parens
//then test fails
if(s.size() % 2 != 0){
return false;
}
//means lenght of s is > 1 and even
//if the previous test fails
std::stack<char> parens;
... | ALGO | 0.990811 | 6.476484 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2023-01-16T05:27: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": "66d12b3a652... |
2f4017bd-32ea-495d-aa40-66a0b276cea1 | raincross7/code-similarity | codes/train_code/problem232/problem232_385.cpp | //#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<stdio.h>
#define lol long long
#define gcd(x,y) __gcd(x,y)
#define mt make_tuple
#define mp make_pair
#define fi first
#define se second
#define fixed fixed<<setprecision(14)
using namespace std;
using pi... | ALGO | 0.999938 | 4.002174 | {
"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": "adcb3975cbe0... |
f59c8eec-4e69-410d-9ba5-20ea4f43c90a | Andrew-J-Li/UTPC-practice | Contests/duel.cpp | #include <bits/stdc++.h>
#define endl "\n"
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t; cin >> t;
while (t--) {
int n; cin >> n;
bool all_one = true; int prev = -1;
bool bad = false;
for (int i = 0; ... | ALGO | 0.999602 | 4.603065 | {
"github_metadata": {
"branch": "main",
"commit_count": 208,
"repo_created_at": "2024-09-15T14:42: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": "b1dc89269d... |
b203b2e8-141b-4761-a41f-8b1caec81840 | hongjianMa/cpp | Algorithm/algorithm/二分查找/二分刷题/LGP1102数对.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
#define int long long
int n, c;
int a[N], ans = 0;
int Bifind_1(int x)
{
int l = 0, r = n + 1;
while (l + 1 != r)
{
int mid = l + r >> 1;
if (a[mid] < x)
l = mid;
else
r = mid;
}
if ... | ALGO | 0.999985 | 3.992803 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2025-01-24T15:32: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": "bc3cefe5ce... |
83293dfa-75af-4e30-9d3c-972667787a72 | Tuebel/filter_bay | include/filter_bay/utility/normal_sampler.hpp | #pragma once
#include <functional>
#include <random>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <Eigen/Cholesky>
namespace filter_bay
{
/*!
Simplifies drawing from a multivariant normal distribution.
*/
class NormalSampler
{
// Drawing from multivariate normal distribution:
// https://en.wikipedia.org/w... | ALGO | 0.994447 | 6.153535 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-08-07T13:59: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": "140cb5d77... |
1c0935ee-fe40-42f2-8408-75b997ee6478 | TraiNguyenVan/learn_lord-in-c-- | test.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'simpleArraySum' function below.
*
* The function is expected to return an INTEGER.
* The function accepts INTEGER_ARRAY ar as parameter.
*/
vector<i... | ALGO | 0.99926 | 3.790323 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-07-30T12:35:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71be79480fe... |
45bcb91a-ae77-4020-916c-09853d8f8dff | j-nary/my_BOJ | 2023 SCPC/1.cpp | //증강현실 배달 안경
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int test_case() {
int N, A, B; cin >> N >> A >> B;
if (A > B) swap(A, B);
// int left = 0, right = N;
int ans = 0;
// while (left <= right) {
// int mid = (left + right) / 2;
// int tmp = N - (A * m... | ALGO | 0.999792 | 3.54751 | {
"github_metadata": {
"branch": "main",
"commit_count": 291,
"repo_created_at": "2022-07-10T14:46:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c496a787d9... |
3297fc19-4a20-4513-9bb5-419fa55de0aa | michaelarakel/local-trainings-and-upsolvings | 07.03.13/C.cpp | #include <iostream>
#include <deque>
#include <algorithm>
#include <sstream>
using namespace std;
void add (deque <int>& d1, deque <int>& d2, int num)
{
d2.push_back(num);
if (d1.size() + 2 == d2.size())
{
d1.push_back(d2[0]);
d2.pop_front();
}
}
void take (deque <int>& d1, deque <int>& d2)
{
if (d1.empty(... | ALGO | 0.999571 | 4.37107 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-08T18:24: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": "972e549058... |
f7b7f507-da76-4e33-adac-2588cb2dfc64 | nguyentuss/Competitive-Programming | CP/OnlineJudge/CodeForce/CodeForce/2050G.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma,popcnt")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define le(x) (x << 1ll)
#define ri(x) ((x << 1ll) + 1)
typede... | ALGO | 0.999662 | 4.465205 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-20T04:18: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": "e0e665d30480... |
d052cdc4-1aa8-4d66-94eb-34707ad5f77e | delwar03/CF | E_Nearly_Shortest_Repeating_Substring.cpp | #include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int mod = 998244353;
const int N = 3e5 + 10;
const int INF = 1e15 + 10;
class DisjointSet {
public:
vector<int> rank, parent, sz;
DisjointSet(int n) {
rank.resize(n + 1, 0);
parent.resize(n + 1... | ALGO | 0.999963 | 4.962177 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-12-26T03:27: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": "3ec04cbf5d... |
5558e9e8-ee3b-4c6a-a303-6c2215cfcebd | lauraippolito28/Proyecto-Tercer-corte | Conjuntos y Mapas/MapaColombia.cpp | #include <iostream>
#include <map>
#include <vector>
#include <string>
using namespace std;
using ColombiaMap = map<string, pair<string, string>>;
// Asociar departamentos con ciudades
pair<string,string> buscarCiudades(const ColombiaMap& colombia, const string& ciudad) {
auto it = colombia.find(ciudad);
if ... | TOOL | 0.989288 | 5.427511 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-04-12T19:49: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": "14387e31fa8... |
e2cfcba5-1561-427d-b25e-234c2ae3e69d | swasthianchankolya/datastructures_lab | queue.cpp | #include<iostream>
using namespace std;
class queue
{
int front,rear,max=5,arr[5];
public:
queue()
{
front=-1;
rear=-1;
}
void insert();
void delet();
void display();
};
void queue::insert()
{
int num;
if(rear==max-1)
{
cout<<"queue is full\n";
}... | ALGO | 0.984224 | 3.673532 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-03-24T18:33:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "809077fd302e... |
e4fd8c81-5d1e-4bc1-be10-1d08690d406a | arulandu/competitive-programming | archive/USACO/Contests/Silver/Wormhole.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool debug = false;
void handle_io(bool end, string filename=""){
if(end){
ios_base::sync_with_stdio(0);
cin.tie(0);
}
if(filename.length() > 0){
freopen((filename+".in").c_str(), "r", stdin);
freopen((filena... | ALGO | 0.999966 | 4.079687 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2020-11-15T00:15:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "406d7567ea3... |
4c9a42ce-d0b0-4909-9a0d-bd4b89556523 | charmingbiswas/Datastructures-And-Algorithms | Algorithms/RotateArray/main.cpp | #include <iostream>
#include <string>
#include <vector>
std::ostream& operator<<(std::ostream& os, const std::vector<int>& vec) {
for(int i : vec) {
os << i << " ";
}
os << std::endl;
return os;
}
// this function can either rotate left or right, by any number of steps
void rotate(std::vector... | ALGO | 0.999914 | 5.803694 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-09-03T16:52: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": "390a76c48bf... |
8b625c4d-e30c-4ec3-b21c-87febc7ced72 | study-kim7507/basic_algo | 프로그래머스/3/42627. 디스크 컨트롤러/디스크 컨트롤러.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;
struct cmp
{
bool operator()(const pair<int, pair<int, int>>& a, const pair<int, pair<int, int>>& b)
{
int numA = a.first;
int numB = b.first;
int reqTimeA = a.second.f... | ALGO | 0.999835 | 4.879804 | {
"github_metadata": {
"branch": "main",
"commit_count": 340,
"repo_created_at": "2024-09-25T17:19: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": "fddb61846e... |
af893b1e-ebb9-4d56-b2af-ae8a6fb52006 | eval1749/evita-common-lisp | compiler/ty/ty_00_fns.cpp | #include "precomp.h"
//////////////////////////////////////////////////////////////////////////////
//
// evcl - minilisp - type system
// compiler/ty/ty_00_fns.cpp
//
// Copyright (C) 1996-2006 by Project Vogue.
// Written by Yoshifumi "VOGUE" INOUE. (<EMAIL>)
//
// @(#)$Id: //proj/evcl3/mainline/compiler/ty/ty_00_fns... | TOOL | 0.902017 | 4.027157 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2014-08-29T13:20:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6dd5f79c3... |
4ce9599f-ceac-4a86-9942-5d97df43f2d0 | li-chiun-lin/MetaHackerCup | 2015_3/boomerang.cpp | /*
*/
#define _USE_MATH_DEFINES
#include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <cmath>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <tuple>
#i... | ALGO | 0.999868 | 4.79179 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-05-07T08:27:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "525c7aecd7c... |
1a711d68-246c-4866-a257-876544901578 | vamsig08/OS_Multithreading_5 | main.cpp | #include <iostream>
#include <fstream>
#include <thread>
#include "thread_safe_queue.h"
using namespace std;
MultiThreadSafeQueue<int> tsq;
void start_reader(const string& input_file) {
ifstream file;
string line;
file.open(input_file, ios::in);
if (file.is_open()) {
while (getline(file, lin... | TOOL | 0.940627 | 4.633909 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-04-18T04: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": "7c3960a1c9db... |
7f98cdf9-8b00-4fc5-92d9-0fd5ea8ab909 | NCTU-PCCA/NCTU_Ragnarok | contest/2016-05-04/Code/pI.cpp | /*************************************************************************
> File Name: pI.cpp
> Author: fuyu0425/a0919610611
> School: National Chiao Tung University
> Team: NCTU_Ragnorok
> Mail: <EMAIL>
> Created Time: 廿十六年五月四日 (週三) 廿一時卅分廿六秒
*********************************************************************... | ALGO | 0.999662 | 4.132179 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2016-03-30T07:49:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "95c9d3304... |
1047a849-3a99-4fca-ad21-02a23f938504 | thisisshub/HacktoberFest | folders/QUEUES/First negative integer in every window of size k - EASY.cpp | /*
First negative integer in every window of size k
Easy Accuracy: 54.27% Submissions: 12446 Points: 2
Given an array A[] of size N and a positive integer K, find the first negative integer for each and every window(contiguous subarray) of size K.
Example 1:
Input :
N = 5
A[] = {-8, 2, 3, -6, 10}
K = 2
Output :... | ALGO | 0.999847 | 5.65426 | {
"github_metadata": {
"branch": "master",
"commit_count": 3643,
"repo_created_at": "2020-09-29T10:51:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 659,
"issues": 8,
"pull_requests": 17
},
"file_meta": {
"content_id": "89f... |
38c2097c-3ecf-4501-bd19-317f4e1c9e9c | xpsa0421/Algorithm-Study | 백준/Silver/17086. 아기 상어 2/아기 상어 2.cc | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int n, m;
int len[50][50];
int map[50][50];
int visited[50][50];
void Init()
{
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
visited[i][j] = false;
}
}
}
int main()
{
ios_base::sync_with_stdio(0);... | ALGO | 0.999939 | 3.568995 | {
"github_metadata": {
"branch": "main",
"commit_count": 854,
"repo_created_at": "2023-08-17T13:54: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": "511babecd5... |
198cf489-310c-4b65-8a05-d45824ae731e | TheRensei/OpenGL-MSAA-SSAA | Resources/CoreStructures/NoiseImages.cpp | #include "NoiseImages.h"
using namespace std;
// generate an image based on Perlin noise
FloatImage *perlinNoiseImage(const Noise* P, const int w, const int h, const float scale) {
if (P)
return new FloatImage(w, h, [P, scale](int x, int y) -> float{return P->noise((float)x, (float)y, scale); });
else
return N... | ALGO | 0.943057 | 5.709389 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-05-27T12:00:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35532447e0... |
6514c0c4-f97b-4dd4-8eca-9894355a37a4 | ayushKhandelwal07/Data-Structure-and-Algorithms | Neetcode_250/Arrys__Hashing/303_range_sum_query_1d_immutable.cpp | #include<bits/stdc++.h>
using namespace std;
// Input
// ["NumArray", "sumRange", "sumRange", "sumRange"]
// [[[-2, 0, 3, -5, 2, -1]], [0, 2], [2, 5], [0, 5]]
// Output
// [null, 1, -1, -3]
class NumArray {
public:
vector<int> prefix;
NumArray(vector<int>& nums) {
prefix.push_back(nums[0]);
for(... | ALGO | 0.99965 | 6.500743 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-01-21T17:40: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": "1712235b3262... |
8263f449-7be9-4c1d-af78-a6f4577401e3 | yyj-me/problem-solving-practice | 0.notes/5.교육/day4/연습A-0022소수경로.cpp | #include <stdio.h>
#include <queue>
#define MAX_NUMBER 10000
using namespace std;
bool isPrime[MAX_NUMBER];
int visited[MAX_NUMBER];
int T, A, B;
queue<int> q;
int main() {
scanf("%d", &T);
for(int i = 2; i < MAX_NUMBER; i++) {
isPrime[i] = true;
}
for(int i = 2; i * i <= MAX_NUMBER; i++) {
... | ALGO | 0.999914 | 4.058751 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2020-07-30T23:47:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "410a72d5a... |
72f2cfe0-459e-4b08-bf86-64715f1c13fb | JustBeYou/infoarena | infoarena/probleme/euclid3.cpp | #include <bits/stdc++.h>
using namespace std;
void euclid(int a, int b, int &d, int &x, int &y)
{
if (!b) {
d = a;
x = 1;
y = 0;
} else {
int x0, y0;
euclid(b, a % b, d, x0, y0);
x = y0;
y = x0 - y0 * (a / b);
}
}
int main() {
... | ALGO | 0.999948 | 3.972372 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-04-03T11:41: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": "f0baebf26... |
1de67d02-f239-479d-a7a6-c9c648eff9a8 | chakryaros/CSCI-2270-Data-Structure | HashTable/HastTable.cpp | #include <iostream>
//#define M 8
using namespace std;
class HashTable {
private:
int M;
string** array;
public:
HashTable(int size)
{
M = size;
*array = new string[M];
for(int i=0; i<M; i++)
{
array[i]=NULL;
}
}
int hashK(char* key)
{
int i=0;
char c = key[i];
int sum =0;... | ALGO | 0.99948 | 3.215344 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-11T22:31: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": "301619f63d... |
2200561b-71b8-4a36-9cd4-9a033c7c8ea2 | TrungPBT/CPP_GiaiPTBac1 | CPP_GiaiPTBac1.cpp | // CPP_GiaiPTBac1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
double tong(double a, double b) { return a + b; }
double hieu(double a, double b) { return a - b; }
double tich(double a, double b) { return a * b; }
... | TOOL | 0.980025 | 3.923952 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-06-17T12:00: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": "dc67c101e7... |
6251b68a-21b9-4b35-83fe-aff4df4450e7 | raghu-yemmanuru/code4fun | mod_arthematic/mod_inverse.cpp | #include <iostream>
#include <cmath>
using namespace std;
//explanation:
// d = gcd(a,b); d = a*x + b*y;
// gcd(a,b) = gcd(b%a,a)
// a*x + b*y = (b%a)*x' + a*y'
// a*x + b*y = (b-[b/a]*a)*x' + a*y'
// a*x + b*y = a*(y'-[b/a]*x') + b*x'
// Thus x = (y'-[b/a]*x') and y = x'
int gcd(int a, int b, pair<int,int> &p) {
... | ALGO | 0.999966 | 3.801031 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2015-01-12T03:48: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": "1bc67f1543... |
a3d29cd6-053c-4326-85d9-7dbeac890c1e | mirinta/leet_code | linked_list/0147_insertion_sort_list.cpp | #include <climits>
/**
* Definition for singly-linked list.
*/
struct ListNode
{
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode* next) : val(x), next(next) {}
};
/**
* Given the "head" of a singly linked list, s... | ALGO | 0.999993 | 6.266876 | {
"github_metadata": {
"branch": "master",
"commit_count": 1725,
"repo_created_at": "2023-04-09T12:48:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c733e51... |
f580a210-f9d9-45cb-afcd-8279ce3716c4 | ZiadGamalDev/schedule-algorithms-operating-system | scheduling-algorithms.h | #pragma once
#include <bits/stdc++.h>
using namespace std;
struct Process {
char name;
int arrivalTime, burstTime2, burstTime, finishTime, turnaroundTime, waitingTime;
};
bool arrivalSort(Process x, Process y) {
return x.arrivalTime < y.arrivalTime;
}
bool burstSort(Process x, Process y) {
return x.burstTime2 < ... | ALGO | 0.9997 | 3.720995 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-05-06T05:04:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03163165c9d1... |
9055a026-2216-4078-b14f-0dc7c2ec84d2 | jianingxu1/EDA | 4. Exhaustive Search/P24674/P24674.cc | #include <iostream>
#include <vector>
using namespace std;
class Permutations {
public:
Permutations(int n);
void solve();
private:
int n;
vector<string> sol;
vector<string> words;
vector<bool> wordIsUsed;
void printPermutation() const;
void backtrack(int i);
};
Permutations::Permutati... | ALGO | 0.999911 | 5.06079 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-01-19T00:03: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": "8643e35d2e83... |
3c39c2a3-6ff4-45e0-8093-954dee0dab6f | dcseal/finess | apps/2d/mhd/rotated_shock_tube/QinitFunc.cpp | #include <cmath>
#include <iostream>
#include <fstream>
#include "dogdefs.h"
#include "IniParams.h"
// This is a user-supplied routine that sets the
// initial conditions at all the points "xpts"
//
void QinitFunc(const dTensor2& xpts, dTensor2& qvals)
{
const int numpts=xpts.getsize(1);
const double gamma1 =... | ALGO | 0.942103 | 3.710662 | {
"github_metadata": {
"branch": "master",
"commit_count": 478,
"repo_created_at": "2022-02-23T19:41: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": "3d1b19d9... |
a243d0b9-66a8-402e-99cc-5e1715caf2fb | chenty0704/ABRSimulation360 | modules/ViewportPredictionSimulator.ixx | export module ABRSimulation360.ViewportPredictionSimulator;
import System.Base;
import System.Math;
import System.MDArray;
import System.Parallel;
import ABRSimulation360.Base;
import ABRSimulation360.ViewportPredictors.IViewportPredictor;
import ABRSimulation360.ViewportPredictors.ViewportPredictorFactory;
using na... | ALGO | 0.999455 | 6.830412 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-04-24T19:00: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": "c5753634a6d... |
f9f7fa4f-e58b-40be-b598-b6b6c2ab97c4 | plibither8/iiitd_cse222-ada | labs/3/a1.cpp | #include <iostream>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
int t[n];
for (int i = 0; i < n; i++) cin >> t[i];
int ans = -1;
int mid, low = 1, high = t[n-1] - t[0];
while (high >= low) {
mid = (low + high) / 2;
int prev = t[0], count = 1;
for (int i = 1; i < n && count <... | ALGO | 0.999997 | 4.041561 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-01-31T05:01: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": "ad5b601402... |
381d52c7-5ef7-496e-94b4-fa21db8706b6 | juny1905/2018_algorithm | 2018_algorithm/Lecture_180911/Queue/main.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAX_QUEUE_SIZE 10 // 실제론 9개까지 저장 가능.
int queue[MAX_QUEUE_SIZE];
int front = 0, rear = 0;
int isQueueFull() {
if (front == (rear + 1) % MAX_QUEUE_SIZE) {
return 1;
}
else {
return 0;
}
}
int isQueueEmpty() {
if (front == rear) {
return 1;
}
else {
return ... | ALGO | 0.996485 | 3.991104 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-12T01:12: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": "af468d011e... |
cfd91b2e-c114-4b5c-9eaa-bf186d659509 | NERSC/timemory | source/timemory/ert/kernels.hpp | // MIT License
//
// Copyright (c) 2020, The Regents of the University of California,
// through Lawrence Berkeley National Laboratory (subject to receipt of any
// required approvals from the U.S. Dept. of Energy). All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy... | ALGO | 0.958433 | 7.49401 | {
"github_metadata": {
"branch": "develop",
"commit_count": 1235,
"repo_created_at": "2018-01-12T17:10:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 362,
"forks": 38,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ade0... |
2c8bbd60-b5c0-48e6-9475-d77c6a14f20b | Fiaze-SHU/XPSC-Problem-Solving | Week 4/Day 6/D_Right_Left_Wrong.cpp | #include <bits/stdc++.h>
#define int long long
#define float double
#define endl '\n'
using namespace std;
int32_t main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
... | ALGO | 0.999515 | 4.166668 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2024-10-26T08:14:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb8b228d860... |
8e9f5df5-64cc-4180-8a67-5840ca2b5475 | RIKEN-RCCS/tmblas | src/trmv.hpp | //Copyright (c) 2022-2023, RIKEN Center for Computational Science. All rights reserved.
//SPDX-License-Identifier: BSD-3-Clause
//This program is free software: you can redistribute it and/or modify it under
//the terms of the BSD 3-Clause license. See the accompanying LICENSE file.
// Copyright (c) 2017-2022, Univers... | ALGO | 0.940639 | 6.921181 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-08-18T01:59:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "653c34a1749e2... |
88d702ca-cfbe-431e-ab10-dec887fbb7a5 | AndrewWang996/6.839-final | ExternalLibs/cinolib/include/cinolib/tangent_space.cpp | /*********************************************************************************
* Copyright(C) 2016: <NAME> *
* All rights reserved. *
* ... | ALGO | 0.944849 | 7.035114 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-12-09T21:18: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": "1cfc93bd6... |
a36dd01f-3137-43fe-aae1-1073459b42cb | opencv/opencv_attic | opencv/modules/video/include/opencv2/video/background_segm.hpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.984549 | 7.07754 | {
"github_metadata": {
"branch": "master",
"commit_count": 7903,
"repo_created_at": "2012-07-26T08:08:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 49,
"forks": 62,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe1747... |
ac951e38-2325-48a8-9be4-8ceb0515569e | tykr0001/algorithm | BOJ/2638.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M;
int flag = 0;
int answer = 0;
vector<vector<int>> graph;
int dx[4] = { -1,1,0,0 };
int dy[4] = { 0,0,-1,1 };
bool BFS(vector<vector<int>>& graph) {
answer++;
vector<vector<bool>> visited(N, vector<bool>(M, false));
vector<vector<int>> cnt(N, vector... | ALGO | 0.99999 | 4.492447 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2020-09-20T04:57: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": "981a2bc8... |
7db6707c-d323-471d-b99c-4c9603db5180 | ssube/VoodooVox3D | Common/CommonTypes.hpp | #pragma once
#include "CommonDefs.hpp"
namespace Common
{
# define INDEX2(o, n) o[n.x][n.y]
# define INDEX3(o, n) o[n.x][n.y][n.z]
# define INDEX4(o, n) o[n.x][n.y][n.z][n.w]
typedef unsigned __int8 uint8;
typedef __int8 int8;
typedef unsigned __int16 uint16;
typedef __int16 ... | TOOL | 0.936826 | 4.188144 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2011-09-14T21:40:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f8d28825... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.