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 |
|---|---|---|---|---|---|---|---|
cc0bfcce-d922-4349-b7a9-4f30da7d73da | ex-MingNine9999/algorithm | Problems/boj2294.cpp | //Problem Number : 2294
//Problem Title : 동전 2
//Problem Link : https://www.acmicpc.net/problem/2294
#include <iostream>
#include <algorithm>
#include <set>
using namespace std;
int dp[10001];
set<int> coin;
int main() {
int n, k;
cin >> n >> k;
int input;
for (int i = 0; i < n; i++) {
cin >> input;
coin.... | ALGO | 0.99977 | 3.886274 | {
"github_metadata": {
"branch": "master",
"commit_count": 160,
"repo_created_at": "2020-03-25T07:39:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f069b40a... |
543be949-a8e2-4d05-bcbb-4d9553c5c25c | alexandraback/datacollection | solutions_1483488_1/C++/piyapan/q3(ver3).cpp | #include<stdio.h>
#include<iostream>
#include<list>
using namespace std;
int countdigit(int n, int &p)
{
int i;
i=0;
p = 1;
while(n)
{
p*=10;
n/=10;
i++;
}
return i;
}
bool findinList(list<int> &data, int x)
{
list<int>::iterator it;
for(it=data.begin();it!=data.end();it++)
if(*it == x)
return ... | ALGO | 0.999152 | 3.328363 | {
"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": "982d239e7... |
41fca587-8b9c-4a39-8e61-d20ddf6aded5 | coderick14/Competitive-Programming-Templates | LongChallenge/OCT17/MARRAYS.cpp | /*
* Deleted code is debugged code :)
*/
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define pp pair<ll,ll>
#define mp make_pair
#define PI acos(-1.0)
#define all(v) v.begin(),v.end()
#define pb push_back
#define FOR(i,a,b) for(i=a;i<b;i++)
#define FREV(i,a,b) fo... | ALGO | 0.999845 | 3.110307 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2017-01-12T21:23:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2abcb391... |
a9b63b09-dfae-4255-ad8b-8fdf17cfe0a4 | AmoghShukla/DSAinCPP | Sorting/MergeSort.cpp | #include<bits/stdc++.h>
using namespace std;
void Merge(vector<int>& arr, int low, int mid, int high){
vector<int> temp;
int left = low;
int right = mid+1;
while(left <= mid && right <= high){
if(arr[left]<=arr[right]){
temp.push_back(arr[left]);
left++;
}
... | ALGO | 0.999988 | 5.864851 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2025-06-27T12:58: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": "288a4dd9673... |
d556082c-78b1-424e-abb0-a246f4d8366e | OmJadhav1/c-DSA | c++/linked list/CircularLinkedList.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node *next;
// constructor
node(int d)
{
this->data = d;
this->next = NULL;
}
~node()
{
int value = this->data;
if (this->next != NULL)
{
delete next;
... | ALGO | 0.999832 | 5.23654 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-10-19T17:22:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c91d32c26b9f... |
c39ab4ab-e341-440a-a577-ab4a880aa611 | OS2World/UTIL-WPS-Nice_OS2_Enhancer | Nice-os2/Shell/Pages/Detector/Detector_form.cpp |
// ─── Обработчик сообщений для окна ───
// Поток приложения вызывает WindowProc всякий раз, когда для окна есть сообщение.
// Window - окно, Message - сообщение, *_parameter - данные, которые передаются вместе с сообщением.
MRESULT EXPENTRY Detector_DlgProc (HWND Window, ULONG Message, MPARAM First_parameter, MPARAM... | TOOL | 0.910772 | 3.208439 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2013-09-25T10:57:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34bef245c0... |
91630426-0106-43ce-bb53-964149b82096 | frandibar/acm-valladolid | rejected/wrong-answer/p701_the_archeologists_dilemma/entrega_01_WA.cpp | /* @JUDGE_ID: 40922FK 701 C++ */
/* @BEGIN_OF_SOURCE_CODE */
/**************************************************************************
Solution to Problem 701 - The Archeologist's Dilemma
by: <NAME>
date: Nov-16-2005
**************************************************************************/
//#define DEB... | ALGO | 0.999676 | 4.328823 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2012-05-17T03:00:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7c7a748f5... |
229e144a-e059-4521-b3b3-c24fe13dd37d | pwwpche/X-Locate-OpenCV | lineDetect.cpp | #include <iostream>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <limits>
#include <fstream>
using namespace std;
using namespace cv;
#define MAX_K 10
#define MIN_K 1.2
#define DEBUG_ONE1
int findVerticleLines(CvSeq *lines,int height, int width);
int findHorizonalLines(CvSeq *lines, int height, i... | ALGO | 0.998451 | 3.495579 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-03-06T21:20:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58ffd47de8... |
af293660-5530-4279-8100-de770ebadcd6 | gsilano/BebopS | src/library/position_controller_with_bebop.cpp | /*
* Copyright 2018 <NAME>, University of Sannio in Benevento, Italy
* Copyright 2018 <NAME>, University of Sannio in Benevento, Italy
* Copyright 2018 <NAME>, University of Sannio in Benevento, Italy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complia... | ALGO | 0.92844 | 5.868347 | {
"github_metadata": {
"branch": "master",
"commit_count": 263,
"repo_created_at": "2019-04-04T12:59:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 67,
"forks": 29,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e163ee... |
b24618a6-7b7a-4a59-b5af-84cd7ad0faf7 | Alejandra-Villalobos/Cuarto-corto-de-programaci-n | Ejercicio_2.cpp | #include "iostream"
using namespace std;
float Media(float [], float *);
int Comparar(float [], float);
int main()
{
float Estaturas[25], Prom;
int j=1;
cout << "\t"<<"Ingrese las edades de los 25 alumnos en metros" << endl;
for (int i=0; i<25; i++)
{
cout << "Alumno "<<j<<" : ";
ci... | ALGO | 0.999114 | 3.76205 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-06-27T22:40: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": "f351e8771d... |
798318ae-f0b6-458b-98f1-b8dcada6e97e | Shahraaz/CP_S5 | codeforces/316406/f/f.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "/debug.h"
#else
#define db(...)
#endif
#define all(v) v.begin(), v.end()
#define pb push_back
using ll = long long;
const int NAX = 2e5 + 5, MOD = 1000000007;
void solveCase()
{
ll n, k, d;
cin >> n >> k >> d;
vector<ll> a(n);
for (... | ALGO | 0.999973 | 4.343327 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2019-07-15T23:57:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e93119b2... |
4f65ef59-1ceb-463a-a6cd-19b57caa53a0 | godnoTA/acm.bsu.by | 4. Алгоритмы на графах/67.2. Поиск в глубину #3568/[OK]171824.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <alg.h>
//#include <set>
#include <stack>
using namespace std;
struct root {
bool inPath = false;
bool full = false;
int ans = 0;
};
vector<root>* mainInf;
int firstPosOfFalse = 0;
/*void Push(int i) {
Queue.push(i);
}*/
bool isFull(int n... | ALGO | 0.999747 | 3.356942 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2018-03-14T17:53:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 16,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "704a9bb... |
b6845fdf-e75c-47c0-8acb-8c58f833dcc4 | wafi981/common-src-1 | config/config_types.hpp |
#pragma once
#include "string"
#include "pdu_session_type.hpp"
#include <netinet/in.h>
#include <vector>
#include <memory>
#include <nlohmann/json.hpp>
#include <yaml-cpp/yaml.h>
namespace ngc::config {
const std::string INNER_LIST_ELEM = "+";
const std::string OUTER_LIST_ELEM = "-";
const std::string EMPTY_LIST_EL... | CONFIG | 0.947045 | 6.586205 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-13T06:35: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": "c4dd77cc3d37... |
cdec4500-83e1-475e-b0dd-446756758d06 | SVF-tools/SVF | svf/lib/SABER/ProgSlice.cpp | //===- ProgSlice.cpp -- Program slicing--------------------------------------//
//
// SVF: Static Value-Flow Analysis
//
// Copyright (C) <2013-> <<NAME>>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as pu... | ALGO | 0.928678 | 5.552122 | {
"github_metadata": {
"branch": "master",
"commit_count": 4390,
"repo_created_at": "2015-06-05T01:52:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1568,
"forks": 458,
"issues": 315,
"pull_requests": 26
},
"file_meta": {
"content_id": ... |
a4ec3be3-cedf-4a5c-b4f6-ba4c3313c761 | rivercity310/study | algorithm/algorithm_cpp/prj/ex1.cpp | #include <iostream>
using namespace std;
constexpr int INF = 1e9;
/*
[ 방문 판매원 문제 ]
입력받은 그래프에서 1 -> K -> X로 가는 최단 경로 값 구하기
*/
// C++에서 2차원 배열은 배열포인터 형으로 반환해야 한다.
// 배열 포인터와 포인터 배열(ex. int* arr[])의 차이는 구글 검색
typedef int(*arrPointer)[501];
arrPointer init_grp(int N, int M) {
// 반환 후 지역변수 gp가 사라지는 것을 막기 위해 static 선언
... | ALGO | 0.999917 | 4.40012 | {
"github_metadata": {
"branch": "main",
"commit_count": 414,
"repo_created_at": "2022-10-13T15:43:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c379b56730... |
b6c73d25-bfe0-4af2-984c-e9ff142075be | bansal1999/LeetCode_Solutions | Implementing Dijkstra Algorithm - GFG/implementing-dijkstra-algorithm.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the shortest distance of all the vertices
//from the source vertex S.
vector <int> dijkstra(int V, vector<vector<int>> adj[], int S)
{
// Code here
vecto... | ALGO | 0.999963 | 5.779673 | {
"github_metadata": {
"branch": "main",
"commit_count": 1427,
"repo_created_at": "2021-07-04T08:06:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "725003fca... |
1419fbbd-4bea-4370-87f2-efcf5a41ce69 | Jagjitbiswal2003/Placement-Related-Programs | ReplaceCharacter.cpp | /*
*/
#include <iostream>
#include <string>
#include<queue>
using namespace std;
void ReplaceCharacter (char str[], int n, char ch1, char ch2){
for (int i = 0; i < n; i++)
{
if (str[i] == ch1)
{
str[i] = ch2;
}
else if (str[i] == ch2)
{
str[i] = ch1;
}
}
cout <... | ALGO | 0.999886 | 3.640371 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-09-14T19:12: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": "1d802123119... |
9977ee88-f2c8-4f38-99cd-a342b716ffcf | milanow/LeetCodePractice | 500+/588_Design_In-Memory_File_System.cpp | /* 588. Design In-Memory File System
* Tire structure to stroe file and directory as a directory system.
* Note: trie node can represent both file and directory by isFile
* if the trie node is a file (isFile = true), then its child represents
* the content of this file (child's isFile = false, but it doesn't matter... | TOOL | 0.991847 | 5.715894 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2017-09-26T00:16:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9dbdf1b6c... |
0dd7119a-2acf-4fb1-be99-173e8352082e | Kshitij-Saluja/Recursion | recursion/flood_fill.cpp | /*Question
1. You are given a number n, representing the number of rows.
2. You are given a number m, representing the number of columns.
3. You are given n*m numbers, representing elements of 2d array a. The numbers can be 1 or 0 only.
4. You are standing in the top-left corner and have to reach the bottom-right corne... | ALGO | 0.999971 | 3.890119 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-08-31T09:50: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": "4f69e7f48efd... |
723270d7-69b8-42f8-a804-a72a39f362ed | MinesParis-MorphoMath/smil | Addons/Filters/include/DfilterMeanShift.h | /* __HEAD__
* Copyright (c) 2011-2016, <NAME> and ARMINES
* Copyright (c) 2017-2024, Centre de Morphologie Mathematique
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistrib... | ALGO | 0.970583 | 6.897269 | {
"github_metadata": {
"branch": "master",
"commit_count": 2862,
"repo_created_at": "2017-06-20T12:48:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 26,
"forks": 4,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "40f68b0... |
bcf4bdb4-1106-4f10-8625-bd0689fcdf27 | Tiramisu-Compiler/TiraLib | examples/function_jacobi1d_MINI_generator.cpp | #include <tiramisu/tiramisu.h>
#include <tiramisu/auto_scheduler/evaluator.h>
#include <tiramisu/auto_scheduler/search_method.h>
#include "function_jacobi1d_MINI_wrapper.h"
using namespace tiramisu;
int main(int argc, char **argv)
{
tiramisu::init("function_jacobi1d_MINI");
// ------------------------------... | ALGO | 0.998151 | 5.604622 | {
"github_metadata": {
"branch": "main",
"commit_count": 207,
"repo_created_at": "2023-05-10T13:23:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "e4de8015d38... |
0bbccab5-c405-4ca0-aff8-0f72d6238a75 | ahmedmamdouh20/2048- | 2048.cpp | # include <iostream>
#include <string>
using namespace std;
const int N = 4;
const int GOAL = 1 << (3 * N - 1);
int grid[N][N];
//This function prints the grid of 2048 Game as the game progresses
void print_grid() {
for (int i = 0; i < ((N + 4) * N + N + 1); cout << "-", i++);
cout << "\n";
for (int i = 0... | ALGO | 0.999514 | 4.156748 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-04-24T01:36:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3d5fc85fe61... |
3b9489d3-efdd-4e3d-9a41-155438c0c67a | Osman-Fatih-Cakir/DX11Renderer | DX11Renderer/Source/Renderer/MathUtils.h | #pragma once
#include <directxmath.h>
#include <random>
#include <math.h>
using namespace DirectX;
namespace DX11Renderer
{
inline float RandomFloat(float min, float max)
{
static thread_local std::uniform_real_distribution<float> distribution(0.0f, 1.0f);
static thread_local std::mt19937 generator;
return mi... | TOOL | 0.915289 | 6.48977 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2023-05-24T13:01: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": "325a01abc... |
7565fa2d-b92c-4fe7-a198-25061c81a47d | wyrover/book-code | stl_examples/ex05-23.cpp | // Illustrating the generic nth_element algorithm.
#include <vector.h>
#include <algo.h>
#include <assert.h>
int main()
{
vector<int> v(7);
v[0] = 25; v[1] = 7; v[2] = 9;
v[3] = 2; v[4] = 0; v[5] = 5; v[6] = 21;
const int N = 4;
// Use nth_element to place the Nth smallest
// element in v in the Nth po... | ALGO | 0.9995 | 6.99993 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2016-07-24T07:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 388,
"forks": 248,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7ac... |
84b93a42-1439-4aa8-86e7-fd544bfb6313 | khyaats/data_structure_algorithm | moving_to_the_ends.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int array;
cin >> array;
while (array--) {
int size;
cin >> size;
vector<int> arr(size);
unordered_map<int, int> position... | ALGO | 0.999865 | 4.004399 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-03T10:53: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": "1351b785c05f... |
fb2d44f8-c8d0-4181-bcae-f20132e51aba | microft11/BJTUsbschool | C++课设/实验五(1)/BigInt.h | #pragma once
#include<iostream>
#include<cstring>
#include<iomanip>
using namespace std;
enum {MINI = 4, SMALL = 16, NORMAL = 32, BIG = 64, LARGE = 128};
class CBigInt
{
public:
CBigInt()
{
pbuf = new int[SIZE];
memset(pbuf, 0, SIZE * sizeof(int));
}
CBigInt(int val)
{
pbuf = new int[SIZE];
memset(pbuf,... | ALGO | 0.979904 | 3.154562 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2023-04-21T09:28:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0d2170d4e9... |
11a8360a-1302-4b36-9e46-93d13a43c254 | shubhamchandak94/Spring | src/reorder_compress_quality_id.cpp | /*
* Copyright 2018 University of Illinois Board of Trustees and Stanford
University. All Rights Reserved.
* Licensed under the “Non-exclusive Research Use License for SPRING Software”
license (the "License");
* You may not use this file except in compliance with the License.
* The License is included in the distributi... | DATA | 0.964945 | 6.884821 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2018-04-03T18:29:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 128,
"forks": 23,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb109d... |
0fff168b-a942-4284-8a08-fed4c66e9131 | kamrann/workbase | code/neuroevo/common/_problems/simple_force_torque.h | // simple_force_torque.h
#ifndef __SIMPLE_FORCE_TORQUE_H
#define __SIMPLE_FORCE_TORQUE_H
#include "problem_base.h"
#include "Eigen/Dense"
#include <boost/math/constants/constants.hpp>
#include <vector>
using Eigen::Vector3d;
class simple_force_torque
{
public:
// Describes a given instance of the problem, ie.... | ALGO | 0.952324 | 6.448465 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-01-17T00:08: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": "ed7702dbd... |
0c55dccf-2ade-45d1-9b4e-a4ad6652689f | StevenMallqui/Algorithmic-Methods | UndirectedGraphs/ArbolesLibres/main.cpp |
/*@ <answer>
*
* Nombre y Apellidos: <NAME>
*
*@ </answer> */
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
#include "Grafo.h" // propios o los de las estructuras de datos de clase
/*@ <answer>
Escribe aquí un comentario general sobre la solución, explicando cómo
se resuelv... | ALGO | 0.999948 | 5.045359 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2023-09-23T16:33: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": "31bb99da59c... |
a7261cd7-de65-43b0-993f-1b8036718647 | intfloat/AlgoSolutions | codeforces/CF345/C.cpp | #include <bits/stdc++.h>
#define FOR(i, n) for (int i = 0; i < (int)n; ++i)
#define IDX(r, c) (r * col + c)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int row, col, fa[1000005];
int _find(int x) {
if (fa[x] == x) return x;
else fa[x] = _find(fa[x]);
return fa[x];
}
inline void _u... | ALGO | 0.999977 | 3.528192 | {
"github_metadata": {
"branch": "master",
"commit_count": 527,
"repo_created_at": "2013-04-16T14:53:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63002f7... |
deb64fdd-3204-45a0-9be7-c9175ec919dc | henryw7/parallel_library_test | queue.cpp | // #define USE_CILK 0
#include <stdio.h>
#include <unistd.h> // sleep
#include <stdlib.h> // exit
#define DIE(...) do { \
printf("Error detected at line %d in %s\n", __LINE__, __FILE__); \
printf(__VA_ARGS__); \
exit(1); ... | TOOL | 0.910593 | 4.338742 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-06T23:47: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": "cef8341c110f... |
62dc5aed-16c0-433d-b7f0-bcc7ba60e0c4 | nikhil1699/Coding-Interview | LinkedLists/doublyLinkedListSorted_insert.cpp | class Node{
int data;
Node* next;
Node* prev;
};
Node* SortedInsert(Node *head,int data)
{
Node* temp = head;
//Initializing the new Node
Node* newNode = new Node();
newNode->data = data;
newNode->next = NULL;
newNode->prev = NULL;
// If the List is empty point th... | ALGO | 0.999904 | 4.549873 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-12-08T19:00:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a0d42024f... |
fb8b748a-430b-400c-aebe-d13843ea664e | GH0STP1R4T3/university-labs | C++_Projects/2 term/OOP/2.2/LinearList.h | #include <iostream>
#include <cstdlib>
using namespace std;
//----------------------------------------------------------------------
//----------------------------------------------------------------------
template <class datatype>
class LinearList
{
struct Node
{
datatype symbol;
Node* next_... | ALGO | 0.992521 | 4.019054 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2023-02-28T17:33: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": "8dac7ac899f... |
0849e058-62f1-47a5-8777-e02d8d8cbce5 | ongbe/trading_engine | src/main/strategy_engine_common/Math/Bisection.cpp | #include "Bisection.h"
Bisection::Bisection()
:
_dLowerBound(-1),
_dUpperBound(-1),
_dMiddle(-1),
_dMiddlePrev(-1),
_bFirstTime(true),
_dIntendedAccuracy(-1)
{}
// Arguments:
// d1, d2: Accepts arguments d1 and d2 in any order
// dIntendedAccuracy: (Intended Accuracy) e.g. 0.001 means abs(dMiddle(n)-dMid... | ALGO | 0.999688 | 5.290158 | {
"github_metadata": {
"branch": "master",
"commit_count": 367,
"repo_created_at": "2018-02-21T16:51:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e34d800... |
0611ba63-5cb1-4665-941c-834bc45675e8 | AnkitVarshney01/My-Coding-Playground | Codeforces/B_Berland_Music.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <climits>
#include <vector>
#include <stdlib.h>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <random>
#include <numeric>
#include <iomanip>
#include <chrono>
#include <cmath>
#include <cassert>
#include... | ALGO | 0.999982 | 4.133629 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-05-26T09:39: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": "fd92d50841... |
e7dc6742-7eff-4db6-a223-8541b64bf696 | pzj-123456/data-structure | code/c++/tre/T2.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
typedef long long i64;
typedef pair<int,int> PII;
const int mod = 1e9 + 7;
const int N = 1e5 + 10;
int tr[N * 32][2], idx;
// 1010 >> 1 101 & 1
// 10 & 01 = 0
// 0000000001100
// 0000000000100
void... | ALGO | 0.999936 | 4.065555 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-07-22T12:50:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dac3fa76ec... |
37721a55-a0ce-41d6-a813-8ae7e9e258fa | AayushVyasKIIT/Resources | C++ package/DP/unbounded_knapsack/unbounded_knapsack.cpp | #include <bits/stdc++.h>
using namespace std;
#define mxn 102
#define mxw 1002
int static dp[mxn][mxw];
//initialise
void initialise(int n,int W){
for(int i=0;i<n+1;i++){
for(int j=0;j<W+1;j++){
if(i==0){
dp[i][j] = 0; //n
}
if(j==0){
dp[i][j] = 0;//j
}
}
}
}
//change the return type
in... | ALGO | 0.999966 | 3.664843 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-08-09T05:36:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8e70fed7dd... |
63d0ea38-0efd-413e-bad2-b1cc4bcbb824 | koth/elements-of-programming-interviews | generating-a-b-sqrt2-improved.cc | // Copyright (c) 2013 Elements of Programming Interviews. All rights reserved.
#include <cassert>
#include <iostream>
#include <queue>
#include <random>
#include <unordered_set>
#include <vector>
using std::cout;
using std::default_random_engine;
using std::endl;
using std::hash;
using std::priority_queue;
using std:... | ALGO | 0.999448 | 4.832634 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2016-03-30T01:43:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 14,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "87799d3... |
5085e3a7-5cab-4077-90d8-d640102cfab0 | canalesb93/ProblemLibrary | Other/gold.cpp | /*
3
2 2 2
2 1 3
10 1000 24
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
#include <map>
#include <string>
#include <utility>
#include <stdio.h>
#include <ctype.h>
using namespace std;
unsigned long long GCD(unsigned long long a, unsigned long long b)
{
whil... | ALGO | 0.999841 | 3.798265 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2015-02-18T01:18: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": "a46769f45... |
36a1614c-e942-49b4-a004-0877ee3c855e | miskcoo/oicode | bzoj/1622.cpp | /* BZOJ-1622: [Usaco2008 Open]Word Power 名字的能量
* 暴力 */
#include <cstdio>
#include <cstring>
const int MaxN = 1001, MaxM = 100, MaxE = 31;
char names[MaxN][MaxN], energys[MaxM][MaxE];
void to_lowercase(char* str)
{
for(int i = 0; str[i]; ++i)
{
if(str[i] >= 'A' && str[i] <= 'Z')
str[i] -= 'A' - 'a';
}
}
in... | ALGO | 0.999818 | 3.843839 | {
"github_metadata": {
"branch": "master",
"commit_count": 217,
"repo_created_at": "2014-05-25T12:26:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "da19a772... |
ec9064ec-f39f-4bec-91a4-0dbfb1c71adc | SmoggsL/Coding | School/C++/GRADE 10/SEQ/SEQ.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1e9+7;
const ll maxn = 1e9;
vector<long> a;
int n,q;
ll binSearch(ll l, ll r, ll k)
{
while ( l <= r)
{
int mid = (l + r)/2;
if(a[mid] == k) return mid;
if(a[mid] < k) l = mid++;
else r = mid--;
... | ALGO | 0.999999 | 4.352386 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2022-12-06T16:34: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": "b1dcfdb51... |
75b16ecb-8ed4-4498-86ed-8a157f1dfdac | aman123463/C-DSA | divide_array_with_twoequalsum.cpp | #include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool divideIn_subarray(vector<int>arr)
{
int total_sum=0, prev_sum=0, next_sum=0, n=arr.size();
for(int i=0;i<n;i++)
{
total_sum+=arr[i];
}
for(int i=0;i<n;i++)
{
prev_sum=arr[i];
next_sum=total_sum-prev_sum;
... | ALGO | 0.999786 | 4.331656 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-12-31T12:19: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": "e8dd8b9fc5... |
b251992e-7db4-4ba7-837e-dc3c9d4ed682 | gitzhzhg/SeismicPackage | CPSeis/spws_home/oop/vf/vf_edit_multiply.cc | /*<license>
-------------------------------------------------------------------------------
Copyright (c) 2007 ConocoPhillips Company
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software with... | TOOL | 0.979409 | 5.017072 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-11-24T03:32:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 70,
"forks": 30,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c7efd7d... |
57d99d81-3a4e-4a69-8570-9d923f903ab2 | privategenocomputation/privategenocomputation | Seal_FV/new_THE/SEAL/utilities.h | #ifndef SEAL_UTILITIES_H
#define SEAL_UTILITIES_H
#include "bigpoly.h"
#include "biguint.h"
#include "encryptionparams.h"
#include "bigpolyarray.h"
namespace seal
{
/**
Computes the exact inherent noise in a ciphertext and returns it as a BigUInt. Computing the inherent noise
requires the ciphertext, the ... | ALGO | 0.998976 | 6.937703 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2016-05-18T14:49:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "482b564eb... |
f20bbf78-fd4b-426f-8dc4-e33db12e889a | deep-astaad/codeforces | Jan 2023/D_Valiant's_New_Map.cpp | // Coded by : <NAME> (deep_aman/astaad)
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vll vector <ll>
#define vvll vector<vector<ll>>
#define vpll vector<pair<ll,ll>>
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define cyes cout<<"YES"<<"\n"
#define cno cout<<"NO... | ALGO | 0.999989 | 4.101846 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2022-07-21T20:23: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": "e1b0587a776... |
cdd7fa1e-4c74-4656-9c49-ab7c7847e743 | shy625/dont-stop-the-camera-study | LJI/스터디-C++/main_3178_코코스.cpp | #include <iostream>
#include <map>
#include <vector>
using namespace std;
int N, K;
struct Node
{
char c;
vector<Node> *next;
};
// K를 기준으로 앞은 정방향 트라이,뒤는 역방향 트라이로 구성하면 될 것 같다.
Node *MakeNode(char c, Node *ptr, int &cnt)
{
// 현재 포인터에서 연결된 Node의 char 중 있는지 체크
// 없다면 새 노드 만들고 연결
bool bFind = false;
... | ALGO | 0.999981 | 4.037455 | {
"github_metadata": {
"branch": "main",
"commit_count": 1371,
"repo_created_at": "2022-02-08T12:37:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 7,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "d26431acd... |
5cf4949b-eb54-4382-ab6b-9e98ad7f3aa1 | Abdallah-Afifi/Black-White- | Ass1.Prob7.cpp |
#include <iostream>
using namespace std;
enum color { black, white }; //color enum with members black and white
const int n = 2; //dimentions of the images
const int m = 3;
bool isnegative(color A[][m], color B[][m]) //checking if A is the opposite of B
{
for (int i = 0; i < n; i++)
{
for (int j ... | ALGO | 0.994668 | 4.832065 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-06T08:21: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": "71dcb32515db... |
f6f8ad42-6f0f-4ccb-89a8-0b56f054e30e | matthewsot/cs197-systems | arith_circuits/polynomial.h | #include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <map>
using namespace std;
// taken from https://jimmy-shen.medium.com/stl-map-unordered-map-with-a-vector-for-the-key-f30e5f670bae
struct VectorHasher {
int operator()(const vector<int> &V) const {
int hash = V.size(... | ALGO | 0.999032 | 4.613108 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2022-09-27T22:48:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58bc370b5... |
780932be-2684-4712-9d05-64a5a5ed534d | pranavsindura/CompetitiveProgramming | uva/1592.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl ... | ALGO | 0.999883 | 3.224547 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-01-26T05:15:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aba88ba87... |
69dd04f1-f91b-4c63-9e56-f0931019f1ca | varunswing/GeeksForGeeks | graph/AlienDictionary.cpp | // { Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
void dfs(int i, bool vis[], vector<vector<int>> v, string ans){
vis[i] = true;
for(auto x:v[i]){
if(!vis[x]){
dfs(x, vis, v, ans);
... | ALGO | 0.999979 | 5.357767 | {
"github_metadata": {
"branch": "master",
"commit_count": 173,
"repo_created_at": "2020-07-16T04:52:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60eafd... |
7bccc892-c049-47d1-90de-f2bd52fda515 | yahyamallak/LanguageCplusplus | matrix palindrome/main.cpp | #include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
using namespace std;
int RandomNumber(int from, int to) {
int number = rand() % (to - from + 1) + from;
return number;
}
void FillMatrix(int matrix[3][3]) {
for(int i = 0 ; i < 3; i++) {
for(int j = 0 ; j < 3; j++... | ALGO | 0.999486 | 4.077625 | {
"github_metadata": {
"branch": "master",
"commit_count": 228,
"repo_created_at": "2021-02-28T01:51:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07aec518... |
a4718844-58e5-4be9-b799-5759713a983a | NH5pml30/WrigglePie | algo/14/14/b.cpp | /* <NAME>, M3238 */
#include <iostream>
#include <vector>
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
constexpr int MAX = 1'000'000;
std::vector<int> first_prime(MAX + 1, -1);
for (int i = 2; i <= MAX; i++)
if (first_prime[i] == -1 && (int64_t)i * i <= MAX)
for (int j =... | ALGO | 0.999963 | 4.745523 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2019-12-17T12:06:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9282bba4... |
74463ecb-23b6-4203-bb0a-1c0cfb58acd6 | AtomAlpaca/OI-Codes | Luogu/P2234/P2234.cpp | #include <iostream>
#include <utility>
#include <random>
using std::cin;
using std::cout;
using std::pair;
std::mt19937 rnd(0x17000001);
int a, ans, n;
struct Treap
{
int tot, rt;
struct Node
{
int lch, rch, val, cnt, siz, pri;
} t[33005];
Treap()
{
tot = rt = 0;
t[0] = {0, 0, -1, 0, 0, 0};
}
void... | ALGO | 0.999842 | 3.384923 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2021-10-16T05:18:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c185ebc82... |
9456e802-5550-4621-99f3-225736fb4e89 | wi-seong-cheol/Algorithm | Backjoon/Greedy/2170_1.cpp | //
// 2170_1.cpp
// main
//
// Created by wi_seong on 2022/03/24.
//
#include <iostream>
#include <algorithm>
#include <vector>
#include <tuple>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
vector<pair<int, int>> lines;
for(int i = 0; i < n; i++)... | ALGO | 0.999886 | 4.678471 | {
"github_metadata": {
"branch": "main",
"commit_count": 350,
"repo_created_at": "2021-12-21T09:20: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": "4e25dca85b... |
006a7123-8291-473b-ab5a-05ff65159f6f | nayuta-0909/Kyopro_Practice | 螺旋本/12/12_5.cpp | #include <iostream> // 標準入出力用ライブラリ
#include <vector> // 動的配列(ベクトル)を使用するためのライブラリ
#include <stack> // スタックを使用するためのライブラリ
using namespace std;
static const int MAX = 100000; // 頂点の最大数を設定
static const int NIL = -1; // 訪問状態が未確定なことを示す定数
int n; // 頂点数
vector<int> G[MAX]; ... | ALGO | 0.999987 | 5.314364 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2024-10-12T07:11: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": "a2b8b1ca1... |
b6482d04-5b56-4c40-9103-dd5bb346d38e | Tarunagg1/Ds_Alog_notes | Liang_Barsky_Algo/Liang_Barsky_Algo.cpp | #include<iostream.h>
#include<graphics.h>
void main()
{
int gd = DETECT, gm;
/** x1, x2, y1 & y2 are line coordinates
xmax, xmin, ymax & ymin are window's lower and upper corner coordinates
xx1, yy1, xx2 & yy2 are the new coordinates of clipped line
**/
int x1, y1, x2, y2, xmax, xmin, y... | ALGO | 0.998675 | 4.139819 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-19T04:18: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": "ce52329a23... |
dc3c5b8e-fd00-44f9-a7f0-ca34e4bf1aac | EluvK/LeetCode | algorithm/2731.移动机器人.cpp | /*
* @lc app=leetcode.cn id=2731 lang=cpp
*
* [2731] 移动机器人
*/
// @lc code=start
class Solution {
const int MOD = 1e9 + 7;
public:
int sumDistance(vector<int> & nums, string s, int d) {
int n = nums.size();
vector<long long> a(n);
for (int i = 0; i < n; i++)
a[i] = (long... | ALGO | 0.999867 | 6.239773 | {
"github_metadata": {
"branch": "VScode-LC-plugin",
"commit_count": 123,
"repo_created_at": "2020-01-07T14:22: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":... |
85b44426-014f-43f8-8f17-9b0deeb8e24b | tonypro17/palindrome | palindrome/mainwindow.cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QIntValidator>
#include <algorithm>
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{
ui->setupUi(this);
result = 0;
// set up UI elements for displaying results
ui->resultTextDisplay->setReadOnly(true... | TOOL | 0.9287 | 6.054722 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-03-25T13:37: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": "480d8e1e81... |
0dad9c67-68c2-491f-a937-e9d8ff09301d | lpharch/DRAM_FAULT_SIM | dram_error_sim/XED.cc | /*
Copyright 2023, The University of Texas at Austin
All rights reserved.
THIS FILE IS PART OF THE DRAM FAULT ERROR SIMULATION FRAMEWORK
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code mu... | ALGO | 0.933776 | 5.754633 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-11T14:03:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e6cbce803237... |
e7e576a8-85c4-42c1-8206-f6540d1d729d | abdusss111/ads-2023-fall | lab4/c.cpp | #include <iostream>
using namespace std;
struct Node{
int val;
Node *right, *left;
Node(int val){
this->val = val;
right = left = nullptr;
}
};
struct BST{
Node *root;
BST(){root = nullptr;}
private:
Node* _insert(Node* cur, int val){
if(cur == nullptr) return new... | ALGO | 0.999983 | 5.191601 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-01-28T07:53: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": "53ade524204a... |
8ee860d8-3f79-4cc8-84b1-2b905df2af24 | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/13_17823_30.cpp | //============================================================================
// Name : file.cpp
// Author : nabil
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include... | ALGO | 0.999544 | 4.457989 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21: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": "c8deb7636... |
775fcc5e-290b-43df-928f-613d9f3f7044 | LuffyWei/PowerHash_Development | bHashTest11.2/Accumulate.cpp | //
// Created by weixun on 18-1-2.
//
#include "Accumulate.h"
#include "murmurhash.h"
#include <iostream>
#include <fstream>
using namespace std;
Accumulate::Accumulate(int accumulate_num, uint64_t bucket_num_small) {
this->accumulate_num = accumulate_num;
this->bucket_num_small = bucket_num_small;
if(acc... | TOOL | 0.933186 | 4.363779 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-06-07T08:45: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": "504ff999d... |
5a1ff29a-3eb5-42f5-ab94-5c877a690dc1 | dibyatanoy/Competitive_Programming | True_friends.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#define pb push_back
#define MP make_pair
#define CLR(x) memset(x,0,sizeof(x));
#define l... | ALGO | 0.999916 | 3.695633 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2015-10-18T03:16: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": "a2c072c614... |
662e99be-b752-42cb-bd93-2eaf25950059 | imabhinav-am/Competetive-Programming | cc_jun_3.cpp | /*
Author : Abhinav
Modified : 07-06-2018 03:55:52 PM
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
#define faster ios_base::sync_with_stdio(false);cin.tie(0);
const ll mod = 1e9+7;
#define rep(i,j,k) for(ll i=j; i<k; i++)
#define repv(i,j,k) for(ll... | ALGO | 0.999874 | 3.669343 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-09-07T18:16:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "40fd55796... |
dd532a7d-74c9-4a43-bf36-3d83671c039c | Kiranraj077/DSA-with-CPP | Strings/796.Rotate_string.cpp | class Solution {
public:
// Function to left rotate a string by d positions
string rotation(string str, int d) {
string temp; // Temporary string to store the first 'd' characters
int j = 0;
int l = str.size(); // Get the length of the string
// Store the first 'd' characters in... | ALGO | 0.999844 | 6.136952 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2024-10-28T13:54: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": "fad8fd9596... |
c752ab84-db14-482b-90bc-7d7a3ad6ce40 | themaskedcrusader/hodgepodge | code_eval/cpp/moderate/challenge_161.cpp | // Created by cschalk on 9/19/2016.
// Challenge 161: Conway's Game of Life
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
using namespace std;
std::vector<string> stage;
int height;
void readInitialState(char* &inFile) {
std::ifstream in {inFile};
std::string line;
// get... | ALGO | 0.999755 | 5.55794 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-05-13T16:42: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": "c7a2afaaa... |
a844cc07-9bbc-4408-b54c-fbdd94e76603 | Gautam-Jangir8/LeetCode-Questions | 0234-palindrome-linked-list/0234-palindrome-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverse(Lis... | ALGO | 0.999793 | 5.821636 | {
"github_metadata": {
"branch": "main",
"commit_count": 1045,
"repo_created_at": "2024-06-23T04:57: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": "111e348d7... |
f9ae6873-7fec-4888-80c8-2d1c2b0afda6 | hmansoori002/Algorithm-Toolbox | week3_greedy_algorithms/4_maximum_advertisement_revenue/dot_product.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
int main() {
// your code goes here
//ll n;
cin>>n;
ll a[n],b[n];
for(ll i=0;i<n;i++)
cin>>a[i];
for(ll i=0;i<n;i++)
cin>>b[i];
sort(a,a+n);
sort(b,b+n);
ll res=0;
for(ll i=0;i<n;i++)
res += a[i]*b[i... | ALGO | 0.999975 | 4.754174 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-01-01T14:55: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": "4baefba377... |
553cd28f-e075-42a4-af49-4c028e1a9313 | Justinshao33/competitive_programming | done/CSES/School_Excursion.cpp | #pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include<bits/stdc++.h>
using namespace std;
#define ZTMYACANESOCUTE ios_base::sync_with_stdio(0), cin.tie(0)
#define ll long long
#define ull unsigned long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define debug(x) ... | ALGO | 0.99997 | 4.41201 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-07-01T18:14:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12ef85ac071... |
0ea55022-4994-4785-a8a7-70c4a7258dc3 | rjenez/W266-final-project | data/programming-homework-dataset-plagiarism-detection/src/B2017/Z1/Z1/student4639.cpp | /*B 2017/2018, Zadaća 1, Zadatak 1
NAPOMENA: ulaz/izlaz za zadatke je specificiran
javnim autotestovima. Zalbe za ne analiziranje testova
se ne uvazavaju!
NAPOMENA: nece svi (javni) testovi sa zamgera biti
dostupni na c9.
Za sva ostala pitanja i nedoumice vezane za
autotestove javiti se na email: <EMAIL>.
*/
... | ALGO | 0.998996 | 4.268342 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2022-02-09T00:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d95c96d3d5... |
9b471e8c-9acc-4f59-9ed3-520a6b221407 | kpjgit/study | baek/bfs/organic cabbage.cpp | //1012
#include <bits/stdc++.h>
int T;
int N, M;
int K;
bool board[50][50];
bool vis[50][50];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
std::queue<std::pair<int, int>> q;
int main(void) {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cin >> T;
int x, y;
for(int nu... | ALGO | 0.999548 | 4.54042 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2024-07-09T04:38: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": "abc6d4e74f2... |
6a070e4c-250c-4176-8980-9e2d19394e0c | trannguyenhan/workspace-algorithms | TTUD_Codeforces/02RELOAD.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
vector<int> vt;
int dgg;
// Tim do gap ghenh cua duong di trong lan dau tien
void findDGG(){
dgg = 1;
for(int i=1; i<n; i++){
if(vt[i] != vt[i-1]) dgg++;
}
}
// Doc vao do gap ghenh cua duong ban dau
void inputData1(){
cin >> n;
for(int... | ALGO | 0.999561 | 3.884271 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2020-09-08T02:54:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 90,
"forks": 46,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf23c9a... |
525c49b3-762d-4b06-afa5-8431db153128 | lleviackermann/CpCodes | codeforces/E_Guess_Game.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;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define endl "\n"
#define fo(i, n) for (i = 0;... | ALGO | 0.999921 | 4.820624 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2023-04-28T10:03: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": "aef1529d... |
56f7d400-1b14-4e59-bd75-b6ed30e0595c | Vyctrus/PEA | Branch2.cpp | #include "Branch2.h"
Branch2::~Branch2()
{
delete[] resultPermut;
delete[] permuTab;
delete[] visited;
delete[] minimusFrom;
}
void Branch2::brutForce(int v)
{
int u;
permuTab[currentSize++] = v;//permuTab jest zawsze tej samej wielkosci, current size to poprwane zapelnienie
if (currentSize < matrixSize)
{
... | ALGO | 0.999955 | 3.449597 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-10-27T16:07: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": "ab7953939... |
92a71450-d8ee-4d00-8dc2-cac3dd537ef1 | Jullemyth122/GameOfLife | src/main.cpp | #include <raylib.h>
#include <iostream>
#include "simulation.hpp"
int main()
{
// The Rules
// underpopulation: A live cell with fewer than two live neighbors dies.
// statis: a live cell with two or three live neighbors lives on to the next generation.
// overpopulation: A live cell with more than t... | ALGO | 0.993415 | 4.973698 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-10T12:44: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": "8a473114a66d... |
619da84a-eeb4-48a0-a777-3a1d19b4ceb0 | DOCUTEE/Docute_2022_2023_Competitive_Programing | KTLT/Medium/contest2/8quanhau.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
int n;
vector<int>y(18);
vector<vector<int>>save(1000000);
int cnt = 0;
bool check(int i, int j)
{
for(int x = 1; x < i; x++)
{
if (y[x] == j || abs(x-i) == abs(y[x] - j)) return false;
}
return true;
}
void b... | ALGO | 0.999977 | 4.480063 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-01T17:59:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17d1e35126d5... |
4f6c05b4-132b-42f2-8b7b-a601550c4643 | isboudja/TallerTrabajo2 | Legendre.cpp | //
// Created by itsfr on 01/05/2024.
//
#include "Legendre.h"
#include <cmath>
#include "Matrix.h" // Asegúrate de incluir la definición de la clase Matrix
/**
* @brief las funciones Legendre asociadas y sus derivadas hasta el grado n y orden m,evaluadas en la latitud dada.
*
* @param n El grado máximo de los po... | ALGO | 0.999749 | 5.846797 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-05-08T15:17: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": "768e5cd64ae... |
0d330e3f-fdfe-4013-8f96-ea5c1b1c35dd | loveBabbar/CodeHelp-DSA-Busted-Series | Lecture063 Tree Interview Questions Day1/diameter.cpp | #include <bits/stdc++.h>
using namespace std;
/* A binary tree node has data, pointer to left child
and a pointer to right child */
struct Node {
int data;
struct Node* left;
struct Node* right;
};
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp-... | ALGO | 0.998673 | 5.227394 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2021-12-08T19:23:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3573,
"forks": 2443,
"issues": 67,
"pull_requests": 263
},
"file_meta": {
"content_id": "5... |
3a620afe-ab7e-42b5-a6a9-192b190f022e | EricGao-Byte/My-CPP-Program | 指针 5x5矩阵顺序存放最大数和最小数/指针 5x5矩阵顺序存放最大数和最小数/源.cpp | #include <stdio.h>
#define N 5
int main()
{
void input_array(int(*a)[N], int n);
void printf_array(int(*a)[N], int n);
void select(int(*a)[N], int n);
int a[N][N];
printf("请输入一个5X5矩阵(每输入一行回车一次):\n");
input_array(a, N);
select(a, N);
printf("调整顺序后的矩阵为:\n");
printf_array(a, N);
return 0;
}
void input_array(int(... | ALGO | 0.999887 | 3.692547 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-04-28T12:02:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc2bff5c1... |
7615e37e-4092-441a-b18c-d720016c4651 | Aditya16102002/deode-DSA-assignment | Arrays2-Assignment/2.cpp | #include <bits/stdc++.h>
using namespace std;
void largestThree(vector<int> &v)
{
int max1 = INT_MIN, max2 = INT_MIN, max3 = INT_MIN;
for (int i = 0; i <= v.size() - 1; i++)
{
if (v[i] > max1)
{
max3 = max2;
max2 = max1;
max1 = v[i];
}
els... | ALGO | 0.999897 | 4.445852 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-02-04T17:36:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2530fb46225... |
914d5e8b-fb19-46e9-8130-3c24b29a1021 | ligiaurora/exercicio-pragmaompfor | matriz_divisao.cpp | #include <windows.h>
#include <assert.h>
#include <stdio.h>
#include <omp.h>
#include <time.h>
int main(int argc, char *argv[]){
const int linha = 2;
const int coluna = 2;
int a[linha][coluna];
int b[linha][coluna];
int c[linha][coluna];
#pragma omp parallel
{
#pragma omp single
... | ALGO | 0.999425 | 4.066199 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-21T22:57: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": "83dc39a73b1b... |
4b54fe83-c2e5-469e-af0a-7d278026b5b3 | DionysiosB/CodeForces | 0300-0399/382A-KseniaAndPanScales.cpp | #include <cstdio>
#include <iostream>
#include <string>
int main(){
std::string current(""); getline(std::cin, current);
std::string remaining(""); getline(std::cin, remaining);
int left = current.find("|");
int right = current.size() - 1 - left;
int diff = left - right; if(diff < 0){diff *= -1... | ALGO | 0.999084 | 3.800182 | {
"github_metadata": {
"branch": "master",
"commit_count": 4487,
"repo_created_at": "2013-06-27T18:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 690,
"forks": 163,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa5... |
6adeb50f-4ed1-46fe-a057-d27ad7fee08f | KAUSHAL36977/grid-texting-style- | grids.c++ | #include <iostream>
#include <map>
#include <iomanip>
#include <string>
#include <limits>
using namespace std;
// Grid size
const int GRID_SIZE = 10;
// Define a structure to represent grid coordinates
struct GridPosition {
char col; // Columns from A to J
int row; // Rows from 1 to 10
// Custom comp... | ALGO | 0.935845 | 6.396789 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-22T08:58:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53c02a7a6aac... |
09813c1f-7f0f-4b1e-96bc-e62ecaa34c8f | koohanmo/MyAlgorithmNote | problems/boj/BOJ_1697.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
int V[200200];
int main() {
int N, K; scanf("%d %d",&N, &K);
memset(V,-1,sizeof(V));
V[N] = 0;
queue<int> Q;
Q.push(N);
while (!Q.empty()) {
int C = Q.front();
Q.pop();
if (C + 1 <= 200100 && (V[C + 1]... | ALGO | 0.999877 | 3.310709 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2016-09-07T18:04:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9dfe0bc9c... |
925e7153-7033-47f7-885d-a8d1209ff792 | ShaikhRaed/personalproject | GameSimulations_InteractiveProjects/Queue-Based Simulations and Circular Resizable Queue/project10/main.cpp | /*
Author: <NAME>
Class: CS 2C
Date: May 2, 2025
Instructor: <NAME>
A discrete-event simulation of a single-server queueing system.
It reads arrival times and service durations from "in1.txt", schedules arrival and departure events
using STL priority_queue and queue, processes each event in chronological order (with a... | ALGO | 0.997427 | 5.744424 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-22T08:01: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": "68c61dfa2f4b... |
8ed59a6c-126d-4404-8ab7-da6b783e6570 | jorgehr12345/GPCFIIS2023 | extra/flows/Dinic.cpp | #include <bits/stdc++.h>
#define pb push_back
#define inic ios_base::sync_with_stdio(false);
#define inic2 cin.tie(NULL);
#define inic3 cout.tie(NULL);
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long ll;
#define Rep0(i, n) for (ll i = 0; i < (ll)n; i++)
#define Rep1(i, n) for (ll i = 1; i <= (l... | ALGO | 0.999988 | 4.111892 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-11-12T16:39: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": "17b3e13c9a5... |
61fdcac4-a635-4f0a-b789-7d885a370232 | zxyinz/MachineLearningToolkit | SanMachineLearningSolution/Toolkit/SanMachineLearning_Main.cpp | #include"iostream"
#include"process.h"
#include"ProblemSet\ProblemUIFunc.h"
using namespace std;
using namespace San;
using namespace San::Device;
using namespace San::FileIOStream;
using namespace San::MachineLearning;
int main(int argc, char** argv)
{
::srand(time(0));
cSanTerminalDevice Terminal;
Terminal.iSetT... | ALGO | 0.997555 | 3.517912 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2014-04-07T08:33: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": "3c79fd972... |
6b7ca0ab-d0dc-415a-a966-ade8569f8b56 | Kaustubh22327/CFsols | B_Odd_Grasshopper.cpp | #include <iostream>
using namespace std;
long long findFinalPosition(long long x0, long long n) {
if (n == 0) return x0;
long long remainder = n % 4;
if (x0 % 2 == 0) {
if (remainder == 1) return x0 - n;
if (remainder == 2) return x0 + 1;
if (remainder == 3) return x0 - (n + 1);
... | ALGO | 0.999988 | 4.494596 | {
"github_metadata": {
"branch": "main",
"commit_count": 267,
"repo_created_at": "2024-09-30T14:02: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": "74de4ca5db... |
8bbf2bb0-db8f-4d35-9df8-7406e7c2f0ba | aajjbb/contest-files | Boca/OperacaoLavaRatos.cpp | #include <bits/stdc++.h>
using namespace std;
vector<string> nomes;
int n, pos, walk;
void ajusta(){
vector<string> newNames(n," ");
for(int i = 1; i <= n; i++){
newNames[i%n] = nomes[i-1];
}
nomes = newNames;
}
int main() {
while(cin >> n){
for(int i = 0; i < n; i++){
nomes.push_back... | ALGO | 0.999883 | 3.161647 | {
"github_metadata": {
"branch": "master",
"commit_count": 892,
"repo_created_at": "2016-03-02T13:05:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6e70fcd... |
4d8ca537-f124-468b-ad2a-1bd68dcb4851 | ishandutta2007/codeforces-j | jdurie/normal/1328/F.cpp | #pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
template<class T, class S>
ostream& operator << (ostream &o, const pair<T, S> &p) {
return o << '(' << p.first << ", " << p.second << ')';
}
template<template<class, class...> ... | ALGO | 0.999859 | 3.808401 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42: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": "5abb278eae05... |
0730fffa-e6bf-45da-a7f7-94dc0ef7ee20 | andersori/Computacao-Grafica | 02 - cuboGL/src/matriz.cpp | #include "matriz.h"
#include <qmath.h>
#include <QDebug>
Matriz::Matriz()
{
}
double **Matriz::rotacionarX(const double theta)
{
double** c = Matriz::criarMatriz();
double s = M_PI/180.0*theta;
c[0][0] = c[3][3] = 1.0;
c[1][1] = c[2][2] = cos(s);
c[2][1] = sin(s);
c[1][2] = -c[2][1];
re... | ALGO | 0.932997 | 3.645368 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-04-28T19:14: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": "ead1629876... |
66417951-c03e-4e48-9e65-11921ebb1844 | Avi711/Anomaly-detection | anomaly_detection_util.cpp | //
// Created by <NAME> - 318731478
// Created by <NAME> - 318409745
//
#include <math.h>
#include "anomaly_detection_util.h"
float var(float* x, int size) {
// calculating Expectation value
float mu = 0, var = 0;
for (int i = 0; i < size; ++i) {
mu = mu + x[i];
}
mu = mu / (float)size;
... | ALGO | 0.931845 | 3.30841 | {
"github_metadata": {
"branch": "main",
"commit_count": 105,
"repo_created_at": "2021-10-19T09:03:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4da895c9d9... |
4c741477-e534-4c14-980d-90a7a50b1f15 | shilpa1-naik/Hacking | leetcode/005_nsquared_ss.cpp | // -------------------------------------------------------------------------------------
// Author: <NAME> (cbrghostrider); Copyright - All rights reserved.
// For email, run on linux (perl v5.8.5):
// perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0a"'
// --... | ALGO | 0.999979 | 5.939496 | {
"github_metadata": {
"branch": "master",
"commit_count": 390,
"repo_created_at": "2015-10-14T16:53:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42914027... |
44627e30-64ee-45d9-89ae-61570ab7a853 | afdal3211/Muhammad-Afdhal_FOP2020 | LAB08/q2.cpp | #include <iostream>
using namespace std;
int main(){
//Stating Variable for number that will conver to ascii number
int x;
cout<<"======================================================="<<endl;
cout<<" Translate Number to Ascii Character "<<endl;
cout<<"========================================... | TOOL | 0.972766 | 3.486277 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-09-11T02:30: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": "d0c535ea2... |
13a129b4-3819-41ee-9dca-34d3492a6c83 | vipinkaulwar13/DSA | 0179-largest-number/0179-largest-number.cpp | class Solution {
public:
// void solve(vector<int>& nums, vector<pair<vector<int>, int>>& res){
// for(int i = 0; i<nums.size(); i++){
// vector<int>temp;
// int temp1 = nums[i];
// while(temp1){
// temp.push_back(temp1%10);
// tem... | ALGO | 0.999989 | 5.808475 | {
"github_metadata": {
"branch": "main",
"commit_count": 1465,
"repo_created_at": "2022-12-31T03:51:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa9473731... |
7a8f9020-df60-4f0c-9bb7-685a6ae1a981 | panerluke/Experiment-3 | prob2.cpp | //Create a C++ Program that store temperature of Province A, Province B and Province C for a week (seven days) and display it
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int x, temp[3][7];
cout << "Enter all temperature for a week of Province A, Province B and then Province C." << en... | ALGO | 0.952369 | 3.589715 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-20T17:15: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": "31c960fa12... |
b391f532-c67b-4a61-981e-ae4c4f13cfd8 | muuuuuua/leetcode | InterleavingString.cpp | /**
* 97. Interleaving String
*/
#include "inc/common.h"
bool isInterleave(string s1, string s2, string s3) {
if(s1.size()+s2.size() != s3.size())
return false;
int m = s1.size();
int n = s2.size();
vector<vector<bool> > dp(m+1, vector<bool>(n+1, false));
dp[0][0] = true;
for(int i = ... | ALGO | 0.999041 | 4.431312 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2016-04-11T14:38: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": "05c650d42... |
f2b010e9-5813-4712-bdab-2afa39df06f9 | sdy1423/Algorithm | [boj_17406]_배열 돌리기4.cpp | #include<vector>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int n, m, k, r, c, s, ans = 987654321;
int map[50][50], original[50][50];
bool visited[50][50];
vector<pair<int, pair<int, int>>> vec;
void input() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
c... | ALGO | 0.999958 | 4.674538 | {
"github_metadata": {
"branch": "master",
"commit_count": 382,
"repo_created_at": "2019-11-21T04:19: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": "1ab8db2b... |
8f29eb71-7ac7-4aeb-85cb-08d7fbec5ec4 | Serin511/Problem-Solving | BOJ/10001-15000/11553.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define all(V) (V).begin(), (V).end()
#define unq(V) (V).resize(unique(all(V))-(V).begin())
using namespace std;
typedef pair<int, int> pii;
struct node {
int V, lz, len, l, r, d;
node() : V(0), lz(0), len(0), l(0), r(0), d(0) {}
};... | ALGO | 0.999878 | 3.986394 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2020-02-19T06:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0de15539c... |
20416018-d457-482f-81c6-87aac3836c60 | jacopograndi/age | game/ai/engine.h | #ifndef ENGINE_H
#define ENGINE_H
#include <iostream>
#include <string>
#include <vector>
#include <limits>
#include <cmath>
#include "../ground.h"
#include "../gst.h"
#include "action.h"
#include "tactic.h"
#include "generator.h"
#include "evaluator.h"
#include "performer.h"
namespace ai {
class engine {
pub... | ALGO | 0.95216 | 5.802326 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-01-04T09:42:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2ef707d118... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.