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 |
|---|---|---|---|---|---|---|---|
ebdd65bc-e990-4860-a15a-da84c61d82bf | LittleYang0531/CQ-CSP-S-2022 | CQ-S00055/transmit/transmit.cpp | #include<bits/stdc++.h>
using namespace std;
long long N,Q1,K,a[200005],A,B;
int hd1[200005],nxt1[400005],to1[400005],hi1;
int hd[200005],nxt[10000005],to[10000005],hi;
void make_edge1(int x,int y) {
hi1++;
nxt1[hi1]=hd1[x];
hd1[x]=hi1;
to1[hi1]=y;
}
void make_edge(int x,int y) {
hi++;
nxt[hi]=hd[x];
hd[x]=hi;
... | ALGO | 0.999964 | 3.9477 | {
"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": "52cfab2b41f0... |
f1d92ada-4d95-4b32-85ac-a485f8e22773 | higumachan/sato | model.hpp |
class Agent
{
public:
Agent()
{
memset(image, 0, sizeof(image));
memset(learn, 0, sizeof(learn));
}
int init(int id)
{
this->id = id;
age = 0;
stock = COMMODITY;
set_hierarchy();
}
int set_hierarchy()
{
double hierarchy[3] = {POOR, COMMON, RICH};
discrete_distribution<std::size_t> dist(hierar... | ALGO | 0.953693 | 4.109887 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-08-06T06:43: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": "b0d933b472... |
b13781b0-afd0-4d76-ba39-b431db40f0fa | RohanLali/DSA | 1 -Array/String/string_compress.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
string compress(string s){
int n=s.length(), ansInd=0, i=0;
string resultS;
while(i<n) {
int j=i+1;
while(j<n && s[i]==s[j]) j++;
resultS.push_back(s[i]);
ansInd++;
int count=j-i;
if(c... | ALGO | 0.999985 | 4.410937 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-06-04T19:06: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": "2fdc91448de... |
7e7c42ea-77ae-4bf3-9837-33402477a1b9 | PrathmeshPhatake/leetcode | 59-spiral-matrix-ii/spiral-matrix-ii.cpp | class Solution {
public:
vector<vector<int>> generateMatrix(int n) {
vector<vector<int>> matrix(n,vector<int>(n,0));
int rowstart = 0;
int rowend = n - 1;
int colstart = 0;
int colend = n - 1;
vector<int> ans;
int total = n * n;
int count = 1;
... | ALGO | 0.999951 | 6.150364 | {
"github_metadata": {
"branch": "main",
"commit_count": 1982,
"repo_created_at": "2024-02-16T10:46: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": "ac2cd27d4... |
14616272-d5e6-4548-b1f5-cc0a7da208d9 | king-yyf/cpcode | other/lanqiao/st1/c.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")
using ar2 = array<int, 2>;
using ar3 = array<int, 3>;
using ar4 = array<int, 4>;
#define all(c) (c).begin(), (c).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int... | ALGO | 0.999963 | 3.544244 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-26T03:35: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": "25a35821b76d... |
f4c2d9c6-5570-4005-874a-9ce9058fe172 | goguma1000/programmers_codingtest | baekjoon/dynamic_programming/22857[가장 긴 짝수 연속한 부분 수열 (small)].cpp | #include<iostream>
#include<vector>
int main() {
std::ios::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL);
int n, k;
std::cin >> n >> k;
std::vector<int> arr;
std::vector<int> dp(n);
for (int i = 0; i < n; i++) {
int temp;
std::cin >> temp;
arr.push_back(temp);
}
for (int i = n - 1; i... | ALGO | 0.999871 | 3.999065 | {
"github_metadata": {
"branch": "main",
"commit_count": 265,
"repo_created_at": "2023-07-11T13:43: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": "58954fffab... |
3a2335d8-7e67-4b9c-8106-ad71d42d0708 | Team8044/2019_Remix_Everybot | RobonautsLibrary/src/RobotUtil.cpp | /*******************************************************************************
*
* File: RobotUtil.cpp
*
* This file contains the definition of a class that is used to hold utility
* type methods that as of yet don't fit anywhere else.
*
* Written by:
* <NAME>
* FRC Team 118
* NASA, Johnson Space Center... | TOOL | 0.982909 | 6.532813 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-10-12T21:02:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57165966136... |
922b0666-7d21-4be7-8f34-508162a6c77a | tanishakataria/DSA | backtracking/Question 1.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
// Function to check if the current position is valid to move
bool isValidMove(int x, int y, vector<vector<int>>& mat, vector<vector<bool>>& visited, int n) {
return (x >= 0 && x < n && y >= 0 && y < n && mat[x][y] == 1 && !visited[x][y]... | ALGO | 0.999986 | 6.545189 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-08-25T13:37: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": "79c8596df24... |
318bb045-1aff-4959-be72-9c5c727a1ed6 | madhur3u/DSA-Questions | LeetCode/876 Middle of the Linked List/traversal.cpp | // https://leetcode.com/problems/middle-of-the-linked-list/
/**
* 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) {}... | ALGO | 0.999916 | 6.294346 | {
"github_metadata": {
"branch": "main",
"commit_count": 448,
"repo_created_at": "2021-11-05T14:07: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": "37c616e302... |
8f34d253-6497-4c96-a853-304416eef2d5 | emes-g/Algorithm | Intermediate02/BJ16988.cpp | #include <iostream>
#include <queue>
#include <tuple>
#include <cstring>
using namespace std;
int n, m, a[20][20], ans;
int dx[4] = { -1,1,0,0 };
int dy[4] = { 0,0,-1,1 };
bool check[20][20];
// <알고리즘>
// 1. 바둑돌 2개를 둘 위치 선정 (브루트 포스)
// 2. 이후, 죽일 수 있는 상대 돌 개수를 확인 (DFS/BFS)
// 3. 최댓값이면 갱신
// 시간 복잡도 : O((NM)^3)
int bfs(... | ALGO | 0.999089 | 4.425202 | {
"github_metadata": {
"branch": "main",
"commit_count": 537,
"repo_created_at": "2024-03-25T11:43: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": "88a5fda3b9... |
3c5a8f1c-b705-4ab5-80a8-053bb12e9d8c | manleKim/codingTest | 1주차_다시풀기/2309_일곱난쟁이.cpp | // 문제
// 왕비를 피해 일곱 난쟁이들과 함께 평화롭게 생활하고 있던 백설공주에게 위기가
// 찾아왔다. 일과를 마치고 돌아온 난쟁이가 일곱 명이 아닌 아홉 명이었던 것이다.
// 아홉 명의 난쟁이는 모두 자신이 "백설 공주와 일곱 난쟁이"의 주인공이라고
// 주장했다. 뛰어난 수학적 직관력을 가지고 있던 백설공주는, 다행스럽게도 일곱
// 난쟁이의 키의 합이 100이 됨을 기억해 냈다. 아홉 난쟁이의 키가 주어졌을 때,
// 백설공주를 도와 일곱 난쟁이를 찾는 프로그램을 작성하시오.
// 입력
// 아홉 개의 줄에 걸쳐 난쟁이들의 키가 주어진다. 주어지는 ... | ALGO | 0.999931 | 3.851654 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-04-20T06:41: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": "905807d9aee... |
62c19983-725f-46b7-8b78-bebb386917af | pritamchaudhary/DSA-Supreme-2.O | Week 17 dynamic programming/class 4/longestPalindromicSubsequence.cpp | // leetcode 516. Longest Palindromic Subsequence
// Given a string s, find the longest palindromic subsequence's length in s.
// A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
#include<iostream>
#include<vect... | ALGO | 0.999951 | 6.240766 | {
"github_metadata": {
"branch": "main",
"commit_count": 234,
"repo_created_at": "2023-09-07T16:08:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "113b5b9064... |
ddb8ed34-cd2c-4445-a7b3-f96727ad7be9 | nexuslrf/DS_homework | 9/1054_treap_others.cpp | #include<cstdio>
#include<iostream>
#include<cstdlib>
using namespace std;
int delta, n, m, leave;
struct Treap{
struct Node{
int v, r, s;
Node* ch[2];
int cmp(int x) const{
if(x == v) return -1;
else return x < v ? 0 : 1;
}
void maintain(){
... | ALGO | 0.999863 | 3.362287 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-01-22T11:47:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c547b9b2f... |
e7cb1e4a-c395-43a6-8deb-07d18c2b8da4 | uzairakram0/DS_Stack_RLL | Asignment2/postfixEval.cpp | #include "stack.hpp"
#include <string>
using namespace std;
int main(){
freopen("input_postfixEval.txt", "r", stdin);
string s;
int solution;
int line_counter = 0;
while(cin>>solution){
cin>>s;
Stack<int> stack;
// The input file is in the format "expected_solution postfix_expression"
// ... | ALGO | 0.997649 | 4.605933 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-06-04T18:59: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": "706f2aa57e... |
14163e22-67cd-43f7-8a98-2b21832b5223 | poparrish/BenderVectorControl | TeensyJoy/TeensyJoy.ino |
/* This software will control the four hub motors of the wheels and the four turn motors for the wheels.
* Also it will feed back current speed and direction for each wheel. For now the getDesiredInfo()and writeCurrentInfo()mehtodws will be
* a shell until that software has been completed. We could also easilty... | TOOL | 0.915273 | 3.971466 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2018-07-24T13:37:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19bc523fa... |
6bf94cb6-5541-4afd-8b58-d4e1d32022df | Rownokk/Ball_Bounce | iMain - Copy.cpp | #include "iGraphics.h"
#define screenWidth 700
#define screenHeight 700
int rd = 20, rd1 = 20;
int count = 0;
float x = rd, y = 350;
float dx = 0.2, dy = 0.2;
float x_1 = 350, y_1 = rd1;
float dx_1 =0.2, dy_1 =0.2;
// Collision detection function
int col() {
if ((x + rd + rd1 > x_1 && x < x_1 + rd1 + rd) && (y ... | ALGO | 0.989447 | 4.486687 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-03-23T10:43: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": "326440bb2b39... |
64dbb366-e2ba-480c-a91a-0c0af6e8a08a | Anguei/OI-Codes | LuoguCodes/SP5.cpp | //【SP5】PALIN - The Next Palindrome - 洛谷 - Ac
#include <string>
#include <iostream>
#include <algorithm>
////inline bool is_huiwen(int x) {
//// /*register int temp = x;
//// register int y = 0;
//// while (x) {
//// y = y * 10 + x % 10;
//// x /= 10;
//// }
//// return temp == y;*/
////}
//
//inline void inc(std::st... | ALGO | 0.999722 | 4.416522 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-14T14:22:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14d93c074e... |
e7419594-6357-442a-ab83-28f42c54dc4f | SHIVANSH-A/DSA | DP/Leetcode/SolvingQuestionsWithBrainpower.cpp | // You are given a 0-indexed 2D integer array questions where questions[i] = [pointsi, brainpoweri].
// The array describes the questions of an exam, where you have to process the questions in order (i.e., starting from question 0) and make a decision whether to solve or skip each question. Solving question i will ear... | ALGO | 0.999977 | 6.016722 | {
"github_metadata": {
"branch": "main",
"commit_count": 233,
"repo_created_at": "2024-12-07T04:52:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "096e525277... |
b62023bb-a86b-4da3-a25d-d7a6526a9e85 | vansh-joshi1/Hangman | hangman.cpp | // Lab 8 - Hangmam
// <NAME>
// 05-07-2024
// This is a 2 player hangman game where the 1st player can pick a word and the 2nd player has to guess the word. If the 2nd cannot guess the word then they lose.
// used copilot to help understand the logic of hangman. I also used it to help me compile all the files together ... | ALGO | 0.9975 | 3.733028 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-10T21:12: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": "0f879f2c0f75... |
43cbc155-d069-4cb0-986e-d8f62531bc77 | fogleman/hmm | src/triangulator.cpp | #include "triangulator.h"
#include <algorithm>
Triangulator::Triangulator(const std::shared_ptr<Heightmap> &heightmap) :
m_Heightmap(heightmap) {}
void Triangulator::Run(
const float maxError,
const int maxTriangles,
const int maxPoints)
{
// add points at all four corners
const int x0 = 0;
... | ALGO | 0.997972 | 7.247712 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2019-08-22T02:42:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 594,
"forks": 53,
"issues": 11,
"pull_requests": 2
},
"file_meta": {
"content_id": "7ceef... |
b6acb4f2-11b6-4659-9c64-1439aa3adc59 | kk-source/DSA-Practice-Repo | My DSA Practice/Binary Search Tree/insert.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int k){
data=k;
left=right=NULL;
}
};
Node *insert(Node *root, int key){ // iterative.
if (root==NULL){
root=new Node(key);
return root;
}
Node *curr=... | ALGO | 0.999945 | 5.018193 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2021-06-01T13:52:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cbe36bea... |
701f4976-ed50-4ba0-a4f1-4d3ac753a67c | 7hokerz/bakjoon | bakjoonmoeum(C++)/그외 유형/자료구조/스택/28278번(황당..).cpp | #include <iostream>
#define MAX_STACK_SIZE 1000000//계속 틀렸던 이유가 size가 부족해서...ㅋㅋㅋ
using namespace std;
//typedef int element;
class stack{
long long top;
unsigned long long data[MAX_STACK_SIZE];
public:
stack(){//기본 생성자
top = -1;
}
int is_empty(){
return (top == -1);
}
int i... | ALGO | 0.997819 | 4.220952 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2024-05-02T12:50: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": "aff84d5dc3d... |
154a9652-047e-4593-ae89-2f5f62cc9099 | islamifelipe/BiST_hybrid_algorithms2 | NSGAII_PLS/SolucaoEdgeSet.cpp | #ifndef SOLUCAOZG_CPP
#define SOLUCAOZG_CPP
/*This code file was kindly provided by Monteiro */
#include <cstdio>
#include <queue>
#include "Solucao.cpp"
#include "UnionFind.cpp"
#include "param.h"
#include "auxEdgeStruct.h"
#include <algorithm>
#include <iostream>
#include <math.h>
using namespace std;
extern dou... | ALGO | 0.99993 | 3.426976 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2017-05-24T18: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": "13078a44... |
2aed3036-c75b-4875-9d43-5dc429096f57 | DenverNg/CSC10007_Process-Sheduling | Source-Code/Scheduler.cpp | #include "Scheduler.h"
Scheduler::Scheduler(string inputFile) : upcomingProcesses(Process::ArrivalTimeCompare)
{
ifstream inp(inputFile);
if (!inp.is_open())
{
cout << "Error: Unable to open input file" << endl;
return;
}
int type;
inp >> type;
cout << "Type: " << type << e... | ALGO | 0.964461 | 4.260126 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-01-24T10:22: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": "a68ecb0d258... |
2ebc0a40-e659-417f-9e73-6c1f6a354298 | gregxsunday/Matura-2016-zadanie-6 | main.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
const char alf[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int round_key(int key, int char_index) //rounding key NOT using modulo allowed me to use negative keys
{
int result = key + char_index;
while(result < 0 || result > 25)
{
... | ALGO | 0.99881 | 3.174479 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-05-29T12:57:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b379423d1... |
9b5c78c6-d01b-410f-b44b-f4c85f4e966d | Niko1879/AoC2021 | aoc/3/main.cpp | #include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include "count.h"
#include <limits.h>
#include "IO.h"
int main()
{
std::vector<std::string> lines = IO::ReadLines("input.txt");
std::vector<std::string> transposes = Transpose(lines);
std::stringstream epsilonGammaBuf;
... | ALGO | 0.998241 | 5.411551 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-12-01T05:02:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac5941c00979... |
a14ff95a-5846-4a2f-9502-41520931db13 | creme332/permutations-and-combinations | CyclicPermutationProblem.cpp | #include <iostream>
#include <vector>
#include <set>
#define ll long long
using namespace std;
set <int> UpdatedSet(set <int> Available, int key) {
//Removes key from set and returns updated set
Available.erase(key);
return Available;
}
ll count(vector <int> sector, int i, set <int> Available, int maxsum... | ALGO | 0.999639 | 3.655293 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-02-05T17:40: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": "d903c813f8c... |
90e8922a-4efd-4aea-84ed-9cc35a339d0b | arthurvtrr/AA-Problems-Solved | codeforces/Maze (377A).cpp | #include <stdio.h>
#include <stdlib.h>
int n, m, k, remain;
bool test[550][550];
char maze[550][550];
using namespace std;
void dfs(int l, int c) {
test[l][c] = true;
remain -= 1;
if (remain == 0)
return;
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
if (ab... | ALGO | 0.999978 | 3.628049 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2015-09-18T11:53:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85bad5514... |
3cb70609-57ab-4c4a-b04d-6807175e6af7 | pcentieiro/midian | Face Recognition Library/ThirdParty/OpenCV/modules/stitching/seam_finders.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.952057 | 6.310503 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2012-03-29T01:05:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 11,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "0451f59... |
6e25a9eb-a66b-418b-9c08-f9e1f71ecd33 | mohitGitHxb/DataStructuresAndAlgo | Contests Upsolving Leetcode and GFG/Searching Sorting/heaps and Greedy/Patching Array POTD.cpp | #include <bits/stdc++.h>
using namespace std;
/*
* CUSTOM hash function which avoids collisions and hence makes unordered maps / sets faster
*/
struct custom_hash
{
static uint64_t splitmix64(uint64_t x)
{
// http://xorshift.di.unimi.it/splitmix64.c
x += 0x9e3779b97f4a7c15;
x = (x ^ (x... | ALGO | 0.999935 | 4.328108 | {
"github_metadata": {
"branch": "master",
"commit_count": 478,
"repo_created_at": "2022-10-20T15:10:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a29b87a1... |
4a37a252-9f89-481a-984a-3e98555cf4a7 | mdsaniulbasirsaz/VirtualJudgeProblemSolve | LightOJ/1062/40687684_AC_5ms_576kB.cpp | /* Md <NAME>
Department Of Computer Science and Engineering
Jashore University Of Scinece and Technology
Student Id: 200103
Email: <EMAIL>
Mobile: 01306032236 */
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<set>
#include<queue>
#include<bits/stdc++.h>
#include<stri... | ALGO | 0.999545 | 3.500581 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-07-18T06:29: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": "306550969b2a... |
ffafd7f3-174a-4434-b033-10f5768b8edd | upple/BOJ | src/17000/17136.cpp17.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF=1e9;
bool arr[12][12];
int p[]={5, 5, 5, 5, 5};
int global_min=INF;
int solve(int x, int y, int c)
{
for(int i=x; i<=10; i++)
{
for(int j=y; j<=10; j++)
{
if(arr[i][j]==0) continue;
if(c+1==global_min) return c+1;
... | ALGO | 0.999731 | 4.195786 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2018-04-09T13:53:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "970fc3093... |
516dc491-2503-4e48-a4bc-bc3e4dbb0c68 | MadPidgeon/Hyle | bot/ai/lib.cpp | #include <limits>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cassert>
#include <unistd.h>
#include <sys/time.h>
#include "lib.h"
using namespace std;
Board::Board(){
memset(bd,-1,SIZE*SIZE);
static_assert(sizeof(bag[0])==1, "fix the memset below");
memset(bag,SIZE,SIZE);
}
bool Board::full... | ALGO | 0.993272 | 4.350803 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-06-28T10:10: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": "987801b70... |
f9d17ff3-039d-4203-8d37-ce2325295b8e | herumi/misc | sve/double-vec.cpp | #include <xbyak_aarch64/xbyak_aarch64.h>
using namespace Xbyak_aarch64;
void sqrAdd(double *z, const double *x, const double *y, size_t n)
{
for (size_t i = 0; i < n; i++) {
z[i] = x[i] * x[i] + y[i];
}
}
struct Code : CodeGenerator {
void genScalar()
{
Label check;
const auto& out = x0;
const auto& src1... | ALGO | 0.974315 | 5.716827 | {
"github_metadata": {
"branch": "main",
"commit_count": 1553,
"repo_created_at": "2012-11-28T13:00:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 61,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "658ff459... |
176c5c6d-3ef3-4ddb-9eb9-af9c58febcab | Deadly-Smile/Practice-Code | My Library/Math/Segmented-Sieve-Primes.cpp | //----------------------Created by <NAME>---------------------------//
#include <bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL)
#define Ignore cin.ignore()
#define PF push_front
#define PB push_back
#define MP make_pair
typedef unsigned char Byte;
typedef long lon... | ALGO | 0.999941 | 3.672401 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-06-05T23:08:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9061dd56a... |
b97a2ddc-0818-4cd4-9e75-f984e44bd4db | sawenzel/VecGeom | USolids/include/UIntersectingCone.hh | //
// ********************************************************************
// * This Software is part of the AIDA Unified Solids Library package *
// * See: https://aidasoft.web.cern.ch/USolids *
// ********************************************************************
//
// $Id:$
//
// -----------... | TOOL | 0.974205 | 5.88031 | {
"github_metadata": {
"branch": "master",
"commit_count": 2217,
"repo_created_at": "2014-01-17T20:30:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2fcdcc... |
1254dab9-c1a2-41f2-8914-b5cccc00e3bc | vgoncharenko/algorithms | validate_binary_search_tree_test.cpp | //
// Created by Vitaliy on 2019-09-26.
//
#include "validate_binary_search_tree.cpp"
void runTestValidateBinarySearchTree(std::string variationName, std::string &input, bool expected) {
TreeNode *root = stringToTreeNode(input);
ValidateBinarySearchTree *solution = new ValidateBinarySearchTree();
bool result = ... | TEST | 0.962041 | 6.301944 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2019-09-25T15:32: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": "bf39dcf6f... |
ae3c3241-1526-455b-b8c4-e275aa063c44 | abdulrasaqzainab/COS110 | Assignment 3/CLinkedList.cpp | #ifndef CLINKEDLIST_CPP
#define CLINKEDLIST_CPP
#include "CLinkedList.h"
template<class T>
CLinkedList<T>::CLinkedList()
{
this->head=NULL;
}
template<class T>
CLinkedList<T>::~CLinkedList()
{
//delete all nodes
/*if(this->head == NULL)
{
return;
}
Node<T>* curr=this->head;
Node<... | TOOL | 0.930472 | 4.715767 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-03-13T11:08: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": "b32f442dfd8d... |
eb0805eb-8608-4d8f-846d-18779dbc245f | ernestyalumni/HrdwCCppCUDA | Voltron/Source/Algorithms/Sorting/InsertionSort.h | #ifndef ALGORITHMS_SORTING_INSERTION_SORT_H
#define ALGORITHMS_SORTING_INSERTION_SORT_H
#include <algorithm> // std::swap
namespace Algorithms
{
namespace Sorting
{
namespace InsertionSort
{
//------------------------------------------------------------------------------
/// \details Compare this against pseudo-cod... | ALGO | 0.999979 | 7.096513 | {
"github_metadata": {
"branch": "master",
"commit_count": 690,
"repo_created_at": "2017-11-01T01:08:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49c2a311... |
3f7d9559-4c74-4519-9e7e-bebcb74949af | li-chiun-lin/ProjectEuler | 121-Disc_game_prize_fund.cpp | /*
35%
<p>A bag contains one red disc and one blue disc. In a game of chance a player takes a disc at random and its colour is noted. After each turn the disc is returned to the bag, an extra red disc is added, and another disc is taken at random.</p>
<p>The player pays £1 to play and wins if they have taken more blue... | ALGO | 0.999915 | 5.070678 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-05-07T08:41: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": "9d674eddd11f... |
772569a6-778a-4635-b663-75a25c1fe742 | hypochoco/sat-solver | src/archive/vsids.cpp |
#include <set>
#include <random>
#include <unordered_map>
#include "decision.h"
#include "data_structures.h"
void vsids::perturb() {
// random number generation
std::uniform_real_distribution<float> dist(0.0, 1.0);
// perturb all values in map and set
std::set<std::pair<float, int>> sorted_variabl... | ALGO | 0.999882 | 5.487169 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-02-27T20:24: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": "9242191e9b4... |
f5df16f6-381d-4821-940a-8ff632b0176b | KingSlayer06/Data-Structures | Data Structures/Doubly linked list/Untitled1.cpp | /*doubly linked lists*/
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node* left;
struct node* right;
};
struct node* head=NULL;
int len;
void append(void);
void display(void);
void reverse(void);
void addatbegain(void);
int length(void);
void addatafter(void);
void del(void);
int main()
{
... | ALGO | 0.998698 | 4.378245 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-03-18T16:30:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5adfef2ef... |
3db9779a-03d9-4b4c-a4f2-721d640510b8 | tr4n/data-structure-and-algorithm | solve-algorighm-problems/ntucoder-c/QN4_NTU.cpp | #include<iostream>
#define _p(i,j) i*m + j
using namespace std;
int a[1003][1003];
int N, M, T;
int X[]= {1,0,-1,0};
int Y[]= {0,1,0,-1};
inline int Sub(int a, int b)
{
if(a > b) return 1;
else return 0;
}
void floodfill(int x , int y)
{
if(a[x][y] == 0)
return ;
else
a[x][y] = 0;
for(int i = 0 ;i ... | ALGO | 0.999483 | 3.617794 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2017-10-28T10:28:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e8853731... |
1a67663a-595a-447f-b1cf-66a733e35048 | MasterYI814/WES237C | project3_submission/dft256_dataflow/dft.cpp | #include<math.h>
#include "dft.h"
#include"coefficients256.h"
#include "stdio.h"
void get_cos_sin(int i, int j, DTYPE *c, DTYPE *s)
{
int k;
k = (i*j)%SIZE;
*c = cos_coefficients_table[k];
*s = sin_coefficients_table[k];
// printf("c is %f \n", *c);
}
void real_imag_calc(int i, int j, DTYPE *real_sample, DTYPE... | ALGO | 0.999206 | 4.281814 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2023-10-20T02:15: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": "9ddfe5ca73d... |
a0d93695-325b-4659-9cbe-7181491cf456 | GwokHiujin/BUAA_SE_PairProgramming | src/test/randomTest.cpp | #include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <unordered_set>
#include <algorithm>
#include <random>
#include <ctime>
#include <sstream>
#include <cassert>
#include <ctime>
#include "../include/engine.h"
#include "../include/paramParser.h"
using namespace std;
const int randomN = 100... | ALGO | 0.993563 | 3.28749 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2023-03-04T10:49:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e324667e11... |
17698c3c-673d-4fbc-8f90-209ab078a289 | khushi-411/learnings | cpp/sum_array.cpp | // https://stackoverflow.com/questions/20163469
#include <iostream>
/*template <class T>
T sum_array(T (&a)[10], int size) {
T result = 0;
for (int i = 0; i < size; i++) {
result = a[i] + result;
}
return result;
}
int main() {
int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
std::cout << ... | ALGO | 0.983515 | 5.345552 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-02-20T09:37:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 10
},
"file_meta": {
"content_id": "ee900c4ed5... |
4c20b700-208f-44f1-9f8c-c4ec361b1335 | physicalist/ncbs-moose | packaging/moose_3.0.1/randnum/Normal.h | /*******************************************************************
* File: Normal.h
* Description: Generates random numbers with normal
* distribution.
* Author: <NAME>
* E-mail: <EMAIL>
* Created: 2007-10-30 11:22:51
******************************... | ALGO | 0.992115 | 3.620172 | {
"github_metadata": {
"branch": "master",
"commit_count": 6601,
"repo_created_at": "2015-03-02T10:18: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": "4613eee... |
0cabae9d-e611-45a9-b22a-c5534cf386e8 | marklang1993/CS486 | a1/sudoku_fc.cpp | #include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <random>
#include <list>
#include <vector>
#include <sys/types.h>
#include <unistd.h>
#define IS_VALID(pos, val) ((((1 << pos) >> 1) & val) != 0)
#define SET(pos, val) val = val | ((1 << pos) >> 1)
#define CL... | ALGO | 0.999926 | 4.834258 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2017-05-17T22:48:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e44e29e6a... |
b11e01a7-8ccd-4015-b8ff-fe87a8d9d1c3 | Nonlinear-Analysis-Core/nonanR | src/Ent_Samp.cpp | #include <RcppArmadillo.h>
using namespace Rcpp;
// [[Rcpp::depends(RcppArmadillo)]]
//' Sample Entropy
//'
//' Calculate the sample entropy of a time series.
//'
//' @param x A single column time series
//' @param m The length of the vectors to be compared for matches
//' @param R The radius for accepting mat... | ALGO | 0.997316 | 6.492284 | {
"github_metadata": {
"branch": "main",
"commit_count": 237,
"repo_created_at": "2023-11-21T15:14:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4f44289600... |
3a256317-50f9-42d1-8636-57e9e6cfeee9 | colinrford/bitvector | cpp/eratosthenes.cpp | /* <NAME>
*
* This is a Sieve of Eratosthenes implementation that I based off of
* another implementation I found online.
*
* The Sieve of Eratosthenes is an ancient but efficient method of
* finding the prime numbers between 0 and some large number N.
*
* The Sieve of Eratosthenes works in the following way... | ALGO | 0.999651 | 5.240962 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-08-07T14:22:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "854c5d7f3... |
b5a6662c-1cee-4fb0-8893-c1daf9bdb38d | SegfaultDaddy/Raytracing | source/main.cpp | #include <cstdlib>
#include <cstdint>
#include <print>
#include <ranges>
#include <iostream>
#include <memory>
#include <chrono>
#include "hittable_list.h"
#include "vec3.h"
#include "ray.h"
#include "numeric"
#include "color.h"
#include "sphere.h"
#include "interval.h"
#include "camera.h"
#include "material.h"
int ma... | ALGO | 0.941069 | 5.858922 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-08-08T07:23: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": "bd3d390b6f6... |
8b849218-541a-43df-9757-a8f410895bab | ArthikRajBJain/QuineMcCluskey | QuineMcCluskey.cpp | #include <iostream>
#include <stdint.h>
#include "functions.h"
using namespace std;
int main()
{
char *input;
uint8_t w_size;
uint16_t *in_array, in_size;
uint16_t *ones[16], *one_size[16];
uint16_t *not_done, *not_done_size;
bool *done;
input = (char *)malloc(1000000*sizeof(char));
//Getting the input as ... | ALGO | 0.999923 | 4.140529 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2021-06-26T16:52: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": "8d4c1bf23... |
067dce3e-6d2f-4193-bb78-2dc6295756c6 | GilgameshxZero/altair | usaco/training-pages/runround.cpp | /*
ID: yangchess1
PROG: runround
LANG: C++
*/
//Description: Find first runaround number bigger than input. A runaround number is number like 81362, where when
//going number of digits on current digit, end up with first and visit every digit when starting with first. To
//be a runaround number, the number must also h... | ALGO | 0.999956 | 3.980678 | {
"github_metadata": {
"branch": "master",
"commit_count": 485,
"repo_created_at": "2021-08-08T21:45:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f07e81f6... |
57942c1e-225c-4740-9438-e117e79bb5f6 | joy-mollick/DP-Problem-Solution | Codeforces: 608C - Chain Reaction.cpp |
/// Codeforces: 608C - Chain Reaction.
/// Category: Classical dp (medium).
#include<bits/stdc++.h>
using namespace std;
const int mxn=1000001;
///dp[i] states that if ith is activated maximum number of destroyed places from 0 to i.
///So,we will check every dp[i] value,assuming ith place is active ,and other s... | ALGO | 0.999702 | 3.893688 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2019-10-03T19:37:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0c4e6a0... |
fda62c55-e1af-42d8-99cb-3ed98e9c68e3 | WASDi/teeworlds-bot | game/client/bot/strategies/blmapv3/steps/Step2_GoFromFightingAreaToUpperAreaStrategy.cpp | #include "Step2_GoFromFightingAreaToUpperAreaStrategy.h"
#include "game/client/bot/BotUtil.h"
Step2_GoFromFightingAreaToUpperAreaStrategy::Step2_GoFromFightingAreaToUpperAreaStrategy(CGameClient* client) :
BotStrategy(client) {
}
void Step2_GoFromFightingAreaToUpperAreaStrategy::execute() {
CCharacterCore* player =... | ALGO | 0.968109 | 4.979352 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2016-12-30T23:08:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a21e27314... |
e5dbdfe5-7c37-4538-817b-c25cec73e209 | hhy3/pyanns | third_party/helpa/helpa/platform/x86/l2_impl.hpp | #pragma once
#if defined(__AVX2__)
#include "helpa/l2.hpp"
#include "helpa/platform/x86/utils.hpp"
#include "helpa/ref/l2_ref.hpp"
#include "helpa/types.hpp"
namespace helpa {
inline float
l2_fp32_fp32(const float* x, const float* y, const int32_t d) {
int32_t da = d / 16 * 16;
return l2a_fp32_fp32(x, y, da... | ALGO | 0.978071 | 6.839689 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2023-10-31T14:20:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 4,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "baded64a1... |
863f99f0-b070-4b0f-a0ac-dfbc75df948a | SoftMatter-Modeling/lammps-Implementation-for-drug-delivery-modeling | bond_potential/bond_ljlr.h | /* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
<NAME>, <EMAIL>
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with San... | ALGO | 0.989394 | 4.989809 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-06-21T12:32: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": "ec35d06c0c54... |
4020442a-6338-4b18-8c9e-c3224aa74704 | sdasgup3/Leetmap | source/leetcode/Done/459_Repeated_Substring_Pattern.cpp | /*
* Problem Description
Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase English letters only and its length will not exceed 10000.
Example 1:
Input: "abab"
Output: Tru... | ALGO | 0.999506 | 5.57306 | {
"github_metadata": {
"branch": "master",
"commit_count": 351,
"repo_created_at": "2014-11-23T08:52:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a62b753... |
869a927d-3484-445d-9bc7-8521c8fec943 | hieu253/DSA_PTIT | SCTDL026.cpp | #include <iostream>
#include <vector>
using namespace std;
int getNumOfDigits(int num) { // Hàm tính số chữ số của 1 số
int count = 0;
while (num != 0) {
num /= 10;
count++;
}
return count;
}
vector<int> findNumbers(int n) { // Hàm tìm các số X
vector<int> result;
int maxNum = ... | ALGO | 0.999927 | 4.75937 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-02-26T18:23: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": "d4680bf2653... |
513e5fde-ffea-4811-b632-3bb352db0dd0 | wolfpld/tracy | server/TracySortedVector.hpp | #ifndef __TRACYSORTEDVECTOR_HPP__
#define __TRACYSORTEDVECTOR_HPP__
#include "TracySort.hpp"
#include "TracyVector.hpp"
namespace tracy
{
#pragma pack( push, 1 )
template<typename T, class CompareDefault = std::less<T>>
class SortedVector
{
public:
using iterator = T*;
using const_iterator = const T*;
t... | TOOL | 0.969477 | 7.305854 | {
"github_metadata": {
"branch": "master",
"commit_count": 9163,
"repo_created_at": "2020-03-17T19:43:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12280,
"forks": 829,
"issues": 185,
"pull_requests": 22
},
"file_meta": {
"content_id":... |
bb74be93-e499-4051-bcdd-1ac4f0edc5a9 | saywoo/competitive-programming-note | source/data-structure/union-find.cpp |
// 생성 : UnionFind* uf = new UnionFind(Siz);
// uf->Find(x) : x의 부모를 반환
// uf->Union(x, y, dir) : x, y 그룹을 하나로 합침
// uf->isSameSet(x, y) : x, y가 한 그룹에 있는지 반환
struct UnionFind {
vector<int> parent;
int group_count = 0; int size = 0;
UnionFind(int siz) {
parent.resize(siz);
group_count = si... | ALGO | 0.999497 | 5.042282 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-03-13T03:33: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": "448bfd5b651b... |
8d1fe3ae-f5c4-41e2-85bc-1bf74125afcd | hermes0h/RBforest | src/rb_tree.cpp | /*
* Skeleton code for project 3 in EE205 2018 Fall KAIST
* Created by <NAME>.
*/
#include "rb_tree.h"
#include <iostream>
#include <string>
#include <list>
#include <cstdlib>
#include <cassert>
#include <algorithm>
using namespace std;
template <class T>
void RBTree<T>::inorder_print(RBNode<T> *n)
{
if (!is_... | ALGO | 0.995815 | 4.754019 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-06-24T12:39:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56873d9e0e... |
14a0ac03-61ca-4df8-943a-dd6503f89441 | janaangeloska/OOP | VtorKolok/9.cpp | /*Да се имплементира класа Trud во која се чуваат информации за: (5 поени)
вид на труд (еден знак и тоа C за конференциски труд, J за труд во списание)
година на издавање (цел број).
Да се имплементира класа Student во која се чува: (5 поени)
името на студентот (низа од најмногу 30 карактери)
индекс (це... | TOOL | 0.917831 | 3.086508 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2023-05-12T15:26: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": "7072b576038... |
abea87a7-d9b0-4b68-9437-56e816ba019b | Fighohji/Competitive-Programming | NowCoder/unknown_contest/Swap/main.cpp | #include <algorithm>
#include <climits>
#include <iostream>
#include <random>
using namespace std;
#define ll long long
#define ull unsigned long long
#define fir first
#define sec second
#define pii pair<int, int>
#define pll pair<long long, long long>
#define lowbit(a) (a & (-a))... | ALGO | 0.999991 | 5.013748 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-20T12:40: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": "4b1ee5b77f1b... |
957e7be1-dbcd-4dec-816c-7a15fcf268eb | doluong-opt/CodeContest | UVA/12384 - Span.cpp | /***********************************************
* Author - <NAME> *
* 12384 - Span ->AC
* Algorithm Adhoc
* Time Limit 0.076s
* *********************************************/
#include <iostream>
#include <stdio.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
... | ALGO | 0.999972 | 3.78462 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-07-02T12:10: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": "53f121158f... |
756e5112-593d-41d7-a589-800cce019de3 | AMIRIOX/MyLuoguRepo | rehab-241019/dfs6.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int notp[maxn];
int era(int n) {
int cnt = 0;
notp[0] = notp[1] = 1;
for(int i = 2; i <= n / i; i++) {
if(!notp[i]) {
for(int j = i << 1; j <= n; j += i) {
notp[j] = 1;
}
cnt... | ALGO | 0.999977 | 3.643104 | {
"github_metadata": {
"branch": "master",
"commit_count": 458,
"repo_created_at": "2020-07-11T06:47:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f78df10f... |
c8646b64-cfb9-4c20-b820-d6927b18ce54 | priyanshi585/DSA | Graph/topologicalSort_using_DFS.cpp | #include<iostream>
#include<stack>
#include<vector>
#include<list>
#include<unordered_map>
using namespace std;
void topoSort(int node, vector<bool> &visited , stack<int> &s , unordered_map<int , list<int>> &adj)
{
visited[node] = 1;
for(auto neighbour : adj[node]){
if(!visited[neighbour]){
... | ALGO | 0.999993 | 5.865131 | {
"github_metadata": {
"branch": "main",
"commit_count": 245,
"repo_created_at": "2025-02-14T14:18: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": "86ea713650... |
15f03935-90fd-4e65-965f-53df7080a4f5 | JHANVILADIWALA/Leetcode | 0210-course-schedule-ii/0210-course-schedule-ii.cpp | class Solution {
public:
vector<int> findOrder(int n, vector<vector<int>>& v) {
vector<int>adj[n]; //adjacency matrix
//creating graph
for(auto it:v ){
adj[it[1]].push_back(it[0]); // directed edge
}
//check for toposort
//that is whether cycle pr... | ALGO | 0.999997 | 6.294027 | {
"github_metadata": {
"branch": "main",
"commit_count": 1905,
"repo_created_at": "2023-05-09T05:20: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": "5771f4781... |
c6602d95-ee49-4026-8797-e1c2eb45829c | irohandev/A2Z-DSA-Sheet | Step 01-Learn the basics/Lec 01-Things to know in C++/06-Nested-if-else.cpp | // Question: Write a C++ program that takes the age of the user as input and determines job eligibility.
// The program should:
// 1. Print "Not eligible for job" if the age is below 18.
// 2. Print "Eligible for job" if the age is between 18 and 57 (inclusive).
// - If the age is 55 or above, it should also print "... | TOOL | 0.989582 | 5.368786 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2024-09-05T09:18:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9080fa713c... |
9c73a9ea-93a8-439b-9835-12da7da99879 | alex-stephen/DES-Encryption | DES.cpp | /**
* Title: DES Encyption and Decryption
* Author: <NAME>
* Date: 08-02-2024
*/
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cmath>
using namespace std;
string enterHex();
string enterKey();
string enterCipher();
void keyManip(string key);
vector<char> hex2binary(string);
int b... | ALGO | 0.998618 | 4.487341 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-26T18:14: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": "34cd6436ab3c... |
6ac5a9e3-d22f-48d9-94c2-a75a8b3e636d | jegonzal/PowerGraph | toolkits/graphical_models/deprecated/gibbs_sampling/matlab/gibbs_sampler_impl.cpp | /**
* Copyright (c) 2009 Car<NAME> University.
* 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
*
... | ALGO | 0.995423 | 6.343856 | {
"github_metadata": {
"branch": "master",
"commit_count": 5464,
"repo_created_at": "2013-07-01T07:59:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 356,
"forks": 514,
"issues": 39,
"pull_requests": 9
},
"file_meta": {
"content_id": "99... |
1ec73f74-b995-4f6c-b7db-c9dd28ff7189 | Cqingy/leetcode | cpluse/offer/StrToInt.cpp | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int StrToInt(string str) {
if(str.size() == 0) return 0;
int flag = 1;
if(str[0] == '+') {
flag = 1;
str.erase(str.begin());
}else if(str[0] == '-') {
flag = -1;
str.erase(str.begin());
}
i... | ALGO | 0.998768 | 3.883037 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2018-10-05T11:19: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": "d6a5843a2... |
b999a6cc-f729-41c4-8e56-4b428c972f00 | blurgyy/ruuush | hdu/3265/3.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 50010;
struct Segment{
ll l, r, h;
int side;
Segment(ll a = 0, ll b = 0, ll c = 0, int d = 0):l(a), r(b), h(c), side(d){}
bool operator< (Segment a){
return h < a.h;
}
}seg[maxn<<2];
struct SegTreeNode{
... | ALGO | 0.988415 | 3.704215 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2018-12-27T09:13:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7dcc6de0b... |
7b88af3b-18c9-444d-bf01-1a1737c01fe3 | Md-Minhajul-Islam/Contest | Codeforces/950/Choosing_Cubes.cpp | // Q:
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef long double ld;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
void solve()
{
int n, f, k; cin >> n >> f >> k;
f--;... | ALGO | 0.999965 | 4.020099 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2023-09-27T17:36: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": "821562c60e... |
afd1bcf5-443c-467b-85b6-1fdb2f2cc588 | Marinovsky/AlgorithmsUN2021I | Algorithms_Graphs/week5_spanning_trees/1_connecting_points/connecting_points.cpp | #include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
using std::vector;
using std::cin;
using std::cout;
using std::endl;
using std::max;
class DisjointSets
{
private:
int* rank;
int* parent;
int cap;
public:
DisjointSets(int size);
int Find(int i);
vo... | ALGO | 0.999881 | 4.324593 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-03-01T16:47: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": "1446777ebf... |
62f82ad5-b3aa-4556-9baa-4ee97fec4d36 | dgsrush/adventOfCode_2016 | src/day7/main.cpp | #include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<set>
using std::cout;
using std::endl;
using std::string;
using std::vector;
using std::fstream;
using std::set;
void readInput(vector<string> &lns)
{
string ln;
fstream inf("input.txt", std::ios_base::in);
while(!inf.eof())
{
inf >... | ALGO | 0.999498 | 4.541258 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-09-17T14:32: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": "6169272ae9a1... |
8a99fb0e-6e34-49ef-88c3-12c5d88e3767 | Sehaj-kahlon/ds-assignments | assignment4.cpp | // 1. What is the difference between in-place and out-place sorting algorithms?
// Ans in-place sorting - it means that the algorithm does not use any extra space for input manipulation.
// Examples of in-place sorting algorithms are Bubble Sort, Selection Sort and Insertion Sort, which don’t require extra space to per... | ALGO | 0.999923 | 5.397976 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-07-12T12:17: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": "1e9dfcb34b8... |
f89b6125-400b-4368-b646-9c661b23b9ba | mnamvarcfd/ArrayFire-Programming | 04-Poisson equation/MAIN_POISSON2D/MAIN_POISSON2D.cpp | //////////////////////////////////////////////////////////////
// Code written by <NAME>
//////////////////////////////////////////////////////////////
#include "arrayfire.h"
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip> // std::setprecision
#include "Field.h"
#include "DenseSolver.h"
#... | ALGO | 0.997323 | 5.317564 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-09-18T21:10: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": "522d60ae496... |
3046b8db-88a8-4849-88a4-da3a26245101 | SOUI2/soui | third-part/skia/src/pathops/SkIntersections.cpp | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkIntersections.h"
void SkIntersections::append(const SkIntersections& i) {
for (int index = 0; index < i.fUsed; ++index) {
insert(i[0][index], i[1][ind... | ALGO | 0.994563 | 5.017665 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2018-06-28T11:22:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 796,
"forks": 283,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "b30b7... |
6d09ac64-9d2f-4d09-acca-18ea7207c5df | Dartemiss/DragonEngine | MyQuadTree.cpp | #include "MyQuadTree.h"
#include "GameObject.h"
#include "debugdraw.h"
#include <stack>
#include <assert.h>
//Recursive Constructor
MyQuadTree::MyQuadTree(const AABB &limits, int level)
{
this->limits = limits;
maxHeight = 5;
levelOfDepth = level;
}
MyQuadTree::MyQuadTree(AABB* limits)
{
assert(limits != nullptr... | ALGO | 0.948984 | 3.823475 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2019-10-21T19:02:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "715e8d16... |
73a99d90-1036-426a-9c3e-4699b828392b | luuuyi/MyPractise | single_number.cpp | class Solution {
public:
void insertSort(int A[], int n){
for (int i = 0; i<n; i++){
int j = i - 1, tmp = A[i];
while (j >= 0 && A[j]>tmp){
A[j + 1] = A[j];
--j;
}
A[j + 1] = tmp;
}
}
void findResult(int A[], int... | ALGO | 0.999997 | 5.246117 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2017-03-10T14:36:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca4e3e10f... |
b4947f77-030c-41c9-891e-a79a437dab3e | linyirun/CompetitiveProgramming | Previous/Codeforces/CF896/B.cpp | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
#define int ll
//const int MOD = 998244353;
const int MOD = 1000000007;
const int INF = 1e15;
int dist(int x1, int y1, int x2, int y2) {
return abs(x1 - x2) + abs(y1 - y2);... | ALGO | 0.999944 | 4.912212 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-12-07T05:43: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": "91e7b128085... |
80270c8d-cf9f-424e-b128-c0307b3d2f44 | sqmedeiros/rouxinol | 1132-Tree_Distances_I/training/2553709.cpp | #include<bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define pb push_back
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
const int MOD = 1000000007;
#define PI = acos(-1)
using namespace std ;
const int N = 2e5 + 5 ;
int n ;
vector<int> adj[N] , par(N) , in(N) , out(N) , vis... | ALGO | 0.999869 | 3.949446 | {
"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": "6555d08442... |
06dc81c1-b187-4beb-aaaf-b193ace1e5d8 | sherif17/Problem_Solving_PST | Level_I/WEEK_THREE/Part_II/Assigned_Problems/I_Gifts_Fixing/Gifts_Fixing.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
long long x, arr_cand[55], arr_org[55], min_cand = INT_MAX, min_org = INT_MAX, counter = 0;
cin >> x;
for (int i = 0; i < x; i++)
{
cin >> arr_cand[i];
if (a... | ALGO | 0.999943 | 4.051373 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2021-07-28T21:20: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": "e6ac35c68... |
82039fcc-2bce-41f7-8b68-697e824469be | mazen-alasas/Problem-Solving | CodeForces/Groups/ICPC Assiut University Training - Juniors Phase 1 Sheets/Juniors Phase 1 Practice #1 ( Prefix sum , Frequency Array )/O - Empty array.cpp | /// بِسْمِ اللَّـهِ الرَّحْمَـٰنِ الرَّحِيمِ
/** إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما **/
#include <bits/stdc++.h>
#define ll long long
#define fix(n) fixed << setprecision(n)
#define T ll tests; cin >> tests; while(tests--)
#define IOS ... | ALGO | 0.999992 | 3.993394 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2023-09-01T14:59: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": "ed0ab7532b... |
86982d98-65e5-4c5c-8e2f-c294716eefe4 | ecoeficiente/EnergyPlus | src/EnergyPlus/SolarShading.cc | // EnergyPlus, Copyright (c) 1996-2018, The Board of Trustees of the University of Illinois,
// 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), Oak Ridge
// National Laboratory, managed by UT-Batt... | ALGO | 0.989593 | 5.393245 | {
"github_metadata": {
"branch": "develop",
"commit_count": 11750,
"repo_created_at": "2018-12-03T11:32:51.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "NREL/EnergyPlus",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content... |
a6f29b2a-0a75-4cdd-98dc-340776945b22 | bianhao626/study-cpp | 24_0512_Algorithm/test.cpp | //#include <iostream>
//#include <algorithm>
//#include <map>
//#include <vector>
//using namespace std;
//
//class Solution
//{
// map<string, int> tmp;
//public:
// vector<string> topKFrequent(vector<string>& words, int k)
// {
// for (auto& e : words)
// {
// tmp[e]++;
// }
/... | ALGO | 0.999967 | 4.051943 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2024-01-17T11:05: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": "b64b581c276... |
c75f0e44-eaed-4fb2-97cb-51f859cec88b | srivatsamr/ParticleSimulator | src/PriorityQueue.hpp | #ifndef MAXPQHEADERDEF
#define MAXPQHEADERDEF
#include <iostream>
#include <vector>
template <typename T>
class MaxPQ{
private:
std::vector<T> pq; // Vector to hold elements
int N; // Number of elements
bool less(int i, int j);// Compares elements at i and j
... | ALGO | 0.976981 | 5.476625 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-12-23T23:33:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efb66d705bf3... |
db61ccc8-47ab-4517-a329-0706a8bca73d | Codensity30/Strivers-A2Z-DSA-Sheet | 04.Linked List/3.Medium Problems of LL/03.Detect_loop_in_LL.cpp | /*
QUESTION:-
Given head, the head of a linked list, determine if the linked list has a cycle in it.
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer... | ALGO | 0.999858 | 6.262825 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2023-05-29T13:38:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 213,
"forks": 70,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "be327368... |
5ac3154f-3a8c-4128-87dc-9f6001f66ecc | CamiChou/cs118-proj2 | project/config_parser.cpp | #include "config_parser.h"
ConfigParser::ConfigParser(string in) : in(in) {}
IpConfig ConfigParser::getIpConfig() const
{
return ipConfig;
}
NaptConfig ConfigParser::getNaptConfig() const
{
return naptConfig;
}
map<pair<string, int>, int> NaptConfig::getLtoW()
{
return lanToWanMap;
}
map<int, pair<string... | TOOL | 0.922837 | 5.261941 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2023-05-19T23:56:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "187a0dd25... |
64386dff-5f38-4faf-b07f-eefc58f78bfa | AlexWeiWGL/samples | operator_contrib/ScatterSubSample/KernelLaunch/ScatterSubKernelInvocation/scatter_sub.cpp | /*
* Copyright (c) Huawei Technologies Co., Ltd. 2022-2023. All rights reserved.
*/
#include "kernel_operator.h"
#include <cmath>
constexpr int32_t BUFFER_NUM = 1; // tensor num for each queue
class KernelScatterSubInt8Aligned {
public:
__aicore__ inline KernelScatterSubInt8A... | TOOL | 0.959633 | 4.846558 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:45: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": "47deb0b94e... |
a019261f-989c-4e01-ae86-2199f31f21f2 | yuanming-hu/taichi_mpm | src/rigid_body_solver.h | /*******************************************************************************
Copyright (c) The Taichi MPM Authors (2018- ). All Rights Reserved.
The use of this software is governed by the LICENSE file.
*******************************************************************************/
#pragma once
#include ... | ALGO | 0.997339 | 7.27226 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2018-08-11T05:36:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2472,
"forks": 318,
"issues": 31,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1... |
c721713d-ee71-4d05-83e8-099a171fffc0 | edisonhello/competitive_programming | Codeforces/contests/#547 Div.3/D.cpp | // #pragma GCC optimize("no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC diagnostic ignored "-W"
#include<cassert>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<iostream>
#inc... | ALGO | 0.999818 | 3.487286 | {
"github_metadata": {
"branch": "master",
"commit_count": 843,
"repo_created_at": "2016-03-15T14:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba927fa2... |
5ad77472-77bb-47d0-9ed7-51c5a1b2f03e | natigeorgieva/UP-2020-2021 | Tasks/Week 09/Примерни решения на контролна работа №1/Вариант 2/Task4.cpp | void swap(int* num1, int* num2)//Задължително трябва да е с указатели (или псевдоними), за да е коректна смяната, иначе не праивм нищо
{
int temp = *num1;
*num1 = *num2;
*num2 = temp;
}
int main(){
int arr[N];
for (int i = 0; i < N; i++)
cin >> arr[i];
int count = 0;//броят а вече наредените двойки в масива (1... | ALGO | 0.999941 | 3.823221 | {
"github_metadata": {
"branch": "master",
"commit_count": 187,
"repo_created_at": "2020-10-01T09:46:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac2a85f6... |
52e60516-4085-4914-81bc-c9187df430e1 | libnonius/nonius | include/nonius/detail/argparse.h++ | // Nonius - C++ benchmarking tool
//
// Written in 2014- by the nonius contributors <<EMAIL>>
//
// To the extent possible under law, the author(s) have dedicated all copyright and related
// and neighboring rights to this software to the public domain worldwide. This software is
// distributed without any warranty.
//... | TOOL | 0.925653 | 6.646274 | {
"github_metadata": {
"branch": "devel",
"commit_count": 256,
"repo_created_at": "2013-12-23T12:55:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 363,
"forks": 48,
"issues": 46,
"pull_requests": 11
},
"file_meta": {
"content_id": "8c7e6... |
e5de24dd-6ce7-4be7-a019-483cdeaaa2be | richoux/LearningErrorFunctions | explored/eo/include/eoFitContinue.h | // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
//-----------------------------------------------------------------------------
// eoFitContinue.h
// (c) <NAME>, GeNeura Team, 1999, 2000
/*
This library is free software; you can redistribute it and/or
modify it under the... | ALGO | 0.974933 | 6.559697 | {
"github_metadata": {
"branch": "master",
"commit_count": 433,
"repo_created_at": "2019-06-05T05:57:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b87d01d2... |
2d11b1c2-3116-455d-b7a6-713cf6349b20 | nickgillian/grt | GRT/Util/LUDecomposition.h | /*
GRT MIT License
Copyright (c) <2012> <<NAME>, Media Lab, MIT>
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, ... | ALGO | 0.998963 | 5.933158 | {
"github_metadata": {
"branch": "master",
"commit_count": 897,
"repo_created_at": "2014-01-03T03:16:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 878,
"forks": 285,
"issues": 80,
"pull_requests": 8
},
"file_meta": {
"content_id": "711... |
18bdd262-b20f-4920-bb27-dd6bf0958065 | ishandutta2007/codeforces-b | brunovsky/normal/1558/A.cpp | #include <bits/stdc++.h>
#ifdef LOCAL
#include "code/formatting.hpp"
#else
#define debug(...) (void)0
#endif
using namespace std;
int main() {
ios::sync_with_stdio(false), cin.tie(nullptr);
int T;
cin >> T;
while (T--) {
int a, b;
cin >> a >> b;
vector<int> sols;
for ... | ALGO | 0.99986 | 4.633192 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c785d4308da... |
99e82c07-8888-49e5-be80-e98f489c5c55 | ishandutta2007/codeforces-s | strawberryc/normal/1149/C.cpp | #include <bits/stdc++.h>
#define p2 p << 1
#define p3 p << 1 | 1
// 0830
//
inline int read()
{
int res = 0; bool bo = 0; char c;
while (((c = getchar()) < '0' || c > '9') && c != '-');
if (c == '-') bo = 1; else res = c - 48;
while ((c = getchar()) >= '0' && c <= '9')
res = (res << 3) + (res << 1) + (c - 48);
... | ALGO | 0.999869 | 3.918662 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "593b0104c218... |
da7143bc-1042-4395-a394-e904c1e949cc | namanjain2602/Leetcode-solutions | 0382-linked-list-random-node/0382-linked-list-random-node.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode *newHead;
... | ALGO | 0.999653 | 5.59697 | {
"github_metadata": {
"branch": "main",
"commit_count": 270,
"repo_created_at": "2023-03-06T13:05:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ed3f2b724... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.