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
59ad3b39-2028-4e26-b162-3d4205e3774f
biyotte/Code_of_gunwookim
BOJ_solve/1161.cpp
#include <bits/stdc++.h> #define x first #define y second #define pb push_back #define all(v) v.begin(),v.end() #pragma gcc optimize("O3") #pragma gcc optimize("Ofast") #pragma gcc optimize("unroll-loops") using namespace std; const int INF = 1e9; const int TMX = 1 << 18; const long long llINF = 1e18; const long long ...
ALGO
0.99998
4.650581
{ "github_metadata": { "branch": "main", "commit_count": 45, "repo_created_at": "2021-01-27T11:17:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "76274f8ceb6...
d3d6847e-d5f1-4688-917d-98a599ab4ace
AlperSaltabas/OR_Tools_Google_API
documentation/tutorials/cplusplus/routing_common/routing_random.h
// Copyright 2011-2014 Google // 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 in wri...
ALGO
0.947415
6.660132
{ "github_metadata": { "branch": "master", "commit_count": 3052, "repo_created_at": "2015-03-15T18:40:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c8dadc...
a5eab760-9f45-4351-9c30-e92e53e12ab8
ishandutta2007/codeforces-p
physics0523/normal/1728/E.cpp
#include<bits/stdc++.h> using namespace std; // https://qiita.com/drken/items/b97ff231e43bce50199a#3-4-%E6%8B%A1%E5%BC%B5%E3%83%A6%E3%83%BC%E3%82%AF%E3%83%AA%E3%83%83%E3%83%89%E3%81%AE%E4%BA%92%E9%99%A4%E6%B3%95%E3%81%AE%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0%E7%9A%84%E8%A8%98%E8%BF%B0 // (x,y) will sa...
ALGO
0.99979
4.631947
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15: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": "26105c4fbcae...
24a2e50c-d399-4409-a8bf-c504dcbb18df
codulluiandrei/pbinfo
pbinfo-837/main.cpp
#include <iostream> #include <fstream> using namespace std; ifstream fin("fill.in"); ofstream fout("fill.out"); int n,m, a[102][102]; const int dx[]={0 , 0 , 1 , -1}, dy[]={1 , -1 , 0 , 0}; void fill(int i , int j , int valoare) { a[i][j] = valoare; for(int k = 0 ; k < 4 ; k ++) if(a[i+dx[k]][j+dy[k]] == -1) fil...
ALGO
0.999878
3.204404
{ "github_metadata": { "branch": "main", "commit_count": 88, "repo_created_at": "2022-04-17T15:34:21.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 9, "forks": 3, "issues": 48, "pull_requests": 0 }, "file_meta": { "content_id": "ff7189229a4...
7066b6a1-90d7-4b36-8819-d63be95e646c
yuhyao/Contest-Library
graph/undo-dsu.cpp
/** * Author: <NAME> * Date: 23-05-01 * Description: Undoable Disjoint Union Set for set ${0, ..., N - 1}$. * Use $top = top()$ to get a save point; use $undo(top)$ to go back to the save point. * Note that Info should have a member function $join$ and a static variable $global$; * Usage: * UndoDSU dsu(n); ...
ALGO
0.999827
5.393712
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2021-07-06T12:01: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": "da2d49b7839...
bb56c478-b2ec-4b28-bb96-73aa7d737f9b
jainayu/Data-Structures-and-Algorithms
Linked List/LinkedList.cpp
#include<bits/stdc++.h> using namespace std; class Node { public: int data; Node* next; }; Node* head = NULL; void printList(Node *node) { while (node != NULL) { cout << " " << node->data; node = node->next; } cout << endl; return; } void insertAtStart(int data) { Node* node =...
ALGO
0.999625
4.639904
{ "github_metadata": { "branch": "master", "commit_count": 129, "repo_created_at": "2020-07-28T21:09: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": "a55847d4...
2bb2edeb-fcf2-4011-baf0-18ebbc6ace23
rishavjnv12/Code-backup
jan_code/final.cpp
#include <bits/stdc++.h> #define int long long using namespace std; int final_n = 0; int memo[4004][4004]; bool iss(vector<int>&nums,int idx,int sum){ if(idx==-1) return sum==0; if(sum<0) return false; if(memo[idx][sum] == -1) return memo[idx][sum] = (iss(nums,idx-1,sum) or iss(nums,...
ALGO
0.999737
3.588039
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2020-08-19T15:37:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8968a42c3...
0937c40c-e7dc-4b2f-8ad5-98902618e0ad
SCIInstitute/SCIRun
src/Core/Algorithms/Legacy/Fields/ClipMesh/ClipMeshBySelection.cc
/* For more information, please see: http://software.sci.utah.edu The MIT License Copyright (c) 2020 Scientific Computing and Imaging Institute, University of Utah. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ...
ALGO
0.980946
6.547323
{ "github_metadata": { "branch": "master", "commit_count": 12589, "repo_created_at": "2012-02-16T18:51:26.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 132, "forks": 73, "issues": 372, "pull_requests": 2 }, "file_meta": { "content_id": "12...
f2910a7c-3c3d-4b37-ab0b-cd4a219f06ab
greenapple1017/codeTree
250104/treeset 기본/treeset-basic.cpp
#include <iostream> #include <set> #include <string> using namespace std; set<int> s; int main() { // Please write your code here. int n; cin >> n; for (int i = 0; i < n; i++) { string cmd; cin >> cmd; if (cmd == "add") { int x; cin >> x; s.i...
ALGO
0.999878
5.004923
{ "github_metadata": { "branch": "main", "commit_count": 824, "repo_created_at": "2024-11-02T09:32: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": "6e76270fdf...
c127ce68-cf5b-4592-b5da-e63bafcf559a
ishandutta2007/codeforces-r
rns_mhb/normal/400/E.cpp
#include <stdio.h> #define N 100100 #define M 17 int a[N], n; int b[17][N]; int fen1[17][N], fen2[17][N]; __int64 ans, cnt; int pre, next; void add1(int k, int pos, int v) { int i; for (i=pos; i<=n; i+=i&-i) fen1[k][i]+=v; } void add2(int k, int pos, int v) { int i; for (i=pos; i<=n; i+=i&-i) fen2[k][i]+=v; } i...
ALGO
0.999801
3.620281
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:58: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": "76f8db2b5435...
e2b4baa1-0ad4-4d1f-b7b8-86334c5e4958
HarshitGupta3017/LeetCode-Daily
Maximum Average Pass Ratio.cpp
class Solution { public: double maxAverageRatio(vector<vector<int>>& classes, int extraStudents) { int n = classes.size(); priority_queue<pair<double, int>> pq; for (int i = 0; i < n; i++) { double curr_pr = (double) classes[i][0] / classes[i][1]; double new_pr = (dou...
ALGO
0.99957
5.69357
{ "github_metadata": { "branch": "main", "commit_count": 726, "repo_created_at": "2024-09-24T16:45:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4989b25758...
fbe93f6d-61a3-420f-b4d5-cb843ee57460
ishandutta2007/codeforces-c
cz_xuyixuan/normal/937/A.cpp
#include<bits/stdc++.h> using namespace std; const int MAXN = 1005; template <typename T> void read(T &x) { x = 0; int f = 1; char c = getchar(); for (; !isdigit(c); c = getchar()) if (c == '-') f = -f; for (; isdigit(c); c = getchar()) x = x * 10 + c - '0'; x *= f; } template <typename T> void write(T x) { if (x...
ALGO
0.999777
3.347659
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T01:17:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8dac1577fbf9...
669f601d-3878-40c9-b940-e30c47b4adbf
kumarshivam675/C-plusplus-repo
stack/StackWithMiddleElement.cc
#include<iostream> using namespace std; class Node{ int data; Node* prev; Node* next; public: Node(int value); int getData(); void setData(int value); void setPrev(Node* node); void setNext(Node* node); Node* getPrev(); Node* getNext(); }; Node::Node(int value){ data = value; } int Node::getData(){ retu...
ALGO
0.99949
4.52419
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2015-08-11T18:44:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6ca4c3a623...
f5c48e2f-65dd-4fb6-83dd-5bf994c781e3
radio-astro/casa
code/synthesis/TransformMachines/BeamCalcAntenna.h
#ifndef SYNTHESIS_ANTENNA_H #define SYNTHESIS_ANTENNA_H namespace casa { #include <synthesis/TransformMachines/BeamCalc.h> #define MAXGEOM 2000 /* * calcAntenna parameters */ typedef struct { casacore::Double sub_h; /* height of subreflector (on axis) */ casacore::Double feed[3]; ...
TOOL
0.985605
4.074894
{ "github_metadata": { "branch": "master", "commit_count": 18139, "repo_created_at": "2015-08-20T09:27:16.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 7, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9de708f...
2ef4dac1-949e-4597-b88a-e8656b903821
eva-rubio/Data-Structures-and-Algorithms
BinarySearchTrees/BTS- lab6.cpp
//============================================================================ // File name : BTS.cpp // Author : <NAME> // Description : LAB #6 - Binary Search Trees // This program implements a BST //============================================================================ #include <iostream> using nam...
ALGO
0.999769
3.866238
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2020-10-09T17:06: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": "166b22ed8998...
c3dd301b-f2f8-4721-a94c-065e38431c51
EusseJhoan/CursoFCII_UdeA_2021_2
Documentos/Seguimiento2/CC1152223665/Tarea2/Tarea2b/Tarea2b_conversor.cpp
#include <iostream> #include <string> //manejo de strings #include <vector> //manejo de vectores #include <math.h> //uso de herramientas matematicas como potenciacion using namespace std; //DECIMAL a HEXADECIMAL string Deci_to_Hexa(string numero){ int n,base,cociente,tam,residuo; n = stoi(numero); //convierto el...
ALGO
0.983696
3.799673
{ "github_metadata": { "branch": "main", "commit_count": 277, "repo_created_at": "2021-11-18T15:45:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 13, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ba50cfb25...
2595b386-0144-4249-bc90-13a8e3a6fe1f
aswinsuresh-04/DS_Lab.
Assignment 2/ques_1/sorting_numbers.cpp
#include <iostream> #include <vector> void bubbleSort(std::vector<double>& arr) { bool swapped; do { swapped = false; for (int i = 0; i < arr.size() - 1; i++) { if (arr[i] > arr[i + 1]) { // Swap arr[i] and arr[i + 1] double temp = arr[i]; ...
ALGO
0.999982
5.534472
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-09-25T10:30: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": "0552974e561b...
bca19442-3ff7-448e-9734-01854ca317bf
Tayeb-Ahmed-TAS/DSA-with-CPP
03 - Character ArraysStrings/08 - Find Shortest Path/02-Shortest_Route_Using_Functions.cpp
// Find Displacement: Given a long route containing N,S,E,W directions, find the // shortest path to reach the location(destination) // Sample Input: SNNNEWE // Sample Output: NNE #include <iostream> using namespace std; void Shortest_Route(int x, int y) { cout << "Shortest Route: "; if (x >= 0 and y >= 0) { ...
ALGO
0.999949
4.905484
{ "github_metadata": { "branch": "main", "commit_count": 156, "repo_created_at": "2024-06-22T06:35:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41fb3bcba1...
2a553233-2b66-45e3-b808-e58c8ec379d3
Darmsztadt/Cpp
nauka_2/filestream/2.cpp
#include <iostream> #include <windows.h> #include <fstream> using namespace std; const int n = 12; char lab[n][n]; int tabRuchow[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; int xStart, yStart, xKoniec, yKoniec; bool czyKoniec = false; void wczytajLabirynt() { ifstream plik; plik.open("lab.txt"); if (!plik) ...
ALGO
0.995457
3.194813
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-05-25T17:53:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dfd6c6c36351...
8b92502a-f7c4-427d-b9ca-dd6160f6e71a
adamcavendish/HomeworkGitShare
DataStructures/AVLTree/main/AVLTree.hpp
#pragma once // Current Project #include "AVLTreeNode.hpp" // STL #include <initializer_list> #include <utility> #include <string> template <typename T> class AVLTree { public: AVLTree(); AVLTree(const std::initializer_list<T> &data); static int balanceFactor(const AVLTreeNode<T> *node) { retu...
ALGO
0.958101
6.769661
{ "github_metadata": { "branch": "master", "commit_count": 75, "repo_created_at": "2013-09-16T11:41:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af2a197a5...
a22dab1d-8c46-4069-addf-190d9b50940a
pradeep-kumar-1705807/Mytest
K-DigitNUmber.cpp
#include<bits/stdc++.h> using namespace std; string maxString(string &s1, string &s2) { string temp; if(s1.length()==s2.length()) { if(s1>s2) { return s1; } else { return s2; } } int diff =s1.length()-s2.length(); d...
ALGO
0.999951
4.739486
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2020-03-30T09:23: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": "9aa1f54c7...
16260aba-323d-4096-b454-e93252c70e29
dongdaang/cplusplus_algorithm_private_study
bronze/단어뒤집기_9093.cpp
#include <iostream> #include <string> using namespace std; int main(){ int T; string S; cin >> T; cin.ignore(); for(int i=0; i<T; i++){ getline(cin, S); for(int j=0; j<S.size(); j++){ if(S[j] == ' '){ for(int k=j-1; S[k]!=' ' && k>=0; k--){ ...
ALGO
0.999876
4.330084
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-03-29T13:36:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "98c9fbb56fc0...
c926b1ef-33c9-4bb4-8c30-840852e102a3
xehoth/OnlineJudgeCodes
BZOJ/BZOJ3589-动态树-树链剖分+容斥.cpp
/** * Copyright (c) 2017, xehoth * All rights reserved. * 「BZOJ 3589」动态树 23-08-2017 * 树链剖分 + 容斥 * @author xehoth */ #include <bits/stdc++.h> namespace IO { inline char read() { static const int IN_LEN = 1000000; static char buf[IN_LEN], *s, *t; s == t ? t = (s = buf) + fread(buf, 1, IN_LEN, stdin) :...
ALGO
0.999915
4.628931
{ "github_metadata": { "branch": "master", "commit_count": 401, "repo_created_at": "2017-08-26T02:49:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "271e5ae2...
7dc86fd6-959e-41dd-ae1c-9fa03feb2bde
jiteshvarade/ProgrammingConcepts
Program149.cpp
#include <iostream> using namespace std; class Number { private : int iNo; public : Number(int x) { iNo = x; } int Factorial() { int iCnt = 0; int iFact = 0; iFact = 1; for(iCnt = 1; iCnt <= iNo; iCnt...
ALGO
0.994006
3.525821
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-06-22T04:15: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": "c972338903a9...
de8040e9-6ae5-444c-a2f0-cacca4bfb1de
infikei/algorithm
baekjoon_contest/2024/147_241130_가희와 함께 하는 7회 코딩 테스트/6_P_boj_32780.cpp
// Solve 2024-11-30 // Update 2024-12-01 #include <bits/stdc++.h> #define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL); #define size(v) (int)v.size() #define all(v) v.begin(),v.end() #define setw(n, c) cout << setw(n) << setfill(c); #define setp(n) cout << fixed << setprecision(n); #define printw(x) cout << ...
ALGO
0.999952
5.614253
{ "github_metadata": { "branch": "main", "commit_count": 1613, "repo_created_at": "2022-05-22T18:51:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "13c68d129...
c0ca479d-fdad-42a4-a326-72ee8d7b4d77
ishandutta2007/codeforces-n
nfssdq/normal/362/B.cpp
/*********************************************************************\ |--\ --- /\ |-----------| ----- /-------| | | \ | / \ | | / | | \ | / \ | | | | | \ | / \ ...
ALGO
0.999966
3.080668
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:35:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "14586e34631c...
41339abe-8449-4729-80de-bf3f19fd21d1
megargayu/USACO-Solutions
codeforces/problems/mohamoudehabfunc/mohamoudehabfunc.cpp
// https://codeforces.com/contest/862/problem/E #include <bits/stdc++.h> using namespace std; #define MAX 1e5 #define ll long long vector<int> a(MAX), b(MAX); // bij[j] is the sum of b_{i+j} vector<ll> bij(MAX); int main() { // 0. input int n, m, q; cin >> n >> m >> q; for (int i = 0; i < n; ++i) cin ...
ALGO
0.999883
4.171611
{ "github_metadata": { "branch": "main", "commit_count": 107, "repo_created_at": "2022-04-14T06:22:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7ae5c762a1...
62c11031-94da-4abd-8940-c1c3a6535415
vipinmishra0852/Leetcode
2216-delete-the-middle-node-of-a-linked-list/delete-the-middle-node-of-a-linked-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : val(x), next(nullptr) {} * ListNode(int x, ListNode *next) : val(x), next(next) {} * }; */ class Solution { public: ListNode* middle(List...
ALGO
0.999863
5.495038
{ "github_metadata": { "branch": "main", "commit_count": 827, "repo_created_at": "2024-03-16T21:35:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5df40fd26b...
faa95a2d-5c24-4788-a2f8-68f4fd0074c7
NVIDIA/thrust
thrust/detail/copy_if.h
/* * Copyright 2008-2013 NVIDIA Corporation * * 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...
TOOL
0.969251
7.15335
{ "github_metadata": { "branch": "main", "commit_count": 4758, "repo_created_at": "2012-03-06T01:01:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4980, "forks": 764, "issues": 0, "pull_requests": 8 }, "file_meta": { "content_id": "acc7d...
4994ec17-cdfd-4c69-8770-847e41505e5c
nutan-sangani/CP-Practice
Initial practice 1500-1600/C_Mad_MAD_Sum.cpp
#include <iostream> #include<bits/stdc++.h> #define ll long long #define forLoop for(int i=0;i<n;i++) #define pii pair<int,int> #define pb push_back #define pll pair<ll,ll> #define mp make_pair #define um unordered_map #define us unordered_set #define umll unordered_map<ll,ll> #define omll map<ll,ll> #define vecll vect...
ALGO
0.999985
4.095842
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2024-12-03T11:56: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": "6d76a26dbae...
c0cf774d-58f0-46a7-b47f-0053fb449264
ryujihyeun/Algorithm_Study
03.Brute-Force/I-17071.cpp
#include <bits/stdc++.h> using namespace std; int n,k; const int MAX = 1000000; int visited[MAX + 4], sister[MAX + 4]; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n >> k; if(n == k){ cout << 0 << '\n'; return 0; } queue<int> q; q.pus...
ALGO
0.999977
3.67957
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2024-01-01T08:01: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": "cba8bac6b4f...
4dd3a1c9-d1ed-4c58-98a6-3ca9cc51d532
kassonlab/gmxapi
src/gromacs/linearalgebra/gmx_blas/sgemm.cpp
#include <cctype> #include <cmath> #include "gromacs/utility/real.h" #include "../gmx_blas.h" void F77_FUNC(sgemm,SGEMM)(const char *transa, const char *transb, int *m__, int *n__, int *k__, float *alpha__, float *a, int *lda__, float *b, int *ldb__, ...
ALGO
0.989017
5.434698
{ "github_metadata": { "branch": "master", "commit_count": 19315, "repo_created_at": "2017-05-25T14:05:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 53, "forks": 13, "issues": 93, "pull_requests": 2 }, "file_meta": { "content_id": "cf26...
a24568fe-979f-4a20-9f69-f4f403eb989e
Ashukr321/complete_data_structure_and_algorithms_for_placement
searching_implementation_in_cpp/lenearSearch.cpp
//preprocessor #include<iostream> using namespace std; int linearSearch (int arr[],int target ){ for (int i = 0; i <sizeof(arr)/sizeof(int); i++) { if(arr[i] == target){ return i; } } return -1; } //main start here ... int main(){ int size ; int target; cout<<"enter the size of ...
ALGO
0.996234
4.802718
{ "github_metadata": { "branch": "master", "commit_count": 1737, "repo_created_at": "2024-04-28T12:42:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a057495...
9f406303-5694-48f1-bbdf-a66499df9586
ratnesh-maurya/Educational-Tech-Exploration
C++ and C/C++/Sieve of Eratosthenes/segmented-sieve.cpp
#include <bits/stdc++.h> using namespace std; void simpleSieve(int target, vector<int> &prime){ vector <bool> mark(target + 1, true); mark[0] = mark[1] = false; for (int i=2; i*i < target; i++){ if (mark[i] == true){ for (int j = i*i; j < target; j += i) mark[j] = false; } ...
ALGO
0.999864
4.163249
{ "github_metadata": { "branch": "main", "commit_count": 876, "repo_created_at": "2022-10-01T17:05:04.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 35, "forks": 188, "issues": 4, "pull_requests": 3 }, "file_meta": { "content_id": "5b6befa...
f3801a77-0f66-418f-b4d6-028a5322a0c5
tekinas/RingBuffers
src/tests/fq_test_mr_mw.cpp
#include "ComputeCallbackGenerator.h" #include "util.h" #include <RingBuffers/FunctionQueue.h> #include <RingBuffers/FunctionQueue_MCSP.h> #include <RingBuffers/FunctionQueue_SCSP.h> #include <fmt/format.h> #include <mutex> #include <thread> #include <utility> using namespace util; using namespace rb; using Compute...
TOOL
0.92742
5.003855
{ "github_metadata": { "branch": "master", "commit_count": 173, "repo_created_at": "2021-04-02T14:31: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": "71823c59...
4031b7f2-1d1a-42bb-bf31-a23dd0160cd5
zahidulislamjewel11/learning-stl
stl-algo/minmax.cpp
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <random> #include <ctime> #include <string> #include <cstring> using namespace std; template<class T> void printList(vector<T> &list) { for (auto &element : list) { cout<<element<<" "; } cout<<endl; } int main...
ALGO
0.994341
4.83292
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-09-16T08:24: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": "9f0f766cfe41...
637fa338-04cd-4349-b50a-684a7d2fb978
hbe72/cdsp
include/cdsp/stft.h
// Copyright <NAME> 2017 - 2018 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file ../../LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #if !defined(CDSP_STFT) #define CDSP_STFT #include <algorithm> #include <cassert> #include <vector> #incl...
ALGO
0.993443
6.701223
{ "github_metadata": { "branch": "develop", "commit_count": 38, "repo_created_at": "2018-05-14T11:47:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 24, "forks": 8, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "387b412...
f9932a1b-4f2d-4016-a14f-b9d73a2d6652
imka239/algo
lab3-priority_queue_DSU/F.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cstdio> using namespace std; vector<pair<int, pair<int, int> > > have; vector<pair<int, int> > pre; vector<string> ans; int n, m, k, c, a, b; int get(int now) { if (pre[now].first != now) { pre[now].first = get(pre[now].first); } ...
ALGO
0.999972
3.279907
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2020-10-21T12:32: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": "7d8297cdbe...
cfd6abe2-fd1d-4941-874e-ab29299a10c7
luxe/unilang
source/code/programs/puzzles/hackerrank/bst_swap_test.cpp
#include "code/utilities/types/tree/bst/tree_traversal.hpp" #include "code/programs/puzzles/hackerrank/bst_swap_solution_sliding_window_two_ptrs.hpp" #include "code/programs/puzzles/hackerrank/bst_swap_solution_in_out.hpp" #include "code/programs/puzzles/hackerrank/bst_swap_solution_geeks_five_ptrs.hpp" #include "code/...
TEST
0.985408
4.758764
{ "github_metadata": { "branch": "main", "commit_count": 520, "repo_created_at": "2015-08-06T00:02:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 34, "forks": 13, "issues": 7, "pull_requests": 4 }, "file_meta": { "content_id": "16b70a65...
b843094f-a8ff-4147-8d0e-4040dbf8ff92
21omkarsase/CP
Codeforces/Contests/DIV2-18-8-2022/fraction.cpp
// A. Burenka Plays with Fractions // time limit per test1 second // memory limit per test256 megabytes // inputstandard input // outputstandard output // Burenka came to kindergarden. This kindergarten is quite strange, so each kid there receives two fractions (ab and cd) with integer numerators and denominators. Then...
ALGO
0.999755
5.647338
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2022-04-15T08:26:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f35d126d7d2...
2fa6f9ea-b246-41fd-be8c-744e490dab07
Vertexwahn/third_party
flip-1.3/cpp/tool/commandline.h
/* * Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, thi...
TOOL
0.986537
6.317922
{ "github_metadata": { "branch": "main", "commit_count": 43, "repo_created_at": "2024-02-02T20:22:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c74140469f5...
ae3232a7-b8d5-460a-bcc8-a58a286e6223
praymeta/Code-Up-Algorithm
BOJ_11257_ITPassportExamination.cpp
#include <iostream> using namespace std; int main(void) { int n, num; double a, b, c; cin >> n; for(int i = 0; i < n; i++) { cin >> num >> a >> b >> c; if(a + b + c >= 55 && a >=35 * 0.3 && b >= 25 * 0.3 && c >= 40 * 0.3) { cout << num << ' ' << (int)(a + b + c) << ' ' << "P...
ALGO
0.990217
3.373849
{ "github_metadata": { "branch": "main", "commit_count": 1177, "repo_created_at": "2021-12-04T09:10: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": "d1ea3f550...
a07f72da-ac66-4910-af0e-273138acdc64
livalex/algorithm-analysis
djikstra/algo.cpp
#include "algo.h" #include<bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f inline void scanning(int &number) { int character; bool negFlag; negFlag = 0; character = getchar_unlocked(); if (character == '-') { negFlag = 1; character = getchar_unlocked(); } numb...
ALGO
0.999909
4.169971
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2020-03-08T13:25: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": "796128f43...
3a029511-8f9d-4811-9f97-4572f7187d82
ermine27/competitive-programming
src/atcoder/tessoku-book/A/A51.cpp
#include <bits/stdc++.h> using namespace std; // clang-format off #define rep(i,n) for(int i = 0; i < (int)(n); ++i) using ll = long long; using vi = vector<int>; using vl = vector<ll>; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chm...
ALGO
0.998988
5.165082
{ "github_metadata": { "branch": "main", "commit_count": 418, "repo_created_at": "2022-10-15T09:25: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": "6cb50bee8e...
c0dd683f-b868-423b-a7e0-5bd226bbd568
mumumu6/kyopro
atcoder/abc/abc360/e_ans.cpp
#include <bits/stdc++.h> using namespace std; #include <atcoder/all> using namespace atcoder; using mint = modint998244353; using ll = long long; #define rep(i, n) for (ll i = 0; i < (n); i++) #define reps(i, a, b) for (ll i = (a); i < (b); i++) #define ft first #define sd second #define all(x) std::begin(x), std::en...
ALGO
0.999751
4.611424
{ "github_metadata": { "branch": "main", "commit_count": 197, "repo_created_at": "2024-06-21T10:21: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": "89e0400480...
b3ae2748-5dfd-4b7d-80f4-7d9111b135db
Triadziuch/2048
src/TileMatrix.cpp
#pragma once #include "TileMatrix.h" void TileMatrix::initTextures() { for (int i = 1, k = 0; i < 15; i++, ++k) m_textures[k] = &AssetManager::GetTexture("assets/Textures/" + std::to_string(static_cast<int>(pow(2.f, static_cast<double>(i)))) + ".png"); } int TileMatrix::findID(int type) const { int ID = 0; while...
TOOL
0.90708
5.57222
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2024-01-27T08:43:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a8b9a1491...
da93c2a1-bad6-4579-a25f-6d91bd1c4f98
Moein-Karami/Digital-System-Design
03_Small-scale RT Level Compontents, Iterative Logic/incrementor test generator/main.cpp
#include <bits/stdc++.h> using namespace std; string convert(int x, int n = 8) { string s; for(int i = 0; i < n; i++) { if(x % 2) s += '1'; else s += '0'; x /= 2; } reverse(s.begin(), s.end()); return s; } int main() { vector<string> s; ...
ALGO
0.976278
3.836602
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2020-12-06T18:10: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": "a05b3577886...
bbac0505-c2b7-4a95-84e5-0975eb4e10e4
RTS-SYSU/Timing-Analysis-Multicores
include/PathAnalysis/PathAnalysis.h
//////////////////////////////////////////////////////////////////////////////// // // LLVMTA - Timing Analyser performing worst-case execution time analysis // using the LLVM backend intermediate representation // // Copyright (C) 2013-2022 Saarland University // Copyright (C) 2014-2015 <NAME> // // This file ...
ALGO
0.990912
7.195771
{ "github_metadata": { "branch": "main", "commit_count": 106, "repo_created_at": "2023-07-22T04:25:56.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 54, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "94d56ad125...
cf443015-1a31-4378-8193-6b58fbeb3700
sanhaa/Coding
백준/Gold/23290. 마법사 상어와 복제/마법사 상어와 복제.cc
// BOJ 23290 마법사 상어와 복제 // 4*4 격자: 1~4 인덱스 사용 #include <iostream> #include <vector> using namespace std; const int N = 5; // 4*4 격자 int fdr[] = { 0, 0, -1, -1, -1, 0, 1, 1, 1 }; // fish 방향 1~8 int fdc[] = { 0, -1, -1, 0, 1, 1, 1, 0, -1 }; int sdr[] = { 0, -1, 0, 1, 0 }; // shark 방향 1~ int sdc[] = { 0, 0, -1, 0, 1 }; ...
ALGO
0.999919
4.629977
{ "github_metadata": { "branch": "master", "commit_count": 410, "repo_created_at": "2020-07-14T07:57:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 14, "pull_requests": 0 }, "file_meta": { "content_id": "4dd3c43...
8328fde3-f205-4a95-873f-14f28ec26a01
MAZHARMIK/Interview_DS_Algo
Heap/Maximal Score After Applying K Operations.cpp
/* Scroll below to see JAVA code also */ /* MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=t2tBCpzYl6w Company Tags : will soon update Leetcode Link : https://leetcode.com/problems/maximal-score-after-applying-k-operations */ /*****************************...
ALGO
0.999874
5.262997
{ "github_metadata": { "branch": "master", "commit_count": 5946, "repo_created_at": "2020-07-12T13:13:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2586, "forks": 1357, "issues": 7, "pull_requests": 37 }, "file_meta": { "content_id": "...
8df44519-c707-4ce7-9687-d9c3a52f2b34
ziglang/zig
lib/libcxx/include/__numeric/reduce.h
// -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===------------...
ALGO
0.998573
7.613969
{ "github_metadata": { "branch": "master", "commit_count": 34092, "repo_created_at": "2015-08-06T00:51:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 40012, "forks": 2915, "issues": 3389, "pull_requests": 267 }, "file_meta": { "content_i...
30bfc65a-fa61-4b24-b6cb-dd3820e5323f
linodurannn/Practica-C-
Primer Programa con Coment.cpp
/* Titulo: Primer programa con comentarios Autor: <NAME> Descripcion: Primer programa para analizar su estructura. Fecha: 2024-01-10 */ #include <iostream> //Inclusion de la librearia de entrada y salida. using namespace std; //El uso de espacio de nombre para STD de la I/O. int main() //Funcion principal main par...
ALGO
0.998676
3.336887
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2024-01-11T01:12: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": "5f40c708c60...
55984139-58c3-49d6-afe5-f6d7db31e2b5
muhammadshiblinoman/Codeforces
1676E.cpp
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while(t--){ int n , q; cin >> n >> q; //cout << n << q; vector<int>arr(n+3); int ar[n+3]; for(int i = 0; i < n; i++){ cin >> arr[i]; } sort(arr.rbegin() ,...
ALGO
0.999925
3.815075
{ "github_metadata": { "branch": "main", "commit_count": 124, "repo_created_at": "2023-07-18T16:13:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0ce8c1ce92...
6db3b4b0-7d9f-4f51-a3ef-925e2526afd8
Parth0105/competitiveprog.-track
2020/September/equidiv.cpp
#include <bits/stdc++.h> using namespace std; long long int findMin(long long int arr[],long long int n) { // Calculate sum of all elements long long int sum = 0; for (long long int i = 0; i < n; i++) sum += arr[i]; bool dp[n+1][sum+1]; for (long long int i = 0; i <= n; i++) dp[i][0] = true; for (long long i...
ALGO
0.999879
3.463496
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2020-07-17T14:52:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "215f5a914...
9ef69846-b212-4d3d-a390-f3520a9128a7
xdtianyu/android-4.3
packages/inputmethods/LatinIME/native/jni/src/correction.cpp
/* * Copyright (C) 2011 The Android Open Source Project * * 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 app...
ALGO
0.998413
6.274064
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2013-07-29T07:46:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 15, "forks": 9, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "0b3dc2b8b...
04541a1e-d16a-4fbd-9244-12cff88e5913
sanjeet-jain/InsertionSort_MergeSort_HW1
CS590_hw1_code/sort.cpp
#include <cstdio> #include <cstdlib> #include <iostream> #include "sort.h" int ivector_length(int *v, int n) { int sum; sum = 0; for (int i = 0; i < n; i++) sum += (v[i] < 0) ? -v[i] : v[i]; return sum; } /* * insertion sort * A is the pointer to the array * r is the last index of the array ( index o...
ALGO
0.999926
4.385927
{ "github_metadata": { "branch": "main", "commit_count": 29, "repo_created_at": "2022-09-28T03:39: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": "d849a55f4d8...
4c3b8c4f-76b8-4bde-a106-0a0c9e8b544b
ofthegoats/57-Exercises
22 - Comparing Numbers/C++/main.cpp
#include <algorithm> #include <iostream> template <int Size> int highest_intarr(int (&arr)[Size]) { int h = arr[0]; // not checking because maxsize is a thing in main() for (int i : arr) { if (i > h) h = i; } return h; } template <int Size> bool hasduplicates_intarr(int (&arr)[Size...
ALGO
0.999153
5.32734
{ "github_metadata": { "branch": "master", "commit_count": 97, "repo_created_at": "2020-04-15T12:20:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c68f64626...
4ef88173-27f5-4c8b-b489-7365a23132ca
shilpa1-naik/Hacking
leetcode/095_uniqueBinSearchTrees_II_dynProg.cpp
// ------------------------------------------------------------------------------------- // Author: <NAME> (cbrghostrider); Copyright - All rights reserved. // For email, run on linux (perl v5.8.5): // perl -e 'print pack "H*","736f75726162682e732e6a6f73686940676d61696c2e636f6d0a"' // --...
ALGO
0.999979
5.546049
{ "github_metadata": { "branch": "master", "commit_count": 390, "repo_created_at": "2015-10-14T16:53:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2c7a4b2b...
9ec2f848-91a9-46b0-b1a4-69c9bd6f5f7d
MorozkoDaddy/allwork
codeOOPplus/c9.cpp
#include <iostream> #include <fstream> #include <vector> int main() { const int N = 10; // Количество чисел для записи в файл const std::string FILE_NAME = "numbers.dat"; // Имя файла // Создание вектора с числами std::vector<double> numbers(N); for (int i = 0; i < N; ++i) { numbers[i] = i + 1.0; // Генера...
ALGO
0.991878
4.297677
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2025-03-14T09:02:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "5337dd668c3...
0f8771d2-5c55-4de4-b0d6-7b3327b81476
kj1241/Algorithm_Portfolio
Algorithm/Algorithm-Portfolio/KarpRabin/main.cpp
#include <iostream> #include <fstream> #include <cmath> #include <string> #define MAX_BUFFER 512 using namespace std; // Hash 함수: 문자열의 해시 값을 계산 int Hash(const string& String, int Size) { int HashValue = 0; for (int i = 0; i < Size; ++i) { HashValue = String[i] + (HashValue * 2); } return HashV...
ALGO
0.999012
5.015233
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2024-02-22T09:36: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": "dc9dca8fbc9...
7f57620b-9839-439d-b261-3f9d0d88f348
sourav600/Problem-Solving
Codeforces/17A.cpp
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define nl '\n' #define pi acos(-1) #define ll long long #define For(i,n) for(ll i=0; i<n; i++) #define mem(a,b) memset(a,b,sizeof(a)) #define all(x) x.begin(), x.end() #...
ALGO
0.99999
4.019311
{ "github_metadata": { "branch": "main", "commit_count": 637, "repo_created_at": "2022-02-14T04:24:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ec914482ce...
a402a71e-61a9-449a-be4d-0c55df88d331
Shahan362/CP_templates-
stringHash_Abid.cpp
#include <bits/stdc++.h> using namespace std; // Speed #define Code ios_base::sync_with_stdio(false); #define By cin.tie(NULL); #define Abid cout.tie(NULL); using vi = vector<int>; using vs = vector<string>; using ll = long long; // #define int long long #define endl '\n' #define print(x) cout << " >> " << #x << " : " ...
ALGO
0.999819
5.02365
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-02-26T08:18:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7adf2e706b7...
d88fb4f3-c72c-414a-9b82-529c4767d92e
OnionZ327/ECM13.0
source/App/CabacTraining/main.cpp
#include <iomanip> #include <iostream> #include <fstream> #include <string> #include "program_options_lite.h" #include "Contexts.h" #include "io.h" #include "optimization.h" #include "simulator.h" using namespace std; namespace po = df::program_options_lite; static constexpr int CNU = 35; int main( int argc, char **...
DATA
0.972749
6.119247
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-07-20T05:12: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": "6b06354eb207...
44237953-3260-48ea-b585-f14459dbe431
Anichattrjee/DSA-Leetcode-Solutions
0084-largest-rectangle-in-histogram/0084-largest-rectangle-in-histogram.cpp
class Solution { public: int largestRectangleArea(vector<int>& a) { int n=a.size(); vector<int>nsr; vector<int>nsl; vector<int>width; stack<pair<int,int>>st; //finding the nsr index for(int i=n-1;i>=0;i--) { if(st.empty()) { ...
ALGO
0.999426
5.750387
{ "github_metadata": { "branch": "main", "commit_count": 298, "repo_created_at": "2024-01-24T23:40:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5bbdb3297...
01d7bcac-3638-4cee-97fe-b4d714b3e800
stefdasca/CompetitiveProgramming
Codeforces/Codeforces Round #552/CF1154-D3-F.cpp
#include<bits/stdc++.h> #define ll long long #define fi first #define se second using namespace std; int n, m, k, v[200002]; struct ve { int y, x; }; ve pp[200002]; int dp[2002]; int sp[2002]; bool viz[2002]; int main() { ios_base::sync_with_stdio(0), cin.tie(0); cin >> n >> m >> k; for(int i = 1; i <=...
ALGO
0.999978
3.325738
{ "github_metadata": { "branch": "master", "commit_count": 917, "repo_created_at": "2018-09-28T18:19:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 48, "forks": 7, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "449fcb9...
479f2585-19d6-48da-ad30-94beedfd3a92
xizhonghua/lintcode
Graph-Valid-Tree.cpp
class Solution { public: typedef unordered_map<int, vector<int>> G; /** * @param n an integer * @param edges a list of undirected edges * @return true if it's a valid tree, or false */ bool validTree(int n, vector<vector<int>>& edges) { // Write your code here G g; ...
ALGO
0.999953
6.243052
{ "github_metadata": { "branch": "master", "commit_count": 177, "repo_created_at": "2015-01-20T15:34:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "563ffc64...
507a54b0-7027-4c6a-97b1-11e5edad724e
raincross7/code-similarity
codes/train_code/problem006/problem006_375.cpp
#include<iostream> #include<vector> using namespace std; vector<int> ans; int cf[20][20]; bool field[20][20]; int w,h; void dfs(int i,int j,int count); int main(){ while(1){ cin >> w >> h; if(w + h == 0) break; for(int i = 0;i < 20;i++){ for(int j = 0;j < 20;j++){ cf[i][j] = -1; field[i][j] = false;...
ALGO
0.999236
3.653801
{ "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": "a927b58a97da...
d1c86334-0533-49e9-b828-1f5cabe7219f
kyad/atcoder
abc324/d/a.cc
#include <algorithm> #include <cassert> #include <iostream> #include <map> #include <vector> using namespace std; long long mx = 10000000000000; vector<int> f(long long x) { vector<int> ans; while (x > 0) { int d = x % 10; if (d != 0) { ans.push_back(d); } x /= 10; } sort(ans.begin(), an...
ALGO
0.999782
4.370568
{ "github_metadata": { "branch": "master", "commit_count": 889, "repo_created_at": "2021-08-26T14:42: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": "240125e8...
0d026502-55b0-4911-a998-48f30bd8922c
dune-mirrors/dune-fem
dune/fempy/geometry/edgelength.hh
#ifndef DUNE_FEMPY_GEOMETRY_EDGELENGTH_HH #define DUNE_FEMPY_GEOMETRY_EDGELENGTH_HH #include <limits> #include <dune/geometry/referenceelements.hh> #if __GNUC__ >= 13 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdangling-reference" #endif namespace Dune { namespace FemPy { // edgeLength ...
TOOL
0.972324
7.015376
{ "github_metadata": { "branch": "master", "commit_count": 13439, "repo_created_at": "2017-08-03T11:55:22.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "19ab266...
1d6d5cd2-a964-4a98-87d7-145a44cf90b5
trex-ayush/Company-Interview-Problem
Difficulty: Medium/Group Balls by Sequence/group-balls-by-sequence.cpp
class Solution { public: // Approach 2: Optimal // T.C: O(nlogn + n*k) = O(nlogn) // S.C: O(n) bool validgroup(vector<int> &arr, int k) { int n = arr.size(); if(n % k) return false; map<int, int> freq; for (int num : arr) { freq[num]++; } ...
ALGO
0.999935
5.600563
{ "github_metadata": { "branch": "main", "commit_count": 196, "repo_created_at": "2025-01-04T16:16:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "58661aefdf...
90eb809e-7ec2-43f1-b3fc-73aa89dfd0da
Tanbir-Hasan-247/competitive-programming
Superincreasing.cpp
#include <bits/stdc++.h> using namespace std; bool isSuperincreasing(int n, int k, int x) { vector<int> a(n); a[k - 1] = x; for (int i = k - 1; i >= 0; i--) { if (i == 0) { if (a[i] <= 1) return false; continue; } a[i - 1] = a[i] -...
ALGO
0.999784
4.467593
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-07-02T19:18: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": "a85399337d32...
c61b531a-9135-4ab9-996c-0820dc29518e
Maximusthr/Programacao-Competitiva
atcoder/contest/Beginner-403-27-04-2025/C_403_Forbidden.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fll; const int MAX = 2e5+10; vector<vector<int>> g(MAX); vector<bool> vis(MAX); int main(){ ios_base::sync_with_stdio(0); cin.tie(NULL); int n, m, q; cin >> n >> m >> q; ...
ALGO
0.999968
4.30962
{ "github_metadata": { "branch": "main", "commit_count": 618, "repo_created_at": "2025-02-09T20:56: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": "9d02b7d04b...
144215ad-a9a5-464b-a171-34be3760fd15
takuron/Lesson-Exercises
Cpp-Programming(ZUCC)/Experiment4/4-6/Triangle-class.h
#pragma once #include "stdafx.h" class Triangle { public: Triangle(int x,int y,int z); int isTriangle() { if (a + b > c&&a + c > b&&b + c > a) { int sideflag = 0; cout << "能构成三角形"; if (a == b&&b == c) { cout << ",并且是一个等边三角形" << endl; } else if (a == b || b == c || c == a) { cout << ",并且是一个...
ALGO
0.960242
3.980697
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2020-06-27T14:53: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": "3a2786e82...
cc7ca0a4-ecce-445a-9634-f7ac61e07bc3
Haniifaa/algoritma-pemrograman
alpro/main.cpp
#include <iostream> /* Pertemuan 2 Judul: Jam menit detik */ using namespace std; int main() { /* //KAMUS int x,hh,sisaDetik,mm,ss; //algoritma cout << "Masukkan detik = "; cin>>x; hh=x/3600; sisaDetik=x%3600; mm=sisaDetik/60; ss=sisaDetik%60; cout<< x <<" detik sama deng...
ALGO
0.998523
3.242074
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2023-11-25T12:38: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": "d27ec6078ad7...
1eb1b26b-e73e-48d7-9743-929f0db59f21
sanjusss/leetcode-cpp
0/300/310/313.cpp
/* * @Author: sanjusss * @Date: 2021-08-10 16:51:41 * @LastEditors: sanjusss * @LastEditTime: 2021-08-10 17:39:22 * @FilePath: \0\300\310\313.cpp */ #include "leetcode.h" // class Solution { // public: // int nthSuperUglyNumber(int n, vector<int>& primes) { // priority_queue<pair<int64_t, int>, vecto...
ALGO
0.99982
6.089023
{ "github_metadata": { "branch": "master", "commit_count": 2055, "repo_created_at": "2019-04-04T03:17: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": "1460851...
55d1d6fe-8736-4eb5-a862-8e7010e71c47
built-with-aman/Competitve-CPP-Coding
Basics/Pattern/tempCodeRunnerFile.cpp
int main() { // int row, col, space; // // Upper half // for (row = 5; row >= 1; row--) { // // Left numbers // for (col = row; col <= 5; col++) { // cout << col << " "; // } // // Spaces // for (space = 1; space <= 2 * (row - 1); space++) { // cout << " "; // } // // R...
ALGO
0.999701
4.103792
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2025-06-27T22:15: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": "b850b897b9d...
f5e2077f-0eb4-4e58-b1c0-278b6d4ef01b
ishandutta2007/codeforces-s
syury/normal/615/D.cpp
#include<bits/stdc++.h> using namespace std; typedef long long lint; typedef long double ldb; typedef unsigned long long uli; #define X first #define Y second #define F(i, l, r) for(auto i = l; i != r; i++) #define Df(i, l, r) for(auto i = l; i != r; i--) #define I(i, a) for(auto i : a) #define pb push_back #define r...
ALGO
0.999954
3.982357
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T16:07: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": "566512ef49d0...
691f13d6-414e-4b92-a14f-c2c4a1ac449e
MOLAorg/mp2p_icp
mp2p_icp_filters/include/mp2p_icp_filters/PointCloudToVoxelGrid.h
/* ------------------------------------------------------------------------- * A repertory of multi primitive-to-primitive (MP2P) ICP algorithms in C++ * Copyright (C) 2018-2024 <NAME>, University of Almeria * See LICENSE for license information. * -------------------------------------------------------------------...
ALGO
0.931057
6.954523
{ "github_metadata": { "branch": "develop", "commit_count": 667, "repo_created_at": "2019-06-07T07:57:39.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 182, "forks": 25, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b1c32...
188e6a00-52be-4e91-a23b-8450442a69ef
kartoza/openModeller
ex_openmodeller/algorithms/csmkg.cpp
// // CsmKG // // Description: Csm implementation using Keiser-Gutman cutoff to discard components // // // Author: CRIA <<EMAIL>>, (C) 2004 // // Copyright: See COPYING file that comes with this distribution // // #include <string.h> #include "csmkg.hh" #include <gsl/gsl_statistics_double.h> #include <gsl/gsl_multif...
ALGO
0.996033
5.980981
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2018-07-25T06:39:46.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bc488dea153...
730010f6-e2c1-4e6d-8ebc-f6bbc2d3d973
mwall-dev/LeetCode
Medium/1110_Delete_Nodes_BT.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.999675
6.27629
{ "github_metadata": { "branch": "main", "commit_count": 169, "repo_created_at": "2021-01-11T07:48:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "db07d2672b...
41048932-0c8e-44fd-882a-c34b09ad2f70
ar0ne/labs
some_from_1year/spline.cpp
/* * spline.cpp * * Created on: 30.05.2013 * Author: LOL */ /* y = arctg (x) * 5 узлов * [0 , 2] */ /* #include <iostream> #include <locale.h> using namespace std; #include <iomanip> #include <math.h> float f(int i){ float y,x; x = 0.5 * i; y = atan(x); return y; } void solve() { double mass[5]; d...
ALGO
0.999146
4.008804
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2013-09-19T19:41: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": "942b096d1b...
a98d2b05-3643-43b7-be91-c0a5a9114c7e
BackupTheBerlios/armor-svn
source/featureLib/features/LBP.h
/* Local Binary Patterns (LBP), following Ojala et al. * * Copyright (C) 2007 -- <NAME> <<EMAIL>> */ #ifndef FEATURES_LBP_H #define FEATURES_LBP_H #include <vector> #include <gmm/gmm.h> #include <vigra/stdimagefunctions.hxx> #include "DenseFeature.h" #include "utility.h" namespace Features { /* We use the exact...
ALGO
0.992472
7.176718
{ "github_metadata": { "branch": "master", "commit_count": 152, "repo_created_at": "2015-08-13T16:44: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": "b528f37e...
5b75fc17-ef42-4e38-b84c-f34dcfea22c2
bhaveshgawri/codeforces
B/300.cpp
#include <bits/stdc++.h> #define ll long long int #define nl "\n" #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define sz(x) x.size() #define all(x) x.begin(), x.end() #define Sort(x) sort(all(x)) #define init(x, k) fill(a...
ALGO
0.999964
3.757442
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2017-01-06T18:31:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "21cd80e35...
0f9919d0-d6b3-48f6-a6f6-eff77e70a734
zhuhaochuan/Leetcode
520. Detect Capital.cpp
/* 判断一个输入的字符串是否满足大写要求 以下几种合法 全部大写 首字母大写 全部小写 */ class Solution { public: bool detectCapitalUse(string word) { int len = word.size(); if(len==1) return true; int tag = 0; if(!isupper(word[0])) { tag = 1; } if(tag==1) { for(int i=1;i<len;i++) { if(!islower(...
ALGO
0.999102
5.462586
{ "github_metadata": { "branch": "master", "commit_count": 307, "repo_created_at": "2017-11-19T13:28:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5d9066c7...
5b9ccb06-6373-4440-bbbc-3f3953c74fae
ElitsaY/Design_and_analysis_of_algorithms_practicum
group-2-Stoyan-Dani/10 - 11.05.2023/Unbelievable_Array.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 310000 int t, n, q, a[MAX], b, par[MAX], depth[MAX], color[MAX], repres[MAX], br, w, e, r; int find(int a) { if(par[a] == 0)return a; return par[a] = find(par[a]); } void uni(int a, int b, int col) { a = find(a); b = find(b); if(a == b)return ; if(dep...
ALGO
0.999936
4.530229
{ "github_metadata": { "branch": "main", "commit_count": 200, "repo_created_at": "2022-03-26T19:32:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "36763cc724...
4f06474a-cc63-4f2b-8e04-7fb8580ab616
leminh2404/Code
C++/CTDLvGT/DSLK.cpp
#include "iostream" #include "cstdlib" #include "conio.h" using namespace std; struct node { int data; node *next; }; typedef struct node NODE; NODE *taoptu(int x) { NODE *tmp = new NODE; tmp->data = x; tmp->next = NULL; return tmp; } NODE *themNODEvaodaudslk(NODE *Head, int x) { NODE *tmp =...
ALGO
0.999812
3.926003
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-08-25T10:09: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": "debd88c48d1...
8a2e06cf-7c7e-412a-82a4-6b9d753e896c
codeplay0314/LeetCode
codes/1568.pseudo-palindromic-paths-in-a-binary-tree.cpp
/* * @lc app=leetcode id=1457 lang=cpp * * [1457] Pseudo-Palindromic Paths in a Binary Tree */ // @lc code=start /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode...
ALGO
0.999936
6.201047
{ "github_metadata": { "branch": "master", "commit_count": 232, "repo_created_at": "2020-05-12T14:20: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": "8ea02117...
bb36a68f-a5de-490c-9dd4-8a63d8225590
libmv/libmv
src/third_party/ssba/Apps/bundle_varying.cpp
/* Copyright (c) 2008 University of North Carolina at Chapel Hill This file is part of SSBA (Simple Sparse Bundle Adjustment). SSBA is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the ...
ALGO
0.987999
5.96906
{ "github_metadata": { "branch": "master", "commit_count": 859, "repo_created_at": "2011-05-17T07:35:40.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 318, "forks": 83, "issues": 5, "pull_requests": 2 }, "file_meta": { "content_id": "603eaa...
e452a904-362b-4378-85b8-4530fcb7384e
RDindahouse/Lab_4
Task_4/4-4.cpp
/* Дан одномерный массив целых чисел. Выбрать из массива все четные числа и упорядочить их по возрастанию. */ #include <iostream> using namespace std; // Сортировка методом вставки void insertionSort(int arr[], int n) { for (int i = 1; i < n; i++) { int key = arr[i]; int j = i - 1; while ...
ALGO
0.999877
5.291041
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2023-03-14T16:06: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": "3eeac857b...
60c8da89-fa4e-49b6-a29f-b8264bb2bb52
ishandutta2007/codeforces-a
anta/normal/739/A.cpp
#include "bits/stdc++.h" using namespace std; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i)) #define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i)) static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL; typedef vector<...
ALGO
0.999988
3.177179
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51: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": "f7497be764f5...
a219a976-694c-4758-80d1-2932da2f9a01
buckeye-cn/ACM_ICPC_Materials
solutions/kattis/naq16/dotsboxes_hcz.cpp
// https://open.kattis.com/problems/dotsboxes #include <cstdlib> #include <cstdint> #include <cstdio> #include <cmath> #include <cstring> #include <string> #include <vector> #include <iostream> using namespace std; template <long N> struct Dinic { struct Edge { long from, to, cap; }; vector<Edge...
ALGO
0.999922
4.707791
{ "github_metadata": { "branch": "master", "commit_count": 1094, "repo_created_at": "2017-09-09T18:26:27.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 40, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9dd4443...
9097a7a9-5457-44aa-b3db-0fa7612afd21
umaidansari12/CP_Backup
6_dp/maximize_the_cut_segments.cpp
#include<bits/stdc++.h> using namespace std; int maximizeTheCuts(int n, int x, int y, int z); int main() { //taking testcases int t; cin >> t; while (t--) { //taking length of line segment int n; cin >> n; //taking types of segments int x, y, z; ci...
ALGO
0.999712
4.869092
{ "github_metadata": { "branch": "main", "commit_count": 1213, "repo_created_at": "2021-06-27T07:26:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4055c48a1...
07697d82-7659-4824-9568-3d1fad610a30
k8440009/Algorithm
BOJ/15685_3.cpp
// 드래곤 커브 // https://www.acmicpc.net/problem/15685 #include <iostream> using namespace std; const int MAX = 100 + 1; int N; int board[MAX][MAX]; int dy[4] = {0, -1, 0, 1}; int dx[4] = {1, 0, -1, 0}; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> N; for (int i = 0; i < N; i++)...
ALGO
0.999414
4.426754
{ "github_metadata": { "branch": "master", "commit_count": 762, "repo_created_at": "2019-08-04T15:03:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 12, "pull_requests": 0 }, "file_meta": { "content_id": "18797b1...
907f5b45-be7d-4b7f-a7cd-3efe23c8ca8a
huzaifa9999/leetcode-practice
Medium/Find All Four Sum Numbers/find-all-four-sum-numbers.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function template for C++ class Solution{ public: // arr[] : int input array of integers // k : the quadruple sum required vector<vector<int> > fourSum(vector<int> &nums, int target) { sort(num...
ALGO
0.999368
5.544532
{ "github_metadata": { "branch": "main", "commit_count": 953, "repo_created_at": "2023-05-15T16:22:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a992c5aaf9...
6601213a-f7a5-4219-8295-ca647890f3fb
wcsanders1/LeetCode
MinimumSwapsToGroupAll1sTogetherII/CPP/MinimumSwapsToGroupAll1sTogetherII.cpp
// https://leetcode.com/problems/minimum-swaps-to-group-all-1s-together-ii/description/?envType=daily-question&envId=2024-08-02 #include <vector> #include <unordered_set> #include <queue> #include <stack> using namespace std; class Solution { public: int minSwaps(vector<int> &nums) { int ones = 0; for (in...
ALGO
0.999975
6.341402
{ "github_metadata": { "branch": "master", "commit_count": 805, "repo_created_at": "2020-04-04T21:50:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef7bc9ec...
8c778d53-13ad-4490-be0e-1e676a944106
kawaiwu2001/imageProcessing
processing.cpp
#include "bmp.h" #include <cmath> #include <QDebug> #include <iostream> #include <vector> #include <math.h> #include <algorithm> using namespace std; const int N = 2048; bool flag[N]; void bubble_sort(int* arr,int num){ for(int i = 0;i < num-1;i++){ for(int j = 0; j < num-i-1; j++){ if(arr[j] >...
ALGO
0.997071
4.216679
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-10-06T17:09: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": "44888c7b6b...
13d5acb7-4138-451d-86a9-227e0cec92a2
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Mixtral/top0-100/find-edges-in-shortest-paths-Solution.findAnswer/177860_Exec_Code_Bypass.cpp
zrestore(i_ctx_t *i_ctx_p) { os_ptr op = osp; alloc_save_t *asave; bool last; vm_save_t *vmsave; int code = restore_check_operand(op, &asave, idmemory); if (code < 0) return code; if_debug2m('u', imemory, "[u]vmrestore 0x%lx, id = %lu\n", (ulong) alloc_save_clie...
ALGO
0.958795
4.596913
{ "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": "f39a9380ea05...
3b472ad3-d9ff-49e2-afd3-c498ba037400
liyiji/LeetCode
096_Construct_Binary_Tree_from_Inorder_and_Postorder_Traversal.cpp
/* * Construct Binary Tree from Inorder and Postorder Traversal * Total Accepted: 8953 Total Submissions: 34352 * * Given inorder and postorder traversal of a tree, construct the binary tree. * * Note: * You may assume that duplicates do not exist in the tree. */ /** * Definition for binary tree * struct Tree...
ALGO
0.999928
6.072923
{ "github_metadata": { "branch": "master", "commit_count": 226, "repo_created_at": "2014-06-02T13: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": "d6719c9f...
4900ffe3-335f-4f70-9dea-5cf52e2ea397
Yawn-Sean/Daily_CF_Problems
daily_problems/2025/03/0329/personal_submission/cf380a_lyxxys.cpp
void solve(){ const int limi = 1e5+10; int m, n; cin >> m; vector<array<int,2>> types; vector <i64> w(m); vector <int> ori; for (int i = 0, type, l, c; i < m; ++ i){ cin >> type; if (type == 1){ cin >> l; types.push_back({l, -1}); w[...
ALGO
0.999978
3.905058
{ "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": "5bae...
85a2df00-7591-4931-ba7a-07cb0152849e
developercheems/CN
Parity_Bit.cpp
#include <bits/stdc++.h> using namespace std; class ParityCheck { public: vector<int> msg; int size, count; void getData(); int parityChecker(vector<int> msg, int n); void displayData(vector<int> msg, int n, int pb); }; void ParityCheck::getData() { int m; cout<<"...
ALGO
0.999824
4.713774
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-11-28T04:58:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cbc755dc2e11...