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 |
|---|---|---|---|---|---|---|---|
284b4dae-28fd-47cf-9134-2639ef8d52a5 | nicehcy2/KW-Data-Structure | HW2_2021203034/HW2_2021203034.cpp | #include <iostream>
#include <stack>
#include <string>
#include <cctype>
#include <cstring>
#include <cstdlib>
#include <vector>
// 소프트웨어학부 2021203034 허찬영
using namespace std;
const char DECIMAL = '.';
const char RIGHT_PARENTHESIS = ')';
const char LEFT_PARENTHESIS = '(';
const char RIGHT_BRACE = '}';
const char LE... | ALGO | 0.9993 | 4.672991 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-13T07:04: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": "7e46f379c601... |
dc9f7c18-f0a2-43de-8a04-e99c966ece51 | 9inpachi/genn-opencl | genn_examples/va_benchmark/simulator.cc | // Standard C++ includes
#include <algorithm>
#include <cassert>
#include <iostream>
#include <random>
// GeNN robotics includes
#include "timer.h"
#include "spikeRecorder.h"
// Model parameters
#include "parameters.h"
// Auto-generated model code
#include "va_benchmark_CODE/definitions.h"
template <typename Genera... | ALGO | 0.922376 | 6.753983 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2020-02-08T10:17:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6ba66bf4... |
0ee26cb8-095e-4e5d-8b0c-a8a43fd564fc | sathyaBabu/AdvancedCPP_Index | any_tuple_Optional_Variant_range/Consteval_constexpr/Consteval_constexpr/main.cpp | //
// main.cpp
// Consteval_constexpr
// Immediate functions
// Created by <NAME> on 11/07/23.
//
/*
Immediate functions
Similar to constexpr functions, but functions with a consteval specifier must produce a constant. These are called immediate functions.
The consteval keyword in C++20 is used to indicat... | TOOL | 0.980292 | 7.375242 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-07-18T01:58:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5686489c76a... |
f6a5dd16-388c-429d-ae6b-50431228e53f | andrealopezco20/ADA | TAREA 1 Analisis/Orientada_Objetos.cpp | #include<iostream>
using namespace std;
template<typename Type>
class CVector {
private:
Type * m_pVect;
int m_nCount = 0,
m_nMax = 0,
m_nDelta;
void Init(int delta);
void Resize();
public:
CVector(int delta = 10);
void Insert(Type elem);
... | TOOL | 0.95061 | 4.715945 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-06-16T15:37: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": "c06a1a7e815... |
61c73ef2-97f0-48d1-b963-3da46b5023ac | Rotoscope/Knights_Tour | Part_B/main.cpp | /*
* File: main.cpp
* Author: <NAME>
*
* Created on October 19, 2015, 10:21 PM
* CECS282 Project 6 Knight's Tour part B
*/
#include <cstdlib>
#include <iomanip>
#include <iostream>
#define SIZE 8
using namespace std;
bool isValid(int, int);
void display(int (&cb)[SIZE][SIZE]);
/*
*
*/
int main(int argc... | ALGO | 0.976462 | 3.738791 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2015-10-20T22:26: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": "e2a7a8403... |
c4b642dd-29d9-4dd5-8c14-fff1b9748c24 | RishabhSinghal04/C_Plus_Plus | 1 Basics/References.cpp |
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int num = 10, num2 = 100, &refNum = num2;
const int &refNum2 = num; // const reference
// Print address of all variables
cout << "num : " << &num << '\n'
<< "num2 : " << &num2 << '\n'
<< "refNum : " << &... | TOOL | 0.952139 | 3.84108 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-03-26T10:17: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": "d5cae083836... |
2316571a-8764-4ddd-b14b-5a52b9b4f4ee | akhikolla/testpackages | fuzzedpackages/LeMaRns/src/RcppExports.cpp | // Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 1<PASSWORD>
#include <RcppArmadillo.h>
#include <Rcpp.h>
using namespace Rcpp;
// calc_M2
arma::mat calc_M2(arma::mat N, arma::mat ration, arma::mat wgt, double nfish, double nsc, double other, Rcpp::NumericVector sc_Linf, Lis... | ALGO | 0.991295 | 5.959853 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f47efc6e5c... |
37f6ae8b-2afc-449f-8c1c-0a2b6cd843b3 | chunzhang/practice | leetcode/0246_strobogrammatic_number/sol.cpp | /*
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).
Write a function to determine if a number is strobogrammatic. The number is represented as a string.
For example, the numbers "69", "88", and "818" are all strobogrammatic.
*/
#include "../common/commo... | ALGO | 0.999432 | 5.758718 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2017-09-16T23:04: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": "0bdc0365... |
5b923310-dc16-4c2d-ae02-6b9806e6b692 | folgerwang/UnrealEngine | Engine/Plugins/Runtime/EditableMesh/Source/EditableMesh/GeometryHitTest.cpp | // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "GeometryHitTest.h"
#include "EditableMesh.h"
#include "MeshAttributes.h"
#include "MeshElement.h"
namespace GeometryTest
{
static FAutoConsoleVariable OverlayPerspectiveDistanceBias(TEXT("MeshEd.OverlayPerspectiveDistanceBias"), 0.05f, TEXT("How ... | ALGO | 0.977613 | 5.849901 | {
"github_metadata": {
"branch": "release",
"commit_count": 73960,
"repo_created_at": "2019-07-21T08:25:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 37,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "89d... |
dd98abad-548a-44af-a16b-be22611a9e7a | deepam20050/competitive-programming | solutions/289390A.cpp | #include "bits/stdc++.h"
using namespace std;
#ifdef DEBUG
#include "../algo/debug.hpp"
#else
#define debug(...)
#endif
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define sz(x) int((x).size())
#define all(x) begin(x), end(x)
#define eb emplace_back
using lli = long long;
using pii = pair < int, int >;
con... | ALGO | 0.99997 | 5.295461 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-01-05T12:59: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": "bffe1ff69fb... |
95327acc-500f-40b8-8b62-55e5caf4804e | algorithm007-class02/algorithm007-class02 | Week_04/G20200343040262/LeetCode_127_0262.cpp | class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
if (wordList.empty()) return 0;
if (find(wordList.begin(), wordList.end(), endWord) == wordList.end()) return 0;
int step = 1;
queue<string> q;
q.push(beginWord);
... | ALGO | 0.99999 | 5.624712 | {
"github_metadata": {
"branch": "master",
"commit_count": 1636,
"repo_created_at": "2020-03-10T07:12:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33,
"forks": 115,
"issues": 619,
"pull_requests": 4
},
"file_meta": {
"content_id": "b39... |
b5158a69-d06c-4d0b-a6b4-5d0d7d36e8cb | alexandraback/datacollection | solutions_5688567749672960_1/C++/Agentchuck/main.cpp | #include <string.h>
#include <stdint.h>
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <sstream>
#include <fstream>
using namespace std;
typedef ... | ALGO | 0.99955 | 3.76706 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd7ebe88b... |
b7e002e5-f29e-4d87-8a9e-23ef719f6c65 | koyamantice/AloneWord | base/Easing.cpp | #include<math.h>
#include"Easing.h"
static const float PI = 3.141592f;
using namespace std;
namespace EasingFunction {
//イージング関数
float InQuad(float t) {
return t * t;
}
float InCubic(float t) {
return t * t * t;
}
float InQuart(float t) {
return t * t * t... | ALGO | 0.928873 | 5.295572 | {
"github_metadata": {
"branch": "master",
"commit_count": 1109,
"repo_created_at": "2022-02-04T13:57: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": "70abb3a... |
cd5257f6-b3c3-487a-bc75-b7eeb3d1d8c6 | tiger0132/code-backup | Review/Tarjan/Rev #1/P2272 [ZJOI2007]最大半连通子图.cpp | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <set>
#include <stack>
typedef long long ll;
const int N = 1e5 + 51, M = 1e6 + 61;
struct edge {
int to, next;
} e[M << 1];
int head[N], cnt, p;
void addedge(int x, int y) { e[++cnt] = (edge){y, x[head]}, x[head] = cnt; }
int dfn[N], low[N], ins[N], ... | ALGO | 0.999953 | 4.140905 | {
"github_metadata": {
"branch": "master",
"commit_count": 862,
"repo_created_at": "2019-08-03T04:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8542724... |
779f29f0-25e9-4b3c-9806-ac503c4d7460 | XJJGoing/-C-- | 二叉树、以及二叉树的各种操作.cpp | #include<iostream.h>
const int Max=32;
template<typename T>
struct biNode{
T data;
biNode<T> *lChild,*rChild;
};
template<typename T>
class biTree{
biNode<T> *root;
public:
biNode<T> *getRoot(){ return root;}
biTree();//构造函数,初始化二叉链表
~biTree();//析构函数,释放二叉链表中的结点
void release(biNode<T> *rt);
//释放以rt所指向的结点为根结点的二叉树
... | ALGO | 0.999762 | 3.437584 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-01-28T02:48:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1c84c41dd... |
0496e403-df62-47f3-a873-26a9447b6c4a | wnsah814/baekjoon | 1439.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef pair<double,double> pd;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vvll;
typedef vector<vector<pl... | ALGO | 0.999998 | 4.334108 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-05-20T18:13: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": "2ba7ac20347... |
a4a09400-15d3-4166-8c08-701f140b3260 | morecreativa/Algorithm_Practice | SW_Expert_Academy/SW_Expert_Academy/2115.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
#define ll long long
#define FOR(i,n) for(int i=0;i<n;i++)
#define INF 98765
int answer = 0;
int n, m, c;
int map[10][10];
int visit[10][10];
bool desc(int a, int b) {
return a > b;... | ALGO | 0.99998 | 4.078762 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2020-01-07T05:15: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": "fbbbba0d5... |
44989e04-8985-48cd-84ee-e46fadef5a86 | JJ-learning/Algoritmica | 2018:2019/P3/src/funciones.cpp | #include "funciones.hpp"
void fillConjunto(Conjunto &C, int tam){
for (int i = 0; i < tam; ++i)
{
C.setElement((rand()%10000)+1, i);
}
};
bool isInSet( Conjunto k,int value){
bool inside=false;
for(int i=0; i < k.sizeC(); i++){
if(k.getElement(i) == value){
inside=true;
}
}
return inside;
};
void sho... | ALGO | 0.997709 | 3.801735 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-01-22T19:06:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccec789420c... |
718a4b74-4db9-4fba-a87b-b561b6fa0805 | bubbercn/LeetCode | C++/Solved/874_WalkingRobotSimulation.h | #pragma once
#include "Common.h"
class Solution
{
public:
int robotSim(vector<int> &commands, vector<vector<int>> &obstacles)
{
int x = 0;
int y = 0;
int direction = 0;
unordered_map<int, unordered_set<int>> lookup;
for (auto &obstacle : obstacles)
{
... | ALGO | 0.999972 | 5.939235 | {
"github_metadata": {
"branch": "master",
"commit_count": 685,
"repo_created_at": "2016-04-24T12:45: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": "d9f59780... |
97b6c3df-f801-4731-b63f-7ca910edae57 | JanasCodeSpace/InfoProj | RobPathGen/header/SegmentApproximator.h | /**
* @file SegmentApproximator.h
*
* @brief Berechnung des Douglas Peuker Algorithmusses
*/
#pragma once
#include <vector>
#include <list>
#include <iostream>
#include <math.h>
#include "Point3D.h"
#include "Logging.h"
using namespace std;
/**
* In dieser Klasse wird der Pfad mit hilfe des Douglas-Peuker Algor... | ALGO | 0.999446 | 4.37187 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2023-03-16T07:57:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b10b0638... |
bacce711-74fb-4565-8970-9f59b93a5256 | jusonalien/Algorithms-Datastructure | HDU/2546.cpp | ////////////////////System Comment////////////////////
////Welcome to Hangzhou Dianzi University Online Judge
////http://acm.hdu.edu.cn
//////////////////////////////////////////////////////
////Username: jusonalien
////Nickname: jusonalien
////Run ID:
////Submit time: 2014-07-28 23:15:44
////Compiler: GUN C++
///////... | ALGO | 0.999962 | 3.183102 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2014-12-08T13:50:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2559ba59d... |
b737d97b-d40e-4867-81c5-0f4667912cc1 | yashs33244/my-cpp-codes | problems/little_girl_max_sum.cpp | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define int long long
#define ld long double
#define sza(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()
const int MAX_N = 1e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ld EPS = 1e-9;
bool isPrime(int n) {
if (n < 2) return f... | ALGO | 0.999956 | 4.67548 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-12T18:11: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": "c512a16493d7... |
a8f51da0-1761-4a8a-ae91-e3c61d739658 | nextpyp/ettk | inc/fm/nbfFastMarchingFool3D.h | #ifndef FILE_nbfFastMarchingFool3D
#define FILE_nbfFastMarchingFool3D
// Class nbfFastMarchingFool3D.
//
// 3D region growing
//
#include <fm/nbfFastMarching3D26.h>
template< class Pixel >
class nbfFastMarchingFool3D : public nbfFastMarching3D< Pixel >
{
public:
// constructor takes weight array as input
nbfFast... | ALGO | 0.980724 | 5.782191 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-21T21:36:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a994fd6a23840... |
6ae2f18a-0172-4e22-9c8e-7cfc67b41b95 | syadav481/leetcode | 160.cpp | #include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
/**
* Definition for singly-linked list.
* struc... | ALGO | 0.999944 | 5.442671 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2023-10-26T03: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": "493e5b7688b... |
c9ae25bd-9e4a-4fc9-90cf-86ffc5f7ce7a | makio93/competitive-annualsites | Facebook/HackerCup/2021/Round1/C/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i))
#define all(x) ... | ALGO | 0.999975 | 4.419729 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2021-07-03T15:32: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": "c7facf3762c... |
baca4c94-0891-4e78-840d-f1c6b015ca07 | Delta2904/Codeforces | 2000A - Primary Task.cpp | // Codeforces | ThemeCP Training
// /\_/\ Author: <NAME> (MangoFI)
// ( o.o ) Github: github.com/Delta2904
// > ^ < Codeforces: codeforces.com/profile/MangoFI
//
// ThemeCP Level: implementation/math/strings/*800 - ThemeCP Level 2
// Problem : 2000A - Primary Task (https://codeforces.com/contest... | ALGO | 0.999822 | 5.259907 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2024-10-12T23:43: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": "4f8b6c8503... |
0a8864c4-e5bf-40c3-953f-5f9d9a096a53 | laundry-96/MMHeaps | Driver1.cpp |
#include "MMheap.cpp"
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <cstdlib>
using namespace std;
int main(int argc, char *argv[])
{
MMheap<int> theHeap;
MMheap<int> theHeap2;
vector<int> numbers;
string filename;
if(argc == 2)
{
filename = argv[1];
}
... | ALGO | 0.992783 | 3.488945 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2016-04-14T13:53: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": "67f7c1e52... |
be1a5545-ddc1-4d11-828d-062a629afb7f | edyapups/Algo | Lab_6/c.cpp | // Copyright 2020 <NAME>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <fstream>
#include <functional>
using namespace std;
class LinkedMap {
private:
struct Node {
string key;
string value;
Node *prev;
Node *next;
Node(string key, s... | ALGO | 0.99903 | 4.823625 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-03-29T14:45: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": "1683b8f01b... |
b8013c4d-7319-4bf4-85ac-272f0ef00ca0 | rocksdanister/OpenGL | LabQuestions/Transformations/Scaling,Translation,Rotation.cpp | #include<GL/gl.h>
#include<GL/glut.h>
#include<stdio.h>
#include<math.h>
int i,n,size;
float x[5],y[5],tx,ty,sx,sy,theta;
int ch;
void draw()
{
glColor3f(1,1,1);
glBegin(GL_LINE_LOOP);
for(i=0;i<n;i++)
glVertex2f(x[i]/size,y[i]/size);
glEnd();
}
void init()
{
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT);
glBeg... | ALGO | 0.996113 | 3.674215 | {
"github_metadata": {
"branch": "master",
"commit_count": 435,
"repo_created_at": "2016-11-25T15:39:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdd14ea9... |
af403f3b-7033-4a28-8634-7333bc57842b | mrid9/competitive-programming | hacker-rank/algorithms/warmup/worst-permutation.cpp | //
// main.cpp
// weekly-challenge
// https://www.hackerrank.com/contests/w14/challenges/worst-permutation
// The worst permutation is just the largest number
//
#include <iostream>
void print(int *a, int n) {
for (int i = 0; i < n; i++) {
printf("%d ", a[i]);
}
printf("\n");
}
void swap(int ... | ALGO | 0.999958 | 4.251322 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2015-04-17T18:14: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": "c2c40932d... |
7629a04a-2717-4dca-b9c4-873bf94d19fb | AlphaByte-RedTeam/College | Semester 1/Tugas/32200091_Andrew Virya Victorio TM Pembahasan 5.cpp | //Terdapat variabel N untuk diinput, dan
//variabel jumlah dengan nilai awal 0,
//variabel angka nilai awalnya 1. Deret hitung
//angka terus bertambah dengan syarat mencapai maksimal
//nilai sama dengan di N. Jumlah=jumlah+angka
//Buatlah algoritma pseudocodenya dan flowchartnya dengan struktur FOR
//C++ Code//
#incl... | ALGO | 0.999715 | 4.140136 | {
"github_metadata": {
"branch": "main",
"commit_count": 134,
"repo_created_at": "2020-11-24T14:32:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63a98802eb... |
961d6284-cfd5-4fb1-a73f-e952301cc8dc | chanzy3/Financial_Computing | Examples/Examples.hpp | //Copyright (c) <NAME>, 2000-2008. All rights reserved.
#ifndef __Examples_hpp__
#define __Examples_hpp__
#include "cfl/Data.hpp"
#include "cfl/AssetModel.hpp"
#include "cfl/InterestRateModel.hpp"
/**
* \file Examples.hpp
* \author <NAME>
* \date 2000-2008
*
* \brief Examples for the course Financial Comp... | ALGO | 0.940022 | 4.81899 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-12-02T17:50:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "059bca4121... |
fb207efd-02fa-4356-a7e4-0574316ad4ca | ilyabelow/algorithms_tasks | 2_term/1_module/Task6/main.cpp | #include <iostream>
#include <vector>
#include <list>
#include <iostream>
#include <stack>
#include <algorithm>
//graph with adjacency lists
class ListGraph {
private:
//we have to store two vectors to be able to find and children and parents for O(n)
std::vector<std::list<int>> adjacency_list_outcome;
std... | ALGO | 0.999353 | 5.754875 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2019-04-28T13:17: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": "eb8db942a... |
b41ddb45-db17-4683-a2f1-c02ca2a26a2c | ivankra/acm | codejam/2006/qual-set4/A/p.cc | #include <algorithm>
#include <vector>
#include <sstream>
using namespace std;
struct SquareCounting {
int howMany(vector<string> grid) {
int N = grid.size(), M = grid[0].size();
int sq[32][32];
memset(sq, 0, sizeof(sq));
for (int y = N-1; y >= 0; y--) {
for (int x = M-1; x >= 0; x--) {
sq[y][x] = 1;
... | ALGO | 0.999448 | 4.531293 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2010-01-03T06:51:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 118,
"forks": 43,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "e3424b... |
2c31db5f-7f9e-44b6-8c30-4898c847e9e2 | SnowySparks/Algorithm_Solve | CodeTree/DP/아이템을 적절히 고르는 문제/최소차분할.cpp | #include <iostream>
#include <cstring>
#include <vector>
#define f(a, b, c) for(int a=b;a<c;++a)
using namespace std;
const int inf =1e9+7;
const int max_val = 1e5;
int n;
int arr[101];
bool dp[101][max_val+1];
int main(void) {
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
cin >> n;
int total ... | ALGO | 0.999996 | 4.049621 | {
"github_metadata": {
"branch": "main",
"commit_count": 186,
"repo_created_at": "2024-11-21T01:38: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": "7bd86ebee9... |
bb520104-bca6-4415-a81f-2bce31bf1dd4 | Jonasmalmlof/TDP004 | Unsorted/1DOJO/2016-11-23 UPPG1.cc | #include <map>
#include <iostream>
#include <string>
using namespace std;
int main()
{
// uppgift 1
const map<char, int> my_map {{'I', 1},
{'V', 5},
{'X', 10},
{'L', 50},
... | ALGO | 0.998616 | 4.447845 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-14T18:03: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": "3044348ebc... |
d5b0e456-1b96-4271-ab6f-7711dc3a372c | Kritika1-art/GRAPH-SERIES | Graph Representation.Cpp | // How Do we store input in a Graph?
// there are two ways to store a graph:
1. Adjacency Matrix
2. Adjacency list
Adjacency Matrix:
here we define a 2-D matrix: adj[nodes+1][nodes+1]
and where the edges say that are connected we just have to write adj[u][v] = 1 (and adj[v][u] = 1 in case of undirected graph)
... | ALGO | 0.999971 | 5.606449 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-02-24T16:52: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": "ad49b5deeae... |
d4587c5c-7797-4816-8b9a-ceab9c56e0b3 | wfabi0/AEDS-I | Atividade 02 - Matrizes/exercicio3.cpp | // Depois da matriz preenchida, faça a soma dos elementos da diagonal principal e
// depois a soma da diagonal secundária. Depois multiplique a soma da diagonal principal
// pela soma da diagonal secundária
#include <iostream>
#include <windows.h>
using namespace std;
int main() {
UINT CPAGE_UTF8 = 65001;
UINT... | ALGO | 0.99846 | 3.668558 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-08-02T00:46:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a2e01ae372... |
de9993dd-283e-4302-bc73-15a95b92768c | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/geometry/algorithms/buffer.hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 <NAME>, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 <NAME>, Paris, France.
// Copyright (c) 2009-2012 <NAME>, London, UK.
// This file was modified by Oracle on 2017-2021.
// Modifications copyright (c) 2017-2021 Oracle and/or... | TOOL | 0.911644 | 7.772901 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
a33b072b-814e-4c49-846b-a1a25f411575 | iamtasir/Competitive-programming | 2020/September/B. Minimum Product.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double dl;
typedef unsigned long long ull;
#define pb push_back
#define PB pop_back
#define nn "\n"
#define O_O ios_base::sync_with_stdio(false); cin.tie(NUL... | ALGO | 0.99987 | 3.481104 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-01-09T20:26:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1130247855... |
5c6850aa-daab-4832-aa7d-76535007bf1b | alu0101543529/jutge-ib-ull | Jutge/P17179_Statistical_measures.cc | /**
* Universidad de La Laguna
* Escuela Superior de Ingeniería y Tecnología
* Grado en Ingeniería Informática
* Informática Básica 2022-2023
*
* @file P17179_Statistical_measures.cc
* @author <NAME> (<EMAIL>)
* @date 03/12/2022
* @brief Es un programa que lee secuencias no vacías de números reales y,... | ALGO | 0.997315 | 5.023705 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-11-16T09:52: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": "6b63ab17757... |
72bb3805-7663-4ee7-83ca-727d183147f3 | lamphanviet/competitive-programming | uva-online-judge/accepted-solutions/11974 - Switch The Lights.cpp | /*****************/
/* <NAME> */
/* UVA 11974 - Switch The Lights
/* Time limit: 5.000s
/********************************/
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>... | ALGO | 0.999944 | 3.939675 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2014-06-20T02:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 83,
"forks": 56,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "bece41f9... |
268b7ad8-da15-4d60-9ec8-1175126cdefd | anas-haq/XPSC | Week 15 SuperZone/Day 02/C_Elemental_Decompress.cpp | /*
Author: Anas
Date: 15-07-2024
Time: 17:39:56
File: C_Elemental_Decompress.cpp
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll t=1;
cin >> t;
auto Anas = [&]() {
ll n;
c... | ALGO | 0.999943 | 4.054903 | {
"github_metadata": {
"branch": "main",
"commit_count": 129,
"repo_created_at": "2024-03-17T12:50:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c56770862... |
d18b4035-2da1-4a9c-aaff-267ee030a146 | ajz34/LeetCodeLearn | cpp/src/competition/week_176/e5342.cpp | // https://leetcode-cn.com/problems/maximum-number-of-events-that-can-be-attended/
#include "extern.h"
class Solution {
struct sortEvents {
inline bool operator()(vector<int>& e1, vector<int>& e2) {
assert(e1.size() == 2 && e2.size() == 2);
if (e1[0] > e2[0]) return true;
... | ALGO | 0.999931 | 5.998837 | {
"github_metadata": {
"branch": "master",
"commit_count": 215,
"repo_created_at": "2020-02-04T08:58: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": "241e1f5b... |
4c45256c-2fb2-4c32-b70e-8456dfcac40d | floodyberry/poly1305-opt | app/extensions/poly1305/poly1305_ref-64.inc | /*
poly1305 implementation using 64 bit * 64 bit = 128 bit multiplication and 128 bit addition
assumes the existence of uint64_t and uint128_t
*/
enum {
POLY1305_BLOCK_SIZE = 16
};
typedef struct poly1305_state_ref_t {
uint64_t r[3];
uint64_t h[3];
uint64_t pad[2];
unsigned char final;
} poly1305_state_ref_t;... | ALGO | 0.910656 | 6.508116 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2014-01-29T20:01:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 45,
"forks": 5,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d61c7e... |
4313356f-5076-47a4-a10c-cf6b52d8c5e4 | galenelias/AdventOfCode_2017 | src/Day14/Day14.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;
void twist(vector<int>& buffer, const vector<int> lengths, int rounds)
{
int skipCount = 0;
int start = 0;
const size_t buf_len = buffer.size();
for (int round = 0; round < roun... | ALGO | 0.99934 | 5.066102 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2017-12-05T18:38:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd97ed60... |
80053cdf-09f8-45df-8fef-2129ca6b95d4 | anurag-111/allSubmissions | minimum-fuel-cost-to-report-to-the-capital/Accepted/2-12-2023, 3_59_29 PM/Solution.cpp | // https://leetcode.com/problems/minimum-fuel-cost-to-report-to-the-capital
class Solution {
public:
long long fuel = 0;
long long dfs(vector<vector<int>>& adj_list, int node,vector<int>& visited, int& seats) {
visited[node] = true;
long long count = 1; //count of nodes
for... | ALGO | 0.999937 | 6.239687 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-21T12:47: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": "640e226c884f... |
b3792400-49bc-4a39-aa12-8900dac393cd | DuyLongg/DataStructure_Algorithms_PTIT | Algorithm/1.Sinh_quaylui_nhanhcan/Sap_xep_quan_hau_2/Sap_xep_quan_hau_2.cpp | #include <iostream>
using namespace std;
int cot[8];
int cheotrai[15];
int cheophai[15];
int b[8][8];
int FOPT = 0;
int tong = 0;
void Try (int i){
for (int j = 0 ; j < 8 ; j++){
if(cot[j] == 0 && cheophai[i+j] == 0 && cheotrai[7-i+j] == 0){
cot[j] = 1;
cheophai[i+j] = 1;
cheotrai[7-i+j] = 1;
tong = t... | ALGO | 0.999876 | 3.905301 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-06-27T03:19:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c7e74978... |
6956d25b-f8cb-40ca-bac4-5b134aef8be5 | abhishek18124/PPCPPAugust2023 | Lecture 08/01 - Bitwise Operators/001BitwiseOperators.cpp | #include<iostream>
using namespace std;
int main() {
// int a = 25;
// int b = 19;
// cout << "a&b : " << (a & b) << endl;
// cout << "a|b : " << (a | b) << endl;
// cout << "a^b : " << (a ^ b) << endl;
// cout << "~a : " << (~a) << endl;
// a = 1;
// cout << "~a : " << (~a) << endl;
int a = 1;
cout... | ALGO | 0.971245 | 3.852586 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-08-22T07:09:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b301f03d90... |
05fc5f55-530d-48c7-a45c-ac8cf438e3a3 | yash-gupta2000/CP_Codeforces | codeforces/251/A.cpp | //Currently in Spain, But S is silent :|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) x.begin(),x.end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define mem(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define mp make_pair
#define fir first... | ALGO | 0.999895 | 3.939028 | {
"github_metadata": {
"branch": "master",
"commit_count": 524,
"repo_created_at": "2020-12-21T07:22: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": "b7f55743... |
8d873742-a158-4ace-9c9a-26cb3f35e418 | jim2832/NTU-CS-Training | LV10/3107_max_avg/3107_max_avg.cpp | /*
說明
延續類別練習 I
試寫一個名為student的類別
其中屬性包含:
name, gender, grades
方法(函數)包含:
avg: 回傳grades list的平均值
add(grade): 新增成績到grades list中
fcount: 回傳不及格(<60)的總數
show: 可以將學生資料依本題格式列印出來 在建立實體實傳入 姓名及性別
將下方程式碼加入類別中
s1 = student("Tom","M")
s2 = student("Jane","F")
s3 = student("John","M")
s4 = student("Ann","F")
s5 = student("Peter","M"... | TOOL | 0.955387 | 3.865506 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2022-05-16T07:57: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": "1e175e464... |
8d97b4d1-d76d-47c6-9e1b-ed33928a58be | cheidegg/cmg-cmssw_oldAndStable | Alignment/KalmanAlignmentAlgorithm/plugins/KalmanAlignmentAlgorithm.h | #ifndef Alignment_KalmanAlignmentAlgorithm_KalmanAlignmentAlgorithm_h
#define Alignment_KalmanAlignmentAlgorithm_KalmanAlignmentAlgorithm_h
#include "Alignment/CommonAlignment/interface/Alignable.h"
#include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h"
#include "Alignment/ReferenceTrajectori... | ALGO | 0.911279 | 7.042244 | {
"github_metadata": {
"branch": "heppy_74X",
"commit_count": 147862,
"repo_created_at": "2016-02-15T12:57:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75... |
177b1271-4444-41ea-a448-b3afd63b58a0 | Topurayhan554/XPSC-Problem-Solving | WEEK-14/DAY-5/E_Enemy_is_weak.cpp | #include <bits/stdc++.h>
using namespace std;
class FenwickTree {
public:
FenwickTree(int size) : size(size) {
tree.resize(size + 1, 0);
}
void add(int index, int value) {
for (; index <= size; index += index & -index) {
tree[index] += value;
}
}
int sum(int ind... | ALGO | 0.999958 | 4.541231 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2024-10-27T13:28: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": "166cd0a00f... |
56cc7569-c072-44f2-bc20-bfd5cb3db1dd | urawa72/procon | atcorder/abc107/c/main1.cpp | #include <algorithm>
#include <bits/stdc++.h>
#include <vector>
using namespace std;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int main() {
int n, k; cin >> n >> k;
vector<ll> x(n);
for(int i = 0; i < n; i++){
cin >> x[i];
}
ll an... | ALGO | 0.999963 | 4.351338 | {
"github_metadata": {
"branch": "master",
"commit_count": 338,
"repo_created_at": "2019-07-28T08:28:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "e87274d1... |
e1e3babf-d4c4-4236-82ef-c6fb04c87dfc | SwReliab/gof4srm | src/KS_arma.cpp | #include <Rcpp.h>
using namespace Rcpp;
//' Compute P(D->d-) for the generalized KS statistic
//'
//' This is an experimental function instead of compute_Pdminus.
//' This is not used yet.
//'
//' @param ctime A sequence represents time slots (bins)
//' @param count A sequence indicates the number of samples falls int... | ALGO | 0.998347 | 6.492106 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-06-02T22:29:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "a2899febfc7... |
6c7010e5-ea9d-44ed-88ae-66fb6e34d75e | kamyu104/LeetCode-Solutions | C++/greatest-english-letter-in-upper-and-lower-case.cpp | // Time: O(n)
// Space: O(1)
// string, freq table
class Solution {
public:
string greatestLetter(string s) {
vector<int> cnt(52);
for (const auto& c : s) {
++cnt[c - 'A' < 26 ? c - 'A' : c - 'a' + 26];
}
for (int i = 25; i >= 0; --i) {
if (cnt[i] && cnt[i +... | ALGO | 0.999894 | 5.96529 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
2ac510e4-90e0-4a34-b578-75fb95c083e2 | prazek/ProgrammingContestsLibrary | data_structures/find_and_union.h | #pragma once
// <NAME>, 2016
#include "headers.h"
#include "iterators.h"
namespace lib {
/**
* FindAndUnion structure.
*/
class FindAndUnion {
public:
using ptr = std::shared_ptr<FindAndUnion>;
using id_type = uint32;
FindAndUnion(uint32 size):
rank_(size, 0),
parent_(make_counting_iterator(0u),... | ALGO | 0.995532 | 6.212624 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2016-12-17T14:29: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": "1a8dd0a81... |
f881cf72-eecc-4002-90bc-2ec811b9acc6 | Rohan-Singh01/Cpp_Course | tut28b.cpp | #include<iostream>
using namespace std;
/* Exchange two class private data value
using Refrence variable in friend function
*/
class c2;
class c1
{
int value1;
friend void exchange(c1 &, c2 &);
public:
void indata(int a)
{
value1 = a;
}
void display(void)
... | ALGO | 0.965173 | 4.951011 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-08-26T06:57: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": "89ed8cde0a83... |
ae90d1bb-5bfe-4855-b811-c1d32069d200 | VainKane/_Scripts | _Beginner2009/13/13C.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int a[(int)2e5 + 10];
int l[(int)2e5 + 10];
int r[(int)2e5 + 10];
stack<int> st;
long long res = 0;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> n;
for (int i = 0; i < n; i++) cin >> a[i];
memset(l, -1, si... | ALGO | 0.999937 | 4.163832 | {
"github_metadata": {
"branch": "main",
"commit_count": 171,
"repo_created_at": "2024-10-03T16:34: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": "ff5fa9ed89... |
643a2355-b735-4893-a6e5-6dcdf4414c97 | ChaunceyKiwi/leetcode-clean-code-handbook | Q30.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), le... | ALGO | 0.999994 | 6.167633 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-05-15T06:50:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "599a50957... |
a16b2887-3360-4f59-99dc-25c3db28e906 | YashPat22/24780_Engineering-Computation | Assignment 7/Assignment 7 - Problem 1/Assignment 7 - Problem 1/ps7.cpp | //
// ps7.cpp
// Assignment 7 - Problem 1
//
// Created by <NAME> on 10/25/22.
//
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <iostream>
#include "fssimplewindow.h"
const double PI = 3.1415927;
const int nObstacle = 5;
const int nBalls = 5;
const int iniVel = 40;
const doubl... | ALGO | 0.972176 | 4.201891 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-25T05:13: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": "e1c394cb28f2... |
da3689bf-6a51-44ba-9b35-751652e95263 | oroussel72/lara | src/AdaptiveMesh.h | class AdaptiveMesh
{
public:
// Constructor and distructor
AdaptiveMesh();
~AdaptiveMesh();
// Number of cells on each level
inline int N(const int l) const
{ return (1<<l); }
// Returns the cells at level l and position (i,j,k)
inline Cell* cell(const int l, const int i, const int j, ... | ALGO | 0.998855 | 4.583415 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-12-19T20:55: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": "68fbdb65dd... |
969db073-0160-47bd-8d6e-fe35a3c25d88 | Mourad-NOUAILI/Hackerrank | practice/algorithms/2-implementation/Larry's Array/my-sol-sum_of_ones.cpp | /*
Calculate the number of inversion using a .
Complexity: O(t * N²)
*/
#include <bits/stdc++.h>
using namespace std;
int *A_sum = NULL;
int range_sum(int x, int end){
int s = 0;
for (int i = x+1 ; i <= end ; ++i)
s += A_sum[i];
return s;
}
int* convert(int *A, int n){;
int *temp = new int[n];
for (... | ALGO | 0.999877 | 4.339758 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2017-07-05T20:21:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7581cc7e... |
a3e45b8a-ba3b-47f4-88c7-3b2049acfafc | ishandutta2007/codeforces-e | emengdeath/normal/1404/C.cpp | #include <algorithm>
#include <cstdio>
#include <vector>
using namespace std;
const int N = 3e5 + 10;
int n, q;
int a[N];
pair<pair<int, int>, int> w[N];
int v[N];
bool sig[N];
struct node{
int v;
pair<int, int> mn;
int tag;
}f[N * 4];
int ans[N];
void upd(int s) {
if (f[s+s+1].mn.first <= f[s+s].mn.fir... | ALGO | 0.999964 | 3.709701 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "e645ae71f676... |
7f4bfb71-726d-421e-ac54-50aa7703918b | durkedy/CS202Homework | reversi.cpp | /****************************
Assignment 4
<NAME>
Dr. <NAME>
CS 202 - sec 1003
***************************/
//Include relevant headers/libraries/
#include "reversi.h"
#include <iostream>
#include <string>
using namespace std;
/*Default constructor sets the characters '#' and '$' to appropriate positions
in the mid... | ALGO | 0.994803 | 4.093752 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-09-03T22:55:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "659f000c6... |
87d85bfc-189f-4988-9d4b-42aedeb0453d | mv123453715/UVA | 12143_Stopping Doom's Day.cpp | #include <stdio.h>
#include <algorithm>
#include <math.h>
using namespace std;
#define LL long long
class Frac {
public:
LL a, b;
Frac() {
a = 0, b = 1;
}
Frac(LL x, LL y) {
a = x, b = y;
reduce();
}
Frac operator+(const Frac &y) {
... | ALGO | 0.999892 | 3.840636 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-09-05T07:40:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c255cbadb3... |
4e670cd5-be3b-493d-8fe9-c435619cc12e | georgerapeanu/c-sources | jc2019/r2/abba/abba_old.cpp | ///helper script
#include <fstream>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
ifstream f("abba.in");
ofstream g("abba.out");
const int LVL = 1e6;
const int MOD = 1e9 + 7;
vector<int> bits;
bool solve(string &s,int lvl) {
bits.clear();
for(auto it:s) {
if(it !=... | ALGO | 0.999934 | 3.679536 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2018-08-15T14:37:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d402750... |
3fb8680d-95b5-49b1-b612-6adc178f64fd | NazrulFaran/CSE_282 | Lab_4/Lab_4_Exercise_2.cpp | /*
Take 6 integer values (0 to 5) into a stack and then find the factorial of
each stack element. Store the outputs in another stack. Print the output in the
following way:
Factorial : 0 = 1
Factorial : 1 = 1
Factorial : 2 = 4
*/
#include <bits/stdc++.h>
using namespace std;
int fact(stack<int> stk)
{
int multi =... | ALGO | 0.999519 | 4.966156 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-01-16T13:45: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": "910d1ba20e34... |
b4a92cc3-7dde-48f8-8195-d43aad4192d9 | devpatel062/sem3-stuff | sem3/sem3 dsa/lab_02/1.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.998341 | 3.827604 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-06-07T06:03: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": "7bdea312fe10... |
2934fb39-4be3-4b69-a94d-3e8cf93f0609 | MrRtcl/My-Algorithm | BST.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
struct node{
int key;
node *l,*r,*pre;
}*root;
bool insert(node *&p,int key,node *pre){
if(!p){
p = new node;
p->key = key;
p->l = NULL;
p->r = NULL;
p->pre = pre;
return true;
... | ALGO | 0.999978 | 3.409474 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-11-02T07:13:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3527b08bf... |
ff0bf2cd-c2ae-4907-b08e-3c10b686c992 | KanishAnand/CompetitiveCoding | CodeforcesContests/contest#643/1.cpp | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define lli long long int
#define llu unsigned long long int
#define fr(va, beg, end) for (lli va = beg; va < end; va++)
#define pb push_back
#define rt return... | ALGO | 0.999981 | 4.791121 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-06-13T09:13: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": "9ff0c400d6... |
77b32f1f-9608-41c6-a612-6ade16d3e4a2 | DarianNwankwo/cs6241-final-project | modeling/SolverFunctions.cpp | //
// SolverFunctions.cpp
// cs6241 Zika HJB Solver
//
// Created by <NAME> on 4/22/21.
//
#include <iostream>
#include <fstream>
#include <cmath>
#include "SolverFunctions.hpp"
#include "helper.h"
#include "boost/multi_array.hpp"
using namespace std;
typedef boost::multi_array<double, 4> multiarray;
/*==========... | ALGO | 0.999968 | 4.782046 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2021-04-10T16:34: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": "e2ec7d61cb8... |
f70fb936-207d-415e-a210-6f4302c2e00e | ishandutta2007/codeforces-e | emilan/normal/1272/C.cpp | #include <bits/stdc++.h>
using namespace std;
inline void ioThings() {
ios::sync_with_stdio(0);
cin.tie(0);
#ifdef LOCAL
freopen("io\\in.txt", "r", stdin);
freopen("io\\out.txt", "w", stdout);
#define debug(x) cerr << #x << ": <" << (x) << ">\n"
#else
#define debug(x)
#endif
}
#define rep(i, n) for (int i = 0... | ALGO | 0.999898 | 3.909159 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "16eb2e76f723... |
507592b3-5311-40a2-bfbe-e0ed7fb5f2fc | bhargavgohil25/Competetive-Programming | Codeforces/0538A.cpp | // Created by ...
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define rep(i,a,b) for(int i=a; i<b; i++)
#define rrep(i,a,b) for(int i=b-1;i>=0;i--)
#define repe(i,a,b) for(int i=a; i<=b; i++)
#define ll long long
#define ld long double
#define ui unsigned int
#define pb push_back
#define all(x) ... | ALGO | 0.99994 | 3.892849 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2020-08-26T05:38: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": "dd038a220... |
65d8b045-532b-48f3-b205-f6c0755a39a5 | taufiqislam/Competitive-programming | segment tree.cpp | #pragma GCC Optimize ("Ofast")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define N '\n'
#define pb push_back
#define pob pop_back
#define ff first
#define ss second
#define bb begin()
#define ee end()
#define fastIO() ios_base::sync_with_st... | ALGO | 0.999665 | 4.115558 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-01-23T07:40: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": "df789ca314a... |
a0defec6-a8fe-4465-835e-d68bcd4869a5 | relief-auth-ros-packages/rb1 | catkin_ws/src/relief-rb1-packages/.robotnik_navigation/robotnik_velocity_limiter/include/robotnik_velocity_limiter/VelocityInterpolator.h | #ifndef _ROBOTNIK_VELOCITY_LIMITER_VELOCITY_INTERPOLATOR_
#define _ROBOTNIK_VELOCITY_LIMITER_VELOCITY_INTERPOLATOR_
#include <geometry_msgs/Twist.h>
#include <geometry_msgs/Point.h>
namespace robotnik_navigation
{
class VelocityInterpolator
{
public:
VelocityInterpolator()
{
}
virtual ~VelocityInterpolator()
... | ALGO | 0.905506 | 7.256943 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-05-01T06:54:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de5b6fe5de0... |
f2038339-2b2b-4446-b770-09f168e018ce | Aumkaar/AdventOfCode | advent22/day4/puz2.cpp | #include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a; i<b; i++)
#define vll vector<long long>
#define vi vector<int>
#define PB push_back
#define MOD 1000000007
using ll = long long;
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll countPairs{};
std::ifstre... | ALGO | 0.999571 | 4.551323 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2022-12-19T12:09: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": "f0aac9481... |
09641463-2b4e-4fc5-80c7-2c50f2be1c4e | CSE-333-Computer-Graphics-2022/Terrain-Sketching | src/stroke/stroke.cpp | #include "stroke.hpp"
#include<utils/utils.hpp>
void Stroke::draw(unsigned int &shader_program) {
glEnable(GL_LINE_SMOOTH);
unsigned int vColor_uniform = getUniform(shader_program, "vColor");
glUniform4f(vColor_uniform, 1, 0, 0, 1.0);
unsigned int vModel_uniform = getUniform(shader_program, "vModel");
glUniformM... | ALGO | 0.967768 | 3.965513 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-11-30T15:15:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "797ccf31da48... |
c852b976-c7aa-44cb-a9ac-58d8d01b6453 | KqSMea8/UtilsDir | ZETLAB/ZETTools/FunctionSeismic/Simplex.h | // Класс трёхмерного тэтарэдра для решения задачи нахождения гиппоцентра землетрясения
#pragma once
#include <FunctionSeismic\SimplexPoint.h>
#include <Seismo\StationSSEC\Struct_EventStation\Ssm_str_EventStation.zschema1.h>
#include <Metrology\Rectangle.h>
#include <Metrology\Space.h>
#include <vector>
#include <list>... | ALGO | 0.999897 | 4.854288 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-02-27T15:53: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": "dbace2c168... |
b0f879d1-e25e-4bf4-83df-6452260cf59e | zihanpeter/problems | nfls1G.cpp | #include <iostream>
#include <algorithm>
#include <set>
using namespace std;
const int N = 2e5 + 5;
int n, k, ans;
struct node {
int x, y, c;
} nds[N];
int temp[N], b[N];
set<int> s[N];
int lowbit(int x) {
return x & -x;
}
void add(int k, int x) {
while (k <= n) {
b[k] += x;
k += lowbit(k)... | ALGO | 0.999975 | 4.026011 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-09-12T14:15: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": "70fe68bef9b... |
cf49f085-6ef4-4fde-843b-ca6d151bafc7 | nitishkiitk/DSA | Tree/GFG Check if two Nodes are Cousins.cpp | // Given the binary Tree of and two-node values. Check whether the two-node values are cousins of each other or not.
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
... | ALGO | 0.999823 | 5.232942 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2022-07-01T05:12: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": "33488d001d... |
cf582863-216f-4f4e-b551-be79336a4168 | InojosaCS/Codeforces_AC | codeforces/1380/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define deb(x) cout << (#x) << " is " << (x) << endl;
const long long M = 998244353ll;
ll expo(ll a, ll b){
if(b==0) return 1ll;
if(b==1) return a%M;
else return expo(a*a%M, b/2)*... | ALGO | 0.999965 | 4.20625 | {
"github_metadata": {
"branch": "master",
"commit_count": 322,
"repo_created_at": "2021-02-08T22:31:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ad47b6f... |
46a093a6-1fc0-4f1b-a56d-e9215da41ac0 | lucianbc/University | AlgorithmsAndDataStructures/Code/Homework8/Obligatorii/MergeSort/main.cpp | #include <iostream>
using namespace std;
void sort(int a[], int l, int r)
{
int p = l + (r - l) / 2;
if(l < p)
sort(a, l, p);
if(p + 1 < r)
sort(a, p + 1, r);
int* tmp = new int[r - l + 1];
int i1 = l, i2 = p + 1;
for(int i = 0; i < r - l + 1; i++)
{
int v1 = i1... | ALGO | 0.999975 | 4.362575 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2017-10-03T21:30:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "464782b3445... |
07216d2e-65db-4a5c-a44e-531f27ef8e29 | harshhy2012/CodingPractice | x.cpp | #include <bits/stdc++.h>
using namespace std;
// long double minimiseMaxDistance(vector<int> &arr, int k) {
// int n = arr.size();
// cout<<"CHALA\n";
// vector<int> placed(n-1);
// for(int i=1;i<=k;i++){
// long double maxi = -1;
// int maxIdx = -1;
// for(int j=0;j<n-1;j++){
... | ALGO | 0.999782 | 4.496086 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2021-12-20T19:22: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": "5a92c46d7... |
549a35fa-51be-44fc-8f59-02964981404b | Mirmix/3D_shape_regularization | main.cc | #include <easy3d/fileio/resources.h>
#include <easy3d/util/logging.h>
#include <easy3d/renderer/renderer.h>
#include <easy3d/renderer/drawable_points.h>
#include <easy3d/renderer/drawable_lines.h>
#include <easy3d/renderer/drawable_triangles.h>
#include <easy3d/viewer/comp_viewer.h>
#include <easy3d/fileio/surface_mesh... | ALGO | 0.998797 | 4.369251 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-02-15T17:25:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "709fabd2dc6c... |
3ec90780-6111-45fe-aa41-41b5617cef7a | Midway91/HactoberFest2023 | Hacktoberfest-2023/Programming/C++/insertion_sort.cpp | #include <bits/stdc++.h>
using namespace std;
void insertion_sort(int arr[], int n) {
for (int i = 0; i <= n - 1; i++) {
int j = i;
while (j > 0 && arr[j - 1] > arr[j]) {
int temp = arr[j - 1];
arr[j - 1] = arr[j];
arr[j] = temp;
j--;
}
}
... | ALGO | 0.999964 | 5.572428 | {
"github_metadata": {
"branch": "main",
"commit_count": 2256,
"repo_created_at": "2023-09-29T12:46:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 1750,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d98b... |
6eb36f5b-609c-44d1-b43a-abeba67042ab | dex046/myleetcode | Compare Version Numbers_165.cpp | class Solution {
public:
int compareVersion(string version1, string version2) {
int v1 =0, v2=0;
int value = 0;
for (size_t i = 0; i < version1.size(); ++i)
if (version1[i] == '.')
version1[i] = ' ';
for (size_t i = 0; i < version2.size(); ++i)
if (version2[i] == '.')
version2[i] = ' ';
istrin... | ALGO | 0.999647 | 5.27988 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2016-06-28T14:15:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "940fb8416... |
e54e5935-f4f9-476a-bc86-ea7126c9afc0 | wzppengpeng/leetcode_solution | stack/844.cpp | /**
* Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character.
Example 1:
Input: S = "ab#c", T = "ad#c"
Output: true
Explanation: Both S and T become "ac".
Example 2:
Input: S = "ab##", T = "c#d#"
Output: true
Explanation: Both S and T become "... | ALGO | 0.999529 | 6.030864 | {
"github_metadata": {
"branch": "master",
"commit_count": 220,
"repo_created_at": "2017-09-17T12:33:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed78877f... |
3ba3497a-584c-4523-bfd9-4b2a2b8cc44c | chaitin/yanshi | src/compiler.cc | #include "compiler.hh"
#include "fsa_anno.hh"
#include "loader.hh"
#include "option.hh"
#include <algorithm>
#include <ctype.h>
#include <limits.h>
#include <map>
#include <sstream>
#include <stack>
#include <unordered_map>
using namespace std;
unordered_map<DefineStmt*, FsaAnno> compiled;
static unordered_map<Define... | ALGO | 0.997555 | 5.268247 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2016-11-03T01:56:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98,
"forks": 21,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "81863fab... |
a487360e-ddc0-4e02-8d42-c1f2ffbfa381 | netcan/LeetCode | Algorithms/289. Game of Life/solution.cpp | /*************************************************************************
> File Name: solution.cpp
> Author: Netcan
> Blog: http://www.netcan666.com
> Mail: <EMAIL>
> Created Time: 2017-01-18 09:56
************************************************************************/
#include <iostream>
#include <v... | ALGO | 0.999986 | 5.647414 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2017-01-09T02:28:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f71aee8... |
075287ce-f64b-466e-ade7-ec3e8fdbeb8e | chongchonghe/quokka-fork | src/RadhydroSimulation.hpp | #ifndef RADIATION_SIMULATION_HPP_ // NOLINT
#define RADIATION_SIMULATION_HPP_
//==============================================================================
// TwoMomentRad - a radiation transport library for patch-based AMR codes
// Copyright 2020 <NAME>.
// Released under the MIT license. See LICENSE file included ... | ALGO | 0.992687 | 5.67115 | {
"github_metadata": {
"branch": "multigroup-dev0.1",
"commit_count": 1,
"repo_created_at": "2023-09-14T01:26: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": ... |
21c10f79-62eb-45d4-844f-124c41d672e5 | ishandutta2007/codeforces-d | dingdingsb/normal/1139/D.cpp | #include<bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define pb push_back
#define pc putchar
#define chkmx(a,b) (a)=max((a),(b))
#define chkmn(a,b) (a)=min((a),(b))
#define fi first
#define se second
using namespace std;
template<class T>
void read(T&x){x=0;char c=getchar();bool f=... | ALGO | 0.999969 | 4.174486 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ac17f8e98f6... |
30b073bc-a2b7-4ef4-9c71-8e7b4cc51b9a | ishandutta2007/codeforces-n | natsugiri/normal/936/B.cpp | #include<stack>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end... | ALGO | 0.999952 | 3.548747 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "74bc040d922b... |
83c21eea-e4a2-4dbb-9125-4300b5ce7d62 | astha736/arpro_maze | src/solve_corridor.cpp | #include <a_star.h>
#include <maze.h>
#include <iostream>
using namespace std;
using namespace ecn;
/*
Assignment for ARPRO: maze
By: Astha
Approach: create a enum to define the pose of the neighbour
for a given parent, this helps in reducing any typing mistakes
reduce the no of nodes create... | ALGO | 0.999838 | 4.976167 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-11-21T18:27: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": "8e0c699f24... |
2614fca6-68cf-4115-9b24-617a6fc0f146 | CarlosDaniel111/competitive-programming | ICPC/LatinAmerica/GPMX/GPMX2023 Segunda Fecha/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<double, double>;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<double>;
using vs = vector<string>;
using ... | ALGO | 0.999992 | 3.74173 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2023-08-03T01:39:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a14da9c0a... |
3539f068-7c01-4092-af9a-f6ba27cd6afc | bartonu4/Tracker | singlekalmanfilter.cpp | #include "singlekalmanfilter.h"
SingleKalmanFilter::SingleKalmanFilter()
{
unsigned int type = CV_32F;
kf = new cv::KalmanFilter(stateSize, measSize, contrSize, type);
cv::Mat state(stateSize, 1, type); // [x,y,v_x,v_y,w,h]
cv::Mat meas(measSize, 1, type); // [z_x,z_y,z_w,z_h]
// Transition St... | ALGO | 0.978189 | 5.738627 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-06-08T11:05: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": "677741dcbd... |
a66e8f21-80f8-47d6-bee6-81099cd5cf0a | prathampithalia/CP | Codeforces/Bitwise Operations/B_XOR_Sequences.cpp | #include<bits/stdc++.h>
using namespace std;
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define pyes cout << "YES" << endl
#define pno cout << "NO" << endl
#define ce cout << endl
#define forr(i, n) for (int i = 0; i < n; i++)
#define e... | ALGO | 0.999737 | 3.175551 | {
"github_metadata": {
"branch": "main",
"commit_count": 1301,
"repo_created_at": "2023-10-02T17:38: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": "155e2c502... |
946a4fd4-912b-4156-b4c7-e0bdffb1796d | SergeyBrykulskii/OAiP_Lab | laba4/task15.cpp | #include <iostream>
#include <iomanip>
using namespace std;
// Natural number check
int tested_input_I() {
int a;
while (!(cin >> a) || a < 0) {
cin.clear();
cin.ignore(numeric_limits < streamsize > ::max(), '\n');
cout << "Incorrect input, try again:\n";
}
return a;
}
int main() {
int n, sum = 0, j = ... | ALGO | 0.991454 | 3.695102 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-11T17:27: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": "e66573c2bba3... |
dbf60d1d-b2f1-46f5-9978-9dd17b78fca7 | ishandutta2007/codeforces-x | xuanquang1999/normal/741/C.cpp | //84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define fto... | ALGO | 0.999892 | 3.609487 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38: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": "01da566624e5... |
9518957e-c12a-4fe7-91c5-ed2521282300 | vsarfare/Project-Sirius | binary-search.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[] = {};
int arrSize;
int first = 0;
int last = 0;
int mid ;
int value;
cout << "Enter the array size : " << endl;
cin >> arrSize;
last = arrSize - 1;
cout << "Enter the array element : " << endl;
for(i... | ALGO | 0.99961 | 4.455157 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-08-15T17:47: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": "05139db9e4a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.