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 |
|---|---|---|---|---|---|---|---|
34070095-f1d6-4823-bb5c-01312865076d | tranchienthang30/bai-tap-ltnc | projectgame2024/main.cpp |
#include <SDL.h>
#include <SDL_image.h>
#include <stdio.h>
#include <string>
#include <iostream>
#include<bits/stdc++.h>
#include"defs.h"
#include<SDL_ttf.h>
#include<windows.h>
using namespace std;
class Dot
{
public:
static const int DOT_WIDTH = 45;
static const int DOT_HEIGHT = 40;
//Maximum axis velocit... | TOOL | 0.904036 | 3.978318 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-03-07T15:39: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": "39ded4fae9f... |
2f584d01-ff96-4a85-bf3c-fe15e443b550 | wang-jiahao/LeetCode | Day11/main.cpp | #include <iostream>
#include <string>
#include <stack>
#include <vector>
using namespace std;
bool isValid(string s) {
stack<char> stk;
for (char c: s) {
if (c == '(' || c == '{' || c == '[') {
stk.push(c);
} else {
if (c == ')') {
if (!stk.empty() && stk... | ALGO | 0.999772 | 5.748102 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2024-12-01T05:51:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7519184f1... |
2f5639d4-c7c0-4602-b6ba-948502dfff5b | FangYang970206/Leetcode | Difficulty/Hard/[25] Reverse Nodes in k-Group/solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *reverseKGroup(ListNode *head, int k) {
if (! head || ! head->next) return head;
int num = 0;
List... | ALGO | 0.999998 | 5.709756 | {
"github_metadata": {
"branch": "master",
"commit_count": 351,
"repo_created_at": "2019-03-06T16:49:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56750f93... |
51a68b96-b1d5-478d-bab0-c734b55c1287 | Kartiki19/DSA | lexLargestStrSwap.cpp | /*
Given a string str and array of pairs that indicates which indices in the string can be swapped,
return the lexicographically largest string that results from doing the allowed swaps.
You can swap indices any number of times.
*/
#include<iostream>
using namespace std;
#include<vector>
void dfs(int& node, vector<... | ALGO | 0.999996 | 5.624292 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-06-28T23:06: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": "bc3f4b829a5e... |
02e034fc-e3c3-46fd-8410-a15980f9e703 | ishandutta2007/codeforces-k | kriii/normal/1349/C.cpp | #include <stdio.h>
#include <queue>
using namespace std;
int n, m, t; char b[1010][1010]; bool chk[1010][1010];
int dist[1010][1010]; queue<pair<int, int> > q;
int main()
{
scanf ("%d %d %d", &n, &m, &t);
for (int i = 0; i < n; i++){
scanf ("%s", b[i]);
for (int j = 0; j < m; j++){
if ((i + j) % 2) b[i][j] =... | ALGO | 0.999786 | 3.808101 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47ca78a48447... |
3c579825-fdda-43f0-8067-14c0c56e44dd | dilishp/Algo-DSSolutions | Practice/LIS.cpp | #include "pch.h"
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int actualLIS(int arr[], int nLength)
{
int* LIS = new int[nLength];
std::fill_n(LIS, nLength, 1);
for (int i = 0;i < nLength;i++)
{
for (int j = 0;j < i;j++)
{
if ((arr[i] > arr[j]) && (LI... | ALGO | 0.999706 | 4.554938 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-04-12T15:34:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "3f2adff73... |
7facc4b5-09e0-4d42-afbe-1af88f1f1613 | MartinGorisek/test_martin | test.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <algorithm>
#include <unordered_set>
using namespace std;
struct Ucenik
{
char ImePrezime[50];
float prosjek;
};
bool cmp(Ucenik &a, Ucenik &b)
{
return a.prosjek > b.prosjek;
}
int main()
{
struct Ucenik ucenici[100];
int brUcenik... | TOOL | 0.938783 | 4.114007 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-06T09:25: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": "719d936485ca... |
b78b1cc7-998a-408c-ad08-7daf8f870606 | mmorse1217/patchwork | src/face_map.cpp | #include "face_map.hpp"
#include <set>
#include <queue>
#include "blended_evaluator.hpp"
#include <limits.h>
#include <omp.h>
#include <algorithm>
#include "sampling.hpp"
#include "polynomial_evaluator.hpp"
#include "diff_geom.hpp"
typedef pair<int, int> intpair;
FaceMapSurf::FaceMapSurf(SurfaceEvaluator* evaluator):... | ALGO | 0.97825 | 4.842605 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2019-02-01T02:05:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "927a870ac... |
d6b693cf-e8de-4d44-8a79-6d410e82bcf3 | SLAMVOM/VSLAM_Book_Code_Exercises_Ubuntu_20.04_LTS | ch7/orb_cv.cpp | #include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <chrono>
using namespace std;
using namespace cv;
int main(int argc, char **argv) {
if (argc != 3) {
cout << "usage: feature_extraction img1 img2" << endl;
... | ALGO | 0.941349 | 6.014743 | {
"github_metadata": {
"branch": "code_dev",
"commit_count": 31,
"repo_created_at": "2022-04-21T19:01: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": "650eb1b... |
65b8b708-c20f-42ed-97f4-d1a6c6b7f70a | Star369666/NUTN_Algoritm | HW2_TMap/ALGO_HW2/ALGO_HW2_S11059003/TMap_Prog3_S11059003/TMap_Prog3_S11059003.cpp | #include <iostream>
#include <vector>
#include <fstream>
using namespace std;
void get_POIs_location(vector<vector<double>>&);
void shortest_Path(vector<vector<double>>);
double get_distance(double, double, double, double);
double compare_distance(double, double, int, int, int*, int*);
int binary_search(vector<int>, i... | ALGO | 0.999388 | 3.715097 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2023-09-29T15:34:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d31aeb91760... |
68573cb0-60c7-4c3a-ace9-439f7a44ddb3 | xSeanliux/CompetitiveProgramming | contests/INFOR考幹/pD.cpp | #include <iostream>
#define lli unsigned long long int
using namespace std;
lli n, q, a, b, c, d;
lli arr[(lli)2e5 + 5], bit[(lli)2e5 + 5];
lli lowbit(lli x){
return x & -x;
}
lli query(lli pos){
if(!pos) return 0;
return bit[pos] + query(pos - lowbit(pos));
}
void update(lli pos, lli toAdd){
if(po... | ALGO | 0.999811 | 5.32187 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-11-18T06:45: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": "65a27b00c... |
8e564eaa-3f60-44a8-aaa0-78ae7f12d351 | bibimoni/codeStuff | cp/vnoj/paliny.cpp | /**
* File : paliny.cpp
* Author : distiled
* Date : 18.05.2023
* Last Modified Date: 17.09.2023
* Last Modified By : distiled
*/
#include<bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include </home/distiled/templates/debug.h>
#else
#define dbg(x...)
#endif
#define int... | ALGO | 0.999992 | 4.815041 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-08-23T09:31: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": "35c7c17ec9f... |
dc866883-c6fe-4e6f-82bc-7e42aa3aae52 | fadilcse5bu/LightOj-Problems-Solution | 2. Medium/Fantasy of a Summation.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll power(ll b, ll p, ll mod) {
if(p == 0) return 1;
if(p%2 == 1) return (b*power(b, p-1, mod))%mod;
else {
ll temp = power(b, p/2, mod);
return (temp*temp)%mod;
}
}
int main()
{
int t, cs = 1;
cin >> t;
start:
while(t--) {
... | ALGO | 0.999687 | 4.176803 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2022-09-30T16:03:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f5de34101... |
b14dd02a-043d-4ad0-a50f-6b5ae6b5ba70 | aniketSanap/SudokuSolver-Backtracking | backtrackingSudoku.cpp | #include <iostream>
using namespace std;
class Sudoku {
int sudoku[9][9];
public:
void createBoard();
int isComplete();
void printBoard();
void printHorizontal();
bool checkRow(int, int);
bool checkColumn(int, int);
bool checkBlock(int, int, int);
bool check(int, int, int);
bool s... | ALGO | 0.999039 | 5.671206 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-08-17T11:58: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": "55f60151f2... |
fd07b3ea-7467-4ad6-9271-3bee8c3f46ce | Diusrex/UVA-Solutions | 10000 Longest Paths.cpp | #include <cstdio>
#include <vector>
using namespace std;
int GetLongestPath(int node, const vector<vector<bool> >& canTravelTo, vector<int> & longestPath, const int& n, const int start)
{
if (longestPath[node] == -1)
{
int longestRoute = 0;
int bestNode = -1;
for (int i = 0; i... | ALGO | 0.999205 | 3.708692 | {
"github_metadata": {
"branch": "master",
"commit_count": 188,
"repo_created_at": "2013-12-15T19:00:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 96,
"forks": 66,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f7601... |
fa34d153-a819-45c2-876b-1d5d94df85eb | Aashimajain18/MyCodes | searching & sorting/Find the Smallest Divisor Given a Threshold.cpp | /*Given an array of integers nums and an integer threshold, we will choose a positive integer divisor and divide all the array by it and sum the result of the division. Find the smallest divisor such that the result mentioned above is less than or equal to threshold.
Each result of division is rounded to the nearest i... | ALGO | 0.99999 | 6.138385 | {
"github_metadata": {
"branch": "master",
"commit_count": 226,
"repo_created_at": "2020-05-10T15:48: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": "2c36ec4a... |
8a07fa34-983d-4130-9030-f78dadc0d947 | jleun1403/BOJ_CPP | Q2357 2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <cmath>
#include <bitset>
#include <cstring>
#define inf 2000000000
using namespace std;
int n, m;
int mintree[300001];
int maxtree[300001];
int a[100001];
int minquery(int node, int l... | ALGO | 0.999936 | 4.238115 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-08-24T08:41: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": "1197a5cd1d... |
46ae4dda-62b3-4dcf-9d24-92c837f1e671 | amritpandey23/PSCP_CS5303 | 3_psp_lab/assignment-13-Jan/29.cpp | /* TITLE: A positive integer is entered through the keyboard,
write a function to find the binary equivalent of this number:(i) without using recursion(ii) using recursion
DATE:
AUTHOR: <NAME> MC20103 */
#include <iostream>
#include <vector>
using namespace std;
void binary(int);
int main()
{
int n;
cout <... | ALGO | 0.999822 | 4.96277 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2021-01-02T06:53: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": "a4b454cbc... |
015f8e89-ca0a-4bb3-8ded-b9438614497e | PrincetonUniversity/athena | src/bvals/fc/polarwedge_fc.cpp | //========================================================================================
// Athena++ astrophysical MHD code
// Copyright(C) 2014 <NAME> <<EMAIL>> and other code contributors
// Licensed under the 3-clause BSD License, see LICENSE file for details
//=====================================================... | ALGO | 0.978626 | 6.043969 | {
"github_metadata": {
"branch": "main",
"commit_count": 5233,
"repo_created_at": "2014-05-02T16:11:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 270,
"forks": 152,
"issues": 24,
"pull_requests": 4
},
"file_meta": {
"content_id": "638f4... |
dbe59dba-5534-4fbd-b80f-9912364726eb | airwindows/airwindows | plugins/MacSignedVST/SurgeTide/source/SurgeTideProc.cpp | /* ========================================
* SurgeTide - SurgeTide.h
* Copyright (c) 2016 airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __SurgeTide_H
#include "SurgeTide.h"
#endif
void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl... | ALGO | 0.985986 | 4.827557 | {
"github_metadata": {
"branch": "master",
"commit_count": 458,
"repo_created_at": "2018-01-22T02:05:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 951,
"forks": 91,
"issues": 31,
"pull_requests": 4
},
"file_meta": {
"content_id": "a7b0... |
afb64563-ebe4-4b81-bdab-bc482cab02c3 | IgnAMS/ICPC | Ejercicios/NWERC 2021/D.cpp | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define repx(i,a,b) for(int i=a; i<b; i++)
#define rep(i,n) repx(i,0,n)
typedef long long ll;
typedef pair<ll, ll> pll;
typedef double db;
typedef vector<ll> vl;
#define ff first
#define ss second
#define pb push_back
// g++ -std=c++11 A.cpp -o ... | ALGO | 0.999871 | 4.06024 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2021-05-19T20:12:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c83dd132c... |
42fd419e-4fc1-4d91-b5d6-fccf00a7694e | Illumina/ExpansionHunter | ehunter/sample/AnalyzerFinder.hh | //
// Expansion Hunter
// Copyright 2016-2019 Illumina, Inc.
// All rights reserved.
//
// Author: <NAME> <<EMAIL>>,
// <NAME> <<EMAIL>>
//
// 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 Licen... | ALGO | 0.932046 | 4.494511 | {
"github_metadata": {
"branch": "master",
"commit_count": 240,
"repo_created_at": "2016-11-10T19:53:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 195,
"forks": 53,
"issues": 81,
"pull_requests": 5
},
"file_meta": {
"content_id": "a083d... |
8bfe17fb-683e-4e65-a054-614812a07303 | pmadriana/Algebra-abstracta | protocolo/protocolo.cpp | #include "Protocolo.h"
Protocolo::Protocolo(int bits){
ZZ phi_N;
while(ProbPrime(this->q,10)!=1)
{
this->q=generador(bits/2,bits,2,1);
}
cout<<"q: "<<q<<endl;
// p = (2*q) + 1;
// ZZ e1= find_gen(p);
do{
this->gen = generador(bits/2, bits, 2, 1);
}while(this->gen > this->q);
cout... | ALGO | 0.978343 | 4.179487 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2017-04-24T06:34:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94108024c... |
dd0098b0-770c-4298-979e-4f81a4f91b6b | JingleBell2809/lab-grader-CPP-data-structure | ข้อ 2.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
}
};
class Linked_List{
public:
Node *head;
int size = 0;
Linked_List(int value)
{
head = new Node(value);
head->next = NULL;
size = 1;
}
void PrintL... | ALGO | 0.99994 | 3.007281 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-22T05:36:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9393671f2401... |
6507b5ce-a111-4471-9e8d-f49b07f9fbab | vrpratheep17/Algo-DS-in-cpp | 20. Queue/QueueList.cpp | #include<iostream>
using namespace std;
template<typename T>
class Node{
public:
T head;
Node *next;
Node(T head){
this->head = head;
this->next = nullptr;
}
};
template<typename T>
class QueueList{
private:
Node<T> *head=nullptr;
int listSize=0;
... | ALGO | 0.999653 | 3.775374 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-12-14T08:57: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": "8ffcb4443b9... |
fc92b6aa-86d4-4b2e-b961-9f54d2c86be5 | hsiaoluw/ntusatbreak | code/BreakID/Tools.h | /*
* Tools.h
*
* Created on: Jan 23, 2013
* Author: jodv
*/
#ifndef TOOLS_H_
#define TOOLS_H_
//#define NDEBUG
#include <string>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <memory>
#include <sstream>
#include <iostream>
#incl... | TOOL | 0.994914 | 5.018514 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-04-25T12:36: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": "df8a7c796a86... |
c6f8bba6-6f1c-4a2c-9f7c-bd23fd2a7a22 | areyykarthik/Zhukouski_Pavel_BSU_Projects | Cryptographic methods/Лаба 3/Crypt_Lab_3/Crypt_Lab_3/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <random>
using namespace std;
/*
«Пока ты жив, не умирай, на этот мир взгляни.
У многих здесь душа мертва – они мертвы внутри.
Но ходят и смеются, не зная, что их нет,
Не торопи свой смертный час» – она сказала мне.
Ария, «Там высоко»... | ALGO | 0.998981 | 3.688734 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2021-11-15T18:13:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "238fde49f... |
d9fbb63d-d6bb-4539-8c5b-beeb88dea6ba | regisarodrigues/exercicios-faculdade | lista-03/11-exercicio.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, char const *argv[])
{
double valor = 0, valor_vista = 0, valor_parcela = 0, valor_final = 0;
cout << "Valor do altomóvel R$ ";
cin >> valor;
valor_final = valor * 0.8;
cout << fixed << setprecision(2) << "Valor à vista R$ " << v... | ALGO | 0.98742 | 3.825865 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-12-27T23:10: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": "0b0cd15038a6... |
d233d932-df72-4dba-8826-5cb08939a7dc | Salah-Tamer/Algorithms | 03 Binary Search/HW 01 - 4 Medium Challenges/03_Valid Triangle Number.cpp | // https://leetcode.com/problems/valid-triangle-number/description/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
//lower bound: find the first greater than of equal index
int BinarySearch(vector<int> &nums, int start, int target){
int end = nums.size... | ALGO | 0.999987 | 6.087393 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2024-06-24T16:07: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": "38ed460d34d... |
8a2eac3a-d8d5-44c0-9b4a-9d6bf8af7db0 | bellbpng/Baekjoon | 2484/source.cpp | #include <iostream>
#include <vector>
using namespace std;
int findMax(vector<int> &v) {
int max = v[0];
for (int i = 1; i < v.size(); i++) {
if (max < v[i]) {
max = v[i];
}
}
return max;
}
int main()
{
int N;
cin >> N;
vector<int> prize(N, 0);
for (int j = 0; j < N; j++) {
vector<int> dice_cnt(6, 0... | ALGO | 0.999676 | 3.790985 | {
"github_metadata": {
"branch": "main",
"commit_count": 340,
"repo_created_at": "2021-04-13T04:27: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": "5e1954b09a... |
f1989a66-1f74-40e0-a10a-a775921370c8 | YiyanWang/algorithm-notebook | leetcode/0101-0150/114. Flatten Binary Tree to Linked List/depth_first_search_bottom_up.cpp | #include <stack>
using namespace std;
// https://leetcode.com/problems/flatten-binary-tree-to-linked-list/
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x... | ALGO | 0.999985 | 5.976911 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2023-11-24T08:44: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": "0c7d62dd89... |
314df9da-6099-423f-8457-7058ee052bb6 | tankyx/Datalogger | PIO_Impl/include/calculations/delta_calculator.h | #pragma once
#pragma once
#include <stdint.h>
#include <vector>
#include <cmath>
#include "track_types.h"
struct LapPoint {
GpsPoint position; // Position with isSet and radius from track_types.h
uint32_t timestamp; // Time since lap start in milliseconds
int32_t speed; // Speed in mm/s
};
... | ALGO | 0.972816 | 6.986467 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2025-01-16T13:05:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5082a87d61... |
373ff8eb-c2f8-417d-a2fb-58a4dc1aae2c | zsarge/snake | src/ai.cpp | #include "ai.h"
namespace AI {
snake_direction get_best_direction(Snake* snake) {
print_debug_info(snake);
snake_direction direction = snake->get_direction();
if (!front_is_clear(snake))
return get_right_turn(direction);
else
return direction;
}
// check whether or not (x,y) squares away from the se... | ALGO | 0.999243 | 6.094715 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2021-08-21T23:33:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4daf5cd6f0e... |
78834072-e2a0-4ffc-80fb-e034a6c109ed | Umar1Shafi/Decode-DSA-with-C-Assingments | 09-Assingment-3/09-Assingment-3-Q5.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
bool isSorted(vector<int>& arr) {
for (int i = 1; i < arr.size(); i++) {
if (arr[i] < arr[i - 1]) {
return false;
}
}
return true;
}
int findK(vector<int>& arr) {
int low = *m... | ALGO | 0.999868 | 4.935189 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-05-02T13:02: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": "9c684a2a97f... |
fa92fabc-87fc-4065-b0f1-5bd652dca4ff | BCLCommons/bcl | include/scorestat/bcl_scorestat_protein_model_sse_triplet_chirality.h | // (c) Copyright BCL @ Vanderbilt University 2014
// (c) BCL Homepage: http://www.meilerlab.org/bclcommons
// (c) BCL Code Repository: https://github.com/BCLCommons/bcl
// (c)
// (c) The BioChemical Library (BCL) was originally developed by contributing members of the Meiler Lab @ Vanderbilt University.
// (c)
// (c) T... | ALGO | 0.998299 | 5.610189 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2022-05-21T17:35:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 19,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "380b2f95... |
8bb5c2d3-b11b-4ec9-973b-07a0662ec626 | dlvguo/NoobOJCollection | LeetCode/Normal/1-99/85.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int maximalRectangle(vector<vector<char>> &matrix)
{
int m = matrix.size();
if (m == 0)
{
return 0;
}
int n = matrix[0].size();
vector<vector<int>> left(m, vector<int>(n, 0));
... | ALGO | 0.999904 | 6.081545 | {
"github_metadata": {
"branch": "master",
"commit_count": 860,
"repo_created_at": "2019-04-17T10:27:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb924b82... |
26f0cfe1-ae32-4b4e-98ad-1b8783ba9914 | UnitTestBot/klee | lib/Core/TimingSolver.h | //===-- TimingSolver.h ------------------------------------------*- C++ -*-===//
//
// The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------... | ALGO | 0.936196 | 7.81548 | {
"github_metadata": {
"branch": "main",
"commit_count": 2805,
"repo_created_at": "2021-10-11T09:25:34.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "klee/klee",
"stars": 19,
"forks": 10,
"issues": 11,
"pull_requests": 11
},
"file_meta": {
"content_id": "... |
bcb61a31-3827-43fe-91a5-65748fd47809 | Winwinstyle14/Cpp | Thuc Hanh 4.7/ThucHanh4.7.cpp | #include<iostream>
int main()
{
float x, y, z;
std::cout << "Nhap x: ";
std::cin >> x;
std::cout << "Nhap y: ";
std::cin >> y;
std::cout << "Nhap z: ";
std::cin >> z;
if (x > y && x > z)
{
std::cout << "Ket qua 1: So lon nhat la : " << x << "\n";
if (y > z)
{
std::cout << "Ket qua 2: So nho nhat la... | ALGO | 0.999454 | 3.580234 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-04T04:12:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6cfab886118... |
cffbc7a2-1261-43ab-936a-7e7a7f337b03 | lucacodorean/Subiecte-de-bacalaureat-rezolvate | Variantele 01-10/bac2009v8.cpp | #include <fstream>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
ifstream fin("bac.txt");
void ex3(){
int v[51],n,s=0,rez[51],l=0;
fin>>n;
for(int i=1; i<=n; i++){
fin>>v[i];
}
for(int i=1; i<=n; i++){
int d = sqrt(v[i]);
if(d*d==v[i]){
... | ALGO | 0.999963 | 3.459186 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-04-26T23:08:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d30521a66dd6... |
4eeac5b5-f405-4cc6-ace9-85b391ec06c1 | qpwoeirut/competitive-programming | GoogleCompetitions/KickStart2021/rabbit_house.cpp | //rabbit_house.cpp created at 03/20/21 21:14:23
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "qpwoeirut/debug.h"
#else
#define debug
#define debug1
#define debug2
#define debug3
#endif
#define pb push_back
#define ins insert
#define fi first
#define se second
#define sz(obj) ((int)(obj.size(... | ALGO | 0.999718 | 4.441858 | {
"github_metadata": {
"branch": "master",
"commit_count": 348,
"repo_created_at": "2020-09-17T05:10:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9ce700... |
795f9789-f865-4410-bb48-052ddeadaf2a | LiZhanZhao/Study-PBRT | src/accelerators/grid.h |
/*
pbrt source code Copyright(c) 1998-2012 <NAME> and <NAME>.
This file is part of pbrt.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyr... | TOOL | 0.945007 | 7.473423 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2017-01-28T15:15: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": "6c751690b... |
084f0420-8004-4fb5-a315-099168886d95 | weierxiao111/cplusplus | 100题系列/100题系列/二叉搜索树.hpp | #pragma once
#include <iostream>
using namespace std;
template <class K, class V>
struct BSTNode {
BSTNode(const K& key, const V& value = V())
:_pLeft(NULL)
, _pRight(NULL)
, _key(key)
, _value(value)
{}
BSTNode *_pLeft;
BSTNode *_pRight;
K _key;
V _value;
};
template <class K, class V>
class Bin... | ALGO | 0.999501 | 3.715131 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-05-24T14:49: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": "1eb1bb8bde... |
dc28a591-b76a-4530-9a34-cfe3c0bcad8a | rayz/algorithms | cf/669/a.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cctype>
#include <stack>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <math.h>
#include <iomanip>
using namespace std;
const long long MOD = 1e9 + 7;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.999986 | 3.987192 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2020-07-12T21:21: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": "cdd065f55... |
56962739-bb7c-4b8b-ad00-ee4f33435766 | vasubansal1033/DSA_dups | Leetcode May Challenge/Week 1/006 majorityElement.cpp |
// Divide and Conquer approach
// O(nlogn) solution
class Solution {
public:
int getFrequency(vector<int>& v, int start, int last, int k){
int c = 0;
for(int i = start; i<=last; i++){
if(v[i]==k)
c++;
}
return c;
}
int majority(vector<int>& v, int... | ALGO | 0.999991 | 5.926229 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-05-15T12:26:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 24,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0523fd7a9... |
4b49a531-72b7-4e90-9943-0422a6e17824 | elibensasson/libSTARK | libstark/src/protocols/Fri/common/common.hpp | #ifndef RS_IOPP_BIASED_COMMON
#define RS_IOPP_BIASED_COMMON
#include "protocols/protocol.hpp"
#include "protocols/common/queries.hpp"
#include <algebraLib/FieldElement.hpp>
#include <vector>
#include <map>
namespace libstark{
namespace Protocols{
namespace Fri{
namespace common{
std::vector<Algebra::FieldElement> g... | CONFIG | 0.937473 | 6.472598 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2018-02-28T08:50:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 536,
"forks": 98,
"issues": 14,
"pull_requests": 6
},
"file_meta": {
"content_id": "28c7f... |
05b71e6e-e60e-4ec2-bb68-d548a02815f2 | HyeongseoShin/ProblemSolving | SWEA/D4/1238. [S/W 문제해결 기본] 10일차 - Contact/[S/W 문제해결 기본] 10일차 - Contact.cpp | #include <bits/stdc++.h>
using namespace std;
int n, st;
vector<int> adj[105];
int dist[105];
void BFS(int x)
{
queue<int> q;
q.push(x);
dist[x] = 0;
while(!q.empty())
{
auto cur = q.front();
q.pop();
for(auto nxt : adj[cur])
{
if(dist[nxt] != INT_M... | ALGO | 0.999865 | 3.372781 | {
"github_metadata": {
"branch": "main",
"commit_count": 505,
"repo_created_at": "2024-11-12T13:48: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": "97ed448f85... |
cdf0f910-785a-4f7d-841a-90bba447bea7 | bruce3557/Uva-Online-Judge | uva_11466.cpp | #include <stdio.h>
#include <string.h>
#define MAX (10000000)
inline long long Max(long long a, long long b) { return a>b?a:b; }
inline long long abs(long long x) { return (x>=0?x:(-x)); }
long long n;
long long prime[MAX],pcnt;
bool notp[MAX+10];
inline void Build() {
for(int i=4;i<=MAX;i+=2)
notp[i] = true;
fo... | ALGO | 0.999937 | 3.584832 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-05-23T07:10:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "572ee428bc... |
23a62779-4f72-4a8f-b5b7-cc394baa0c3b | TheDuck314/halite2018 | bots/9_kappa/hlt/Grid.cc | #include "Grid.h"
#include "Log.h"
Grid grid;
void Grid::resize(int _width, int _height)
{
width = _width;
height = _height;
cells.resize(width * height);
positions.resize(width * height);
for (int x = 0; x < width; ++x) {
for (int y = 0; y < height; ++y) {
positions[width*y ... | ALGO | 0.972166 | 5.843101 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2018-11-21T04:56:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e9fe15e... |
38c77c02-b217-42f6-a2f1-3231f785049a | demidenko/olymp-cpp-lib | graphs/trees/tree_dp_root_each.cpp | template<class S, class ...T>
vector<S> tree_dp_root_each(
const graph_t<T...> &g,
auto &&single, //[](size_t v) -> S { ... }
auto &&link //[](S dv, S di, auto &edge) -> S { auto [v, i, ...] = edge }
) {
auto edge_cat = [](size_t v, auto &e) { return tuple_cat(tuple{v}, tuple<size_t,T...>{e}); };
const size_t n ... | ALGO | 0.999029 | 5.150463 | {
"github_metadata": {
"branch": "master",
"commit_count": 471,
"repo_created_at": "2020-09-08T11:35:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1915e2b... |
d5e5cbad-fa05-4d82-88e1-06a1eec3cd59 | magnese/miscellaneous | mpi_workshop/sendrecv.cpp | #include <iostream>
#include <mpi.h>
int main()
{
MPI_Comm comm = MPI_COMM_WORLD;
int nprocs, procno;
MPI_Init(0,0);
MPI_Comm_size(comm,&nprocs);
MPI_Comm_rank(comm,&procno);
int mydata=1,leftdata=0,rightdata=0;
int sendto,recvfrom;
int firstproc(0),lastproc(nprocs-1);
// Set `sendto' and `recvfr... | ALGO | 0.999555 | 4.75597 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2015-03-18T23:23: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": "9c9a8587... |
32224c9c-c310-4278-ba76-410f43bc0a3b | Living-Hell/DSA | Data Structures/BST.cpp | #include <bits/stdc++.h>
using namespace std;
// Used in largestBst function
class NodeValue
{
public:
int size, minVal, maxVal;
NodeValue(int sz, int mn, int mx)
{
this->size = sz;
this->minVal = mn;
this->maxVal = mx;
}
};
class BST
{
public:
// A binary tree Node
st... | ALGO | 0.999996 | 4.058634 | {
"github_metadata": {
"branch": "master",
"commit_count": 329,
"repo_created_at": "2022-09-25T15:16: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": "8397b17f... |
35ecf8aa-757a-4e46-94b9-39d8722ca74e | ishandutta2007/codeforces-c | crackersamdjam/normal/1294/C.cpp | #include <bits/stdc++.h>
#define gc getchar()
#define pc(x) putchar(x)
template<typename T> void scan(T &x){x = 0;bool _=0;T c=gc;_=c==45;c=_?gc:c;while(c<48||c>57)c=gc;for(;c<48||c>57;c=gc);for(;c>47&&c<58;c=gc)x=(x<<3)+(x<<1)+(c&15);x=_?-x:x;}
template<typename T> void printn(T n){bool _=0;_=n<0;n=_?-n:n;char snum[65... | ALGO | 0.999762 | 3.882812 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7c86e16a577... |
1055af10-b67c-4651-a842-049dcacf54be | HugoBoss1212/GravSimulation | src/Quadtree.cpp | #include "Quadtree.h"
#include "Particle.h"
#include "HugoStable.h"
// Implementations for Boundary
Boundary::Boundary(double x, double y, double w, double h) : x(x), y(y), width(w), height(h) {}
bool Boundary::contains(const Particle& particle) const {
return (particle.getX() >= x - width &&
particle... | ALGO | 0.999083 | 6.322018 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-05T07:38: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": "045db25f106f... |
8edcc357-52ce-4074-acd0-8b34be659a45 | MohammadAbduljalil/EOI-Newbies | Day 12/Homework/C. Megacity.cpp | #include <bits/stdc++.h>
#include <iomanip>
using namespace std;
int main()
{
int n, s; cin >> n >> s;
map<double, int> mp;
for (int i = 0; i < n; i++)
{
int x, y, k; cin >> x >> y >> k;
double distance = pow(x, 2) + pow(y, 2);
distance = sqrt(distance);
mp[distance] += ... | ALGO | 0.999857 | 3.710421 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-10-18T17:08: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": "b6e788df12e3... |
605ba78d-9000-4933-9d43-4688ed337879 | OpossumCrash/Maria-Levina-11K | ДЗ на 11.11.18/18.cpp | /*18) Напишите логическую функцию, проверяющую, является строка палиндромом.
Можно считать, что строка состоит только из букв латиницы.*/
#include <iostream>
using namespace std;
int chet(int b){
if ((b % 2) == 0){
return 1;
}
return 0;}
bool pal(char* &a, int n){
int i = 0;
while (*(a + i) == (*(a + n - 1 ... | ALGO | 0.999951 | 4.067232 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-11-25T15:14: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": "a2335e336... |
16537e62-3836-449b-83e3-d2aa361f1e35 | Souravrao-31/Data-Structure-and-Algorithms | Sorting/Linear_time.cpp | #include<bits/stdc++.h>
using namespace std;
/*
You will be given an array containing only 0s, 1s and 2s. you have sort the array in linear time that is O(N) where N is the size of the array.
Input Format
The first line contains N, which is the size of the array. The following N lines contain either 0, or 1, or 2.
... | ALGO | 0.999987 | 4.208638 | {
"github_metadata": {
"branch": "master",
"commit_count": 166,
"repo_created_at": "2020-05-27T12:26:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 35,
"issues": 0,
"pull_requests": 11
},
"file_meta": {
"content_id": "360fb... |
ca8bb308-7ba0-4b4f-a37d-086f5cf39dbe | Anatejl/NNTU_INF | 3/41-23-Kornilov/COMMENTS/application.cpp | #include "application.h" // Включить файл заголовка для класса Application
int app_launch(Application &app, Source_data& source){ // Функция запуска основного приложения
app_input(app, source); // Вызвать функцию ввода
app_process(app, source); // Вызвать функцию обработки
app_output(app); // Вызвать функц... | TOOL | 0.938999 | 3.975775 | {
"github_metadata": {
"branch": "master",
"commit_count": 390,
"repo_created_at": "2022-10-12T18:23: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": "a36e94b3... |
f1783593-8ac5-40cd-9168-3087333f8a3d | Pramoth-N/DAA | DP/LCS LIS/practice/prob3.cpp | /*
You are given two strings, strl and str2, and a maximum number k of allowed operations. An operation can be defined as either inserting or deleting a character from either of the strings. Your task is to calculate the maximum length of the longest common subsequence (LCS) of the two strings after performing at most ... | ALGO | 0.999963 | 4.577582 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2024-07-23T08:00: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": "ebb2d568d... |
c9c1113f-57fd-4af4-be31-74206d5e7828 | PeltX/solved | class2/10845.cpp | //10828, 큐 20240801
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int Q[10000];
int main()
{
int X, N, ins = 0;
string str;
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> str;
if (str == "push")
{
cin >> X;
Q[ins++] = X;
}
else if (str == "pop")
{
if (ins == 0)... | ALGO | 0.999712 | 4.04112 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-07-09T22:58: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": "ff95b22d82d... |
418bab2a-bed5-4092-bed3-419bc8e0a367 | Jorgefiestas/CompetitiveProgramming | Codeforces/CF1181C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, m;
string mat[N];
struct Flag {
int l = 0;
int c1 = 0;
int c2 = 0;
int c3 = 0;
};
Flag flag[N][N];
bool operator ==(Flag &a, Flag &b) {
bool l = a.l == b.l;
bool c1 = a.c1 == b.c1;
bool c2 = a.c2 == b.c2;
bool c3 = a.c3 == b.c3;
return... | ALGO | 0.999981 | 3.961473 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2019-01-08T13:08: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": "06d9783fb... |
628b6234-095a-4eb1-b830-b8a7ca92aa4a | golaced/back_MF | src/px4/include/optical_flow.hpp | /*
* optical_flow.h
*
* Created on: Dec 13, 2016
* Author: Christoph
*/
#pragma once
class OpticalFlow {
protected:
//params which can be set
int image_width;
int image_height;
float focal_length_x; //[pixel]
float focal_length_y; //[pixel]
public:
inline void setImageWidth( int ... | TOOL | 0.908929 | 5.403818 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-04-19T07:26:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af13f37c35... |
cd00c523-cca0-4667-8a2d-61b3f89c0e29 | MaradjaAryelle/QuestoesArvore | Questoes13-15.cpp | #include <iostream>
using namespace std;
struct NoArvore{
int data;
NoArvore *esquerda;
NoArvore *direita;
};
void posOrdem (NoArvore *raiz){
if (raiz != NULL){
posOrdem (raiz -> esquerda);
posOrdem (raiz -> direita);
cout << raiz -> data << " ";
}
}
int altura(NoArvore *raiz) {
if (raiz == NULL) {
... | ALGO | 0.997527 | 4.288359 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-06T04:35: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": "32bc448c86c9... |
f4bcd46f-fe47-4410-91f6-8308fdc84226 | rogelio08/310Project3 | util.cpp | #include "util.h"
#include <iostream>
#include <ctype.h>
#include <string>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
void nextCommandFind(char str[30], int* source, int* destination, int* flag) {
char upper;
char c;
char inputSource[] = { str[5], str[6] };
int src = atoi(inputSource);
*sour... | TOOL | 0.936878 | 3.267245 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-04-22T04:12:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2fd523e5e30... |
8cbed280-a16d-4b44-84b2-98833bde61cc | hyunstory/CodingTestPractice | Baekjoon/CPP/17837.cpp | #include<iostream>
#include<vector>
using namespace std;
#define MAX 12
#define chess_max 10
struct chess {
int x;
int y;
int dir;
};
int n, k, result;
int map[MAX][MAX];
vector<int> map_state[MAX][MAX];
chess Chess[chess_max];
int dx[] = { 0, 0, 0, -1, 1 };
int dy[] = { 0, 1, -1, 0, 0 };
int find_delete_nu... | ALGO | 0.99985 | 3.842718 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2020-12-01T10:58: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": "3f8b97e3cab... |
1ae7e3eb-6496-4937-8e23-0bbc925ce67f | dealii/dealii | bundled/boost-1.84.0/include/boost/gil/extension/rasterization/circle.hpp | //
// Copyright 2020 <NAME> <<EMAIL>>
//
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BOOST_GIL_EXTENSION_RASTERIZATION_CIRCLE_HPP
#define BOOST_GIL_EXTENSION_RASTERI... | ALGO | 0.997119 | 7.162077 | {
"github_metadata": {
"branch": "master",
"commit_count": 65304,
"repo_created_at": "2014-07-17T14:00:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1530,
"forks": 789,
"issues": 533,
"pull_requests": 92
},
"file_meta": {
"content_id": ... |
23948537-1017-4e62-bb27-c7b1598ef01b | saquibjawedbit/cp | C_Basketball_Exercise.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll solve(vector<pair<ll, ll>> &arr, ll index, bool second, vector<vector<ll>> &dp) {
if(index >= arr.size()) return 0;
if(dp[index][second] != -1) {
return dp[index][second];
}
ll incl = 0, excl = 0;
if(second) {
... | ALGO | 0.999981 | 3.634138 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-09-15T19:27: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": "f7cf3319458... |
3367751c-0c9e-46dc-ba32-53d94f05e8dd | jesuswr/cp-codes-and-problems | WF_TRAINING/30/f.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int das;
#define FOR(i,n,m) for(int i = n; i < (int)m; i++)
#define ROF(i,n,m) for(int i = n; i > (int)m; i--)
#define ms(obj,val) memset(obj,val,sizeof(obj))
#define ri(a) das... | ALGO | 0.999934 | 3.876408 | {
"github_metadata": {
"branch": "master",
"commit_count": 389,
"repo_created_at": "2019-07-11T00:26: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": "f244d3c1... |
5ba119af-a9a3-4bf8-8180-1b575c6ce7ce | ishandutta2007/codeforces-i | imeimi/normal/1100/F.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#define fs first
#define se second
using namespace std;
typedef pair<int, int> pii;
int n, q;
int C[500001];
vector<pii> P[500001];
int ans[500001];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n;
for (int i ... | ALGO | 0.999988 | 4.930027 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c07e83a2c0b... |
e2837907-c6b2-446e-8809-b22d01cab32a | theVCS/competitveProgramming | dataStructure/linkedList/singleLinkedList/14reverseList.cpp | #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;
#define ll long long int
//#define bint cpp_int
#define pii pair<int, int>
#define mod 1000000007
#define REP(i, a, b) for (int i = a; i < b; i++)
#define maxN 1000001
#define all(x) (x).... | ALGO | 0.999864 | 4.903477 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-02-23T06:51:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdb651d0e... |
5eef7e7f-c02e-4219-881c-fd184273ab46 | MHF2145/Data-Structure-2023 | Other Class/Strukdat Kelas D(1)/PRAKTIKUM/PRAKTIKUM 3/Ersya.cpp | #include <iostream>
#include <algorithm>
using namespace std;
struct AVLNode
{
int data;
struct AVLNode *left, *right, *parent;
int height;
int index = 0;
};
struct AVL
{
AVLNode *_root;
unsigned int _size;
};
void avl_init(AVL *avl)
{
avl->_root = NULL;
avl->_size = 0u;
}
int _getHe... | ALGO | 0.999902 | 4.35302 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-04-12T09:46:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a202ffb2210... |
af85d5b6-a54a-4080-82db-2d971329b42c | mp9weff/lab-4.7 | lab4.7/lab4.7.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
double xp, xk, x, dx,a = 0, R = 0, S = 0,eps=1;
int n = 0;
cout << "xp = "; cin >> xp;
cout << "xk = "; cin >> xk;
cout << "dx = "; cin >> dx;
cout << "eps = "; cin >> eps;
cout << fixed;
cout << "-------------------------... | ALGO | 0.996966 | 3.694813 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-10-27T22:26: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": "bedc4175b5... |
3a66e950-04e9-43cf-b750-76b2ce359570 | Kulkarni-mohit/SPPU-Comp-3rd-semester-Practicals | Sem 3 DSL Practicals/4. Sparse Matrix.cpp | #include <iostream>
using namespace std;
int main()
{
int m,n;
cout<<"Enter the number of rows";
cin>>m;
cout<<"Enter the number of columns";
cin>>n;
int mat[m][n];
for (int i=0; i<m; i++)
{
for (int j=0; j<n; j++)
{
cout<<"Enter the value for "<<i<<","<... | ALGO | 0.996267 | 3.312872 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-26T06:52: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": "f6fe8f1f3024... |
2922d58a-7015-44f5-a9ab-f2ff2fdfc685 | ipc2023-classical/planner17 | planners/powerlifted/src/search/datalog/datalog.cc | #include "datalog.h"
#include "rules/generic_rule.h"
#include "rules/product.h"
#include "transformations/action_predicate_removal.h"
#include "transformations/generate_edb.h"
#include "transformations/goal_rule.h"
#include "transformations/normal_form.h"
#include "transformations/remove_equivalent_rules.h"
#include ... | ALGO | 0.932395 | 3.731241 | {
"github_metadata": {
"branch": "latest",
"commit_count": 149,
"repo_created_at": "2023-02-07T11:08:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30addb2e8... |
026707cb-0f31-4ece-9f6e-1909776477d5 | ElliotEklund/MAVARIC-MTS | MAVARIC/src/hamiltonian/theta_mixed.cpp | #include "theta_mixed.hpp"
theta_mixed::theta_mixed(int num_states,int nuc_beads, int elec_beads,
C_Matrix &C_In, M_Matrix &M_In)
:num_states(num_states),
nuc_beads(nuc_beads),
elec_beads(elec_beads),
gamma_mat(identity_matrix<std::complex<double> > (num_states)),
Q_tra... | ALGO | 0.984715 | 5.10852 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-04-03T00:07:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d6718463... |
f28fae37-8cf5-460e-a0f3-d1ac2e7f3e11 | RahulScripted/DSA | Single Linked List/LinkedListCycle.cpp | // 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 is connecte... | ALGO | 0.999979 | 5.411691 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-18T00:14: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": "357dcde53719... |
5198bf1f-5924-4c2f-8753-71728434c75f | MissouriMRDT/RoveWare | RoveMotionControl/Experimental/PIVConverter.h | /*
* PIVConverter.h
*
* Created on: Sep 28, 2017
* Author: timurguler
*/
#ifndef ROVEJOINTCONTROL_PIVCONVERTER_H_
#define ROVEJOINTCONTROL_PIVCONVERTER_H_
#include "../AbstractFramework.h"
//represents an PIV loop algorithm, IE two cascaded PI loops with the outer loop being a position PI loop that genera... | ALGO | 0.929859 | 7.042496 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2016-02-13T21:04:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "7374313a9e... |
20872c3a-6541-4af9-94ce-6ae51b8fb788 | zittoooo/Algorithm | BFS/4024_lake.cpp | #include <iostream>
#include <queue>
#define X first
#define Y second
using namespace std;
int dx[8] = {-1,-1,-1,0,0,1,1,1};
int dy[8] = {-1,0,1,-1,1,-1,0,1};
char board[102][102];
int vis[102][102];
int w, h;
int main()
{
int num = 0;
queue<pair<int ,int> > Q;
cin >> w >> h;
for (int i = 0 ; i < h; i+... | ALGO | 0.999341 | 3.653871 | {
"github_metadata": {
"branch": "master",
"commit_count": 291,
"repo_created_at": "2020-02-22T06:15:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8ee4979... |
242d55f6-0d9d-492c-b925-6f83f91ef023 | march1896/pegas | data/9.9.2013/main.cpp | #include <iostream>
#include <set>
#include <ctime>
#include <cassert>
using namespace std;
static int __num_modify; /* number of insert and remove */
static int __num_search;
static int __data_diff_type; /* number of different values to store in the set */
static int __data_max_count; /* max count of a single value ... | ALGO | 0.975838 | 3.844249 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2013-10-30T00:17:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea689f763... |
00010568-d401-48de-9405-0722e7ddd961 | Mohamedosama-dev/-Algorithm-Problem | Problem 6.cpp | #include <iostream>
#include<istream>
#include<cmath>
using namespace std;
//Translation & scalinggs
int* ComputerGraphicstransformations(int* v, int** TheMATR){
int* newV = new int[3];
for(int i=0;i<3;i++){
int element = 0;
for(int j=0;j<3;j++){
element += v[j] * TheMATR[j][i];
... | ALGO | 0.984895 | 3.532922 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-09-09T01:00: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": "3caf6083008e... |
11a819a6-3ab6-43c2-9577-be12fc37793d | E3SM-Project/E3SM | components/homme/utils/trilinos/donoxloca3d.cpp | #include "LOCA.H"
#include "LOCA_Epetra.H"
//STRAT1
#include "NOX_Epetra_LinearSystem_Stratimikos.H"
// Trilinos Objects
#include "Epetra_MpiComm.h"
#include "Epetra_Map.h"
#include "Epetra_Vector.h"
#include "Epetra_RowMatrix.h"
#include "Epetra_CrsMatrix.h"
#include "Epetra_Map.h"
#include "Epetra_LinearProblem.h"
#... | ALGO | 0.998438 | 3.404633 | {
"github_metadata": {
"branch": "master",
"commit_count": 64504,
"repo_created_at": "2014-07-03T19:04:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 381,
"forks": 425,
"issues": 535,
"pull_requests": 54
},
"file_meta": {
"content_id": "... |
dcde8d79-7548-445f-ae97-ea6fe219cdd2 | MashPlant/undergraduate_projects | 数据结构/UIntSet.h | template <unsigned N, unsigned Bits>
struct UIntSet
{
typedef unsigned size_type;
typedef unsigned word_type;
const static size_type _word_bit = 8 * sizeof(word_type);
const static size_type _data_len = N * Bits / _word_bit + 1u;
word_type _data[_data_len] = {};
struct Ref
{
UIntSet... | TOOL | 0.956123 | 6.720387 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-05-14T01:07:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 11,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c5eddd7e... |
89ac3020-fd46-4269-bca3-e3178c375bd8 | keplerisgone/CodingTest | Baekjoon/b26513.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n = -1, a = 1, b = -1;
cin >> n >> b;
while (n != 0 && b != 0) {
a = 1;
for (int i = 0; i < n; i++) {
int temp;
string state;
cin >> temp >> state;
if (state =... | ALGO | 0.999212 | 3.333561 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-09-01T15:42: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": "b80bd027f77... |
976576eb-77a1-4858-aade-061128205b7c | MinJunKimKR/Sw-maestro-2nd-coding-test | Charlie/baekjoon/11404.c++ | #include <bits/stdc++.h>
#define F_I ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // F_I 사용 시 주의) scanf와 printf 사용 금지, 오로지 cin , cout 만 사용!
#define INF 987654321
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pl;
typedef pair<int, int> pi;
ll Min(ll a, ll b) { return (a < b) ? a : b; }
ll ... | ALGO | 0.999984 | 3.622339 | {
"github_metadata": {
"branch": "main",
"commit_count": 164,
"repo_created_at": "2022-03-11T12:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db99e0f84f... |
cbf9cb92-30eb-4769-8d78-29808c332897 | dudaribeiro7/Trabalho_Estrutura_de_Dados_II | tabela/src/huffman.cc | #include <sstream>
// #include <map>
#include "../include/huffman.h"
#include "iostream"
#define tam 28
#define espaco 27
Huffman::Huffman(ifstream & livro) {
if(livro.is_open()){
this->nSaida = 0;
this->nEntrada = 0;
this->livro = &livro;
contFreq(); // ve a frenquencia dos carac... | ALGO | 0.978761 | 3.48693 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-10-17T14:04: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": "5248cc0aff0e... |
6702bb5a-159e-493a-8145-eab7a388a608 | 0point1Zishan/CP | DSA Practice/Graphs/Alien Dictionary.cpp | class Solution{
public:
bool dfs(vector<vector<int>> &adj, vector<int> &visited, int node){
visited[node] = 2;
for(auto it: adj[node]){
if(!visited[it]){
if(dfs(adj, visited, it)) return true;
}
if(visited[it] == 2) ... | ALGO | 0.999996 | 5.302903 | {
"github_metadata": {
"branch": "main",
"commit_count": 485,
"repo_created_at": "2024-02-26T07:12:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19d2c80a95... |
ee721880-cdd2-4828-a3d5-07e224f980f5 | eh2ll/algorithm | 40-49/bj2042.cpp | //justicehui
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
ll init(vll &arr, vll &tree, int node, int start, int end){
if(start == end){
return tree[node] = arr[start];
}
return tree[node] = init(arr, tree, node * 2, start, (start + end) / 2) + init(ar... | ALGO | 0.999977 | 5.475994 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-08-30T04: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": "fac951921db... |
b2624f76-8a4f-4864-83c4-aaf2a32f38eb | FelixWinchester/_SeminarDz2 | Dop.Dz/2.cpp | #include <iostream>
#include <string>
using namespace std;
class Conference {
private:
string name;
string location;
string* speakers;
int numSpeakers;
int maxSpeakers;
int numAttendees;
public:
// Конструкторы
Conference() {
name = "";
location = "";
numSpeakers ... | TOOL | 0.956387 | 5.701469 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-02-27T18:50: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": "8529d626016... |
9be10b5b-772f-4620-94c9-38d32ff5d564 | yzxo/leetcode | LeetCode3/LeetCode3/69_sqrt.cpp |
//NewTon's method, I DON'T understand
int sqrt_Newton(int x) {
long r = x;
while (r*r > x)
r = (r + x / r) / 2;
return r;
}
// binary search
int sqrt_binary1(int x) {
if (x == 0)
return 0;
int left = 1, right = x;
while (true) {
int mid = left + (right - left) / 2;
if (mid > x / mid) {
right = ... | ALGO | 0.999925 | 4.037623 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-04-19T15:30:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecf05d7f92... |
98969903-21d4-404a-ade9-7f20130e8691 | mk-isos/Algorithms_Cpp | coding_test/BOJ-강의x/1031.cpp | #include <bits/stdc++.h>
#define FIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;
int N, M;
int f[103][103]; // 현재 유량
int c[103][103]; // 용량
vector<int> adj[103];
int total_flow;
void ek_flow()
{
int S = 0, T = N + M + 1;
while (true)
{
vector<int> prev(N + M + 2, -1);
... | ALGO | 0.999937 | 3.771308 | {
"github_metadata": {
"branch": "master",
"commit_count": 503,
"repo_created_at": "2024-06-27T13:14:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2749b6a3... |
50826454-44d4-4c4a-ac29-18c07634bab6 | MateuszPasternak/Pasternak_Mateusz_POiO2023_genetyczny | Algorytm_Genetyczny/TPopulation.cpp | #include <iostream>
#include <random>
#include "TPopulation.h"
unsigned int TPopulation::pop_count = 0;
TPopulation::TPopulation(int cand_num, bool rand)
{
this->Max_candidates_num = cand_num;
for (size_t i = 0; i < cand_num; i++)
{
TCandidate cand;
if (rand == true)
{
cand.rand_gens_val();
this->cand... | ALGO | 0.988651 | 4.089384 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-04-03T06:29: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": "349450ff606... |
c2e956e3-c516-46ae-bd03-fea183a386c0 | Kamshanski/_CppLab | reversi/engine/ReversiEngine.cpp | #include "includeAll.h"
#include "utilities.cpp"
#include "ReversiEngine.h"
bool ReversiEngine::isStarted() const {
return _isStarted;
}
void ReversiEngine::finishGame() {
if (!isStarted()) {
tryToNotifyOnError(gameStateException());
return;
}
auto snap = getSnapshot();
_isStart... | TOOL | 0.953987 | 4.685649 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2021-09-19T11:10: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": "6f1600709... |
ed4eba8a-04f7-4a99-8b94-9fc022a7248f | aftabansari2005/DSA | 2888-minimum-index-of-a-valid-split/minimum-index-of-a-valid-split.cpp | class Solution {
public:
int minimumIndex(vector<int>& nums) {
int dominant = -1, count = 0;
for (int num : nums) {
if (count == 0) {
dominant = num;
count = 1;
} else if (num == dominant) {
count++;
} else {
... | ALGO | 0.999985 | 5.667934 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2025-01-13T15:29:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc939131e2c... |
df430390-5750-4949-a662-71891b7f2905 | mostafa-cse/CSES-Solutions | 5. Range Queries/E - Range Xor Queries /Using_SQRT_Decomposition.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
int n, q;
cin >> n >> q;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
int block_size = sqrt(n) + 1;
vector<int> block_sum(block_size, 0);
for (int i = 0; i < n; i++)
{
block... | ALGO | 0.999975 | 5.1027 | {
"github_metadata": {
"branch": "main",
"commit_count": 105,
"repo_created_at": "2025-05-25T08:12:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22e5b0a407... |
d49df61f-d697-4cee-9208-904dbe28c852 | cringelordium/hse_aglo | ford_bellman_negative_cycle.cpp | #include <iostream>
#include <vector>
#include <limits>
#include <climits>
#include <algorithm>
std::vector<int> BellmanFord(std::vector<std::vector<int>>& graph, int vertices, int source) {
std::vector<int> distance(vertices + 1, INT_MAX);
std::vector<int> from(vertices + 1, -1);
std::vector<int> cycle;... | ALGO | 0.99999 | 5.094992 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-20T11:41:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a73a92c6c19... |
a13ac04e-da99-497e-b338-e3a259078dce | Safin178/Rating-Rocket | A_TubeTube_Feed.cpp | #include<bits/stdc++.h>
using namespace std;
typedef vector<long long> vl;
typedef vector<int> vi;
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))
#define ll long long
#define pb push_back
#define endll '\n'
#define CY cout<<"YES\n";
#define CN cout<<"NO\n";
#define CYR cout<<"YES\n";retur... | ALGO | 0.999972 | 3.494727 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2023-07-08T06:13: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": "2f17d7857e2... |
f756a81f-6c3c-4baf-b279-5b40588b9d7b | Rishabh-1999/Algorithms-and-Data-Structures | Linklists/Remove Loop.cpp | #include<iostream>
#include <cstdlib>
using namespace std;
struct node
{
int data;
struct node *next;
};
void detectAndRemoveLoop(node* head)
{
if (head == NULL || head->next == NULL)
return;
node *slow = head, *fast = head;
slow = slow->next;
fast = fast->next->next;
whi... | ALGO | 0.999901 | 4.102581 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-10-16T07:38: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": "1c764fc1f... |
187228f1-5705-4f90-bb7a-a486cb4cd73c | yjdong9697/Baekjoon-practice_cpp | baekjoon_14286.cpp | #include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define INF 987654321;
const int MAX_N = 501;
using namespace std;
struct edge{
int from, to, capacity, flow;
edge* reverse_edge;
edge(int u, int v, int c) : from(u), to(v), capacity(c), flow(0)
{}
int ... | ALGO | 0.999943 | 4.513527 | {
"github_metadata": {
"branch": "master",
"commit_count": 565,
"repo_created_at": "2020-07-23T15:44: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": "9c3d4af1... |
229d6773-071f-4fbc-a743-1d90ffffc457 | Jaed69/antlr-cpp-statistical-interpreter | src/SistemaEvaluacion.cpp | #include "SistemaEvaluacion.h"
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <iomanip>
// ===== GESTIÓN DE EMPLEADOS =====
void SistemaEvaluacionFisher::agregarEmpleado(const Empleado& empleado) {
empleados[empleado.id] = empleado;
std::cout << "Empleado agregado: " << ... | TOOL | 0.959389 | 6.475667 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-06-29T04:02:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f095aa132a6... |
bf678750-2f4b-444b-bae5-4fc882465f12 | jHoon0223/2021_Algorithm | HW5 - Traveling Salesperson/HW5_2.cpp | #include <stdio.h>
#define N 4
#define INF 9999
int W[N][N] = { {0,2,9,INF},
{1,0,6,4},
{INF,7,0,8},
{6,3,INF,0} };
int TSP(int W[N][N], int T[N], int start, int n) {
int tmp[N], minT[N];
int minCost, currCost;
if (start == n-2)
return W[T[n-2]][T[... | ALGO | 0.999898 | 3.081823 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2021-09-15T02:09: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": "22f86efb2... |
bdf77b75-bf79-4bd4-a0dd-9699ba8cc03d | torres07/competitive-programming | spoj/MTOTALF.cpp | #include <bits/stdc++.h>
#define vi vector<int>
using namespace std;
#define go(i,n) for (int i = 0; i < (int)n; i++)
#define MAX_V 100 // enough for sample graph in Figure 4.24/4.25/4.26/UVa 259
#define INF 0x3f3f3f3f
int res[MAX_V][MAX_V], mf, f, s, t; // global variables
vi p;
void augment... | ALGO | 0.999951 | 3.65229 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2018-07-17T14:51:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2eb388d9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.