uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c880eeb5-e73f-4a62-858d-6326ebafd12e | noko206/AtCoder | abc/351-400/400/d.cpp | // clang-format off
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#define _overload3(_1,_2,_3,name,...) name
#define _REP(i,n) REPI(i,0,n)
#define REPI(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,R... | ALGO | 0.999654 | 4.748721 |
74a2d022-35b3-4bae-8a54-a3cb39538fab | DcmTruman/my_acm_training | CodeForces/816B/10042822_AC_1123ms_2824kB.cpp | #include<iostream>
using namespace std;
int ADD[200000+100];
int main()
{
int m,n,q;
cin>>m>>n>>q;
for(int i = 0;i<m;i++)
{
int a,b;
cin>>a>>b;
ADD[a]++;
ADD[b+1]--;
}
for(int i = 1;i < 200100;i++)
{
ADD[i] +=ADD[i-1];
}
for(int i = 1;i < 200100;i++)
{
ADD[i] =ADD[i-1]+ (ADD[i]>=n);
}
for(int i ... | ALGO | 0.99995 | 3.695613 |
cdb12fb0-6d7b-4724-98a5-898a9ec0096c | saurav727767/c--_program | dynamic_initialization_of_objects_using_constructors.cpp | #include<iostream>
using namespace std;
class BankDeposit{
int principal;
int years;
float interestRate;
float returnValue;
public:
BankDeposit(){}
BankDeposit(int p, int y, float r); // r can be a value like 0.04
BankDeposit(int p, int y, int r); // r can be a value like 1... | ALGO | 0.924085 | 3.9258 |
93e80e48-d0b1-4cf1-bcdd-f400be9cf8a2 | Sosuke23/LeetCode | 2265-partition-array-according-to-given-pivot/2265-partition-array-according-to-given-pivot.cpp | class Solution {
public:
vector<int> pivotArray(vector<int>& nums, int pivot) {
vector<int> less, more;
for (auto x : nums) {
if (x < pivot) {
less.push_back(x);
} else if (x > pivot) {
more.push_back(x);
}
}
int pi ... | ALGO | 0.999978 | 6.38725 |
70a82d3c-ce0c-4d47-9b4f-814f1ee99a1b | imchanyang/OOP2 | Week2/Week2-3/main.cpp | #include <iostream>
using namespace std;
int main() {
const double PI = 3.14159;
double radius;
double perimeter;
double area;
cout << "원의 반지름 입력: ";
cin >> radius;
perimeter = 2 * PI * radius;
area = PI * radius * radius;
cout << "반지름: " << radius << endl;
cout << "둘레: " <<... | ALGO | 0.98177 | 4.501802 |
48beb949-9bb7-4c0b-b008-68e633c170c6 | jodyxha/QHG4 | QHG4/populations/FlatExpPop.cpp | #include <omp.h>
#include <hdf5.h>
#include "EventConsts.h"
#include "BitGeneUtils.h"
#include "SPopulation.cpp"
#include "Prioritizer.cpp"
#include "LayerBuf.cpp"
#include "LayerArrBuf.cpp"
#include "Action.cpp"
////////////////////////////
#include "WeightedMove.cpp"
//#include "ConfinedMove.cpp"
#include "SingleE... | ALGO | 0.975344 | 4.996594 |
bb2a02e7-b516-46a3-b22a-aa68fda33447 | MattMisolas/midTermProject | MidtermProj/Product.cpp | void multGame()
{
//local variables
int Product;
int Answer;
int correct = 0;
int wrong = 0;
//local constants
const int QUIT = -1;
const int MAX = 10;
// Seed the random number generator.
unsigned seed = (unsigned)time(NULL);
srand(seed);
/************************START main program*********************... | TOOL | 0.986198 | 3.319946 |
1f21b269-ddd7-4079-947c-68d90279d74e | nayeem003/CP | array_cancellation.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
int arr[n+1];
for (int i = 1; i<=n; i++) cin >> arr[i];
long long pos = 0;
long long rem_neg = 0;
for (int i = 1; i<=n; i++)
{
... | ALGO | 0.999859 | 4.191339 |
cdc0c082-1c2d-4bbd-ba78-2ce476047ab3 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/evaluate-the-bracket-pairs-of-a-string-Solution.evaluate/177906_DoS_Exec_Code_Overflow.cpp | SplashPath *Splash::makeDashedPath(SplashPath *path) {
SplashPath *dPath;
SplashCoord lineDashTotal;
SplashCoord lineDashStartPhase, lineDashDist, segLen;
SplashCoord x0, y0, x1, y1, xa, ya;
GBool lineDashStartOn, lineDashOn, newPath;
int lineDashStartIdx, lineDashIdx;
int i, j, k;
lineDashTotal = 0;
... | ALGO | 0.995654 | 4.546488 |
e915545d-a3e3-4b1a-b01b-c1d6a66ce9e6 | wouf/hj191 | DataFormats/GeometrySurface/test/testGeometricSort.cpp | #include "Utilities/General/interface/precomputed_value_sort.h"
#include "DataFormats/GeometrySurface/interface/Plane.h"
#include "DataFormats/GeometrySurface/interface/GeometricSorting.h"
#include <iostream>
#include <iterator>
using namespace std;
using namespace geomsort;
typedef Surface::PositionType PositionType... | ALGO | 0.930456 | 4.883698 |
babcac3d-85fe-472c-a2e8-ed1ea47e1c4a | thaisonhp/UDTT | Hoc_UDTT/bai3_schedule.cpp | #include<iostream>
#include<vector>
using namespace std ;
struct congviec{
double start ;
double finish ;
};
void sort(double s[],int n){
/*
Ham nay de xap sep tang dan vi no yeu cau lay toi da so luong chai
*/
for(int i = 0 ; i < n ;i++){
for(int j = i ; j < n ; j++){
if(s[j] < s[i]){
int tmp = s[i] ... | ALGO | 0.999824 | 4.253612 |
8c23e5fe-22f6-43bd-937d-0c3fe30acabb | IMPranshu/DSA-C- | firstRepeating numbers.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cout<<"\nEnter size:";
cin>>n;
int a[n];
for(int i =0 ;i<n;i++){
cin>>a[i];
}
const int N = 1e5+2;
int idx[N];
for(int i =0 ;i<N;i++){
idx[i]=-1;
}
int minidx = INT_MAX;
for(int i =0 ;i<n;i++){
if(idx[a[i]] != -1){
minidx= min... | ALGO | 0.999962 | 4.311064 |
443a66d6-5795-4f04-8cc8-0cbc7485746c | shivani26-bot/DSA-questions | 0005-longest-palindromic-substring/0005-longest-palindromic-substring.cpp | class Solution {
public:
// s=babad
// try all the possible substrings, and check whether they are palindromic substrings or not
// b, ba, bab, baba, babad, a, ab, aba, abad, b, ba, bad, a, ad, d
// b abad b a bad
// i,j i j
// b a bad bab ad baba d
// i j i j i j
// b a bad b a bad ... | ALGO | 0.999945 | 6.535461 |
5e227996-b4e5-4de4-b831-deec2a56e992 | atharv-asr-group/cses_solvings | cses_roadConstruction.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<functional>
#include<cstring>
#include<array>
#include<set>
#include<numeric>//for iota
#include<algorithm>
#include<map>
#define ll long long
using namespace std;
#define ar array
//road construction and road repairation are similar
//disjoint sets problems... | ALGO | 0.999853 | 3.986202 |
0f2ac558-9ee7-4257-a45e-c3211fb2cc20 | tmlishuai2/Algorithms | data_structure_learning/hash_learning/hash_learning/C++.cpp | #include<iostream>
#include<unordered_map>
using namespace std;
class Quadruplets :public vector<int> {
public:
Quadruplets(vector<int> v) {
this->push_back(v[0]);
this->push_back(v[1]);
this->push_back(v[2]);
this->push_back(v[3]);
}
Quadruplets(int a, int b, int c, int d) {
this->push_back(a);
this->p... | ALGO | 0.978813 | 4.599658 |
2ba45474-eb06-4cc2-b82c-b540b28acc7b | linux4life798/llvm-project-ci-test | llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp | #include "llvm/Transforms/Utils/BreakCriticalEdges.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/LoopInfo.h"
#inclu... | TOOL | 0.999418 | 7.663181 |
ea20109b-c594-4c4f-a7cf-e504bca781eb | ashishnagpal2498/CPP_Concepts_and_Codes | CodeChef-Problems/New/LunchTimeAugust/ratingAndRanking.cpp | // rating and ranking
#include<bits/stdc++.h>
#define ll long long int
#define endl "\n"
#define ArrIn(n) for(int i=0;i<n;i++)
#define ArrOut for(int i=0;i<n;i++) {cout<<arr[i]<<" "; }
#define mod 1e9+7
using namespace std;
ll t,n,m;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>t;
... | ALGO | 0.999809 | 3.534246 |
76d20429-afdb-406d-a404-4b3c2adf2b97 | Saurav7012/DSA-in-Cpp | Recursion/factorial.cpp | #include <iostream>
using namespace std;
int fact(int N)
{
if(N==0)
{
return 1;
}
return N* fact(N-1);
}
int main(){
int N;
cout<<"Enter number : ";
cin>>N;
if(N<0)
{
cout<<"Factorial not possible.";
}
cout<<"Factorial : "<<fact(N);
} | ALGO | 0.999862 | 4.370375 |
d46303fa-7909-4be2-8529-b0a8326660d1 | hecmorr/udemy_intermedio | miscelaneos/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998106 | 6.797273 |
21c35db7-a214-446d-9af6-0b05d10e13c6 | ShinsuSenju/Practice-Questions | my-folder/0017-letter-combinations-of-a-phone-number/solution.cpp | class Solution {
public:
void recursion(string digits,unordered_map<char,string> key,vector<string> &ans,string temp,int i){
if(i==digits.size()){
ans.push_back(temp);
return;
}
string s = key[digits[i]];
for(char c:s){
recursion(digits,key,ans,tem... | ALGO | 0.999989 | 6.812391 |
af19b8f2-1836-4fa1-846e-6648d8890c1b | gloryhry/M2DP-CPP | m2dp.cpp | /*
* ┌─────────────────────────────────────────────────────────────┐
* │┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐│
* ││Esc│!1 │@2 │#3 │$4 │%5 │^6 │&7 │*8 │(9 │)0 │_- │+= │|\ │`~ ││
* │├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤│
* ││ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ ... | DATA | 0.998405 | 3.816355 |
b57e2cfb-2d78-4d3f-b740-f2feaffdd0e7 | Xornyv3/Stop-sign-AI-detection | src/edge-impulse-sdk/tensorflow/lite/micro/kernels/add_n.cpp | #include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/add_n.h"
#include <cstdint>
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/quantization_util.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/tensor_ctypes.h"
#includ... | ALGO | 0.964791 | 7.736274 |
feaea17e-6ce9-4ee5-9db3-e1144b97fe49 | grtushar/UVA | uva530.cpp | using namespace std;
#include<iostream>
#include<cstring>
#include<cstdio>
int main()
{
unsigned long long int n,k,ans,i;
while(scanf("%llu%lld",&n,&k)==2)
{
if(n==0&&k==0) break;
if(k>n/2) k=n-k;
ans=1;
for(i=0;i<k;i++)
... | ALGO | 0.99994 | 3.708627 |
dc664d4d-14a1-4dc3-8fd3-6e8214a1e84f | wirc-sjsu/fofem | FOF_DLL/calden2HMV.cpp | #include <stdio.h>
#include <string.h>
#include <math.h>
#include "BMsoil.h"
extern double TMax, denwx, denix, denwNx;
extern double dencr;
extern double BW[];
extern double tempcr;
double tauc [eC_MaxLev];
double tauc1 [eC_MaxLev];
double tauc2 [eC_MaxLev];
double denwa [eC_MaxLev];
double denwTa [eC_Ma... | ALGO | 0.999882 | 3.438173 |
3b9d35b0-bf44-4bd6-83ee-a0b27266c695 | HACONGTUAn/Jam-With-Galagon | Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.94874 | 6.933585 |
03d3406e-6116-4bf8-b023-de5acac38342 | alvind1/virtual_pointer_pen | contour_detection.cpp | #include "contour_detection.h"
#include "utility.h"
#include <iostream>
#include <opencv2/opencv.hpp>
#include <string>
#include <vector>
using cv::imshow;
using cv::Mat;
using cv::Point;
using std::string;
using std::vector;
using std::cout;
using std::endl;
using utility::IMAGE_PATH;
namespace contour_detection {
... | ALGO | 0.984677 | 6.363236 |
88e8d65c-4956-4ee5-9ebe-ea8ec97b4446 | Alvee78/Codeforces | A_The_Way_to_Home.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n,d;
string s;
ll idx(ll pre){
ll in=-1;
for(ll i=pre+1;i<=pre+d && i<n;i++){
if(s[i]=='1'){
in=max(in,i);
}
}
return in;
}
int main(){
cin>>n>>d;
cin>>s;
ll c=0,pre;
for(ll i=0;i<n-1;){
... | ALGO | 0.999959 | 4.031478 |
e39e299d-a837-48fa-acab-107f43c56b9a | 2532779/RosalesJerson_CSC5_43952 | Hmwrk/Assignment 2/Gaddis_8thEd_Chap3_Prob9/main.cpp | /*
* File: main.cpp
* Author: Jerson Rosales
* Created on March 17, 2015, 8:48 PM
* Purpose:Figure how many calories you consume from cookies
*/
//System Libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution Begins
int main(int argc, char*... | DATA | 0.863288 | 3.553998 |
e6c35d81-124e-40e5-85f8-0f3c1bde0605 | haifeng-jin/codejam | 2015/r1b/B-large.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
#define D(x)
int col_num, row_num, n;
int xor_value;
int occupied(int x, int y)
{
return ((x + y) % 2) ^ xor_value;
}
int cal(int n, int a)
{
xor_value = a;
int ret = 0;
int corner_num = 0;
corner_num += occupied(1, 1) + occupied(row_num, 1);
corne... | ALGO | 0.999851 | 4.676733 |
7f7e22fb-7a06-44a9-aa7a-e093813ba2ce | InnoFang/algo-set | LeetCode/1583. Count Unhappy Friends/solution.cpp | /**
* 99 / 99 test cases passed.
* Runtime: 28 ms
* Memory Usage: 24.9 MB
*/
class Solution {
public:
int unhappyFriends(int n, vector<vector<int>>& preferences, vector<vector<int>>& pairs) {
vector<vector<int>> importence(n, vector<int>(n));
vector<int> mapper(n);
for (int i = 0, im... | ALGO | 0.99998 | 5.400562 |
cee2743d-32fc-4c4b-967a-aae58e8a47a3 | mahmoudmahgoub/leetcode | algorithms/e47.path-sum/e47_cplusplus.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), ... | ALGO | 0.999979 | 6.139534 |
b3d8f56f-9df4-4533-b33d-160d40ee6be3 | maa-zzz/LeetCode-Solutions-CPP- | 509-fibonacci-number/509-fibonacci-number.cpp | class Solution {
public:
int fib(int n) {
int a = 0;
int b = 1;
int c = 0;
for ( int i=0; i<n; i++){
c = b;
b = a+b;
a = c;
}
return a;
}
}; | ALGO | 0.999996 | 5.894331 |
ce8ff7c4-721f-4dce-be23-fafdcba4f1d2 | Jackiebibili/lc | dp/luogu/interval/CombineStones.cpp | // problem https://www.luogu.com.cn/problem/P1880
#include <iostream>
using namespace std;
int f[201][201]; // for max
int g[201][201]; // for min
int s[201];
int pre[200];
int main() {
int L;
cin >> L;
for (int i = 1; i <= L; i++) {
int num;
cin >> num;
s[i] = s[L + i] = num;
}
fo... | ALGO | 0.999968 | 3.337136 |
ce22728e-1fd5-4887-b417-77728a3e707d | shbhshs/codechef_programs | CHEFARC_test1.cpp | // a given source cell to a destination cell.
#include <bits/stdc++.h>
using namespace std;
#define ROW 9
#define COL 10
//to store matrix cell cordinates
struct Point
{ int x;
int y;
};
// An Data Structure for queue used in BFS
struct queueNode
{ Point pt; // The cordinates of acell
int dist; // cell's distance of fr... | ALGO | 0.999485 | 4.29255 |
89caf7b1-f515-4596-bf1a-c981fbde1c9f | ShamerOC/informatyka-matura | 2k17sf/CIAGI BINARNE/zadanie 4 2.cpp | #include <iostream>
#include <fstream>
using namespace std;
// 0: 48
int bin_to_dec(string a) {
int len = a.length();
int mnoznik = 1;
int wynik = 0;
for(int i = len - 1; i >= 0; i--) {
wynik += (a[i] - 48) * mnoznik;
mnoznik *= 2;
}
return wynik;
}
int main() {
ifstream plik("binarne.txt");
if (!plik... | ALGO | 0.971091 | 3.466552 |
fde9f9b8-ed62-4ea2-b986-51edf5ae8008 | priyanka-111-droid/codewithharry_cpp | C++STL/tut73c.cpp | //maps part 2(unordered)
//use this for less time comp
/*
1.inbuilt implementation->hash table
2.time complexity
3.valid keys datatype
*/
#include<bits/stdc++.h>
using namespace std;
void print(unordered_map<int,string> &m){
cout<<m.size()<<endl;
for(auto &pr:m){//pair
cout<<pr.first<<" "<<pr.second<<... | TOOL | 0.951952 | 5.061533 |
2c98d3ba-2a54-4784-a0fe-c0c3674c129b | JackyLu0520/cpp | sort.cpp | #include<bits/stdc++.h>
using namespace std;
int arr[15];
int search(int l,int r,int n,int a[]){
int mid=l+(r-l)/2;
if(l>r) return l;
if(a[mid]>n) return search(l,mid-1,n,a);
else return search(mid+1,r,n,a);
}
void print_list(int a[]){
int i;
for(i=0;i<10;i++){
cout<<a[i]<<' ';
}
cout<<endl;
}
void bubble_so... | ALGO | 0.999673 | 4.458812 |
cee688e3-d234-4bd2-897f-ddd70054831d | kywyhkkk/acmlx | 24比赛/24.2.23/B.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#ifdef Debug
#define D() cerr<<__LINE__<<endl;
#else
#define D()
#endif
#define ll long long
#define ull unsigned long long
using namespace std;
const ll maxn=10001000;
const ll inf=0x3f3f3f3f3f3f3f3fll;
/*
ios::sync_with_stdio(0)... | ALGO | 0.999938 | 3.108951 |
62675e36-4c8f-488d-bb5c-08c01a5d31a3 | Aaron94435/Cpp-programs | Practice Lab 7 required files/DriverProgram.cpp | // Chapter 21 Assignment-Driver Program
#include <iostream>
#include "BinaryTree.h"
using namespace std;
int main()
{
// Create an instace of BinaryTree.
BinaryTree<int> tree;
// Insert some nodes into the tree.
tree.insertNode(1);
tree.insertNode(5);
tree.insertNode(2);
tree.insertNode(4);
tree.insertNode(8... | ALGO | 0.977827 | 6.310795 |
855cde48-2257-466c-8edf-5dc985b230f3 | StormOfWar/c- | 7.0/lecture1Homework/1SumInArray.cpp | #include <iostream>
int SumArray(int array[], int size){
int result = 0;
for(int i =0; i < size; i++){
result += array[i];
}
return result;
}
int main(){
int array[] = {1,2,3,4,5,6,7,8,9,10};
int sizeArray = sizeof(array)/ sizeof(array[0]);
int result = SumArray(array, sizeArray);
std:... | ALGO | 0.991833 | 4.641444 |
7657cccc-999d-4867-afac-812afe9a2a22 | raincross7/code-similarity | codes/train_code/problem163/problem163_496.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
static const int MAX_NUM = 2000000;
static const int MAX_ELEM = 10000;
#if 0
void CountSort(int elem[], int num)
{
int i;
int cnt[MAX_ELEM] = {0};
int elem2[MAX_NUM+1];
int target;
for (i = 0; i < num; i++) {
+... | ALGO | 0.999979 | 4.453062 |
f789cec0-68ab-4d0f-8bff-688f4ca17977 | RobertLowrey/CS-405-Secure-Coding | Module5EncryptionActivity.cpp | // Encryption.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <cassert>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <ctime>
/// <summary>
/// encrypt or decrypt a source string using the provided key
/// </summary>
/// <param... | TOOL | 0.921947 | 5.448563 |
77414a71-29db-4971-8250-9432be9a0516 | kvantetore/PyProp | examples/combined/h2_ionization/non-bo/potential.cpp | #include <core/wavefunction.h>
#include <core/potential/dynamicpotentialevaluator.h>
template<int Rank>
class LaserPotential : public PotentialBase<Rank>
{
public:
//Required by DynamicPotentialEvaluator
cplx TimeStep;
double CurTime;
//Potential parameters
double FieldStrength;
double Frequency;
double Durati... | TOOL | 0.990678 | 5.638921 |
0f2a875c-143f-40c4-b508-0f46a2bbe34b | Arshjeet-Singh/DSASheet2022 | Excel Sheet Column Title.cpp | class Solution {
public:
string convertToTitle(int columnNumber) {
string s="";
while(columnNumber>0)
{
int r=columnNumber%26;
if(r==0)
{
s=char(26+64)+s;
columnNumber/=26;
columnNumber-=1;
... | ALGO | 0.999903 | 5.865091 |
e206efc6-0d4c-42df-82aa-3ed5f5590632 | praneethaBrindavanam/LeetCode | power of two/code.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
for( int i=0;i<100;i++)
if (pow(2,i)==n){
return true;
}
return false;
}
};
| ALGO | 0.997984 | 5.880281 |
95a10620-e19b-44b9-854d-36a84c60e0d3 | ishandutta2007/codeforces | caoyue/normal/1630/D.cpp | #include<iostream>
#include<cstring>
#include<cassert>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<time.h>
#include<bitset>
#include<cstdio>
#include<algorithm>
using namespace std;
#define REP(i,x,y) for(ll i=x;i<=y;i++)
#define rep(i,n) REP(i,1,n)
#define rep0... | ALGO | 0.999978 | 3.546997 |
a83f1722-0202-429b-b668-ab66248f6b29 | aadits1965/CODEFORCES | LEVEL A/A_Wizard_of_Orz.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s="0123456789";
if(n==1){
cout<<"9"<<endl;
}
else if(n==2){
cout<<"98"<<endl;
}
else if(n==3){
cout<<"9... | ALGO | 0.999781 | 4.676684 |
03adc93f-939b-459d-b294-183513d0ea7a | brandonvl/sdmg | sdmg/Box2D/Dynamics/Joints/b2WeldJoint.cpp | #include <Box2D/Dynamics/Joints/b2WeldJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Point-to-point constraint
// C = p2 - p1
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i ... | ALGO | 0.991087 | 6.796124 |
ad296bc8-769e-4db8-a266-28781952597e | luckynoob/Leetcode | isRotation.cpp | #include<iostream>
#include<string>
using namespace std;
class Solution {
public:
bool isRotation(string s1, string s2) {
if (s1.size() != s2.size()) return false;
s1 += s1;
if(s1.find(s2) == string::npos) return false;
return true;
}
};
int main() {
string s1 = "ppmmaa";
... | ALGO | 0.999799 | 5.150087 |
b999fd97-7371-4757-8821-711ecf9d9d73 | sarvex/leetcode-javascript | solution/1900-1999/1959.Minimum Total Space Wasted With K Resizing Operations/Solution.cpp | class Solution {
public:
int minSpaceWastedKResizing(vector<int>& nums, int k) {
++k;
int n = nums.size();
vector<vector<int>> g(n, vector<int>(n));
for (int i = 0; i < n; ++i) {
int s = 0, mx = 0;
for (int j = i; j < n; ++j) {
mx = max(mx, num... | ALGO | 0.999974 | 5.380234 |
a9ea39ae-097f-4024-a446-eac6dd2810e0 | Harshjs-Gupta/DSA | String/FindDuplicatesInString.cpp | // write a program to find a a Duplicates
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char A[] = "programming";
int length = strlen(A);
for (int i = 0; i < length; i++)
{
for (int j = i + 1; j < length; j++)
{
if (A[i] == A[j])
{
... | ALGO | 0.996081 | 3.748057 |
e6f144be-56dd-46e1-9e66-0577f6ade351 | Naren-Sai-17/CS-254 | week-4/question-3/q3.cpp | // time complexity : O(nlogn) average case O(n^2) worst case
// space complexity : O(1)
#include<bits/stdc++.h>
using namespace std;
int partition(vector<int> &arr, int l, int r)
{
int pivot = arr[r];
int j = l;
for (int i = l; i < r; i++)
{
if (arr[i] < pivot)
{
swap(arr... | ALGO | 0.999988 | 4.95806 |
2ca90cd8-0bd3-4b92-a2da-488e20836a92 | benajtil/til_chapter11 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
74f6be3c-55c4-4544-9560-72a15fd09690 | Andres-Perez-Leonis/TrabajosUMH | Estructura_de_Datos/Colas/libreria.cpp | #include <iostream>
#include "libreria.h"
using namespace std;
/**
Guarda memoria para la estructura definida como Cola
*/
LaCola CrearCola() {
LaCola cola = new struct Cola;
cola -> ultimo = cola -> primero = new Pasajero;
cola -> ultimo = cola -> primero -> sig = NULL;
return cola;
}
/**
I... | TOOL | 0.902302 | 4.732733 |
4aa113f9-59c9-44ec-9b72-66265711bec7 | BSC1999/CSA0272-Daily-Test | Multiple vlaues.cpp | #include <stdio.h>
struct greaterSmaller {
int greater, smaller;
};
typedef struct greaterSmaller Struct;
Struct findGreaterSmaller(int a, int b)
{
Struct s;
if (a > b) {
s.greater = a;
s.smaller = b;
}
else {
s.greater = b;
s.smaller = a;
}
return s;
}
... | ALGO | 0.999484 | 3.85246 |
0564ba92-aab3-4ace-a804-5662b825a246 | jaluova/algorithm | diff/lq19761.cpp | // 商品库存管理
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<pair<int, int>> range(m);
vector<long long> cnt(n + 2);
for (auto& [f, s] : range) {
cin >> f >> s;
cnt[f]++;
cnt[s + 1]--;
}
partial... | ALGO | 0.999965 | 4.447001 |
669b302f-6aac-4151-8371-baa9efa39a8f | GDSCltce/DSA | Stack/twoStack.cpp | #include <bits/stdc++.h>
// #include "../Cpplibrary/array.h"
using namespace std;
#define endl '\n'
#define space ' '
#define dbg(x) printf("%s = %d\n", #x, x);
typedef long long ll;
#define all(x) (x).begin(), (x).end()
// const int mod = 1e9+7;
inline void solve();
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.... | ALGO | 0.999872 | 3.659583 |
04f497e0-6973-4e63-bf83-bff911edacec | Masters-Akt/CS_codes | leetcode_sol/429-N-ary_Tree_Level_Order_Traversal.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val) {
val = _val;
}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
*/
class Solution {
public:
vector<vector<int>> levelOr... | ALGO | 0.999957 | 6.08299 |
6146936a-a0d1-4efa-839d-a53bf874f7ba | kraj2503/cp | c++/codechef/random challanges/TEMPLELA.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int, int>
#define ll long long int
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
cin >> t;
while (t--)
{
ll n;
cin >> n;
vector<int> v1(n);
for (int i = 0; i ... | ALGO | 0.999967 | 4.196606 |
afaee3de-5d9f-4801-9bdc-c07aa9afd4b6 | prakharguptaujjain/DSA_assignments | Saves/3rdweek/postfixevaluate.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<pair<int, int>> pi;
#define pb push_back
#define ff first
#define ss second
#define hi cout << "HI";
#define des greater<int>()
#define ma(v) max_element(v.begin(), v.end())
#define mi(v) min_element(v.begin()... | ALGO | 0.999627 | 4.035717 |
e77e2017-f1e2-436c-b695-4bf96a4fedd8 | aman0a/OS | OS/ass1/ass1.cpp | #include <iostream>
#include <unistd.h>
#include <sys/wait.h>
#include <cstdlib>
using namespace std;
void show_menu() {
cout << "\n1) Fork";
cout << "\n2) Wait";
cout << "\n3) Exec (ls -l)";
cout << "\n4) Copy file (cp)";
cout << "\n5) Search in file (grep)";
cout << "\n6) Exit";
cout << "... | TOOL | 0.937603 | 3.211542 |
b8bc5a6f-f2d4-4d2f-90d1-8af53bbd3d93 | excalibrwinterberry/LearningDSA_own | Linked list/cpp/ll1.cpp | #include <iostream>
using namespace std;
class node
{
public:
int data;
node *next;
node(int val)
{
data = val;
next = NULL;
}
};
void insertAtTail(node *&head, int val)
{
node *n = new node(val);
if (head == NULL)
{
head = n;
return;
}
node ... | ALGO | 0.999948 | 4.734606 |
dc39d3d8-700c-46af-9db5-b5deb3b352ef | BeingSeight/Cpp | Day5/7.reverse.cpp | // reversing number using recursion by mod 10 and divide 10 with making function
#include <iostream>
using namespace std;
int rev(int n)
{
if (n == 0)
{
return 0;
}
else
{
return n % 10 + rev(n / 10) * 10;
}
}
int main()
{
int n;
cin >> n;
cout << rev(n);
} | ALGO | 0.999851 | 4.585662 |
23902fbb-f456-4075-8693-830ddf9c6720 | OLR-xray/OLR-3.0 | src/3rd party/nvtt/src/nvimage/ConeMap.cpp | #include <nvcore/Ptr.h>
#include <nvmath/Color.h>
#include <nvimage/NormalMap.h>
#include <nvimage/Filter.h>
#include <nvimage/FloatImage.h>
#include <nvimage/Image.h>
using namespace nv;
static float processPixel(const FloatImage * img, uint x, uint y)
{
nvDebugCheck(img != NULL);
const uint w = img->width();
... | ALGO | 0.989904 | 5.409225 |
a2d0ec2b-2d8f-4187-a031-afe290845dc5 | Mindjolt2406/Competitive-Programming | Codechef/Snackdown/Round1A/ARRGRAPHKHALID.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define rep(n) for(int i=0;i<n;i+=1)
#define prarr(a,n) rep(n) printf("%d ",a[i] );printf("%s\n"," " );
#define sc(a) scanf("%d",&a);
#define scl(a) scanf("%lld",&a);
#define sc... | ALGO | 0.999924 | 3.373928 |
b92a704a-09e7-4400-acdf-02ac1f55ee20 | ajaxlt/OnlineProgram | 剑指Offer/最小的k个数.cpp | #include <iostream>
#include <vector>
#include <string.h>
#include <map>
using namespace std;
/*
* 来源: 剑指Offer
* 题目: 最小的k个数
*
* 描述:
* 输入n个整数,找出其中最小的K个数。例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4
*
* 思路:
* 基于小顶堆的堆排序
*
*/
class Solution {
public:
int left(int i){
return (i << 1) + 1;
}
int rig... | ALGO | 0.999893 | 4.505932 |
b2e274e0-b41c-4f1f-a303-abaaa7e0e10f | Yeah-Jack/cpp-projects | Console/German/Widerstandsrechner/main.cpp | #include <iostream>
#include <windows.h>
void menu(short &auswahl);
void berechnung(short &auswahl, double &widerstand1, double &widerstand2,
double &widerstand3, double &ergebnis);
void ausgabe(double &ergebnis);
int main() {
SetConsoleOutputCP(CP_UTF8);
short auswahl = 0;
double widerstand1 = ... | TOOL | 0.933514 | 3.622128 |
71be659f-afe9-4411-925a-04fc6ae84567 | WuXibin/practiceCode | leetcode/longestValidParentheses.cpp | #include <iostream>
#include <stack>
using namespace std;
int longestValidParentheses(string s) {
stack<char> st;
int maxlen = 0, len = 0, prefix =0;
for(int i = 0; i < s.length(); i++) {
if(s[i] == '(')
st.push('(');
else {
if(!st.empty()) {
st.pop(... | ALGO | 0.999338 | 5.341463 |
b5025cbf-b695-4ea5-8102-20ccf7b98688 | shuangw98/BoVW | fsdet/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.cpp | namespace fsdet {
template <typename T>
void box_iou_rotated_cpu_kernel(
const at::Tensor& boxes1,
const at::Tensor& boxes2,
at::Tensor& ious) {
auto widths1 = boxes1.select(1, 2).contiguous();
auto heights1 = boxes1.select(1, 3).contiguous();
auto widths2 = boxes2.select(1, 2).contiguous();
auto h... | ALGO | 0.9967 | 6.835999 |
b295752c-ab75-4b82-923a-ecf71fc50c1f | RowerOjMateusza/grafikaUAM | dependencies/physx-4.1/source/geomutils/src/pcm/GuPCMContactCapsuleConvex.cpp | #include "geomutils/GuContactBuffer.h"
#include "GuGJKPenetration.h"
#include "GuEPA.h"
#include "GuVecCapsule.h"
#include "GuVecConvexHull.h"
#include "GuVecConvexHullNoScale.h"
#include "GuGeometryUnion.h"
#include "GuContactMethodImpl.h"
#include "GuPCMContactGen.h"
#include "GuPCMShapeConvex.h"
namespace physx
{
... | ALGO | 0.97646 | 6.643626 |
96003c30-067a-4faa-a54c-922990877abc | Toysoft/NNvision | darknet_nvenc/opencv_contrib-3.4.4/modules/ximgproc/src/slic.cpp | /*
"SLIC Superpixels Compared to State-of-the-art Superpixel Methods"
Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua,
and Sabine Susstrunk, IEEE TPAMI, Volume 34, Issue 11, Pages 2274-2282,
November 2012.
"SLIC Superpixels" Radhakrishna Achanta, Appu Shaji, Kevin Smith,
Aurelien Lucch... | ALGO | 0.99464 | 5.328145 |
4a3f3819-7b31-400e-bbd8-87ca8005c80c | ravi956/dsa-in-cpp | Tree (GFG)/01_implementation_of_binaray_tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int key;
Node *left;
Node *right;
Node(int k)
{
key = k;
left = right = NULL;
}
};
/*
10
/ \
20 30
/
40
*/
int main()
{
... | ALGO | 0.999812 | 3.693946 |
148b5694-910b-4ffc-bfce-26075740a33c | Hareij/lekcje | lekcja5/rekurencja/main.cpp | #include <iostream>
bool contains(int T[], int n, int x)
{
if (n == 0)
return false;
if (T[n - 1] == x)
return true;
return contains(T, n - 1, x);
}
int L[1000];
int R[1000];
void quickSort(int T[], int left, int right)
{
// Base cases:
if (left >= right)
return;
if ... | ALGO | 0.999316 | 4.663316 |
d3218468-9da5-4e82-88d6-edb1240c3948 | ndharmateja/accelerated-cs-fundamentals-specialization | 1-object-oriented-data-structures-in-c++/9-towers-of-hanoi/main.cpp | #include "Game.h"
#include <iostream>
using std::cout;
using std::endl;
int main(int argc, char const *argv[])
{
Game g;
cout << "Initial game state: " << endl;
cout << g << endl;
g.solve();
cout << "Final game state: " << endl;
cout << g << endl;
return 0;
}
| ALGO | 0.880226 | 4.492554 |
79d882e4-6c1a-46c2-8013-01d7937992fe | chethanac15/C-plus-plus | Print Quadratic Equations.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
double a, b, c, discriminant, root1, root2;
cout << "Enter coefficients a, b, and c: ";
cin >> a >> b >> c;
// Calculate discriminant
discriminant = b * b - 4 * a * c;
// Condition for real and different roots
if (discriminant > 0) ... | ALGO | 0.998635 | 4.146344 |
aff5a66d-6e60-46f4-b5a1-2d8bd04abc0a | kt117/ProCom | atcoder/agc/048/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << end... | ALGO | 0.999989 | 3.574025 |
f223fab9-eaad-424d-a5b1-a5089b968166 | ruixiaoLee/lut_seal_simulation | src/ckks_6_relu.cpp | #include "demo.hpp"
double relu(double x){
if(x>0)
return x;
else
return 0;
}
vector<double> readTable(const string &filename){
vector<double> ori_table;
string lineStr;
ifstream readData(filename);
cout<<"read file:"<<filename<<endl;
while(getline(readData, lineStr)){
// cout<<l... | ALGO | 0.994968 | 3.711488 |
cf804b02-7b18-4d91-99e7-c24bcedf0c6b | boxworld18/jittor-brender | python/jnerf/ops/op_include/eigen/blas/double.cpp | #define SCALAR double
#define SCALAR_SUFFIX d
#define SCALAR_SUFFIX_UP "D"
#define ISCOMPLEX 0
#include "level1_impl.h"
#include "level1_real_impl.h"
#include "level2_impl.h"
#include "level2_real_impl.h"
#include "level3_impl.h"
double EIGEN_BLAS_FUNC(sdot)(int* n, float* x, int* incx, float* y, int* incy... | ALGO | 0.978001 | 4.726407 |
f6e15f60-07df-4e90-aad3-8f0957106df2 | Y7EA/Competitive-Programming | String Processing/KMP (Prefix function).cpp | // Given a string s (with length n) and a pattern p (with length m), find all occurrence of p in s
// Time complexity: O(n + m)
// Problem link: https://cses.fi/problemset/task/1753/
#include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 ... | ALGO | 0.999876 | 5.837377 |
80c0edef-a2f4-4b78-9e50-b6833c01ed04 | itsmevithy/cpp-prog | daa_lab/merge_sort.cpp | #include<iostream>
#include<fstream>
#include<climits>
using namespace std;
void sort(long *a, long beg, long end, long &count){
long mid=(beg+end)/2;
long i, n1=mid-beg+1;
long j, n2=end-mid;
long larr[n1+1], rarr[n2+1];
larr[n1]=rarr[n2]=INT_MAX;
for(long i=0; i<n1; i++) larr[i]=a[beg+i];
for(long j=0; j<n2; ... | ALGO | 0.999594 | 4.09606 |
3355768f-d5c2-4c5f-9d8e-db2e518035ae | Germano-Silva/Programming | Programming in C++/Trilha 1 - Introdução ao C++/05_Loops for baseados em intervalo/02_Using the Break and Continue Keywords/arrays_and_loops_v07.cpp | #include <iostream>
#include <string>
using std::cout;
using std::cin;
using std::endl;
using std::size;
using std::string;
using std::getline;
int main()
{
string student_names[] {"Joseph", "Martin", "Sheila", "Tanya", "Nancy"};
string name_to_search_for;
cout << "Please enter the name of the student you are ... | TOOL | 0.923109 | 4.982731 |
9a283cf1-6410-4c62-b3a7-5730e54ffc38 | ayushkxyz/Coding_Blocks_DSA_Solutions | Bitmanipulation/Miscellaneous/optimised decimal to binary.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
int n;
cin>>n;
string s;
while(n>0){
int a=n&1;
if(a==1){
s.push_back('1');
}
else{
s.push_back('0');
}
n=n>>1;
}
reverse(s.begin(),s.end());
cout<<s<<endl;
}
| ALGO | 0.999999 | 4.041934 |
4d816129-a04a-4f68-8d2d-635729746bfb | Ak5h4yVengala/Ak5hC0mpetitiveC0ding | CF1844A.cpp | #include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i, n) for (int i = 0; i < n; i++)
#define forn(i, a, b) for (int i = (a); i <= (b); ++i)
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define ll long long
#define mp make_pair
#define pb push_back
#de... | ALGO | 0.999814 | 4.897135 |
d3784d21-7ec7-474b-b705-466dee8f3968 | Huste6/data-structure-and-algorithms-c-plus-plus | sapxepdslk.cpp | #include<bits/stdc++.h>
using namespace std;
struct Sinhvien{
string name;
double gpa;
Sinhvien(){
}
Sinhvien(string ten,double diem){
name=ten;
gpa=diem;
}
};
struct node{
Sinhvien data;
struct node *next;
};
node *makenode(Sinhvien s){
node *newnode=new node;
newnode->data=s;
newnode->next=NULL;
r... | ALGO | 0.993961 | 3.866355 |
2e2f1cab-e614-49a9-b286-e77b4e06a1d4 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_1953_0.cpp | #include <bits/stdc++.h>
using namespace std;
int book[10];
int main() {
int x, y;
cin >> x >> y;
if (x == y) {
cout << "=" << endl;
} else if (x == 2) {
if (y == 3)
cout << "<" << endl;
else if (y == 4)
cout << "=" << endl;
else
cout << ">" << endl;
} else if (y == 2) {
... | ALGO | 0.999971 | 3.777415 |
af122a82-8929-4023-ba2b-e2b92040fb1d | aqfaridi/Competitve-Programming-Codes | SPOJ/PALDR.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <vector>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
#define MAX 1000010
#define MOD 1000000007
namespace manacher
{
int P[MAX],n,cnt;
s... | ALGO | 0.999763 | 3.614669 |
33192e53-89ec-4fef-88bb-d7bcb1fcb2d2 | KittyBarnett/rlva | indra/llmath/llline.cpp | /**
* @file llline.cpp
* @author Andrew Meadows
* @brief Simple line class that can compute nearest approach between two lines
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribu... | ALGO | 0.998988 | 5.391053 |
3326ef6c-a79e-40ec-a7d9-63cf5b5e2870 | abhinn05/DSA | LeetCode/Trees/Binary Search Trees/653. Two Sum IV - Input is a BST.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.999996 | 6.056352 |
e4e04219-bf66-481d-905e-6a55cd63dd58 | lmbarr/Fast-r-cnn-pedestrian-detection-with-CAFFE-and-GPU-support | ProgramasTesisGPU/ProgramaTesisC++/Candidatos.cpp | /*
* Candidatos.cpp
*
* Created on: Feb 2, 2017
* Author: luis
*/
#include "Candidatos.h"
Candidatos::Candidatos(){
cout<<"Objeto candidatos se ha creado....."<<endl;
}
Candidatos::Candidatos(cv::Mat& img, Size dimensiones){
met1 = HeadDetector(img);
//(img, step, dimensiones)
met2 = RegionGrowing(img... | ALGO | 0.913792 | 3.555016 |
190070db-f4fe-4850-bc60-593b46be1bfc | GHGmc2/ccia_code_samples | listings/listing_4.12.cpp | #include <list>
#include <algorithm>
template<typename T>
std::list<T> sequential_quick_sort(std::list<T> input)
{
if(input.empty())
{
return input;
}
std::list<T> result;
result.splice(result.begin(),input,input.begin());
T const& pivot=*result.begin();
auto divide_point=std::partit... | ALGO | 0.999807 | 5.550368 |
febbf1a0-38bd-456a-bf07-312b6d2fc717 | HoweXing/Pat | 1098.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
int n,tmp;
vector<int> src,now;
vector<int> sorted,unsorted;
map<int,int> Map;
bool isi()
{
int k=-1;
bool flag=true;
for(int i=1;i<now.size();++i)
{
if(now[i]<now[i-1])
{
... | ALGO | 0.999978 | 3.603955 |
e2311074-fdad-4a14-adb6-23a87787f5da | tripathidivyansh/leetcode_question | 1524-string-matching-in-an-array/string-matching-in-an-array.cpp | class Solution {
public:
vector<string> stringMatching(vector<string>& words) {
int n = words.size();
vector<string> ans;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (i != j && words[j].find(words[i]) != string::npos) {
ans.p... | ALGO | 0.999856 | 5.538455 |
bc27db19-a0ca-4358-9ad4-8270445be0cc | CaiHeran/XCPC | Luogu/P2032.cpp | #include <cstdio>
#include <iostream>
#include <memory>
#include <deque>
using std::cout;
template <typename T=int>
T rd()
{
T n; char c=getchar();
while (c<'0'||'9'<c)
c = getchar();
n = c-'0';
while (c=getchar(), '0'<=c&&c<='9')
n = n*10 + c-'0';
return n;
}
int main()
{
str... | ALGO | 0.999987 | 3.392269 |
eaaece54-fb8e-4bad-bafb-d81bee0e02c1 | Abdur-Rawf/Compitive-Programming | AL-Techemist Weekly Long Contest 1/AD.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int m,h;
cin>>m>>h;
if(h%m==0)
cout<<"Yes\n";
else
cout<<"No\n";
return 0;
}
| ALGO | 0.999904 | 3.210411 |
06d0c6fc-f897-4637-b9cf-b0b5f65dd019 | AeroX2/sweepers-neural-network | src/network/brain.cpp | #include "brain.hpp"
Brain::Brain()
{
int i = BRAIN_INPUT_LEN;
int h = BRAIN_HIDDEN_LEN;
int hl = BRAIN_HIDDEN_LAYER_LEN;
int o = BRAIN_OUTPUT_LEN;
Matrix new_matrix = Matrix(i+1,h);
new_matrix.set_by_col(random_array(i*h+h));
genes.push_back(new_matrix);
for (int ii = 0; ii < hl-1; ii++)
{
new_matrix = M... | ALGO | 0.990977 | 3.957361 |
4c5fac9e-4d45-4c89-9865-2f8fef42c648 | duboviy/low_level_programming | cpp_bubble_sort/main.cpp | #include <iostream> // std::cout
#include <algorithm> // std::swap
#include <vector> // std::vector
template <typename T >
void bubble_sort( T &a )
{
for( T::size_type i = 0; a.size() && i < a.size() - 1; ++i )
{
for( T::size_type j = i; j + 1 > 0; --j )
{
if( a[j] > a[... | ALGO | 0.999111 | 4.71616 |
6b43726b-9972-4d91-be54-a1df66c5f83c | wonsangL/algorithm | Problem/baekjoon/3190_snake.cpp | #include<iostream>
#include<vector>
#include<utility>
using namespace std;
int N, K, L;
int dir_graph[100][100] = { 0 };
int drow[] = { 0, 1, 0, -1 };
int dcol[] = { 1, 0, -1, 0 };
bool collision_body(pair<int, int> newPos, pair<int, int> origin, int length) {
bool body[100][100];
for (int i = 0; i < N; i++) {
... | ALGO | 0.999964 | 4.241192 |
867a4ac0-d7cd-4271-9b73-b1a5a521e1ff | CCSEPBVR/CS-IS-PBVR | IS_DaemonAndSampler/Daemon/JobDispatcher.cpp |
#include "JobDispatcher.h"
#include <iostream>
#ifndef CPU_VER
#include <mpi.h>
#endif
#include "timer_simple.h"
JobDispatcher::JobDispatcher() {}
JobDispatcher::~JobDispatcher() {}
int JobDispatcher::Initialize( int bstep, int estep, std::vector<int> volume_table )
{
int size, workers;
#ifdef CPU_VER
size... | ALGO | 0.898761 | 5.481434 |
33a48738-3a84-4a5d-94c4-c376e3d3940b | manh610/document-c- | ACMbaiD.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#define max 100005
using namespace std;
int main(){
long long a[max],b[max];
int n,k;
cin>>n>>k;
for (int i = 0; i< n ; i++){
cin >> a[i];
}
for (int i = 0; i < n; i++ ){
cin >> b[i];
}
sort (a,a+n);
sort (b,b+n);
int vitri1=0, vitri2=0;
int i = 0... | ALGO | 0.999997 | 3.376999 |
1197c96b-7da3-4309-a9b0-d67df7808e50 | nakib1948/Competitive-programming | F_Thank_you_Jamil_Sir_Naimul.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(i=0;i<n;i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define debug cout<<"debug"<<endl;
int main()
{
///"In the name of Allah,most gracious and most merciful"///
ll i,j,x,y,z,coun... | ALGO | 0.999986 | 3.779389 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.