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
0878228f-1786-469b-9f60-10840550244e
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/07/0720/personal_submission/cf954d_fancyalad.cpp
// submission link: https://codeforces.com/contest/954/submission/271502851 // 今天也来跟上双语学校 #include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, m, s, t, x, y; cin >> n >> m >> s >> t; s --; t --; vector<vector<int>>...
ALGO
0.999829
3.762911
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "a87c...
1d27ce9b-e62f-4884-8484-f2f8caf509ab
dcalmes/CS-School-Work
cs2010/VossenW_CalmesD_Lab6b.cpp
/*------------------------------------------------------------- Authors: <NAME> & <NAME> Purpose: Calculate total points, average per game and total games. Input: points per game Processing: calculate total points, average per game and total games. Output: points per game, total points, average */ #include<iostream> #...
ALGO
0.992806
3.606915
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2017-02-07T20:31:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9aa0d775e8...
26ebb461-92a2-42be-908a-5c59a9baf8e6
CASP-Systems-BU/Gadget
src/include/gadget/distributions/keyPopularity.h
// // Created by <NAME> on 2/23/21. // #ifndef GADGET_KEYPOPULARITY_H #define GADGET_KEYPOPULARITY_H #include <iostream> #include <memory> #include <fstream> #include <sstream> #include <vector> #include <random> #include <optional> #include "include/gadget/distributions/distributionParamters.h" class KeyPopular...
ALGO
0.990867
4.709259
{ "github_metadata": { "branch": "main", "commit_count": 139, "repo_created_at": "2021-10-25T19:39:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 17, "forks": 4, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "775dd79664...
760d2130-5387-443a-900f-0e035995421b
21PIRLO21/LeetCode2020
0151_Reverse_Words_in_a_String.cpp
#include <ostream> #include <vector> #include <algorithm> #include <string> using namespace std; /* medium */ class Solution { public: string reverseWords(string s) { reverse(s.begin(), s.end()); int n = s.size(); int pos = 0; for (int begin = 0; begin < n; ++begin) { i...
ALGO
0.999926
5.487813
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-03-05T05:59: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": "d309b8301...
e07c0b32-08e5-45ae-9fa8-df18e8f4af69
A1doranM/HowProgrammingWork
C++/9. Standard Template Library (STL)/Challenge_1/main.cpp
// Section 20 // Challenge 1 // Identifying palindrome strings using a deque #include <cctype> #include <deque> #include <iostream> #include <string> #include <vector> #include <iomanip> bool is_palindrome(const std::string& s) { // You must implement this function. // Since we are learning the STL - use a deq...
ALGO
0.998932
6.232699
{ "github_metadata": { "branch": "master", "commit_count": 1927, "repo_created_at": "2021-07-28T12:42:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "88854c7...
82f9bf8d-659e-4407-8c31-f9b3f6f1e411
El-Medonho/Contests
Geral/CSES/Graphs/921planetscycles.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.999875
3.923098
{ "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": "605eb6cea2f...
26481e8d-dd06-4da0-b564-5c208bf5ac10
aloneguid/bt
bt/app/ui/config_app.h
#pragma once #include "grey.h" #include <string> #include <memory> #include <map> #include <vector> #include "../browser.h" #include "../setup.h" #include "../strings.h" #include "../url_pipeline.h" #include "win32/process.h" namespace bt::ui { struct rule_match_status { std::string id; bool match...
CONFIG
0.924495
5.351415
{ "github_metadata": { "branch": "master", "commit_count": 351, "repo_created_at": "2022-11-01T13:39:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 281, "forks": 14, "issues": 17, "pull_requests": 2 }, "file_meta": { "content_id": "d342...
5410f75b-0a90-40c4-acb8-16e85de4f08e
thisjiang/script
single_test/erniedoc/softmax_forward_D1.h
/* Copyright (c) 2021 jiangcheng Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
ALGO
0.995641
6.594479
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2020-12-28T03:27: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": "5d8dbce91ef...
a225cf32-b23a-4881-912f-b2750a30fd84
jay10125104/leetcode
1032-stream-of-characters/1032-stream-of-characters.cpp
struct node{ node*links[26]; int x = 0; }; class Trie{ public: node*root; Trie(){ root = new node(); } void insert(string &s){ node*temp = root; for(int i=s.size()-1;i>=0;i--){ // cout<<s<<" "<<s[i]<<"\n"; if(temp->links[s[i]-'a']==NULL){ ...
ALGO
0.999665
5.302567
{ "github_metadata": { "branch": "main", "commit_count": 2430, "repo_created_at": "2022-09-10T16: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": "6ec4c74b9...
6e4df082-44b1-4230-b195-ec4d821aedf9
TheRickyZhang/CompetitiveProgramming
Notes/CIS4930/HW/FinalPractice/EAdaAndTrip.cpp
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; using ll = long long; using vll = vector<long long>; using vb = vector<bool>; using vs = vector<string>; using pii = pair<int, int>; using pll = pair<ll, ll>; using vpii = vector<pii>; using vpll = vector<pll>; using pq = priority_queue<ll>; using p...
ALGO
0.999715
4.109027
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2024-12-09T23:10: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": "00287431b39...
93834105-fb88-423c-8658-8981ea711416
RaoufGhrissi/problem-solving
Topics/Tree/binary lifting/lca.cpp
// problem link: https://www.spoj.com/problems/LCASQ/ #include <bits/stdc++.h> #define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define ll long long #define Pair pair<ll,ll> #define iPair pair<int,int> #define newL cout<<endl #define ll_max 1e18 #define pb push_back #define f first #define s ...
ALGO
0.999988
4.143582
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2023-12-04T17:18:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2597c1ed0c8...
ce704b58-4cf5-4245-964d-abcf01ed35b3
wmathor/RemNet
RemNet/myNet.cpp
#include "myNet.hpp" #include "myBlob.hpp" #include <json/json.h> #include <fstream> #include <cassert> using namespace std; void NetParam::readNetParam(string file) { ifstream ifs(file); assert(ifs.is_open()); Json::CharReaderBuilder reader; JSONCPP_STRING errs; Json::Value value; if (Json::parseFromStream(read...
DATA
0.915152
5.042298
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2020-02-16T08:29:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 26, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ea79d4c8...
a3dc10a2-edea-469b-9aa0-49a7af3bb2c5
ardkastrati/AlgoLab
week10/majestys_secret_service/main.cpp
// ALGOLAB BGL Tutorial 3 // Code snippets demonstrating // - MinCostMaxFlow with arbitrary edge costs using cycle_canceling // - MinCostMaxFlow with non-negative edge costs using successive_shortest_path_nonnegative_weights // Compile and run with one of the following: // g++ -std=c++11 -O2 bgl_mincostmaxflow.cpp -o...
ALGO
0.999658
4.757637
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2018-11-03T16:04:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "15f272f2a...
26ef7312-d8e3-4a7d-bc63-d09d4ffb4f86
truongduy134/uva-online-judge-solutions
Volume_104/UVA10487.cpp
#include <cstdio> #include <algorithm> #include <vector> using namespace std; int myabs(int x) { return x >= 0 ? x : -x; } int main(void) { // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); int n, m, q, closet, caseId, l, h, s; caseId = 1; while(1) ...
ALGO
0.999883
3.765778
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2013-05-09T16:23:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 21, "forks": 17, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4393e1f...
53b30686-f825-4a88-bc5c-37c398ac66a1
verdandi/AwesomeLibrary
sources/ListOperations.h
#ifndef LIST_OPERATIONS_H_ #define LIST_OPERATIONS_H_ #include "defines.h" #include "ListNode.h" namespace AwesomeLibrary { namespace Private { template<class Key> class ListOperations { /* Класс ListOperations реализует операции со списком в терминах узла списка. При создании этого класса предполагается, что все ...
ALGO
0.990156
4.614483
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2014-07-27T08:23:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6f589ab20...
1b0dd370-ca1e-48a6-b9da-94724405c8b8
monir-zaman/CompetitiveProgramming
hackerrank/hr frequencis query.cc
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); // Complete the freqQuery function below. vector<int> freqQuery(vector<vector<int>> queries) { vector<int> result; unordered_map<long, long>map1, map2; for (int i =...
ALGO
0.999763
4.868202
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2016-05-27T10:46: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": "8e149325b...
8c7df85b-c3c1-42c8-8dd1-31690e16c06f
jiayuehua/adventOfCode
game24/aoc171202.cpp
//======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. // Authors: <NAME>, <NAME>, <NAME> // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE...
ALGO
0.997026
5.009799
{ "github_metadata": { "branch": "master", "commit_count": 87, "repo_created_at": "2020-10-24T05:22: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": "17e2a3f20...
9bde6414-9db3-4ee2-871b-c57ef3ffc61f
eternity6666/life-in-acm
practive/HDU/Problem/finished/2045.cpp
#include <iostream> using namespace std; const int maxn = 55; int main() { long long a[maxn]; a[1] = 3; a[2] = a[3] = 6; for(int i = 4; i <= 50; i++) { a[i] = a[i - 1] + a[i - 2] * 2; } int n; while(~scanf("%d", &n)) { cout << a[n] << endl; } return 0; } /* #i...
ALGO
0.999914
3.291708
{ "github_metadata": { "branch": "master", "commit_count": 237, "repo_created_at": "2018-04-03T15:40: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": "c1b860d1...
162718d4-f87d-4f21-9529-a3105bebe384
MayankK806926/DSA
Find maximum number of people who can attend meeting.cpp
#include<bits/stdc++.h> using namespace std; int maxPeople(vector<vector<int>>& mat,int n){ sort(mat.begin(),mat.end(),[&](auto a,auto b){ if(a[1]==b[1]) return a[0]<b[0]; return a[1]<b[1]; }); vector<int> dp(n,0); dp[0]=mat[0][2]; // Need a map to store the highest possible value,...
ALGO
0.999891
5.699992
{ "github_metadata": { "branch": "main", "commit_count": 100, "repo_created_at": "2024-09-07T17:40:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "27e11bffe5...
0b809b79-fbcd-42c3-9748-e2bb6cbccdc0
ARYAN-PURI/Operating-Systems-Lab
CPU_scheduling/multilevel_Feedback_Queue.cpp
#include<iostream> #include<bits/stdc++.h> using namespace std; int main(){ map<int,pair<int,int>> info; map<int,int> binfo; int nsys,nbatch,ninter,atime,btime,pri; cout<<"Enter the Number of System Processes:";cin>>nsys; unordered_map<int,pair<pair<int,int>,int>> syspro,interpro,batchpro; cout<...
ALGO
0.99945
3.714043
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-01-13T09:49: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": "84e24003a583...
6431cb60-b904-41ea-a641-46da527ead6c
aanupam29/codeforces-problems
158C - Cd and pwd commands.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ulli unsigned long long int #define li long int #define ff(i,a,b) for(int i=a;i<b;i++) #define fb(i,b,a) for(int i=b;i>=a;i--) #define w(t) while(--t >= 0) #define l(s) s.len...
ALGO
0.995287
4.214072
{ "github_metadata": { "branch": "master", "commit_count": 912, "repo_created_at": "2020-04-21T05:12:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e4862ab...
e6eb3ed4-12f8-4863-8d95-cedd44db1e6d
Maybenex1ime/Data-Structure-and-Algorithm-openedu
AlgorithmOpenedu/lab4.cpp
#include <stdio.h> #include <iostream> using namespace std; int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int n; double a[10001]; int c[10001]; cin >> n; for (int i = 1; i <= n; ++i) { cin >> a[i]; c[i] = i; } for (int i = 2;...
ALGO
0.999995
3.106179
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-04-21T16:24: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": "690bf06e81c5...
02985407-49be-4424-8136-ac4da574ca6d
viren-sureja/Love-Babbar-450
01_array/14_merge_intervals.cpp
/* link: https://leetcode.com/problems/merge-intervals/ simple greedy approach */ // ----------------------------------------------------------------------------------------------------------------------- // vector<vector<int>> merge(vector<vector<int>>& intervals) { int n = intervals.size(); int idx ...
ALGO
0.999996
6.421261
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2021-03-21T14:17:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 356, "forks": 169, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "0d6e1...
9a554c19-d45a-4f0f-850c-49c25237458e
Sandeepbhatt3287/Data-structures-and-Algorithms
Function and Arrays/find element in array.cpp
//1.You are given a number n, representing the size of array a. //2.You are given n distinct numbers, representing elements of array a. //3. You are given another number d. //4. You are required to check if d number exists in the array a and at // what index (0 based). If found print the index, otherwise print -1. #i...
ALGO
0.99994
4.612093
{ "github_metadata": { "branch": "main", "commit_count": 281, "repo_created_at": "2021-08-12T03:07:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e709186563...
99461de6-15ab-4118-b6a1-cb517fe5b5b7
tudzct/hw_ltnc
week7/bai3.cpp
#include <bits/stdc++.h> using namespace std; int power_(int x, int n){ int res = 1; for (int i = 1; i <= n; i++) { res *= x; } return res; } void findPower(int x, int n, int cur, int acc, int &count){ static int lim = pow(x, 1/static_cast<float>(n)); if (x == acc){ coun...
ALGO
0.999959
4.764786
{ "github_metadata": { "branch": "main", "commit_count": 39, "repo_created_at": "2024-03-13T08:35: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": "5d08007a6cc...
81ea3293-d34f-4c90-9b85-0bf65fdcbfb6
GergesHany/Ramadan-Marathons-2023-solutions
Minya-Ramadan-Marathons/P.Kees-Gwafah/MiinaMagdy.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define sz(x) int(x.size()) #define all(x) x.begin(), x.end() #define endl '\n' ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } int main() { ios_base::sync_with_stdio(0), cin.tie(0); int test; cin >> test; while (test--) { int n, m; cin...
ALGO
0.999882
4.353519
{ "github_metadata": { "branch": "main", "commit_count": 441, "repo_created_at": "2023-03-25T15:12:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6253726a2...
2c5a8ed0-178e-4d22-a760-52a4bb09dfb0
special114/A-algorithm
main.cpp
/* Shortest path algorithm A* * This algoithm is more efficient than Dijkstra's algorithms * because includes heuristic * author: <NAME> * 01.2020 */ #include <iostream> #include <vector> #include <cmath> using namespace std; #define N 7 typedef struct Vertex{ int x; int y; int cost; int g_sco...
ALGO
0.999974
4.785011
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-03-30T17:21: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": "b2aa281f18...
944e906a-a623-4b32-a801-d4baeb3d50b0
Shikhar-S/Analysis-of-Competitive-Codebase
Data/Contest1248/all/29179278_63000935.cpp
#include <bits/stdc++.h> #define endl '\n' #define f first #define s second #define pb push_back using namespace std; typedef long long ll; typedef pair<int, int> pii; const int oo = numeric_limits<int>::max(); const int MAXN = 1e5, W = 0, B = 1; const ll M = 1e9 + 7; ll dp[MAXN][2][2]; int main() { ios_base::sync_...
ALGO
0.999985
4.071199
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2019-11-22T14:40: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": "31f219abb...
050c8183-d5d8-46fd-a405-ef1fdbfcbbe3
jj123t/code
atcoder/147/d.cpp
/************************************************************************* > File Name: d.cpp > Author:123emm > Mail: <EMAIL> > Created Time: Thu 13 Apr 2023 05:24:00 PM CST ************************************************************************/ #include<bits/stdc++.h> using namespace std; typedef long long ll...
ALGO
0.999898
4.465001
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-09-21T11:37:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "808e693efe7a...
12401071-da1b-4d1e-a1fe-85f330d0b38c
intsven/ARTPraktikum
src/giovanni/gio-cont.cc
// // STANDALONE TEST g++ -o odometrie odometrie.cc -lm -Wall // /*************************************************************************** * INCLUDED HEADERS ***************************************************************************/ #include <iostream> #include <fstream> using std::ofstream; using std::ifstrea...
ALGO
0.999247
3.695847
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-09-23T15:47:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "33fa56a651...
68572b33-7801-4c1e-a725-825821d6d58a
Sammybenzaira/2D_Quadrature_rules
Q1/Driver.cpp
#include <iostream> #include <cmath> #include "TriangleIntegral.hpp" #include "TriangleIntegrator.hpp" int main() { //Initialising double** quad_1_point; double** quad_3_point; double* weight_1_point = new double[1]; double* weight_3_point = new double[3]; double* vectorX = new double[3]; ...
ALGO
0.997898
5.154402
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2025-06-01T12:51: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": "083b5579eeb9...
f47e663e-8cc4-4974-8989-621f8c081474
kofinder/CxxTutorial
app/src/datastructures/tree/binary_search_tree.cpp
#include "binary_search_tree.hpp" using namespace tree; bool BinarySearchTree::rContains(Node* currentNode, int value) { if(currentNode == nullptr) return false; if(currentNode->value == value) return true; if(value < currentNode->value) { return rContains(currentNode->left, value); } else { ...
ALGO
0.996196
4.891396
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2024-07-10T14:54:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e7ca62754...
b0c1fbf2-2fa6-4195-ab5c-cc77cb85c873
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Phi/top0-100/find-building-where-alice-and-bob-can-meet-Solution3.leftmostBuildingQueries/177740_DoS_Exec_Code_Overflow_Mem._Corr..cpp
static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */ { /* This is how the time string is formatted: snprintf(p, sizeof(p), "%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100, ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec); */ time_t ret; struct tm thetime; char * strbuf; ...
ALGO
0.990009
5.121658
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-03-22T14:39:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5c165647f9d8...
86125de0-db4b-4f17-9f8a-3cc2593efc24
ishan-nitj/Competitve-Programming
Graphs/Ford Fulkerson.cpp
//1 based indexing of nodes //Using adjacency matrices //Ignore the self loops //If there is cycle, kirchoffs law will be violated there.This code will work. //O((V^2)*maxflow) #include<bits/stdc++.h> using namespace std; #define ll long long #define vl vector<ll> #ifndef ONLINE_JUDGE # define dbg(x) (cerr << #x << "...
ALGO
0.999822
4.51007
{ "github_metadata": { "branch": "master", "commit_count": 111, "repo_created_at": "2016-05-15T12:00:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 14, "forks": 12, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "bb57ad...
b1b33ced-7c04-4324-b686-fa9375c7ab41
Glennine/Ros_test
src/v_test/src/odometry_calculation.cpp
#include "v_test/odometry_calculation.h" #include "iostream" #include "chrono" using namespace std; using namespace cv; typedef vector<Eigen::Vector2d, Eigen::aligned_allocator<Eigen::Vector2d>> Vector2dVector; typedef vector<Eigen::Vector3d, Eigen::aligned_allocator<Eigen::Vector3d>> Vector3dVector; void odometry_cal...
ALGO
0.990581
4.098433
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2022-04-16T08:33: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": "ebb258a5d...
7ef4af40-69d1-4c96-a448-bad97d371049
christophnetz/Kleptomove
cine/any_ann.cpp
#include <stdexcept> #include "any_ann.hpp" #include "simulation.h" namespace cine2 { any_ann::any_ann(int N, int state_size, int size) : N_(N), state_size_(state_size), size_(size), state_(nullptr) { state_ = (float*)_mm_malloc(N_ * size_ * sizeof(float), 16); std::memset(state_, 0, N_...
ALGO
0.934808
4.366845
{ "github_metadata": { "branch": "master", "commit_count": 155, "repo_created_at": "2019-06-04T10:01:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "10db297d...
f94967ec-f83f-4c39-b1d6-366a321ac674
AbdelrahmanRamadan/competitive-programming
UVA/12300-Smallest-Regular-Polygon.cpp
/*input 0 0 1 1 4 1 2 3 4 5 2 3 4 5 6 0 0 0 0 0 */ /* @author: <NAME> @email: <EMAIL> @repo: https://github.com/AbdelrahmanRamadan/competitive-programming @problem: 12300 - Smallest Regular Polygon @link: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=244&page=show_problem&problem=3...
ALGO
0.99984
4.550237
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2017-12-10T01:12:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "37adcecc7...
39de9f27-389e-4a5e-bb75-e18cbd7119e7
Vaa3D/vaa3d_tools
released_plugins/v3d_plugins/bigneuron_AmosSironi_PrzemyslawGlowacki_SQBTree_plugin/libs/ITK_include/vnl/algo/vnl_rnpoly_solve.h
// This is core/vnl/algo/vnl_rnpoly_solve.h #ifndef vnl_rnpoly_solve_h_ #define vnl_rnpoly_solve_h_ #ifdef VCL_NEEDS_PRAGMA_INTERFACE #pragma interface #endif //: // \file // \brief Solves for roots of system of real polynomials // \author <NAME>, ESAT-VISICS, K.U.Leuven // \date 12-Aug-1997 // // \verbatim // Modif...
ALGO
0.999887
5.411124
{ "github_metadata": { "branch": "master", "commit_count": 7983, "repo_created_at": "2016-01-27T18:19:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 110, "forks": 70, "issues": 11, "pull_requests": 12 }, "file_meta": { "content_id": "3fd...
17413e4f-92da-4b65-ac2d-ec28441c5037
guyueshui/JianZhiOffer
RectCover.cpp
// Problem: // 我们可以用2*1的小矩形横着或者竖着去覆盖更大的矩形。 // 请问用n个2*1的小矩形无重叠地覆盖一个2*n的大矩形, // 总共有多少种方法? /* * Again a typical DP problem. Let opt(n) denotes * the # of ways that give small (2x1) rectangle * covers a big (2 x n) rect. How can we write the * recursive relation? Again consider the first * step, which is so-called f...
ALGO
0.999938
5.716698
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2019-04-05T15:36: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": "daef614246...
39848f6f-d071-48e8-8c49-a4930aaef8b4
sriramkumar111/DAA-4th-Sem
DAA code/mergeSort.cpp
#include <iostream> using namespace std; void display(int *arr, int n){ for (int i = 0; i < n; i += 1) { cout << arr[i] <<" "; } cout << endl; } void merge(int *arr, int low, int high){ int mid = (low+high)/2; int len1 = mid-low+1; int len2 = high-mid; int arr1[len1], arr2[len2]; int mainArrayIndex = low; ...
ALGO
0.999983
5.559518
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-12-27T08:11: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": "07c80625fc03...
a6b91bc9-2fb8-44b0-a1d2-b48a4d86765a
LuisEnGuz/Luis_Enrique_PMC2
programas cap 6/programa 6.12.cpp
#include <stdio.h> const int PRO = 24; const int YEA = 10; const int MES = 12; int LECTURA(float [PRO][MES][YEA], int, int, int); int FUNCION1(float [PRO][MES][YEA], int, int, int); int FUNCION2(float [PRO][MES][YEA], int, int, int); int FUNCION3(float [PRO][MES][YEA], int, int, int); int main() { float LLU[PRO]...
ALGO
0.996995
3.875544
{ "github_metadata": { "branch": "main", "commit_count": 258, "repo_created_at": "2025-05-21T19:30:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c571d8ed12...
270a1dfa-e7c9-4c39-b5d5-fee9d95fa3ad
Onion-Leee/C_Plus_Plus
C_Plus_Plus_Formerly/Test_06_11_vector/Test_06_11_vector/Test.cpp
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <vector> using namespace std; void main() { vector<int> iv = { 1,2,3,4,5,6,7,8,9,10 }; auto it = iv.begin(); while (it != iv.end()) { if (*it % 2 == 0) it = iv.erase(it); else ++it; } for (const auto& e : iv) { cout << e << " "; } cout ...
ALGO
0.976075
3.465534
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2021-09-26T12:56: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": "6049747f8c...
6c4b65b2-46d6-4093-ae0d-99091e535997
rraetz/CppExercises
demo02/main.cpp
/* // // Author: <NAME> // Contact: <EMAIL> // */ #include <iostream> #include <vector> #include <algorithm> #include <iterator> using namespace std; int main() { vector<int> vec = {9,60,69,90,8,45,87,90,69,69,55,7}; // Non-modifying // 1. Counting all values 69, cout how many int values = count(ve...
ALGO
0.99894
5.156661
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2020-09-16T19:35: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": "ee410f2ee...
5babe237-9c26-47cc-807d-10c4641f87f1
jpricarte/grammar-constructive
src/structs/union-find.hpp
/* * Based on a code by <NAME> */ #include <algorithm> #include <vector> struct UnionFind { std::vector<int> parent; // parent[i]=-r: i is root of rank r-1 unsigned numComponents; // inv.: nc == # { p[i]<0 } == # roots UnionFind() : numComponents(0) {}; UnionFind(int n) : parent(n, -1), numCompon...
ALGO
0.998874
5.091136
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2024-04-10T00:11:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5f632bdb94f...
bb702d00-36be-4682-9403-80d63d1990a0
Louis5499/leetcode-practice
529/solution.cpp
class Solution { public: vector<vector<int>> v = { {1,-1},{ 1,0 },{ 1,1 },{ -1,-1 },{ -1,0 },{ -1,1 },{ 0,-1 },{ 0,1 } }; vector<vector<char>> updateBoard(vector<vector<char>>& board, vector<int>& click) { if (board[click[0]][click[1]] == 'M') { board[click[0]][click[1]] = 'X'; r...
ALGO
0.999976
6.200158
{ "github_metadata": { "branch": "master", "commit_count": 514, "repo_created_at": "2021-01-04T09:22:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c7b3c6de...
e0379cc9-20a5-44cc-86ef-6acbba9eb5c4
G0maa/DS_Course_DrMostafaSaad
14_Linked_stack_template.cpp
// O(1) both array & linkedlist // Size for linkdlist, I don't think random access is an avantage for arrays // I think generally linked list might be a better implementation for Stack // maybe reverse and inert at bottom are easier? // This round for HW was kind of bad, I didn't know how to solve two problems, // and...
ALGO
0.9997
4.566187
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-04-29T20:50: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": "72b435ef0d...
ed904d2e-eba7-4860-8ac5-16e72cc9369c
topology-tool-kit/ttk
core/base/progressiveTopology/ProgressiveTopology.cpp
#include "DataTypes.h" #include "MultiresTopology.h" #include <ProgressiveTopology.h> int ttk::ProgressiveTopology::computeProgressivePD( std::vector<PersistencePair> &CTDiagram, const SimplexId *offsets) { int ret = -1; printMsg("Progressive Persistence Diagram computation"); ret = executeCPProgressive(1, off...
ALGO
0.999888
6.861547
{ "github_metadata": { "branch": "dev", "commit_count": 8465, "repo_created_at": "2017-03-05T07:41:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 447, "forks": 129, "issues": 18, "pull_requests": 12 }, "file_meta": { "content_id": "e9fa...
5fa9c27c-dcba-49f6-af3e-3fb0a265a192
sonugan/tp-taller-1-2018
src/shared/model/trajectory.h
#ifndef TRAJECTORY_H #define TRAJECTORY_H #include "player.h" #include "keeper.h" #include "trajectory-type.h" class Player; class Keeper; enum class DIRECTION; class Trajectory { public: Trajectory(DIRECTION direction, unsigned int drive, TRAJECTORY_TYPE trajectory_type); Trajectory(DIRECTION dir...
ALGO
0.910267
6.784587
{ "github_metadata": { "branch": "master", "commit_count": 491, "repo_created_at": "2018-03-29T17:55:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "6c619363...
e9863643-97c5-4bd3-b71d-02be13522fca
Dego404/Laboratorio-2
Problema_2/main.cpp
/*Elabore un programa que genere un arreglo de 200 letras mayúsculas aleatorias, imprima este arreglo y luego imprima cuantas veces se repite cada letra en el arreglo. Ejemplo: supóngase que se genera el arreglo de 10 elementos: ABARSECAAB. El programa debe imprimir: ABAR- SECAAB A: 4 B: 2 C: 1 Y así sucesivamente. *...
ALGO
0.99659
4.194895
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-01-28T14:16: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": "a09050a5b462...
c724136e-a6be-4d2d-a0f8-38bc0de8e8c6
shivanshsanoria1/LeetcodeSolutions
CPP [1-500]/225.implement_stack_using_queues [1].cpp
class MyStack { private: queue<int> q; public: MyStack() { } void push(int x) { // T.C.=O(n) q.push(x); // push curr element in queue int n = q.size(); // pop (n-1) elements from the front and push them into the rear of the queue for(int i=1; i<n; i++)...
ALGO
0.999086
5.672368
{ "github_metadata": { "branch": "main", "commit_count": 196, "repo_created_at": "2024-02-21T17:59: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": "db3c7d8f46...
b3322564-8d09-4a7c-ad9d-edfe200d4c4a
wukong220/Backup
ref/MD_ref/intg.cpp
#include "intg.h" using namespace std; void rand_tangent_vector(const Vector3D &u, Vector3D &rVec, Normaldev *ran) { double vx = ran->dev(); double vy = ran->dev(); if (u.z < 1. && u.z > -1.) { double cos_theta = u.z; double sin_theta = sqrt(1 - cos_theta * cos_theta); double cos_phi = u.x / sin_theta; d...
ALGO
0.999059
3.953563
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2019-05-22T03:29: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": "891176611...
9f6f8d72-6606-4907-8e12-56c20be832ce
mengarena/Leetcode
com/leet_cpp/TheMaze.cpp
/* There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop rolling until hitting a wall. When the ball stops, it could choose the next direction. Given the ball's start position, the destination and the maze, determine whether ...
ALGO
0.999969
5.771904
{ "github_metadata": { "branch": "master", "commit_count": 1022, "repo_created_at": "2016-10-29T01:06: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": "ec067c2...
5828b01f-9593-4596-849d-63f48170d629
CLDP/ACM-ICPC
World-Finals/2012 - Warsaw/L.cpp
#include <iostream> #include <vector> #include <set> #include <algorithm> using namespace std; const string CP1 = "Takeover Incorporated"; const string CP2 = "Buyout Limited"; bool simulate(multiset<long long> &A, multiset<long long> &B, bool &turn) { long long temp; while (true) { if (A.empty()) ret...
ALGO
0.999839
3.551739
{ "github_metadata": { "branch": "master", "commit_count": 486, "repo_created_at": "2013-09-24T19:04:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "965d9ec2...
0192f340-30d8-4edb-ae68-3978dc471fc5
nhatnm212/CV_MoPhongMayATM
CTDL_Nhom1_MayATM/CTDL_Nhom1_MayATM/LinkedList.cpp
#include "LinkedList.h" template <class DataType> void LinkedList<DataType>::displayNode(Node<DataType>* node) { node->display(); } template <class DataType> void LinkedList<DataType>::getNode(Node<DataType>* node) { node->getData(); } template <class DataType> Node<DataType>* LinkedList<DataType>::getHead() { r...
TOOL
0.981139
4.630919
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-06-05T09:20: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": "29dc6bee3eb2...
b7b0597e-6bd0-4389-ad69-df86f84ad6de
cenacrharsh/dsa-practice
Coding Ninjas/Striver SDE Sheet (Coding Ninjas)/Binary Trees & BST/Size of Largest BST in Binary Tree.cpp
#include <bits/stdc++.h> #include <vector> #include <algorithm> #include <climits> #include <unordered_map> #include <cstring> using namespace std; class TreeNode { public: int data; TreeNode *left, *right; TreeNode() : data(0), left(NULL), right(NULL) {} TreeNode(int x) : data(x), left(NULL), right(NU...
ALGO
0.999907
5.945227
{ "github_metadata": { "branch": "main", "commit_count": 1005, "repo_created_at": "2022-02-09T08:55:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2dfa12f52...
53bdfed2-a3e7-4ca9-a69a-df83650857ba
Ron2014/algorithm
nowcoder/ta_huawei/HJ16.cc
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(int argc, char *argv[]) { int N, m, v, p, q; scanf("%d %d", &N, &m); vector<vector<int>> val(m+1, vector<int>(3, 0)); vector<vector<int>> wei(m+1, vector<int>(3, 0)); for (int i = 1; i <= m; ++i) { ...
ALGO
0.999293
3.458259
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2020-05-21T14:21: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": "d8c03ad7f...
1f56b6b0-f2bc-4cbf-b2d7-d3f23317b6ab
ugovaretto-education/hackerrank-submissions
strange-counter/cpp/strange-counter.cpp
#include <iostream> #include <fstream> #include <ostream> #include <string> using namespace std; string ltrim(const string &); string rtrim(const string &); /* * Complete the 'strangeCounter' function below. * * The function is expected to return a LONG_INTEGER. * The function accepts LONG_INTEGER t as parameter...
ALGO
0.999867
4.438721
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2022-03-01T06:51:46.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "881536afdf54...
4fa31fba-1ed1-435d-b9ce-4162ec5d4620
LavenderQAQ/code
acm/acwing1097.cpp
#include <cstdio> #include <iostream> #include <queue> using namespace std; typedef pair<int, int> P; const int maxn = 1010; char g[maxn][maxn]; int vis[maxn][maxn], ans, n, m; int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1}; int dy[8] = {0, 1, 0, -1, -1, 1, 1, -1}; void bfs(int x, int y) { queue<P> que; que.push(make_...
ALGO
0.999754
4.344416
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2021-12-10T01:25:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "68dcb824035...
6ae49020-8e4a-417a-93b9-dd94a8a966a9
mayur-aggarwal/Data-Structures
Solved Questions/kth_smallest_element_merge_sort.cpp
/** * @file kth_smallest_element_merge_sort.cpp * @brief Find Kth position smallest element in an unsorted array by Merge Sort Approach * * @author <NAME> * @bug No known bugs. * Contact: <EMAIL> * */ #if 0 #include <iostream> #include <climits> using namespace std; #define HSIZE 100001 // Main array having ...
ALGO
0.999961
5.705556
{ "github_metadata": { "branch": "master", "commit_count": 69, "repo_created_at": "2019-12-30T17:09:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0674a7716...
b0c3490d-2743-42d8-a55b-94b0daadee1b
lgsvl/apollo-5.0
modules/prediction/predictor/regional/regional_predictor.h
/****************************************************************************** * Copyright 2017 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ...
ALGO
0.976816
7.194339
{ "github_metadata": { "branch": "simulator", "commit_count": 13395, "repo_created_at": "2019-08-19T21:00:15.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 88, "forks": 91, "issues": 0, "pull_requests": 18 }, "file_meta": { "content_id": "2...
030e7aff-afb2-4bf7-b468-da95f45b7997
gaosheng19920801/leetcode
leetcode_vs/leetcode_vs/98_isValidBST.cpp
/** * Definition for a binary tree node. * 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), l...
ALGO
0.999993
5.693933
{ "github_metadata": { "branch": "master", "commit_count": 34, "repo_created_at": "2019-11-05T11:50:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "354b3b490...
65b4c630-5faa-4baa-8084-c9ae2ca6ee95
Sunidhi-Tiwari/Algozenith
Cpp_Programs/M1 W1/Super_Minimum_Sum.cpp
#include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define int long long int #define forloop(i,n) for(int i=0;i<n;i++) void solve() { int n; cin>>n; int a[n]; forloop(i,n) cin>>a[i]; stack<int> st; int left[n]; int rig...
ALGO
0.99953
4.446576
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2021-12-17T03:25: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": "401e91eede3...
b06dbcda-02b4-421b-b3c0-92e62a9ab9fa
Ekanshsomani/Competitive-Programming-Solutions
Kattis/Fire.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> ii; typedef vector<bool> vb; typedef vector<vb> vvb; int rows, columns; inline bool isInside(int r, int c) { return (r>-1 and c>-1 and r<rows and c<columns); } int main() { int rAround[]{-1, 0, 1, 0}; int cAround[]{0, 1, 0, -1}; ...
ALGO
0.999896
3.997982
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-02-27T21:38: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": "8e5a010e53a...
cf44c884-13b6-4dbe-95d0-d2e2a165e030
JacobHughes/CppDebug
HashTable/HashTable.h
/*======================================================= Code written by <NAME> <EMAIL> https://github.com/JacobHughes/ =======================================================*/ #pragma once #include "HashBucket.h" #include <vector> #include <string> #include <memory> #include <ostream> #include <iostream> #in...
TOOL
0.971399
5.427173
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2014-08-12T04:57:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 8, "pull_requests": 0 }, "file_meta": { "content_id": "d1ac0b423...
3015f301-75d3-465b-971a-0f9e49e70bd2
Dao-AILab/flash-attention
hopper/softmax.h
/****************************************************************************** * Copyright (c) 2024, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. ******************************************************************************/ #pragma once #include <cmath> #include <cute/tensor.hpp> #include <cutlass/numeric_t...
ALGO
0.981925
6.825148
{ "github_metadata": { "branch": "main", "commit_count": 970, "repo_created_at": "2022-05-19T21:22:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 18439, "forks": 1818, "issues": 780, "pull_requests": 67 }, "file_meta": { "content_id": "b...
d62c8482-6e8f-49d7-aa4d-bf5d79476ac6
cheerconi/online-judge
codeforces/Codeforces Round #648/B. Trouble Sort/main.cpp
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <ctime> #include <deque> #include <iostream> #include <list> #include <map> #include <memory.h> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <vector> #include <unordere...
ALGO
0.999991
3.262865
{ "github_metadata": { "branch": "master", "commit_count": 407, "repo_created_at": "2017-07-19T16:20:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3f6bab0...
8063ad06-33ae-4243-9530-10d495ed8eb5
TYLearChen/CityU-EE3301
Count_Sorted_Vowel_Strings.cpp
/** * Topic: [Week 7] [LeetCode] [DP] 1641. Count Sorted Vowel Strings * Author: CHEN, TSUNG-YU * Keyword: Week 7, LeetCode, Dynamic Programming **/ class Solution { public: int countVowelStrings(int n) { /** initialising the loopUp table with 0 * Since a row will not be used...
ALGO
0.999912
6.44296
{ "github_metadata": { "branch": "main", "commit_count": 41, "repo_created_at": "2021-01-16T15:09:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2aabd487efe...
78c32d60-9b7b-44f3-b097-fb906f7913ab
satyamdwivedi7/DSA
addingelementsinarray.cpp
#include <iostream> #include <vector> using namespace std; int main() { int m, n; cout << "Enter m & n = "; cin >> m; cin >> n; vector<int> v1; vector<int> v2; vector<int> ans; for (int i = 0; i < m; i++) { int a; cout << "Enter the elements in array 1 = "; ci...
ALGO
0.999977
3.846159
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-08-21T17:04: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": "28dcdb8c30a3...
4becc5a0-98e3-47fd-b011-b435cf2401de
jonklein/breve
include/breve/neuralNetworkLearningAlgorithm.hh
/***************************************************************************** * The breve Simulation Environment * * Copyright (C) 2000-2004 <NAME> * * * * This prog...
ALGO
0.996791
5.662578
{ "github_metadata": { "branch": "master", "commit_count": 1065, "repo_created_at": "2011-01-22T15:13:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 13, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "40e8e...
8481314e-20e9-4fcd-b487-f1f130a9ccce
andremralves/competitiveProgramming
codeforces/eduRound150/b.cpp
/** * author: mralves * created: 12-06-2023 11:34:04 **/ #include <bits/stdc++.h> #define pb(x) push_back(x) #define all(x) x.begin(),x.end() using namespace std; using ll = int64_t; using ii = pair<int, int>; ll ceil(ll a, ll b) {return a % b == 0 ? a / b : a / b + 1;} vector<ii> dir4 = {{1, 0}, {0,...
ALGO
0.999937
4.51177
{ "github_metadata": { "branch": "master", "commit_count": 147, "repo_created_at": "2022-09-16T06:11: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": "c1efd1b3...
3e12edc6-dd4c-409e-b13c-2957b83084e9
malvinval/leetcode-answers
easy/3-palindrome-number/app.cpp
#include <iostream> /** * Given an integer x, return true if x is a palindrome, and false otherwise. Example 1: Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left. */ bool isPalindrome(int x) { int temporaryNum = 0; // 111 if(x < 0 || (x % 10...
ALGO
0.998829
5.671888
{ "github_metadata": { "branch": "master", "commit_count": 115, "repo_created_at": "2023-04-06T17:52: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": "f6b4d906...
8965f114-6ace-4a82-aaf1-cce7ced632c9
855309/langtonsant
main.cpp
/* author: @fikret0 date: November 13, 2021 GitHub: @fikret0 */ #include <bits/stdc++.h> #include <SFML/Graphics.hpp> #define WIDTH 800 #define HEIGHT 800 #define XCELLS 200 #define YCELLS 200 int antx = XCELLS / 2, anty = YCELLS / 2; int movx = 0, movy = 1; int cellw = WIDTH / XCELLS, cellh = HEIGHT ...
TOOL
0.910345
4.669932
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-11-14T14:27:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "40a13bda4494...
8883ef9e-7982-4d49-aae4-4ba50e34da36
jesushilarioh/C-Plus-Plus
Chapter-4-Making-Decisions/Review Questions and Exercises/Algorithm Workbench/39.cpp
/******************************************************************** * * 39. Assume str1 and str2 are string objects that have been * initialized with different values. Write an if/else * statement that compares the two objects and displays * the one that is alphabetically greatest. * * <NAME> * Fe...
ALGO
0.995197
5.147589
{ "github_metadata": { "branch": "master", "commit_count": 141, "repo_created_at": "2018-03-14T21:06:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bea7d3e6...
0e9f6ca9-3a58-4831-b891-3a6680d017a4
RishabhRD/450DSA
heap/12.cc
#include <algorithm> #include <array> #include <iostream> #include <iterator> #include <limits> #include <numeric> #include <vector> using namespace std; template <typename T> concept is_container = requires(T a) { a.begin(); a.end(); }; template <is_container T> requires(!std::same_as<T, std::string>) std::ostr...
ALGO
0.998922
4.514634
{ "github_metadata": { "branch": "master", "commit_count": 371, "repo_created_at": "2021-03-17T05:14: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": "14752082...
425f4c71-3483-493a-abe6-567f25346010
subratamondalnsec/Pw-cpp-code
19Hashmap/class/12copy-list-with-random-pointer_Leetcode-138.cpp
#include <iostream> #include <unordered_map> using namespace std; // Definition for a Node. class Node { public: int val; Node* next; Node* random; Node(int _val) { val = _val; next = nullptr; random = nullptr; } }; class Solution { public: Node* copyRandomList(Nod...
ALGO
0.991932
6.026937
{ "github_metadata": { "branch": "main", "commit_count": 272, "repo_created_at": "2024-09-22T18:08:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e6f25827ba...
a9fe139c-ce6c-42a8-bbd3-2f48dd0e4496
Hwanghoseon/algorithm_test
모의고사.cpp
#include <string> #include <vector> using namespace std; vector<int> solution(vector<int> answers) { vector<int> answer; vector<int> A = { 1, 2, 3, 4, 5 }; vector<int> B = { 2, 1, 2, 3, 2, 4, 2, 5 }; vector<int> C = { 3, 3, 1, 1, 2, 2, 4, 4, 5, 5 }; int cntA = 0; int cntB = 0; in...
ALGO
0.999941
4.87746
{ "github_metadata": { "branch": "master", "commit_count": 489, "repo_created_at": "2019-11-19T04:41: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": "8896a371...
1b99d510-7b2b-42c9-9dd0-8ff0ec4821a0
KhushanshuYadav/LeetCode
0870-magic-squares-in-grid/0870-magic-squares-in-grid.cpp
class Solution { private: bool isAns(int row, int col, vector<vector<int>>& grid) { unordered_set<int> s; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { int num = grid[row + i][col + j]; if (num < 1 || num >9) return false; ...
ALGO
0.999646
6.018123
{ "github_metadata": { "branch": "main", "commit_count": 1367, "repo_created_at": "2024-06-25T18:08: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": "02f7b5207...
e06cda15-c6aa-439a-8ef7-416212ebd205
priyanshu070702/GEEKS-for-GEEK
Medium/Construct a Full Binary Tree/construct-a-full-binary-tree.cpp
//{ Driver Code Starts //Initial Template for C++ #include<bits/stdc++.h> using namespace std; struct Node { int data; struct Node *left; struct Node *right; Node(int x){ data = x; left = NULL; right = NULL; } }; // } Driver Code Ends /* Structre of the Node of the Binary Tree is as follows str...
ALGO
0.999969
6.108558
{ "github_metadata": { "branch": "master", "commit_count": 581, "repo_created_at": "2022-12-06T12:19:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f44f1d11...
07482def-36e9-4d6a-85a2-aaa19161e176
Camithilwen/Code-Cloning-Analysis
src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p00200/s588766006.cpp
#include <iostream> #include <limits.h> using namespace std; int m; int dijkstra( const int data[101][101], int start, int end ) { int i,j,next,min; bool visited[101]; int distance[101]; for( i = 1;i <= 100;i++ ){ visited[i] = false; distance[i] = INT_MAX; } distance[start] = 0; next = start; do{ i =...
ALGO
0.999108
3.677078
{ "github_metadata": { "branch": "main", "commit_count": 243, "repo_created_at": "2025-06-06T16:57:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "7720d26950...
e9b7ee0d-9307-4739-9924-29bff74e1d33
EasySocHacks/ITMO-AlgoLabs
Term_3-4/lab1/A.cpp
#include <bits/stdc++.h> using namespace std; const int LEN = 100009; int n, m; vector <int> g[LEN]; int used[LEN]; vector <int> top; void dfs(int v) { used[v] = 1; for (int u : g[v]) { if (used[u] == 1) { cout << -1; exit(0); } if (used[u] == 2) ...
ALGO
0.999972
4.039452
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2019-04-16T22: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": "528941159...
1025bc1a-6b2a-4960-ac96-e2cffc85fd8a
tonyouyang/leetcode
clone_graph.cpp
/** * Definition for undirected graph. * struct UndirectedGraphNode { * int label; * vector<UndirectedGraphNode *> neighbors; * UndirectedGraphNode(int x) : label(x) {}; * }; */ class Solution { public: UndirectedGraphNode *cloneGraph(UndirectedGraphNode *node) { // Note: The Solution obj...
ALGO
0.999906
6.359817
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2013-09-06T08:39:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "cb4aad0c...
7371af98-a1d2-4198-b564-14fd55bdc101
rokyan/leetcode
medium/cpp/1878.cpp
// https://leetcode.com/problems/get-biggest-three-rhombus-sums-in-a-grid/ class Solution { public: std::vector<int> getBiggestThree(std::vector<std::vector<int>>& grid) { const auto n = static_cast<int>(std::size(grid)); const auto m = static_cast<int>(std::size(grid.front())); std::a...
ALGO
0.999974
6.187638
{ "github_metadata": { "branch": "master", "commit_count": 2228, "repo_created_at": "2022-09-17T09:45:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "05ea7a2...
1ac78cf4-e7ce-4fef-a00c-a61ab2ba021a
Mengsen-W/algorithm
cpp/731_MyCalendarTwo/MyCalendarTwo.cpp
#include <cassert> #include <unordered_map> using namespace std; class MyCalendarTwo { public: MyCalendarTwo() {} void update(int start, int end, int val, int l, int r, int idx) { if (r < start || end < l) { return; } if (start <= l && r <= end) { tree[idx].first += val; tree[idx]....
ALGO
0.999916
6.044641
{ "github_metadata": { "branch": "main", "commit_count": 1562, "repo_created_at": "2021-01-17T11:54:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1027edc3f...
a9ceba26-63c2-4856-b2ae-8083dc5f6db7
xplodwild/android_external_Focal
celeste/Gabor.cpp
/*************************************************************************** * Copyright (C) 2008 by <NAME> * * <EMAIL> * * * * This program is free so...
ALGO
0.904682
4.886832
{ "github_metadata": { "branch": "master", "commit_count": 84, "repo_created_at": "2013-07-02T08:25:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 25, "forks": 38, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "c3843cd...
677cef37-1460-443e-81c0-44ce9f8c6df3
knightzf/review
leetcode/uniqueLetterString/timeoutSol.cpp
#include "header.h" class Solution { public: int uniqueLetterString(string S) { if(S.empty()) return 0; std::for_each(S.begin(), S.end(), [](char& c){ c = std::tolower(c);}); vector<int> v(26, 0); int n = S.size(); int res = 0; int fullStrVal =...
ALGO
0.999991
5.09045
{ "github_metadata": { "branch": "master", "commit_count": 846, "repo_created_at": "2013-05-15T02:50:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "51070527...
80fc2ee7-a382-473a-89a5-70f5a79281d5
SydZero/430
comp/power.cpp
#include <bits/stdc++.h> using namespace std; struct team{ long x; long y; bool valid; team(long x, long y): x(x), y(y), valid(true){} void print(){ cout << "(" << x << ", " << y << ")"; } }; bool on_path(team a, team b, team c){ // a.print(); // cout << "->"; // b.pri...
ALGO
0.999976
4.20114
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2024-01-19T03:02:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "432d12f1101...
f8c21d82-6243-475f-9461-fbfeb7bb9c30
saajanis/CarND
CarND-Project6EKF/src/tools.cpp
#include <iostream> #include "tools.h" using Eigen::VectorXd; using Eigen::MatrixXd; using std::vector; Tools::Tools() {} Tools::~Tools() {} VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations, const vector<VectorXd> &ground_truth) { /** TODO: * Calculate the RMSE...
ALGO
0.995835
6.049542
{ "github_metadata": { "branch": "master", "commit_count": 147, "repo_created_at": "2017-06-26T00:48: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": "0d274f05...
bb9a67eb-ff20-46aa-b605-6d2c845819da
hameem008/Competitive_Programming
Codeforces_and_others/LauraandOperations.cpp
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define gap ' ' typedef long long ll; typedef long double lld; const ll infinite = INT32_MAX; void solve(int I, int T) { ll i, j, k, a, b, c, d, m, n, p, q; bool flag; // solve starts cin >> a >> b >> c; vector<ll> ans(3, 0); if (a...
ALGO
0.999886
4.386253
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2025-06-02T07:22: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": "86c0707db562...
de362455-7f01-4a4e-b19d-c2aa9a5b3ea9
ahmadsh2007/APIO-IOI
DataStructures/SegmentTree/segment_tree.cpp
#include <vector> #include <algorithm> // For std::min, std::max #include <limits> // For numeric_limits // Basic Segment Tree template - Example for Range Minimum Query (RMQ) // Can be adapted for Range Sum, Range Maximum, etc. by changing merge function and NEUTRAL_ELEMENT. struct SegmentTree { int n; // Size...
ALGO
0.999975
7.018749
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2025-05-01T18:32:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "92fb2e8501b...
57c6185d-ac78-45e5-a717-0e722b22a455
david-why/35tang-study
cpp-lvl4/006-structs/hw/001-citystate.cpp
#include <bits/stdc++.h> using namespace std; ifstream fin("citystate.in"); ofstream fout("citystate.out"); #define s2i(c, s) (((((c)[0] - 'A') * 26 + ((c)[1] - 'A')) * 26 + ((s)[0] - 'A')) * 26 + ((s)[1] - 'A')) #define rotate(i) ((i) / 26 / 26 + ((i) % (26 * 26)) * 26 * 26) int city_state[26 * 26 * 26 * 26]; int...
ALGO
0.999871
3.828286
{ "github_metadata": { "branch": "main", "commit_count": 187, "repo_created_at": "2021-05-22T06:45: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": "92d9eb0169...
dfe86dae-026f-41f2-be50-f67d84e587f5
PedroHMNobrega/Programming-Problems
URI/Graphs/2490.cpp
//<NAME> //Assunto: Krustal; #include<bits/stdc++.h> #define fi first #define se second #define pb push_back #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define loop(i, a, b) for(int i = a; i < b; i++) #define loopBack(i, a, b) for(int i = a; i >= b; i--) #define INF INT_MAX #define LINF LLON...
ALGO
0.999643
3.356643
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2020-01-23T23:20:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e70d25027...
ef1bb9ff-8b41-473c-bd7b-41578d9218d5
sangdo913/Algorithms
StudyAlone/StudyAlone/codeforces/634/E.h
#include<iostream> #include<string.h> using namespace std; int n; int arr[2001]; int sum[27][2002]; int sum2[27][2002]; int main(){ freopen("0Text.txt","r",stdin); int t; cin >> t; while(t--) { cin >> n; for(int i = 1; i <= n+1; ++i) for(int j = 1; j <= 26; ++j) sum[j][i] = 0, sum2[j][...
ALGO
0.999655
3.016968
{ "github_metadata": { "branch": "master", "commit_count": 850, "repo_created_at": "2018-01-06T13:25: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": "0a6e178f...
f8d8dfa3-fcc8-461f-956e-a295f45993d3
snl-dakota/dakota-packages
muq2/MUQ/Optimization/Optimizer.h
#ifndef OPTIMIZER_H_ #define OPTIMIZER_H_ #include <boost/property_tree/ptree.hpp> #include "MUQ/Modeling/ModPiece.h" #include "MUQ/Optimization/ModPieceCostFunction.h" #include "MUQ/Utilities/RegisterClassName.h" namespace muq { namespace Optimization { /// Solve an optimization problem /** \f{eqnarray}{ ...
TOOL
0.976148
6.048904
{ "github_metadata": { "branch": "devel", "commit_count": 279, "repo_created_at": "2021-08-17T16:15:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 6, "issues": 5, "pull_requests": 1 }, "file_meta": { "content_id": "edd0585aaf...
26bef3eb-93cc-484b-b45c-526a4f172686
GeorgiMinkov/UP_IS_2019_2020_gr_3
week10/example.cpp
#include <iostream> #include <cmath> int fib(int n); int sumOfDigits(int n); int recStrlen(const char*); int reverseHelper(int n, int& count) { if (n < 10) { ++count; return n; } //std::cout << n % 10; return (n % 10) * (int)pow(10,count) + reverseHelper(n / 10, ++count); } int reverse(int n) { int count =...
ALGO
0.996979
3.779972
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2019-10-03T11:19:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6e9e5a162...
cfa76a0a-8633-4c5f-883a-e8355ea66a29
DesZou/Project-Eros
LuoGu/3332.cc
/* * luogu3332 * * *真正* 的线段树套线段树,不开 O2 过不了。 * 碰到这种题,一定要想着换换顺序维护,不要死死地跟着题面来。 * */ #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> using std::cin; using std::cout; using std::cerr; const char El = 10; const int Size = 5e4 + 5; const int Log = 17; char getChar() { static char buf[...
ALGO
0.999987
4.271164
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2017-10-11T11:20:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "84262354e...
0ffcfe8e-eae8-441a-b1ab-4d2c4da92b6f
ishandutta2007/codeforces-y
ytkn/normal/1627/E.cpp
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <iostream> #include <algorithm> #include <iomanip> #include <vector> #include <queue> #include <deque> #include <set> #include <map> #include <tuple> #include <cmath> #include <numeric> #include <functional> #include <ca...
ALGO
0.99973
4.188774
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:40: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": "f04841f53e54...
d758140e-2f4d-45b7-a774-d3cd03883c92
dreyus95/AVSP_SourceQualityPrediction
CodeJamCrawler/dataset/10_7651_59.cpp
#include <stdio.h> #include <string.h> int n, k; int dic[4][2] = {0, 1, 1, 0, 1, 1, 1, -1}; char map[100][100]; char nw[100][100]; int chk(char a) { for(int i = 0; i < n; ++i) { for(int j = 0; j < n; ++j) { for(int l = 0; l < 4; ++l) { int t, x = i, y = j; for(t = 0; t < k; ++t) { if(x < 0 || x >= ...
ALGO
0.99985
4.109414
{ "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": "3870d2174...
0c4a9739-ed71-4212-baa7-ff68913242da
riteme/test
oi/uoj/P290/main.cpp
#define NDEBUG #include <cstdio> #include <cstring> #include <vector> #include <algorithm> using namespace std; #define NMAX 500000 #define MOD 998244353LL typedef long long i64; inline i64 inv(i64 x) { return x == 1 ? 1 : MOD - MOD / x * inv(MOD % x) % MOD; } inline void add(i64 &a, i64 b) { a += b; ...
ALGO
0.999886
5.31205
{ "github_metadata": { "branch": "master", "commit_count": 550, "repo_created_at": "2015-04-26T07:16:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "536e0234...
86e5d4bb-5367-4239-9aca-e6bb506f491d
dimaglushkov/solutions
acm.timus/1067.cpp
/** source:https://acm.timus.ru/problem.aspx?num=1067 Пояснения к примененному алгоритму: Будем рассматривать файловую систему как дерево. Количество отступов перед именем следующего файла равно его уровню в дереве. Выводить имена файлов/директорий будем в соответствии с прямым обходом этого дерева. */ #include <iostr...
ALGO
0.999312
4.552549
{ "github_metadata": { "branch": "master", "commit_count": 578, "repo_created_at": "2021-03-29T21:25:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af5326e9...
d58177c0-d3f0-49d2-83d2-9aec6a4a9c22
slycoder/Rlda
Sampler.cpp
#include <vector> class Sampler { int K_; std::vector<Posterior> posteriors_; std::vector<double> probabilities_; public: Sampler(const int K) : K_(K), probabilities_(K) { } void addPosterior(Posterior& posterior) { posteriors_.push_back(posterior); } int sampleVariable(const Position& position)...
ALGO
0.999428
5.597234
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2011-07-20T09:34:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "36c7b45c03...