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
ce5aad03-22e0-4b8c-b97e-8f21a66a414a
godotengine/godot
modules/navigation_2d/2d/nav_mesh_generator_2d.cpp
/**************************************************************************/ /* nav_mesh_generator_2d.cpp */ /**************************************************************************/ /* This file is part of: */ /* ...
TOOL
0.959537
6.954266
{ "github_metadata": { "branch": "master", "commit_count": 76043, "repo_created_at": "2014-01-04T16:05:36.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 98972, "forks": 22820, "issues": 5000, "pull_requests": 3866 }, "file_meta": { "content...
a3c6750f-0bd7-4b18-8563-a76733548ac7
Xilinx/Vitis-AI
examples/waa/plugins/include/pl/imgproc/xf_boundingbox.hpp
/* * Copyright 2019 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
ALGO
0.946462
4.047147
{ "github_metadata": { "branch": "master", "commit_count": 1253, "repo_created_at": "2019-10-16T21:41:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1631, "forks": 649, "issues": 340, "pull_requests": 75 }, "file_meta": { "content_id": "...
470598bc-30c3-43af-a037-c62629f0cd97
Arles96/Proyecto2_OS
reader.cpp
#include <pthread.h> #include <iostream> #include <string.h> #include <semaphore.h> #include <vector> #include <stdlib.h> #include <stdio.h> #include <time.h> #include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> #include <unistd.h> #include <ctime> using namespace std; #define STRING_SIZE 20 #define TABLE...
TOOL
0.985128
4.546732
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-09-11T23:30: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": "8c7af10ff0...
4c18cca9-8f9b-477a-8463-d1ed7c5fb95c
alwzbright97/Cpp-practice
baekjoon/implementation/candy_game.cc
#include <iostream> #define endl '\n' #define MAX 51 using namespace std; string board[MAX]; int N, answer = 0; void countRowMax(int j) { if (j >= N) return; int count_1 = 1; for (int n = 0; n < N; n++) { if (board[j][n] == board[j][n + 1]) { count_1++; if (count_1 > answer) ans...
ALGO
0.999979
3.98023
{ "github_metadata": { "branch": "master", "commit_count": 82, "repo_created_at": "2022-04-06T02:09: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": "6a469d090...
79b4ec08-89ea-4744-9bfd-ea5a44563efa
miuhui/LeetCode
easy/107.cpp
// // main.cpp // leetcode // // Created by 缪慧 on 3/10/16. // Copyright © 2016 miaohui. All rights reserved. // #include <iostream> #include <vector> #include <stdio.h> #include <queue> #include <math.h> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int ...
ALGO
0.999488
5.101634
{ "github_metadata": { "branch": "master", "commit_count": 105, "repo_created_at": "2016-03-02T08:41: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": "36e2aeb7...
c5ff16b0-35e7-423d-a479-55eff19cade8
chelseafandev/LeetCodeProblems
Easy/RomanToInteger.cpp
/* Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just two one's added together. 12 is writte...
ALGO
0.999111
5.848498
{ "github_metadata": { "branch": "main", "commit_count": 196, "repo_created_at": "2021-04-10T05:01: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": "af01d0eaa2...
3c32fed4-0695-4fbe-80ff-f1484ea4229f
Benjamin-Manjolo/Algorithms-practice
LinkedList.cpp
#include <bits/stdc++.h> #include <string> using namespace std; /* ALGORITHM inserting at the begining of the LinkedList 1. START 2. Create a node to store the data 3. Check if the list is empty 4. If the list is empty, add the data to the node and assign the head pointer to it. 5. If the list is not empty, add ...
ALGO
0.999221
4.435457
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2025-05-08T03:54:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "84e4a6eb3d1...
388356f6-fd8e-41eb-b781-645bc72927e8
GABRYCA/Algoritmi_Scuola
Superiori - Informatico/C++/Stringa/main.cpp
#include <iostream> #include <stdio.h> void continua(); bool compare(int lunghezzaMassima, char stringa[], char stringa2[]); int dimensioni(char stringa[]); void unisci(char stringa[], char stringa2[]); void inverti(int lunghezzaMassima, char stringa[]); void subString(char stringa[], int numeroSub); void replace(cha...
TOOL
0.956748
3.235771
{ "github_metadata": { "branch": "master", "commit_count": 934, "repo_created_at": "2020-10-19T21:12:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e240a68d...
b1f3d530-347e-4a67-bbba-2d9db753a6dd
butasebi/Algorithms
Palindromic Tree.cpp
//Palindromic PAL_tree //<NAME> (butasebi) //University of Bucharest //palindromes(STRING) returns a list of all the palindromes of a string //Time complexity: O(n) where n is the length of the string #include<bits/stdc++.h> #define MOD 1000000007 #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast...
ALGO
0.99995
4.618978
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2021-02-12T12:10:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b651e4e9e1f...
dd726636-0a0d-4cdb-a777-f44676cc1a6a
Taejin1221/Problem-Solving
Baekjoon/Baekjoon16234.cpp
// Baekjoon16234.cpp // https://www.acmicpc.net/problem/16234 #include <iostream> #include <vector> #define abs(x) ((x) > 0) ? (x) : (-(x)) using namespace std; typedef pair<int, int> pii; const int moves[4][2] = { { -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 } }; int main(void) { ios_base::sync_with_stdio(false); ci...
ALGO
0.999931
4.18041
{ "github_metadata": { "branch": "master", "commit_count": 1156, "repo_created_at": "2019-10-06T05:54:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5345957...
fd73c2dc-949a-4458-af37-8124208d8960
vedavikas06/competetive-programming
codeforces/Round 453/453B.cpp
//codeforces 453A.cpp #include <bits/stdc++.h> using namespace std; #define pb push_back #define sf scanf #define pf printf #define f first #define s second #define clr(x,y) memset(x,y,sizeof x) #define LL long long #define L int #define mx 100009 typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pii>...
ALGO
0.999656
3.434695
{ "github_metadata": { "branch": "master", "commit_count": 135, "repo_created_at": "2017-08-19T10:25:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f10fe025...
d51ced4a-ab06-482c-835a-9341f2539c6b
shashwats538/CSES-Solutions
Introductory Problems/Coin_Piles.cpp
/*You have two coin piles containing a and b coins. On each move, you can either remove one coin from the left pile and two coins from the right pile, or two coins from the left pile and one coin from the right pile. Your task is to efficiently find out if you can empty both the piles. Input The first input line has...
ALGO
0.999544
5.367723
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2020-10-07T08:57:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "99a5f93a8f4...
1c525115-c6fb-4c53-bac9-3bcab419b06f
sanshar/Dice
ICPT/StackArray/CxDiis.cpp
/* This program is not yet in a release condition and should not be distributed. * Author: <NAME>, Aug. 2013. */ #include <iostream> #include <cmath> #include <stdexcept> #include <cmath> #include "CxTypes.h" #include "CxAlgebra.h" #include "CxDiis.h" #include "CxMemoryStack.h" namespace ct { uint const VecNotPres...
ALGO
0.990082
5.889905
{ "github_metadata": { "branch": "master", "commit_count": 1360, "repo_created_at": "2017-05-08T02:51:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 55, "forks": 24, "issues": 10, "pull_requests": 2 }, "file_meta": { "content_id": "485e...
95fe9e37-b8ab-47a6-8c2a-35557a188516
jicewarwick/MA417Project
library/f.cc
#include <vector> #include <gsl/gsl_vector.h> #include "NormalRandomNumberGenerator.h" #include "HestonModel.h" #include "MonteCarloSimulation.h" #include "Options.h" struct data { size_t n; double* k; double* y; NormalRandomNumberGenerator* norm; }; //input: // data includes the actural val and number of obser...
ALGO
0.993623
4.399607
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2014-07-30T09:00: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": "1de45a8634...
8c06afe5-7d42-49d2-be7b-89350c317426
proysm/Algorithm
Programmers/두 큐 합 같게 만들기/code.cpp
#include <bits/stdc++.h> using namespace std; int answer = 0; vector<int>::iterator ptr1, ptr2; long long sum1 = 0, sum2 = 0; int solution(vector<int> queue1, vector<int> queue2) { ptr1 = queue1.begin(); ptr2 = queue2.begin(); for(auto e : queue1) sum1 += e; for(auto e : queue2) sum2 += e; if((s...
ALGO
0.999994
3.914508
{ "github_metadata": { "branch": "main", "commit_count": 126, "repo_created_at": "2023-03-25T02:04: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": "46ed7145b8...
e6885ba6-312c-4581-8f01-1a6455f49966
sangmin7b/algorithm
problems/22358.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vl = vector<ll>; using vvi = vector<vi>; using vvl = vector<vl>; using pi = pair<int, int>; using pl = pair<ll, ll>; vector<vector<pi>> adj; vector<vector<pi>> rev_adj; int main(int argc, const char** argv) { ios::sy...
ALGO
0.999918
4.367593
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-04-27T13:12:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c4458c5f083...
31203b65-bf83-47e5-a168-1fc944194bd4
timzheng0804/Leetcode
Serialize and Deserialize Binary Tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Codec { public: // Encodes a tree to a single string. string serialize(TreeNode* root) { string s = "...
ALGO
0.999261
5.46698
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2017-07-12T14:43: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": "b284879f...
565eb89a-5c7c-40c4-a876-14e643c6cf13
eaburns/search
gridnav/watch.cc
// © 2013 the Search Authors under the MIT license. See AUTHORS for the list of authors. #include "../graphics/ui.hpp" #include "../utils/utils.hpp" #include "gridmap.hpp" #include "gridnav.hpp" #include <cstdio> #include <cstdlib> #include <cstring> #include <cerrno> #include <vector> #include <SDL/SDL_opengl.h> cla...
TOOL
0.911881
6.308211
{ "github_metadata": { "branch": "master", "commit_count": 1210, "repo_created_at": "2013-06-20T14:23:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 34, "forks": 20, "issues": 28, "pull_requests": 0 }, "file_meta": { "content_id": "0e2c...
b5d21e5b-db89-4f46-ae86-b3fb16ef4f31
Akashsharma015/DAA
lab work/week1_2.cpp
#include <bits/stdc++.h> using namespace std; int binarySearch(int a[], int l, int k) { int b = 0, e = l - 1, no_of_comparison = 0; while (b <= e) { ++no_of_comparison; int mid = (b + e) / 2; if (a[mid] == k) { cout << "Present " << no_of_comparison << endl; ...
ALGO
0.999682
4.056995
{ "github_metadata": { "branch": "main", "commit_count": 68, "repo_created_at": "2021-08-16T05:35:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0f2fe8fb605...
d9c4b537-c10b-44bb-83ef-b62ec2006e49
sqmedeiros/rouxinol
1668-Building_Teams/training-60/2327051.cpp
// AUTHOR:- <NAME> #include <bits/stdc++.h> using namespace std; #define int long long #define pi (3.141592653589) #define mod 1000000007 #define float double #define pb push_back #define mp make_pair #define vi vector<int> #define vii vector<pair<int,int>> #define fr first #define sc second #define all(c) c.begin(),...
ALGO
0.99999
4.085245
{ "github_metadata": { "branch": "main", "commit_count": 238, "repo_created_at": "2024-01-31T15:39:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c47e946461...
0a3b123a-dc05-432f-9507-6c3a0d9061cc
Kulezi/potyczki_algorytmiczne
2019/runda1/pop/pop3.cpp
// Rozwiązanie brutalne do zadania 'Muzyka pop [1A]' Z Potyczek Algorytmicznych 2019. // Autor rozwiązania: <NAME> // Złożoność czasowa: O(n * m) // Złożoność pamięciowa: O(n * m) // Punkty: 3 (upsolve) #include <bits/stdc++.h> using namespace std; using ll = long long; constexpr int MAXN = 205, MAXM = 1 << 16 + 1; co...
ALGO
0.999969
4.279601
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2025-01-11T15:49: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": "f411365ebb29...
cc98ddf4-d061-43fd-9cee-c189930a03d2
runqingc/Coding-Practice
leetcode/farm_production/main.cpp
#include <iostream> #include <vector> #include <algorithm> #include <numeric> using namespace std; long N; vector<long> d; vector<long> g; long totalMinCost = LONG_MAX; // calculate the distance between 2 farms auto calDis = [](vector<long>& d, int x, int y){ return accumulate(d.begin()+min(x,y), d.begin()+max(...
ALGO
0.9999
3.76773
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2023-09-12T12:44:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f77996083a2...
cb673ca4-7587-4ab7-9758-6ac8fac4b9e2
LuigiPagani/Monte-Carlo-Methods-for-the-2D-ising-Model
Test/Rem/Rem.h
// MonteCarloSimulation.h #ifndef MY_PROJECT_MONTE_CARLO_SIMULATION_H #define MY_PROJECT_MONTE_CARLO_SIMULATION_H #include <array> #include <vector> #include <memory> #include "../Lattice/SquareLattice.h" #include <mpi.h> class Rem { public: Rem(float interactionStrength, int latticeSize, float T_MIN, float ...
TOOL
0.984125
5.745571
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2024-01-16T08:39: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": "9f3c0a5fba6...
f73ed57f-fa50-4537-8a96-cc0000daadc5
Vishal-Roy09/hangman-game
Hangman.cpp
#include <iostream> #include <vector> #include <algorithm> // for find #include <cstdlib> // for rand() #include <ctime> // for srand(time(0)) #include <limits> int main() { // List of words std::string nobodys[10] = {"dave", "ian", "carol", "simon", "peter", "sandra", "alan", "steve", "elliot", "keith"}; ...
TOOL
0.998453
4.337248
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-02-24T06:30: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": "2bc256889fee...
1b3c534a-8762-4245-a8e1-694e6fde79d1
weizds/LeetCode
easy/459_Repeated_Substring_Pattern.cpp
class Solution { public: bool repeatedSubstringPattern(string s) { int n = s.size(); string tmp{s.substr(1, n - 1)}; tmp.append(s.substr(0, n - 1)); return tmp.find(s) != string::npos; } // bool check(const string &s, const string &t) { // int m = t.size(); // ...
ALGO
0.999554
5.533762
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2023-02-12T20:14: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": "5fe68f5d049...
64edf9cc-c7a1-4a7c-a682-0fba43a5ba14
Bojc1K/NP-Proektna-48
main.cpp
#include <iostream> #include <vector> #include <algorithm> #include <fstream> using namespace std; int main(){ vector<int> vec; int siz = 0; int siz2 = 0; int br = 0; string s; string a; cout<<"Vnesete indeks, ime i prezime: "; cin>>s; cout<<"Vnesete email adresa: "; cin>>a; cout<<s<<" "<<a<<endl; ...
ALGO
0.99831
3.61107
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2022-05-29T20:13: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": "3244f93a75c1...
a4c17b3f-0bdf-4bc7-95bf-a8aa171264be
nayeemasha101/DS-Programming
lnk_lst_fst.cpp
//A Code For Linked List Inserting At First Position....... #include<stdio.h> #include<stdlib.h> struct Node { int Info; struct Node *Link; }*Ptr,*Start, *Save, *newN; int main() { int Val = 0, Startok = 1; printf("\t\tAshA\n"); printf("Enter The Value Please: "); scanf("%d", &Val); whil...
ALGO
0.999943
3.361862
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2019-02-03T18:42:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d6d76d38e4...
b5caff47-2441-48be-849b-bbc42913a0e0
wavescholar/numerical_libraries
itpp/itpp-4.3.1/itpp/base/math/elem_math.h
/*! * \file * \brief Elementary mathematical functions - header file * \author <NAME> and <NAME> * * ------------------------------------------------------------------------- * * Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors) * * This file is part of IT++ - a C++ library of mathematical...
TOOL
0.934259
6.943281
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2012-11-30T14:19:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 4, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "ba99ba2e...
a1500cc9-df38-41c4-9a34-cdb5a0e76001
RohanKhatua/LeetcodeSolutions
l110.cpp
#include <bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right...
ALGO
0.999906
5.749071
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-08-17T08:12:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bdc36afd5909...
77d5dc24-ff10-4dfe-8a4d-9aeab1385f8f
fbornhofen/randomsnippets
euler/0022/namescores.cc
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <locale> #include <fstream> using namespace std; class Name { string name_; public: Name() {}; Name(string s) : name_(s) {}; virtual ~Name() {}; void read_from(istream& s) { char c = 0; while ...
ALGO
0.981713
4.09789
{ "github_metadata": { "branch": "master", "commit_count": 65, "repo_created_at": "2013-03-14T20:21: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": "5c0de665f...
d6b7d342-6e65-4c31-9398-bb9b3393905d
ChairmanFMao/codeforces
practice/solved/1382B.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long // Accepted first try! void solve() { int n; cin >> n; int numbers[n]; for (int i = 0; i < n; i++) cin >> numbers[i]; int ones = 0; for (int i = 0; i < n; i++) { if (numbers[i] == 1) ones++; ...
ALGO
0.999957
4.156271
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2022-01-17T22:10: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": "f39830005...
c1eebd8d-a3b3-4f10-a1ec-1fdb9cb83040
3DPIT/algorithmTest
Algorithm(2020.08.26)/test/test/09.12 카카오6.cpp
#include <string> #include <vector> #include <queue> using namespace std; int dy[] = {0,0,-1,1,0,0,-1,1,0 };//방향 지정 int dx[] = {0,-1,0,0,1,-1,0,0,1 }; struct Data { int y, x,cnt,removeImage,image; }; bool safe(int y, int x) {//범위 지정 return 0 <= y && y < 4 && 0 <= x && x < 4; } int solution(vector<vector<int>> board, ...
ALGO
0.999121
4.60307
{ "github_metadata": { "branch": "master", "commit_count": 219, "repo_created_at": "2019-11-07T10:44: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": "4fcae7d5...
7722bcbf-05fc-48e3-bff4-55f0efd8f758
LemoNade2000/ProblemSolving
BOJ/10XXX/10830/src/MatrixPower.cpp
#include <iostream> #include <math.h> #include <cstring> using namespace std; int main() { int size; long long int power; cin >> size >> power; int matrix[size][size]; int powmat[size][size]; for(int i = 0; i < size; i++){ for(int j = 0; j < size; j++){ cin >> matrix[i][j]; } } memcpy(powmat, matrix, s...
ALGO
0.999867
4.013372
{ "github_metadata": { "branch": "master", "commit_count": 85, "repo_created_at": "2022-02-22T06:54: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": "86a0de0f7...
d636dfbf-4da6-480f-bbf9-5d2e2188709f
dishnat-hash-lab/DSA
Stack/array_implementation.cpp
#include<iostream> using namespace std; struct mystack{ int *arr; int top=-1; int cap; mystack(int c){ cap = c; arr = new int[cap]; } void push(int x){ if(top==cap-1){ cout<<"\nStack Overflow"; return; } top++; arr[top] =x...
ALGO
0.991301
4.447582
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2024-06-26T18:02: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": "f4720683a...
cda08a92-b7d7-4ee9-b9af-50f2808c2128
battlewolf/Event
Round-3E.cpp
/*Debug/Optimise it*/ #include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include...
ALGO
0.999888
3.941484
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2014-01-31T06:44: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": "d6acd2c45a...
483c6aad-9ea7-4c64-b300-f78e0fb1db6d
huannd0101/KTLT_HaUI
BTH2/bai2.5.cpp
/*Bài 2.5. Viết chương trình tính và hiển thị ra màn hình tiền điện phải trả của một hộ gia đình trong một tháng. Với số kwh điện tiêu thụ trong tháng là n được nhập vào từ bàn phím và giá 1kwh được tính như sau: 100 kwh đầu tiên: 750đ/1kwh; từ kwh thứ 101 đến kwh thứ 200: 1250đ/1kwh; từ kwh thứ 201 đến kwh thứ 300: 17...
ALGO
0.997688
3.013203
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2020-09-22T10:58: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": "dd12e91e7...
c65aa4a7-f888-46f4-9b12-5bfeb1dd9e32
mj0840/BaekJoon_C
백준/Bronze/25704. 출석 이벤트/출석 이벤트.cc
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> int main() { int n, p, five = 50000, ten = 50000, fifteen = 50000, twenty = 50000; scanf("%d %d", &n, &p); if (n >= 5) five = p - 500 >= 0 ? p - 500 : 0; if (n >= 10) ten = p / 10 * 9 >= 0 ? p / 10 * 9 : 0; if (n >= 15) fifteen = p - 2000 >= 0 ? p - 2000 : 0; if (...
ALGO
0.999642
3.185717
{ "github_metadata": { "branch": "main", "commit_count": 343, "repo_created_at": "2022-10-03T12:44:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b568262b29...
7283122e-701f-4255-bdee-3ae8666ce7a3
wksaurey/advent-of-code-2015
day2.cpp
#include <iostream> #include <fstream> #include <bits/stdc++.h> int main() { std::ifstream file("input/day2.txt"); if (!file.is_open()) { std::cerr << "Error opening the file!"; return 1; } std::string line; int result = 0; while (getline(file, line)) { std::stringstre...
ALGO
0.994198
5.57831
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-04-11T14:45: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": "e8f1e7726110...
60564f17-f535-4b40-a3f5-24b49e7c7bb0
IanGhioni/EstrD2023s1
TP-Final - Fixeado/testBiBST.cpp
#include <iostream> #include <algorithm> #include "BiBST.h" int main() { // g++ -o app testBiBST.cpp BiBST.h BiBST.cpp QueueBiBST.cpp QueueBiBST.h StackBiBST.cpp StackBiBST.h BiBST t = EMPTYBB; //? TESTEANDO insertBBNode; t = insertBBNodeBFS(t, 0, 0); cout << "Paso el insert de EMPTYBB" << endl; i...
TEST
0.99651
3.295573
{ "github_metadata": { "branch": "main", "commit_count": 85, "repo_created_at": "2023-03-15T20:33: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": "2407a4d8df3...
048d680f-f959-4626-8629-e693e4f8acb8
MajedAlMunefi04/MajedAtCERN
CudaTimeMeasurementTest/Old/newTimeCalc.h
//initializing the libraries needed #include <iostream> #include <iomanip> #include <cmath> #include <cstdlib> #include <string> #include <algorithm> #include <vector> #include <random> #include <utility> #include <cuda.h> #include <unistd.h> #include <cmath> // for abs() from <cmath> #include "HeterogeneousCore/CUDAU...
ALGO
0.999166
5.078916
{ "github_metadata": { "branch": "main", "commit_count": 62, "repo_created_at": "2023-06-07T08:33:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "004b71f1b50...
a4dfe99d-ef68-4c05-a88e-186861385435
kssilveira/topcoder
old/Filtering.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <limits> #include <list> #include <map> #include ...
ALGO
0.99889
4.102371
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2011-12-17T15:31: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": "552f9a2b89...
d8223393-5090-49bb-9cfe-7a021cf5a5c1
dpnguyen94/topcoder
CutTheNumbers.cpp
#include <stdio.h> #include <math.h> #include <limits.h> #include <memory.h> #include <algorithm> #include <numeric> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <stack> #include <map> #include <set> using namespace std; #define REP(i,a,b) for (int i=(a),_b=(b...
ALGO
0.999964
4.813614
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-01-19T23:15: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": "535bd2c3f4...
27bca7bc-e09e-4047-bddf-776d13fc0d44
dev-swapnilx/Machine_Learning
KNN/src/knn.cpp
#include "knn.hpp" knn::knn(int value) { k = value; } knn::knn() { // NA } knn::~knn() { // NA delete_neighbors(); } void knn::delete_neighbors() { delete neighbors; // Free up memory allocated for neighbors neighbors = nullptr; // Set the pointer to nullptr after deletion } // complexity: O...
ALGO
0.995765
5.567274
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2023-11-12T00:57: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": "5098cbe768c...
f37e4cf0-b099-4a8b-8115-e93de5a07f5c
VeblenYe/SimpleCompile
SimpleCompile/Grammar.cpp
#include "Grammar.h" #include <iostream> #include <stack> using namespace std; Grammar::Grammar() : Vn(make_unique<set<string>>()), Vt(make_unique<set<string>>()), S(""), P(make_unique<map<string, set<string>>>()), peek(' '), nP(make_unique<map<string, set<string>>>()), FIRST(make_unique<map<string, set<strin...
ALGO
0.991849
3.085576
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-05-26T04:52: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": "0dab7a89e4...
0128cd6a-b495-4812-aea7-c0203dd1b000
aditgautam/cs3
13_03_simple_list_class-aditgautam/includes/list_simple/list_simple.h
#include "../linked_list_functions/linked_list_functions.h" template <class ITEM_TYPE> class List { public: List(); ~List(); List(const List<ITEM_TYPE> &copyThis); List& operator =(const List& RHS); node<ITEM_TYPE>* insert_head(ITEM_TYPE i); //inset i at the head of list node<ITEM_...
TOOL
0.994389
4.27831
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-01-28T18:32:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8aa8c22be24a...
d78c6ef9-6ada-49b2-a176-194f2ac07657
VladimirLunkin/AiSD
dz1/task4_2/main.cpp
#include <iostream> #include <assert.h> using namespace std; template <class T> struct is_less { bool operator()(const T &l, const T &r) { return l > r; } }; //bool is_less(const int &l, const int &r) { // return l < r; //} template <class T> struct DefaultComparator { bool operator()(const T...
ALGO
0.999929
5.170733
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2021-01-11T17:34:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "90a54b5fe8f...
f0831156-708a-4ac6-a1f2-27b75e1f6732
cs2103aug2014-w10-1c/main
You-QueryEngine/comparator.h
/// \file You-QueryEngine/comparator.h /// Defines the base class and constructors for sorting comparators. //@author A0112054Y #pragma once #ifndef YOU_QUERYENGINE_COMPARATOR_H_ #define YOU_QUERYENGINE_COMPARATOR_H_ #include <stdexcept> #include <functional> #include "task_model.h" namespace You { namespace QueryEn...
TOOL
0.936123
7.691976
{ "github_metadata": { "branch": "master", "commit_count": 1869, "repo_created_at": "2014-09-02T05:42:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 3, "issues": 23, "pull_requests": 1 }, "file_meta": { "content_id": "0b2b3a7...
1b27ee11-c0e1-493c-b167-a31923b9de44
liuyaqiu/LeetCode-Solution
861-Score-After-Flipping-Matrix.cpp
int convert(const vector<int>& digits) { int res = 0; for (int i = 0; i < digits.size(); i++) { if (digits[digits.size() - 1 - i] == 1) { res += 1 << i; } } return res; } class Solution { public: int matrixScore(vector<vector<int>>& A) { for (int i = 0; i < A.siz...
ALGO
0.999903
6.010813
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2016-11-06T12:48: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": "93cb030c91...
5c12b5d9-2c65-4ca3-b68e-b37c8fd600a2
itsmohitkr/c_plus_plus_code
linked_list/Move_lst_element_to_front.cpp
#include<iostream> using namespace std; // user defined node class class node { public: int data; node*next; //constructor node(int d) { data = d; next = NULL; } }; void insertAt_Head(node *&head, int data) { if (head == NULL) { head = new node(data); return; } node*n = new node(data); //dyanamic allo...
ALGO
0.99993
4.190723
{ "github_metadata": { "branch": "main", "commit_count": 20, "repo_created_at": "2021-08-11T04:25: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": "637939f1d7e...
20503e22-6405-4243-9f2f-9040568347b0
hailiyouyu/codes
algos/avl_tree.cc
#include "avl_tree.h" #include <iostream> #include <cstdlib> static bool avl_balanced(struct node *p); static int avl_height(struct node *p); static struct node *avl_ll_rotate(struct node *p); static struct node *avl_rr_rotate(struct node *p); static struct node *avl_lr_rotate(struct node *p); static struct node *avl...
ALGO
0.999025
5.441002
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2015-11-02T09:53:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "764969e30e...
3e2c5350-65f3-4374-881b-be3f3ecac1bc
MrZhulik0/Chislaki_labs
Lab_4/src/approximation.cpp
#include "approximation.h" #include <cmath> #define M 2 double* approx(double* t , double* r, int n){ double** sums = new double*[M]; for(int i = 0; i < M; i++){ sums[i] = new double[M]; for(int j = 0; j < M; j++){ double sum0 = 0; for(int k = 0; k < n; k++){ ...
ALGO
0.999539
3.703325
{ "github_metadata": { "branch": "Lab_1", "commit_count": 38, "repo_created_at": "2023-10-25T20:37: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": "b2be22ccd2...
3af58669-f627-4c2c-adcf-ad74c7546751
Darelife/CompetitiveProgramming
Problems/B_A_BIT_of_a_Construction.cpp
#include <bits/stdc++.h> using namespace std; #define int long long using pii = pair<int, int>; #define forr(i, n) for (int i = 0; i < n; i++) #define reforr(i, n) for (int i = n; i >= 0; i--) #define eqforr(i, a, n) for (int i = a; i <= n; i++) #define sqforr(i, n) for (int i = 1; i * i <= n; i++) #define genforr(i,...
ALGO
0.999543
3.873511
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2024-02-01T14:32: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": "2ce21ce6152...
edbad667-ad59-43c8-b7bd-5e6922c08599
ravireddy07/cpp-book
src/Code-Forces/#698_nezzar-and-board.cpp
// Problem Statement: https://codeforces.com/contest/1478/problem/D/ /** * Author: <NAME> * Code Forces: ravireddy07 * Code Chef: ravireddy115 * Github: ravireddy07 **/ #include <bits/stdc++.h> #define ll long long int #define ravireddy07 return #define ii(a) scanf("%d", &a) #define ii2(a, b) scanf("%d%d", &a...
ALGO
0.999062
3.732155
{ "github_metadata": { "branch": "master", "commit_count": 490, "repo_created_at": "2019-06-20T07:54:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 1, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "793223b...
5b782fb1-6d7a-4214-bf2d-afc27e38879d
1-pluto1/algorithm
kamacoder101/kamacoder101.cpp
// dfs #include<iostream> #include<vector> using namespace std; int dir[4][2] = {-1, 0, 0, -1, 1, 0, 0, 1}; int count; void dfs(vector<vector<int>>& grid, int x, int y){ grid[x][y] = 0; count++; for (int i = 0; i < 4; i++){ int nextx = x + dir[i][0]; int nexty = y + dir[i][1]; if (ne...
ALGO
0.999908
4.444297
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-05-03T10:47: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": "1be834580977...
d6a0d359-3b58-4021-b2ef-b3a9d70ef4f6
Tariq-amir/Project-2-1
morningjogging.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int,int> #define si(n) scanf("%d",&n); #define PI acos(-1.0) #define sl(n) scanf("%lld",&n); #define sf(n) scanf("%lf",&n); #define sc(n) scanf(" %c",n); #define for0(i,n) for(ll i=0;i<n;i++) #define for1(i,n) for(ll i=1;i<=n;i++) #defin...
ALGO
0.999948
3.037345
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-01-03T17:01: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": "6c485c756500...
ffc13c22-9b0a-448f-8481-144ea4536696
gewu/Algorithm
palindromePartitioning.cpp
#include <iostream> #include <vector> using namespace std; class Solution{ public: vector<vector<string> > partition(string s){ vector<vector<string> >res; if (s.size() == 0) return res; vector<string> tmp; help(s, tmp, res); return res; } void help(str...
ALGO
0.999949
5.155337
{ "github_metadata": { "branch": "master", "commit_count": 97, "repo_created_at": "2015-03-15T05:59:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "94190a750...
0a49f465-8f31-4327-b33e-64c02850ebce
El-Medonho/Contests
Geral/CSES/Graphs/926giantpizza.cpp
#include "bits/stdc++.h" using namespace std; #define MOD 1000000009 #define mod(x,mvvm) (((x%mvvm)+mvvm)%mvvm) #define f first #define s second #define pb push_back #define pii pair<int,int> #define pll pair<long long,long long> #define vii vector<int> #define vll vector<long long> #define endl "\n" #define esp " " #...
ALGO
0.999999
4.377364
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2022-09-03T14:12: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": "17c63c60444...
8a0a5218-1263-4a76-ad6a-4610cf758632
Vicky-Jha/Must_Do_Coding_Interview_Questions_GFG
Array/Trapping_Rain_Water.cpp
#include<bits/stdc++.h> using namespace std; // } Driver Code Ends // function to find the trapped water in between buildings // arr: input array // n: size of array int trappingWater(int arr[], int n){ int res = 0; vector<int> left(n), right(n); left[0] = arr[0]; right[n-1] = arr[n-1]; f...
ALGO
0.999956
6.41473
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2021-05-04T04:54:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8b11d6fc47f...
4a5cb3f4-4762-4d86-a38c-b1b1e94a96c2
mAsLo01/2302OvechkinaAIlab2
funct.h
#pragma once #include <iomanip> #include <iostream> #include <algorithm> #include <fstream> #include <cmath> #include "stack.h" using namespace std; void swap(int* a, int* b); void bubble(int len, int heap[]); void selection(int len, int heap[]); void merge(int arr[], int arr1[], int low, int mid, int high); void merge...
ALGO
0.997025
4.33081
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-10-24T20:28:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8012362b2eae...
5d5af04e-257d-421b-abdc-5b8baef6bb41
KristiyanGergov/DataStructuresAndAlgorithms
Week 07 - Tree Algorithms/Homework/Task2/main.cpp
#include<iostream> #include<climits> using namespace std; // H E A P class Heap { protected: int *harr; int capacity; int heap_size; int parent(int i) { return (i - 1) / 2; } int left(int i) { return (2 * i + 1); } int right(int i) { return (2 * i + 2); } public: Heap(int capacity); int pop(); int t...
ALGO
0.99999
4.832909
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2018-10-09T07: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": "2e759b5d6...
691d2554-4bb5-4a0a-a4b3-ecd1cfc3de23
Jareu/NoMansRay
NoMansRay/maths.cpp
#include "maths.h" #include <cmath> Vector2<decimal> maths::rotate(const Vector2<decimal>& vertex, decimal angle_radians) { return Vector2<decimal>{ vertex.x()* std::cos(angle_radians) - vertex.y() * std::sin(angle_radians), vertex.x()* std::sin(angle_radians) + vertex.y() * std::cos(angle_radians) }; } int mat...
ALGO
0.97174
6.667356
{ "github_metadata": { "branch": "develop", "commit_count": 105, "repo_created_at": "2023-04-03T23:18: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": "52ac217...
d651e732-4b77-4e0f-98dc-d1c2d9288c9a
nafizfouad/CompetitiveProgramming
codeforces/1788/B.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long int #define ld long double #define pi acos(-1) #define pb push_back #define pf push_front //#define endl '\n' #define MAXN 2000 #define mod 1000000007 #define fast ios_base::sync_with_stdio(false);...
ALGO
0.999938
3.946284
{ "github_metadata": { "branch": "master", "commit_count": 1207, "repo_created_at": "2023-11-13T22:22: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": "d91ea8e...
171df9f0-6102-48d6-aa1d-42f49022e0e3
AngelVzla99/Algorithms-competitive-programming
graph/LCA.cpp
// Para usar, l=log2(n), y se llama a dfs(1,1), luego se usa lca(u,v) int n, l; // l = log(n) vector<int> G[MAXN]; int timer; // Tiempos de entrada y salida de cada nodo y su ancestro a dist 2**i int tin[MAXN], tout[MAXN], anc[MAXN][ int(log2(MAXN))+1 ]; void dfs(int v, int p){ // Se inicializa con dfs(1,1) tin[...
ALGO
0.999865
4.352668
{ "github_metadata": { "branch": "master", "commit_count": 94, "repo_created_at": "2020-05-11T19:09:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "75da181dc...
26db33f2-8c98-4378-b6d2-de5f9e55c69c
cormoran/CompetitiveProgramming
src/contest/codeforces/208div2/C.comp.cpp
#include<iostream> #include<vector> #include<cassert> #include<string> #include<algorithm> #include<cstdio> #include<cstdlib> #include<cmath> #include<stack> #include<queue> #include<set> #include<map> #include<tuple> #include<numeric> using namespace std; typedef pair<int,int> pii; typedef long long ll; typedef ll in...
ALGO
0.999783
3.815518
{ "github_metadata": { "branch": "master", "commit_count": 110, "repo_created_at": "2016-08-18T12:24: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": "b8116571...
e226cc9a-a3ff-4f9f-802c-29192792a693
justinlee007/CarND-Kidnapped-Vehicle-Project
src/particle_filter.cpp
/** * particle_filter.cpp */ #include <random> #include <algorithm> #include <iostream> #include <numeric> #include <math.h> #include <iostream> #include <sstream> #include <string> #include <iterator> #include "particle_filter.h" using namespace std; static const int NUM_PARTICLES = 1000; static const double DEF...
ALGO
0.993834
6.099973
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2017-06-03T00:22:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "60523aad6...
20889888-583f-4929-a8be-567ca9573d9f
Talal916/CSUS-CPE-CSC-EEE-Materials
PHYS 162/Homework/13derivatives/hw13p1.cpp
// ------------------------------------------------------------------------- // Homework 12: Derivatives, integrals // ------------------------------------------------------------------------- // // Write a C++ program that calculates the derivative of f(x) = x^4−2x^3+5x−1 // for various values of Δx, using either of ...
ALGO
0.999716
5.741667
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2019-05-13T00:00:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 50, "forks": 33, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c1408ab...
6d9f7ce3-ef17-42b8-80fc-7114c7e8f601
OrigenesZhang/-1s
codeforces/R326/CF587C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++) #define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--) #define REP(i, n) FOR(i, 0, (n)-1) #define sqr(x) ((x) * (x)) #define all(x) (x).begin(), (x).end() #de...
ALGO
0.999949
4.051456
{ "github_metadata": { "branch": "master", "commit_count": 1525, "repo_created_at": "2017-02-01T16:05:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "19f101e...
d120ee44-3cdd-4f32-b7f6-945ec24570ab
naveengitboi/cp
codes/dp/interLeavingString.cpp
//leetcode 97 // @leet start // method one recursive + memoization #include <bits/stdc++.h> using namespace std; class Solution { public: vector<vector<int>> dp; int m, n, l; bool solve(int i, int j,int k, string& s1, string& s2, string& s3){ if(k == l){ return true; } ...
ALGO
0.999934
6.098063
{ "github_metadata": { "branch": "main", "commit_count": 183, "repo_created_at": "2024-08-09T22:00:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "79c84b4f06...
ee392fe2-9a31-444d-a9ac-4934e3274edd
RisshabSingla/LeetCode-C-Solutions
3290-number-of-subarrays-that-match-a-pattern-ii/number-of-subarrays-that-match-a-pattern-ii.cpp
class Solution { public: // int count = 0; void calcLPS(string &p, int LPS[]){ LPS[0] = 0; int i = 0, j = 1; while (j < p.length()){ if (p[i] == p[j]){ LPS[j] = i + 1; i++; j++; }else{ if (i == 0){ LPS[j] = 0; ...
ALGO
0.999974
5.332388
{ "github_metadata": { "branch": "main", "commit_count": 2390, "repo_created_at": "2023-06-13T15:11: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": "1878396fb...
2f45d939-5f33-44f1-bed1-d9ed85e7707e
wtangdev/acm
multiTran/team7/1002.cpp
/************************************************************************* > Author: AnsonTang > Mail: <EMAIL> > Created Time: 2017 Tue Aug 15 2017 12:59:20 ************************************************************************/ #include <iostream> #include <cstdio> #include <string> #include <cstring> #include <cma...
ALGO
0.999665
3.451412
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2017-07-25T10:55: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": "e947d3906...
0ac80600-35e5-41cc-b84e-39cd4295e6eb
K1M-MinW00/CodingTest
백준/Silver/1446. 지름길/지름길.cc
#include <iostream> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <map> #include <set> #include <string> #include <cstring> #include <cmath> #include <climits> using namespace std; int n, d; vector<pair<int, int>> v[10001]; int answer = INT_MAX; void solve() { queue<pair<int, in...
ALGO
0.999871
4.048147
{ "github_metadata": { "branch": "main", "commit_count": 594, "repo_created_at": "2024-03-23T09:59: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": "c88e54c187...
bbeb6886-65b5-4ad1-8d4b-b42f7753a614
ShawnNotFound/code-server
Shawn/Luogu/P2050[NOI2012]美食节.cpp
#include<iostream> #include<cmath> #include<cstdio> #include<algorithm> #include<cstring> #include<queue> const int N = 3e6 + 10; const int INF = 1 << 29; using namespace std; bool v[100005]; int d[100005], ver[N], nxt[N], cost[N], head[N], edge[N], incf[N], pre[N]; int maxflow, ans, n, m, s, t, mincost, tot = 1; qu...
ALGO
0.999949
3.382838
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2023-03-12T10:54:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "593777c17...
760810cc-0cca-4bad-a7f7-21ed01ffb1e6
yongjulejule/Algorithm
boj/10828/main.cpp
#include <iostream> #include <stack> using namespace std; int main() { cin.ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int N; cin >> N; stack<int> st; while (N--) { string s; int nbr; cin >> s; if (s == "push") { cin >> nbr; st.push(nbr); } else if (s == "pop") {...
ALGO
0.998876
4.503083
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2021-03-23T02:37:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "29588a83c88...
cb24066a-b795-43e4-bbb6-2421d8edc4b5
clytras/WizBoSa
src/config.h
#include <stdio.h> #include <iostream> #include <iomanip> #include <vector> using namespace std; namespace wizbosa { class Config { public: Config(); bool Load(string = NULL, bool = false); public: const string& GetSearchDir() const { return m_sSearchDir; } bool GetRecurseSubdirectories() { ...
TOOL
0.927254
4.368408
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2021-03-19T13:31: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": "c527d6d43e...
ffb84f36-e720-4af6-bb87-a1c12807cd6d
razlibo/EX_4
HuffmanTree.cpp
#include <algorithm> #include "HuffmanTree.h" #include <map> //The Function get str and encode the str using Huffman code void HuffmanTree::encode(string str) { if(str.empty())//check if the str not empty return; pQueue = buildQ(pQueue,str);//build priority queue int size = pQueue.size(); cout...
ALGO
0.999845
3.771059
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2022-12-28T17:21: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": "d5dc54d98...
9c8ea347-c5ae-4228-b5c0-89ed87527eba
Atharvmahajan231/Atharv-Mahajan-OS
atharvv.cpp
#include <iostream> #include <vector> using namespace std; struct process { string name; int brusttime; int waitingtime; int turnaroundtime; }; int main() { int numprocesses; cout << "Enter the number of processes: "; cin >> numprocesses; vector<process> processes(numprocesses); ...
ALGO
0.999723
4.917796
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-04-02T08:34:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8f098773c55...
71b468a0-d5a4-4586-8962-2fd9ae56eb7f
blender/blender
source/blender/bmesh/intern/bmesh_walkers.hh
/* SPDX-FileCopyrightText: 2023 Blender Authors * * SPDX-License-Identifier: GPL-2.0-or-later */ #pragma once /** \file * \ingroup bmesh */ #include "bmesh_class.hh" /* * NOTE: do NOT modify topology while walking a mesh! */ enum BMWOrder { BMW_DEPTH_FIRST, BMW_BREADTH_FIRST, }; enum BMWFlag { BMW_FLA...
TOOL
0.971013
6.234171
{ "github_metadata": { "branch": "main", "commit_count": 152123, "repo_created_at": "2019-10-09T12:47:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 15670, "forks": 2395, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5...
ec01c65e-a805-4f6d-8554-1ee5ff7eab39
openbsd/xenocara
lib/mesa/src/intel/compiler/elk/elk_dead_control_flow.cpp
/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, pub...
TOOL
0.937995
7.603099
{ "github_metadata": { "branch": "master", "commit_count": 7764, "repo_created_at": "2016-08-30T18:36:01.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 175, "forks": 49, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bb836...
e7392cff-8952-4b18-837e-307c9132cb1e
peshe/FMI-SDP-2024
Семинари/Информатика/Група 3/09_binary_search_tree/solutions/inclass.cpp
template <class T> class Node { public: T value; Node<T>* left; Node<T>* right; Node(const T& value, Node<T>* left = nullptr, Node<T>* right = nullptr) : value(value), left(left), right(right) { } }; template <class T> class BTSree { public: BTSree(Node<T>* root) : root(root) {} B...
ALGO
0.997546
4.33988
{ "github_metadata": { "branch": "main", "commit_count": 292, "repo_created_at": "2024-10-01T11:40:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b25c123b1...
c9c992cf-b0ae-415f-a9e6-c3a2ad1690b9
koosaga/olympiad
IOI/ioi24_tree.cpp
#include "tree.h" #include <bits/stdc++.h> using namespace std; using lint = long long; using pi = array<lint, 2>; #define sz(v) ((int)(v).size()) #define all(v) (v).begin(), (v).end() #define cr(v, n) (v).clear(), (v).resize(n); const int MAXN = 200005; struct disj { int pa[MAXN], sum[MAXN]; void init(int n) { io...
ALGO
0.999892
3.832539
{ "github_metadata": { "branch": "master", "commit_count": 361, "repo_created_at": "2015-11-06T16:01:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 285, "forks": 31, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f80b9...
9edc39c1-6c23-4a6a-94ef-8593f34012eb
MichaelTurner04/2024-SP-102-pa02-arraylist
MyVector.hpp
/* Define all your MyVector-related functions here. * You do not need to include the h file. * It included this file at the bottom. */ // We're giving you these functions for free // and as a guide for the syntax. #include "MyVector.h" #include <vector> template <typename T> MyVector<T>::~MyVector() { // clear()...
TOOL
0.9004
4.505928
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2024-05-05T04:43:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "73bdee1c60...
58694c05-a05d-491d-9374-deca8be41bcf
raincross7/code-similarity
codes/train_code/problem222/problem222_217.cpp
// // Created by tac on 2016/10/12. // #include <cstdlib> #include <string> #include <iostream> const int B_SIZE = 4; const int F_SIZE = 3; const int R_SIZE = 10; static int residents[B_SIZE + 1][F_SIZE + 1][R_SIZE + 1]; int main() { for (int b = 1; b <= B_SIZE; ++b) { for (int f = 1; f <= F_SIZE; ++f) ...
ALGO
0.998953
4.759861
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-03-06T05:07:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "28ed0af67c23...
5b3936dc-c6cc-4fad-a327-a7665d38ba4b
Cisplatin/Snippets
euler/c++/P108.cc
/* Diophantine Reciprocals I Problem 108 */ #include <iostream> const uint64_t DISTINCT = 1000; // Returns the number of solutions for 1/x + 1/y = 1/n // @param [n] The number to find the solution for // @return The number of solutions uint64_t diophantine(uint64_t n) { uint64_t total_solutions = 0; for(uint...
ALGO
0.99989
5.405142
{ "github_metadata": { "branch": "master", "commit_count": 235, "repo_created_at": "2015-12-30T22:10:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "85e0366e...
57081cac-fa2a-45a8-8283-b4f26dd2be1e
alexandraback/datacollection
solutions_5662291475300352_0/C++/sohelH/hiking.cpp
#include<cstdio> #include<iostream> #include<queue> #include<stack> #include<vector> #include<string> #include<algorithm> #include<map> #include<sstream> #include<cmath> #include<cctype> #include<cassert> #include<cstring> #include<cstdlib> using namespace std; int debug = 0; #define DEBUG(x) cout<<">> "<<#x<<':'<<(x...
ALGO
0.999775
3.530726
{ "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": "db0ca322c...
0901cde7-b193-4d7f-bbbb-42e8537833b3
leeEunJooo/coding-test-practice
assignment11/beakjun_14891_톱니바퀴.cpp
#include <bits/stdc++.h> using namespace std; vector<vector<int>> topni(4,vector<int>(8)); int dir[4]; int K; void rotate_topni(int idx, int mydir){ vector<int> temp(8,0); copy(topni[idx].begin(), topni[idx].end(), temp.begin()); //0 1 2 3 4 5 6 // clock : 3->4 // not clock : 0<-1, 1<-2, 2 <- 3,...
ALGO
0.999614
4.119459
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2020-08-05T15:24: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": "e979dd852...
4642af21-aed9-410f-badd-acdf67b9c817
BCLCommons/bcl
include/math/bcl_math_binary_sum_function.h
// (c) Copyright BCL @ Vanderbilt University 2014 // (c) BCL Homepage: http://www.meilerlab.org/bclcommons // (c) BCL Code Repository: https://github.com/BCLCommons/bcl // (c) // (c) The BioChemical Library (BCL) was originally developed by contributing members of the Meiler Lab @ Vanderbilt University. // (c) // (c) T...
ALGO
0.96632
6.755857
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2022-05-21T17:35:18.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 29, "forks": 19, "issues": 2, "pull_requests": 1 }, "file_meta": { "content_id": "cac27bab...
21ae237b-59bc-4875-a510-ec162d44ddfc
syberium/tarang
trunk/lib/fluid/fluid_base/io/input/init_cond_random_titov_ed.cc
/* Tarang-2 * * Copyright (C) 2008, 2009 <NAME> * * <NAME> * Indian Institute of Technology, Kanpur-208016 * UP, India * * <EMAIL> * * This file is part of Tarang-2 . * * Tarang-2 is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published...
ALGO
0.984387
4.43255
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-05-15T14:23: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": "8c9fb9bff2...
e2b2bd9d-cda2-4e93-86d4-f455652e2fdd
cou929/topcoder
FriendScore.cpp
// BEGIN CUT HERE // END CUT HERE #include <sstream> #include <string> #include <vector> #include <algorithm> #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> using namespace std; class FriendScore { public: int highestScore(vector <string> friends) { int i, j, k; int max = 0;...
ALGO
0.999789
4.181761
{ "github_metadata": { "branch": "master", "commit_count": 71, "repo_created_at": "2010-01-17T10:59:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 10, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "9e7f6d2...
ca8bbfcd-455b-456d-9766-069f01128f3a
passer-by-Wang/mujoco_go2
include/Dynamic.h
/***************************************************************************** BQR3 simulation Copyright (C) 2023 <NAME> <EMAIL>. This file is part of BQR3. @file Dynamic.h @brief Dynamic Details. @author <NAME> @email <EMAIL> @version 1.0.0 @date 2023/12/25 @license NONE -----...
ALGO
0.958393
5.250159
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-07-08T14:26:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "db5727402f3e...
60126e64-2889-4e45-bcd2-0b59ab64b101
wade1010/cpp_study_long_ago
二刷/提高编程/模板/main3.cpp
#include "iostream" using namespace std; template <class T> void mySort(T arr[], int len) { for (int i = 0; i < len; i++) { int maxIndex = i; for (int j = i + 1; j < len; j++) { if (arr[maxIndex] < arr[j]) { maxIndex = j; } } ...
ALGO
0.999382
4.104764
{ "github_metadata": { "branch": "main", "commit_count": 23, "repo_created_at": "2022-11-02T07:44: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": "337f961ffbf...
a2121a9e-0172-4d32-ac8a-1ef851bc9b1f
Waitti-long/AlgorithmCourse
dp/backpack.cpp
#include "backpack.h" using namespace std; int base_zero_one(int *dp, int c, int w, int V) { for (int v = V; v >= c; v--) { dp[v] = max(dp[v], dp[v - c] + w); } } int zero_one(const vector<int> &sizes, const vector<int> &values, int V) { int dp[sizes.size() + 10]; memset(dp, 0, sizeof dp); ...
ALGO
0.999925
4.854095
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2020-05-11T07:52: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": "2484c3c6f0...
b0c63fd9-4f8e-41f2-9560-b9903854479f
USTC-CS-Course-Resource/USTC-CS-Resources
CS/数据结构/Data_Structures/Data_Structures/BiTree.h
/* * BiTree: for BinaryTree. */ #pragma once #include <iostream> #include <string> #include <queue> using namespace std; namespace BiTreeSpace { const string Test1 = "AB#C#D##E##"; const string Test2 = "A#BC##DE##F##"; const string Test3 = "ABCD##E##F###"; } class BiTree { private: BiTree* pre = nullptr; //前...
ALGO
0.999797
4.829205
{ "github_metadata": { "branch": "master", "commit_count": 180, "repo_created_at": "2020-09-10T03:12:43.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 143, "forks": 27, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f1ed50...
a92662c0-e05d-4bc9-adce-c73c9abb22ad
HuynhNhatThanh2402/De-Quy
Bai272/Bai272.cpp
#include <iostream> #include <iomanip> using namespace std; void Nhap(float[][100], int&, int&); void Xuat(float[][100], int, int); void HoanVi(float&, float&); void SapCotTang(float[][100], int, int, int); int main() { float b[100][100]; int k, l; cout << "Nhap ma tran:\n"; Nhap(b, k, l); cout << "\nMa tran v...
ALGO
0.999188
3.637858
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2023-11-13T14:38: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": "744a0b8db...
b0f6baff-66e6-44a2-bfb0-fbc7d9edcf85
rhammad7/Supersymmetry_Analysis
external/TrackCovariance/SolGridCov.cc
#include <iostream> #include <TMath.h> #include <TVectorD.h> #include <TVector3.h> #include <TMatrixDSym.h> #include <TDecompChol.h> #include <TMatrixDSymEigen.h> #include "SolGridCov.h" #include "SolGeom.h" #include "SolTrack.h" using namespace std; SolGridCov::SolGridCov() { // Define pt-polar angle grid fNpt...
ALGO
0.999894
5.376842
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2024-02-27T17:42: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": "9d55acc5a86...
53313260-cd26-48b9-ad30-0d4a192f12c6
edsonlipa/Solutions
uva/12086_-_Potentiometers.cpp
#include <bits/stdc++.h> using namespace std; #define LSO(i) i&(-i) #define S(x,r) update(x,r-A[x],N); #define M(i,j) rsq(j)-rsq(i-1) int A[200005]; long long FT[200005]; long long rsq(int i){ long long sum=0; for (; i; i-=LSO(i)) { sum+=FT[i]; } return sum; } void update(int k,int v,int N){ for (; k <= N...
ALGO
0.999259
3.965268
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2018-07-02T05:01: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": "9f8ea6ba22...
03894239-7375-4fd5-b057-3f5ca3f32d9c
yash9373/CNS
ass7.cpp
#include <iostream> #include <vector> using namespace std; // Key matrix for encryption (3x3) vector<vector<int>> keyMatrix = { {6, 24, 1}, {13, 16, 10}, {20, 17, 15} }; // Function to calculate modular inverse int modInverse(int a, int m) { for (int x = 1; x < m; x++) { if ((a * x) % m == 1) ...
ALGO
0.999992
5.654105
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-08-30T05:34:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da8e378c8a92...
bd39cf58-5dcd-4246-9047-0e40070d62b1
AryanKatariya/Cplusplus--DSA
array/2LargestElement.cpp
#include <cmath> #include <iostream> using namespace std; int getLargest(int arr[], int n) { int r = 0; for (int i = 0; i < n; ++i) { if (arr[i] > arr[r]) { r = i; } } return r; } int secondLargest(int arr[], int n) { int largest = getLargest(arr, n); int second = -1; for (int i = 0; i ...
ALGO
0.99991
5.058214
{ "github_metadata": { "branch": "main", "commit_count": 42, "repo_created_at": "2023-09-26T14:57: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": "5d9a747f109...
e5a813da-a2b2-46c1-8ef5-928ce491b880
RQ-Wu/leetcode-exercise
洛谷/【算法1-6】二分查找与二分答案/P1873 砍树.cpp
#include<cstdio> #include<algorithm> using namespace std; int main(){ long long m, n, l = 0, r = 0; long long tree[1000000]; scanf("%lld %lld", &n, &m); for (int i = 0; i < n; i++){ scanf("%lld", &tree[i]); r = max(r, tree[i]); } while(l <= r){ long long mid = (l ...
ALGO
0.999994
3.548726
{ "github_metadata": { "branch": "master", "commit_count": 56, "repo_created_at": "2020-11-09T12:04:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3b4506433...
ee8a538b-a37b-42fe-90be-93d373a47ee8
felipefoschiera/Competitive-Programming
URI Online Judge/AD-HOC/2246 - Ladrilhos/ladrilhos.cpp
#include <cstdio> #include <cstring> #include <queue> #define MAX 212 #define INF ((int)1e9) using namespace std; typedef pair<int, int> ii; int H, L; int movX[] = {1, -1, 0, 0}; int movY[] = {0, 0, 1, -1}; int mat[MAX][MAX], visited[MAX][MAX]; bool valido(ii a, ii b){ return b.first >= 0 && b.first < H && b.se...
ALGO
0.999719
3.763372
{ "github_metadata": { "branch": "master", "commit_count": 285, "repo_created_at": "2018-04-14T20:39:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fe669435...
dffcedb0-4b47-4de0-b11e-c3566aba1f62
bigtelescope/Stack
stack.cpp
#include <iostream> #include <cstdlib> #include <cstdio> #include <cmath> #include "head.h" Stack::Stack(int init_size) : canary1 (CANARY), size (init_size), amount (0), hash (0), data ((Mytype *)calloc(size + 2, sizeof(Mytype))), error (0), canary2 (CANARY) { if(!data) error = INCORREC...
TOOL
0.94386
4.099307
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2018-10-17T14:31:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "443af9546...