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 |
|---|---|---|---|---|---|---|---|
a9528e0b-3296-4a9d-9a75-a52657742f05 | FlyingChihwahwa/SolvedBaekjoonProblem | 백준/Gold/9252. LCS 2/LCS 2.cc | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
typedef long long int ll;
const int INF = 987654321;
int dp[1001][1001];
int main() {
string X, Y;
string temp1, temp2;
cin >> temp1;
cin >> temp2;
X = ' ' + temp1;
Y = ' ' + temp2;
for (int i = 1; i < Y.... | ALGO | 0.999991 | 3.700091 | {
"github_metadata": {
"branch": "main",
"commit_count": 320,
"repo_created_at": "2023-04-24T12:08: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": "11cec936aa... |
855272ea-9c31-48d5-879e-b526a7f40953 | labuwx/progpuzzles | project_euler/pe32.cpp | #include <iostream>
#include <set>
#include <vector>
using namespace std;
typedef unsigned long long num;
typedef vector<num> digitvector;
digitvector digits(unsigned int n) {
auto dv = digitvector();
while (n) {
dv.push_back(n % 10);
n /= 10;
}
return dv;
}
bool ispan(num ... | ALGO | 0.999789 | 4.987479 | {
"github_metadata": {
"branch": "master",
"commit_count": 314,
"repo_created_at": "2021-10-14T20:34: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": "6cd6c87c... |
b517a8ec-4cbb-442d-bfe0-0672d3a20b67 | aroojinam94/vp | sack/sack/xyz.cpp | #include <iostream>
#include <conio.h>
using namespace std ;
typedef int StackElement;
const int STACK_CAPACITY = 128;
StackElement myArray[STACK_CAPACITY];
class stack
{
private:
int myArray[STACK_CAPACITY];
int top ;
public :
stack();
bool is_empty();
bool is_full();
void push( int n);
int pop();
}
i... | ALGO | 0.985405 | 3.319951 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-03-16T05:03: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": "da1a9a8e9... |
c96a66b4-71d9-439e-be07-0554b2dfcfce | dhruviyengar/TitanLib | include/titanlib/chassis/util/util.hpp | #pragma once
#include "titanlib/chassis/point/point.hpp"
#include <cmath>
#include <functional>
#include <vector>
namespace titanlib {
inline float avg(std::vector<float> values) {
float count = 0;
int size = 0;
for (float value : values) {
if (value != NAN) {
count += value;
size++;
}
}
... | ALGO | 0.993841 | 6.797556 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2024-05-01T04:46:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b32337a1c... |
adedeb83-3413-47d6-b312-ac6b852528d8 | sarganio/Final-Project | Final_Project/Final_Project/dataanalysis.cpp | /*************************************************************************
ALGLIB 3.16.0 (source code generated 2019-12-19)
Copyright (c) <NAME> (ALGLIB project).
>>> SOURCE LICENSE >>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publishe... | ALGO | 0.998721 | 5.372494 | {
"github_metadata": {
"branch": "Develop",
"commit_count": 373,
"repo_created_at": "2020-01-03T09:02:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "625aac1... |
28417d3a-9bc7-4448-afd2-c8286aae289e | arkaslittlemind/Placement-Preparation | Codechef/Starters 104 Division 4/Problem D.cpp | #include <bits/stdc++.h>
using namespace std;
//#define int long long
#define INF (int)1e18
#define f first
#define s second
mt19937_64 RNG(chrono::steady_clock::now().time_since_epoch().count());
int gcd(int x, int y) {
if (y == 0)
return x;
return gcd(y, x % y);
}
int helper(int x, int y, int k) {
... | ALGO | 0.999979 | 4.874366 | {
"github_metadata": {
"branch": "master",
"commit_count": 227,
"repo_created_at": "2023-03-13T14:31:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fd0feb7... |
997a6cbc-1f78-41a6-a5ca-fbd179bd3308 | LiLiParty/AtCoder_Archive | atcoder.jp/abc088/abc088_c/Main.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF32 2147483647 //2.147483647×10^{9}:32bit整数のinf
#define INF64 9223372036854775807
//const ll mod=1000000007;//10^9-7
ll divisor_num(ll a){ //aの約数の個数,O(√a)
ll ans = 1;
for (ll i = 2; i <= sqrt(a); i++) {
ll cnt = 0;
whi... | ALGO | 0.999975 | 4.364543 | {
"github_metadata": {
"branch": "main",
"commit_count": 669,
"repo_created_at": "2021-09-14T07:16:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4e3fb868e... |
eed8c911-df45-48d5-ba77-6b28fe86c90e | davidstutz/superpixel-benchmark | lib_ers/mex_ers.cpp | /*
Copyright 2011, <NAME>
All Rights Reserved
Permission to use, copy, modify, and distribute this software and
its documentation for any non-commercial purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that copyright notice and this permission
not... | ALGO | 0.986323 | 5.525461 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2016-12-04T17:16:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 411,
"forks": 111,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "da628... |
efc23be9-6795-4160-b361-f127530e48a3 | ZeekoZhu/HomeWork | FinalHomeWork/CppTask08/Source.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
struct Point
{
Point(int d, int a, int b) : data(d), x(a), y(b)
{}
int data;
int x;
int y;
};
Point getUpPoint(const vector<vector<int> >& matrix, const Point& temp);
Point getBelowPoint(const vector<vector<int> >& matri... | ALGO | 0.99998 | 4.102764 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2016-09-14T05:53:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb2fbfc6... |
6ad027ab-3f08-4f1e-8e12-1d5c5927a681 | mgrantdev/CSCI-104-Labs-Assignments | hw4/rsa.cpp | #include <cmath> // To use log
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> split(string s) // Split the string to a vector using delimiter ' ' (space)
{
vector<string> v;
string buf = "";
for (int i = 0; i < s.length(); i++) {
//... | TOOL | 0.999529 | 4.228008 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2022-12-05T06:46: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": "e7438112a63... |
69deb4f2-70a6-437d-858a-98a201c293ae | huangyicong0769/LearningRecord | CH/磁力块.cpp | #pragma GCC optimize(3,"Ofast","inline")
//CH #46A
//ykhoj 3353
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <queue>
#define reg register
#define il inline
#define ll long long
#define SIZEN 250006
#define SIZET 600
#define f(a, b, c) for (reg int a=b; a<=c; a++)
using namespace ... | ALGO | 0.999806 | 3.880304 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2018-06-25T12:12: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": "429528a61b4... |
5c81453a-7768-4275-88ed-df83ac045672 | linnil1/106_1_DSNP | hw5/src/util/array.h | /****************************************************************************
FileName [ array.h ]
PackageName [ util ]
Synopsis [ Define dynamic array package ]
Author [ Chung-Yang (<NAME> ]
Copyright [ Copyleft(c) 2005-present LaDs(III), GIEE, NTU, Taiwan ]
********************************... | ALGO | 0.988355 | 5.945334 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2017-09-21T10:21:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f35b9efb3... |
c049e810-7c13-45b4-ab5e-757aa5c83d24 | ashhalll/DSA-Part-1 | dLL.cpp | #include <iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node* prev;
Node()
{
data=0;
next = nullptr;
prev = nullptr;
}
Node(int n)
{
data=n;
next=nullptr;
prev=nullptr;
}
~Node()
{
int ... | ALGO | 0.995127 | 5.717392 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-27T17:57:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8725ba59c3e... |
451fe2fa-d841-4859-9800-1ede9a01f235 | Mooophy/Cpp-Primer | ch05/ex5_12.cpp | #include <iostream>
using std::cin; using std::cout; using std::endl;
int main()
{
unsigned aCnt = 0, eCnt = 0, iCnt = 0, oCnt = 0, uCnt = 0, spaceCnt = 0, tabCnt = 0, newLineCnt = 0, ffCnt = 0, flCnt = 0, fiCnt = 0;
char ch, prech = '\0';
while (cin >> std::noskipws >> ch)
{
switch (ch)
... | ALGO | 0.919251 | 3.718827 | {
"github_metadata": {
"branch": "master",
"commit_count": 1813,
"repo_created_at": "2014-05-09T14:43:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8228,
"forks": 2982,
"issues": 109,
"pull_requests": 90
},
"file_meta": {
"content_id":... |
370ca7a5-49e0-453f-b1dc-c66ad73105c1 | Mythili007/CodePractice | LeetCode/EASY/TREES/TreeViews/diameterOfATree.cpp | /*
* DIAMETER A BINARY TREE - PRACTICE
*/
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
/**
* Definition for a binary tree node.
*/
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), rig... | ALGO | 0.999774 | 4.750313 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-06-01T17:47:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5641fc6d... |
2c39ff4c-10e4-4def-a95e-52ebeca3f909 | princeofcrows/archiveCPcodes | archived/stevenfelix/SSSPbfs/439 - Knight Moves.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
vector <pair <long long, long long> > xy;
vector <pair <long long, long long> > ab;
vector <long long> x;
vector <long long> y;
string str, str1, str3;
ll arsz;
vector <ll> ara;
string star[205];
bool compare(pair <long long, long long> i, pair <lo... | ALGO | 0.999951 | 3.964123 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-05-16T02:52:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45ac63f0ad3... |
f181df91-93cd-4baf-96d0-dc601ff1bc95 | marioyc/Online-Judge-Solutions | Live Archive/4872 - Underground Cables.cpp | #include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
struct edge{
int u,v,d2;
edge(){}
bool operator < (edge X)const{
return d2 < X.d2;
}
}E[499500];
int parent[1000];
int Find(int x){
if(parent[x] != x) parent[x] = Find(parent[x]);
return parent[x];... | ALGO | 0.999725 | 3.827839 | {
"github_metadata": {
"branch": "master",
"commit_count": 364,
"repo_created_at": "2010-09-24T16:07:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 603,
"forks": 359,
"issues": 1,
"pull_requests": 9
},
"file_meta": {
"content_id": "8c92... |
7cf0e981-0343-46a2-9c2c-8ab8a95a0448 | Himanshu07-debug/Competitive-Programming | 06-STL/Concept/C-02-STL-Functions.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
const long long MOD = 1e9 + 7;
const long long INF = LLONG_MAX >> 1;
// COMPARATORS
bool cmp(int a, int b){
return a < b;
}
int main(){
ios::sync_with_stdio(false); cin.tie(NULL);
vector<int> arr{1,2,3,5,4,7,6};
// ******************... | ALGO | 0.999308 | 3.021224 | {
"github_metadata": {
"branch": "main",
"commit_count": 167,
"repo_created_at": "2023-10-05T06:08: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": "b1a8be395f... |
cee305f2-54d8-43e3-bc6b-cdd735ff59ac | FeifeiWang7/LeetCode | ReverseLinkedList/cpp.cpp | class Solution { public: ListNode* reverseList(ListNode* head) {
if(!head) return nullptr;
ListNode *p= head, *pPre = nullptr;
while(p) {
ListNode* tmp = p->next;
p->next = pPre;
pPre = p;
p = tmp;
}
return pPre;
}
};
///////
ListNode * reverseList( ListNode * he... | ALGO | 0.999953 | 5.693268 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-07-14T17:20:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3d6103cd... |
f2b81444-de60-459f-914c-37fe7dbad66a | M0D4/Competitive-Programming-Problems-Solutions | CodeForces/GNU C++17/1367F1 | Flying Sort (Easy Version)/84035300.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
#define sz(x) (int) (x.size())
#define Unique(x) x.erase(unique(all(x)), x.end())
#define endl "\n"
#define START cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
#define isOdd(n) (n&1)
#define pow(n, m) (ll)powl(n, m)
#de... | ALGO | 0.999955 | 4.476367 | {
"github_metadata": {
"branch": "main",
"commit_count": 3590,
"repo_created_at": "2022-06-03T20:54:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07ed80324... |
a257fb47-335b-4e13-b49c-25ec6f8994f3 | Professor-Emanuel/Cpp_Advanced | Templates3/main.cpp | #include <iostream>
//Example 1
//Swap data using function templates
template<typename T> void Swap(T &n1, T &n2){
T temp;
temp = n1;
n1 = n2;
n2 = temp;
}
//Example 2
template<typename T> T Operation(T a, T b){
if(a != 0){
a = b/a + 3*a;
}else{
a = b*10;
}
return a;
}
... | TOOL | 0.990689 | 6.036738 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-08-16T17:36: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": "2ea1db749b8... |
b80b4ec8-b562-4986-90cb-8393a8941ac1 | GameFoundry/bsf | Source/Foundation/bsfUtility/ThirdParty/simdpp/detail/null/bitwise.h | /* Copyright (C) 2011-2012 <NAME> <<EMAIL>>
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)
*/
#ifndef LIBSIMDPP_DETAIL_NULL_BITWISE_H
#define LIBSIMDPP_DETAIL_NULL_BITWISE_H
#if SIMDPP_USE_NUL... | TOOL | 0.932156 | 6.980204 | {
"github_metadata": {
"branch": "master",
"commit_count": 5221,
"repo_created_at": "2018-03-15T10:17:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1752,
"forks": 194,
"issues": 99,
"pull_requests": 8
},
"file_meta": {
"content_id": "fd... |
bfc1ad59-a609-4f8a-983a-1b86451b4479 | zhouyong1234/SLAM-All-In-One | SLAM框架搭建/SLAM-KDQ/SlamCodes/gauss_filter/app/test3.cpp | //
// Created by kdq on 2021/6/22.
//
//
// Created by kdq on 2021/6/22.
//
#include <stdio.h>
#include <stdlib.h>
#include "GslGaussFilter.hpp"
#include <gsl/gsl_math.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include "fstream"
#include "iostream"
int main(void)
{
const size_t N = 500; ... | ALGO | 0.946758 | 4.313528 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-08-04T02:28:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 366,
"forks": 92,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1254481e7... |
bde5317b-c3fa-4f2a-8892-52bb11dcd4de | NhatMinh0208/CP-Archive | codeforces/92/D.cpp |
#include <bits/stdc++.h>
using namespace std;
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define ff first
#define ss second
#define pb push_back
#define space " "
#define all(x) (... | ALGO | 0.999967 | 3.456109 | {
"github_metadata": {
"branch": "master",
"commit_count": 1398,
"repo_created_at": "2020-12-23T02:12: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": "e13ed71... |
ff3e37be-8aff-4a5b-a0cb-9bcf9d0e942f | PriyanjulSonkar/NETWORKING | src/CRC.cpp | #include "../include/CRC.h"
using namespace std;
string CRC::textToBinary(const string& text) {
string binaryString = "";
for (char ch : text) {
binaryString += bitset<8>(ch).to_string();
}
return binaryString;
}
string CRC::binaryToText(const string& binary) {
string text = "";
for (s... | ALGO | 0.97813 | 5.850411 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-24T09:57: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": "b8aa7ad31359... |
acbcb5b5-c2bc-4b40-b569-6866bcb1bd9c | yuta-minamisawa/AtCoder | 166_ABC/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep3(i, s, n ,a) for (int i = (s); i < (int)(n); i+=a)
#define rep2(i, s, n) rep3(i, s, n, 1)
#define rep(i, n) rep2(i, 0, n)
#define MOD 1000000007
long binary_square(int x, int n);
int main(){
int x;
cin >> x;
vector<long> V;
rep(i, 10000){
... | ALGO | 0.999843 | 3.574536 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-09-14T10:48: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": "7d3779392... |
032d5141-8f5b-4402-aa54-697f60dd5539 | franv314/competitive | CSES/Graphs/shortest_routes1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int n, m; cin >> n >> m;
vector<vector<pair<int, int>>> adj(n);
for (int i = 0; i < m; i++) {
int a, b, c; cin >> a >> b >> c;
a--, b--;
adj[a].push_back({b, c});
}... | ALGO | 0.999959 | 4.367076 | {
"github_metadata": {
"branch": "soluzioni",
"commit_count": 263,
"repo_created_at": "2023-06-30T15:30:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17a37... |
26d10659-272f-4aa9-a0f6-1c9ea93a8656 | gvsagar2004/striver-sheet | DP/subaaraywithDivibyK.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <unordered_map>
using namespace std;
class Solution
{
public:
int subarraysDivByK(vector<int> &nums, int k)
{
int n = nums.size();
int ans = 0;
// for(int i=0;i<n;i++){
// int sum =0;
// for(int j=i;... | ALGO | 0.999616 | 5.633278 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-19T07:35: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": "941faae4a479... |
ac755e78-7130-4381-ac6b-192d39842dd7 | lzh107u/Leetcode-Daily | 1432_Max_Difference_You_Can_Get_From_Changing_an_Integer/solution.cpp | class Solution {
public:
int maxDiff(int num) {
int running = num;
vector<int> digits;
while ( running > 0 ) {
digits.push_back( running % 10 );
running /= 10;
}
bool flag_max = true;
bool flag_min = true;
int n = digits.size();
... | ALGO | 0.999959 | 5.574069 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-06-08T15:15: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": "c93db8d838f... |
1e67e1f9-6e9f-4af8-a1cd-b26f36c05b65 | febiosoftware/FEBio | FECore/MatrixProfile.cpp | /*This file is part of the FEBio source code and is licensed under the MIT license
listed below.
See Copyright-FEBio.txt for details.
Copyright (c) 2021 University of Utah, The Trustees of Columbia University in
the City of New York, and others.
Permission is hereby granted, free of charge, to any person obtaining a... | ALGO | 0.955808 | 5.384123 | {
"github_metadata": {
"branch": "develop",
"commit_count": 8010,
"repo_created_at": "2020-06-15T23:52:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 217,
"forks": 75,
"issues": 28,
"pull_requests": 3
},
"file_meta": {
"content_id": "c31... |
c054d6f7-acce-465a-aa2e-2aeffbee1458 | adityachirania/LEETCODE_PREP | No. of islands.cpp | class Solution {
public:
//dfs,visited vector
void dfs(vector<vector<char>>& grid,int x,int y,int n,int m)
{
grid[x][y] = '0';
int inc_x[] = {1,-1,0,0};
int inc_y[] = {0,0,1,-1};
for(int i = 0; i < 4 ; i++ )
{
int nx = x+inc_x[i];
int ny = y+in... | ALGO | 0.999973 | 6.147575 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2020-06-20T07:48: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": "26ed1e640... |
fff6cffa-844d-48b1-a7a0-979b6da1b6df | Wilson1996/LeetCode-exercise | 剑指offer/singleNumber.cpp | /*
* @Author: wilson_t(<EMAIL>)
* @Date: 2020-06-30 09:11:58
* @Last Modified by: wilson_t
* @Last Modified time: 2020-06-30 11:39:08
*/
/*********************************************************
在一个数组 nums 中除一个数字只出现一次之外,其他数字都出现了三次。请找出那个只出现一次的数字。
示例 1:
输入:nums = [3,4,3,3]
输出:4
示例 2:
输入:nums = [9,1,7,9,7,9,7]
输出:1... | ALGO | 0.999853 | 5.2933 | {
"github_metadata": {
"branch": "master",
"commit_count": 176,
"repo_created_at": "2020-03-06T02:51:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a9cc182... |
5148798e-8f47-4300-9bff-f6234fb3bfc7 | mual3154/HW1 | HW1.cpp | #include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<cstdlib>
#include<vector>
using namespace std;
struct wordItem{
string word;
int count;
};
void getStopWords(char *ignoreWordFileName, vector<string>& _vecIgnoreWords);
bool isCommonWord(string word, vector<string>& _vecIgnoreWord... | DATA | 0.999274 | 4.151696 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-08-29T21:10:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "409c3f2559... |
bd3db01c-3fa7-4e47-b317-497f9cdbcc50 | MahdiTavakol/Ray_Tracing | Ray_Tracing_20/RayTracing_13.cpp | #include <iostream>
#include <fstream>
#include <mpi.h>
#include "rtweekend.h"
#include "camera.h"
#include "hittable.h"
#include "hittable_list.h"
#include "material.h"
#include "sphere.h"
#include "write.h"
#include "color_array.h"
#include "camera_parallel.h"
#include "parallel.h"
int main()
{
// MPI
MPI_Ini... | ALGO | 0.983241 | 5.095061 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2024-08-31T09:31:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6642c1dedaf... |
d87aded0-935e-4e9d-855c-5964d528dfeb | Mitesh12ehd/DSA | 1. Basic question/q11_printAllDigit.cpp | #include<iostream>
#include<cmath>
using namespace std;
int countDigit(int n){
int ans = 0;
while(n != 0){
ans++;
n = n /10;
}
return ans;
}
void reverseArray(int arr[],int n){
int start = 0;
int end = n-1;
while(start <= end){
int temp = arr[start];
arr[sta... | ALGO | 0.999547 | 4.651134 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-01-11T11:07:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1a59bc3521... |
4be8d202-e27e-462d-996f-2ea6e78cd580 | weekend27/leetcode | restoreIPAddresses/restoreIPAddresses.cpp | // Source : https://leetcode.com/problems/restore-ip-addresses/
// Author : weekend27
// Date : 2015-12-17
/**********************************************************************************
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given... | ALGO | 0.999772 | 5.592659 | {
"github_metadata": {
"branch": "master",
"commit_count": 227,
"repo_created_at": "2015-11-18T13:41:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf80483... |
e48beced-52c8-47fd-896b-0c0ed95b6510 | flaviu2001/High-School-Small-Projects | ONI/ONI 2019/maxk.cpp | #include <bits/stdc++.h>
using namespace std;
const int nmax = 1000005;
int n, k, v[nmax], f[nmax/10+5], mn = nmax;
int main()
{
ifstream fin ("maxk.in");
ofstream fout ("maxk.out");
fin >> n >> k;
for (int i = 1; i <= n; ++i)
fin >> v[i];
int cnt = 0, id = 0;
for (int i = 1; i <= ... | ALGO | 0.999993 | 3.933093 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-04-09T13:40: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": "a0ae4f6ce... |
677886a4-b382-44c3-98b8-a1e4396a7f7c | u-noob-i/contest | Codeforces/Educational Round 144 div2/A.cpp | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <queue>
#include <climits>
#include <sstream>
#include <tuple>
#include <iomanip>
using namespace std;
int n, m, i, j;
string s;
long long modu = ... | ALGO | 0.999845 | 3.794466 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-09-01T17:42: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": "9af426654c9c... |
963a2406-70c3-480a-8298-0dbb78cb3cb8 | HPCSYSPROS/Workshop20 | Application_performance_in_frontera_acceptance_process/artifacts/namd/code/NAMD_2.12_Source/src/GridForceGrid.h | /**
*** Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by
*** The Board of Trustees of the University of Illinois.
*** All rights reserved.
**/
#ifndef GRIDFORCEGRID_H
#define GRIDFORCEGRID_H
#include <set>
#include "Vector.h"
#include "Tensor.h"
#include "SimParameters.h"
#include "NamdTypes.h"
#include "MStre... | ALGO | 0.970314 | 3.44746 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2020-12-10T22:00:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9b7e95ced... |
b97aa029-0671-4b54-ae3f-eb96f9d55f9b | chizhizhen/leetcode | official/14.cpp | #include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
string min_str;
int num = INT_MAX;
for (auto str:strs) {
int n = getNum(str);
if (n <= num) {
n... | ALGO | 0.999541 | 4.72515 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-14T01:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f6c146ff2... |
38f0ba2c-40cf-44b1-acf8-f72dace8b895 | hszouszcz/praca_magisterska | Mirror/Mirror/EyeTracker.cpp | #include "EyeTracker.h"
#include <iostream>
#define _CRT_SECURE_NO_WARNINGS
#define NOMINMAX
EyeTracker::EyeTracker()
{
}
EyeTracker::~EyeTracker()
{
}
bool EyeTracker::are_eyes_detected(std::vector<cv::Rect> eyes, cv::Point reference_point)
{
cv::Point firstEye = cv::Point(eyes[0].x, eyes[0].y);
cv::Point second... | ALGO | 0.915656 | 5.664042 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2015-04-26T19:53: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": "9cb673256... |
6f21dd44-55aa-4684-9182-d193355e9b58 | MezaMaximiliano/Practicas_Cplusplus | Practicas C++/Archivos secuenciales/Pilas/Practica/Ejercicio 2.cpp |
/*Ejercicio 2
Desarrollar los siguientes algoritmos:
a) Colocar un nuevo elemento a una pila
b) Eliminar de una pila todas las ocurrencias de un elemento dado.
c) Intercambiar los elementos del inicio y del final de la pila, sin modificar el resto
d) Generar una PILA que contenga la pila original y a continuación una ... | ALGO | 0.998823 | 3.847862 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-09-07T21:57: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": "750003d460... |
a401c4f7-534c-47aa-9d1a-354f2fa76d3f | Kitware/iMSTK | Source/CollisionHandling/imstkSphCollisionHandling.h | /*
** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
** iMSTK is distributed under the Apache License, Version 2.0.
** See accompanying NOTICE for details.
*/
#pragma once
#include "imstkCollisionHandling.h"
#include "imstkMacros.h"
namespace imstk
{
class CollisionData;
class CollisionDetec... | TOOL | 0.985872 | 5.715141 | {
"github_metadata": {
"branch": "master",
"commit_count": 4139,
"repo_created_at": "2021-09-20T17:10:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 26,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2043ac... |
119f9b0e-6202-4330-aecf-139ec41f5647 | matia6170/codeforces-problems | 4_complete_search/4A_placing_queens2.cpp | #include <stdio.h>
#include <vector>
using namespace std;
int k = 2, n = 3, m = 4;
int qCnt = k, possibleBoards = 0;
void printBoard(vector<vector<bool> > &vvb) {
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
printf("%c ", vvb[i][j] ? 'Q' : '.');
}
printf("\n");... | ALGO | 0.999956 | 4.25075 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-09-09T14:37:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21b1779d024... |
5c0b513b-5893-4e73-a39e-4a9092fdf2e4 | mohsin-riad/codeforces-solutions | 1265 B.cpp | /**
* Git >> Mohsin_Riad
░░░▄█████████████████▄
░░▐████▀▒██████████████▄
░▒██▀▒▒▒▒▒█████████▀█████
░▐██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██... | ALGO | 0.999851 | 3.48298 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-02-28T19:27:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a678ec7b9f... |
e8eb1de6-e07b-4fba-8b50-f7788d1a5303 | luzh0422/algorithm | graph/BellmanFord/main.cpp | #include <iostream>
#include <vector>
#include <cmath>
using std::cout;
using std::endl;
using std::vector;
const int INF = 1000000000;
struct Edge {
int from;
int to;
double weight;
};
struct Graph {
private:
int V;
vector<Edge> E;
vector<int> pre;
vector<int> d;
public:
Graph(int v... | ALGO | 0.999977 | 4.394474 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-05-20T14:31: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": "9fe5f2756... |
f69a33fb-52fb-47e1-94d6-51ef5f3743ee | devgoel186/Leetcode-Solutions | first-missing-positive/Accepted/7-30-2021, 3_31_57 PM/Solution.cpp | // https://leetcode.com/problems/first-missing-positive
class Solution {
public:
int segregate(vector<int> &nums)
{
int index = 0;
for(int i = 0; i < nums.size(); i++)
{
if(nums[i] <= 0)
{
swap(nums[i], nums[index]);
index++;
... | ALGO | 0.999977 | 5.389194 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-04-13T07:40: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": "4fc0b9996658... |
66c1e4f2-daa5-42bb-9198-642ba72a0598 | alaneos777/club | uva/12307.cpp | #include <bits/stdc++.h>
using namespace std;
typedef double ld;
ld eps = 1e-9;
struct point{
ld x, y;
point(): x(0), y(0){}
point(ld x, ld y): x(x), y(y){}
void read(){cin >> x >> y;}
point operator-(const point & p) const{
return point(x - p.x, y - p.y);
}
ld cross(const point & p) const{
return x * p.y... | ALGO | 0.999842 | 4.334513 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-08-06T04:13:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e5305fc3... |
6ad53455-225a-4928-96be-0e64673e8fde | wayne1204/DSP | hw3/mydisambig.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include "Ngram.h"
using namespace std;
typedef std::pair<vector<string>, double> pathPair;
class Dictionary{
public:
void reset(){
wordTree.clear();
bestPat... | ALGO | 0.998412 | 4.473423 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-04-23T07:12:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f26f268501... |
057519be-2120-4152-983a-4b4c2b24b4e6 | durgeshpushpakar/LeetCode-Questions | Graphs/Practice/get path BFS.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int>*BFS(vector<vector<int>>&edges, int start, int end){
int n=edges.size();
vector<bool> visited(n, false);
vector<int>*ans=new vector<int>;
if(start==end){
ans->push_back(start);
return ans;
}
unordered_map<int, int>parent;
... | ALGO | 0.999986 | 4.577199 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2021-10-02T18:51:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "231e6a9f4b... |
01fcbf95-efd2-4030-8dd7-292d3555c1c6 | Edgarrrrrr/T2-RELION | src/jaz/tomography/reconstruction.h | /***************************************************************************
*
* Author: "<NAME>"
* C-CINA Basel
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the ... | ALGO | 0.944843 | 4.66841 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-28T08:03:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0eb90d3abaea... |
6a49fdac-9045-4d60-8560-be7e91eab7c2 | Lagites/qvk827 | student/03/container/main.cpp | #include <cstdlib>
#include <iostream>
#include <vector>
#include <cmath>
// Prints the elements in the parameter vector ints.
void print_integers(const std::vector< int >& ints)
{
for(auto elem : ints) {
std::cout << elem << " ";
}
std::cout << std::endl;
}
// Reads as many integers as the param... | TEST | 0.972057 | 4.442503 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2024-11-26T18:54:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6058791c6b... |
9a087cb1-a4df-4ba4-b74e-6a2b32820ba9 | esgems/paperpose | src/PositionEstimator.cpp | #include "src/include/PositionEstimator.h"
#include <opencv2/calib3d.hpp>
namespace paper_pos
{
void decompositionH(cv::Mat K, cv::Mat H, cv::Mat& R, cv::Mat& t)
{
cv::Mat h1 = H.col(0);
cv::Mat h2 = H.col(1);
cv::Mat h3 = H.col(2);
cv::Mat invK = K.inv();
double L = ... | ALGO | 0.999033 | 5.49002 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-04-27T10:03: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": "a7362e33ee... |
7ecc865e-4652-4b18-8789-86b818345b43 | nickwang333/Leetcode | LC 103. Binary Tree Zigzag Level Order Traversal.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.999989 | 6.06637 | {
"github_metadata": {
"branch": "main",
"commit_count": 865,
"repo_created_at": "2021-09-06T03:30:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfe8c61d41... |
ecd8cc43-b86d-4f7f-a1f2-f9bb5c7ad055 | alvinahsu/Competitive-Programming | Practice/UCSD/UCSDSP23_5/D.cpp | /*
* File: UCSDSP23_5D
* Author: <NAME>
* Date: 05/15/2023 18:17:26
*/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "../../Templates/debug.h"
#else
#define dbg(...)
#endif
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
//always need to go the absolute min
//if multiple spots, we n... | ALGO | 0.999969 | 4.303309 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-04-04T09:52: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": "b7afc64818f... |
2cdc2ff2-fdf0-41c6-bd9f-705cd3ddd085 | imDema/noir-paper-main | loc/single/collatz/openmp/main.cpp | typedef struct
{
size_t n, count;
} result_t;
void merge(result_t &omp_out, const result_t &omp_in)
{
if (omp_in.count > omp_out.count)
{
omp_out.n = omp_in.n;
omp_out.count = omp_in.count;
}
}
#pragma omp declare reduction(merge:result_t \
: merge(omp_out, omp_in)) initia... | ALGO | 0.999994 | 5.356716 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-06-12T15:42:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "263bf0d0a0a9... |
85782063-e009-454e-aebc-e6cc175e2d32 | algebra84/leetcode | src/twopoints/partition.cpp | /* 86. Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You should preserve the original relative order of the nodes in each of the two partitions.
For example,
Given 1->4->3->2->5->2 and x = 3,
return 1->2->2->... | ALGO | 0.999988 | 5.088006 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2017-03-21T08:15: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": "3acad19d... |
955d92b0-05ea-40ff-82b9-e9f76d80dd88 | Chinesezjc/Solved-Problems | CodeForces/CF1455E.cpp | // This Code was made by Chinese_zjc_.
#include <bits/stdc++.h>
// #define debug
#define int long long
// #define double long double
const long double PI = acos(-1);
const long double eps = 1e-10;
const long long INF = LLONG_MAX >> 1;
int T, x[4], y[4], c[4], ans;
signed main()
{
std::ios::sync_with_stdio(false);
... | ALGO | 0.999737 | 4.271617 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2020-12-29T10:37: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": "a24ccfc58... |
084c24cf-168e-48e2-9ed5-9e827c378e0d | iambharatks/LeetCodeProblems | palindromeLinkedList.cpp | #include <bits/stdc++.h>
using namespace std;
// 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:
... | ALGO | 0.999912 | 5.880061 | {
"github_metadata": {
"branch": "main",
"commit_count": 282,
"repo_created_at": "2020-10-15T12:57:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5bf498758... |
14a21b91-3347-4efe-a35c-a0e09f4c56ce | sertayy/University_Projects | bogazici/CMPE250 | Data Structures and Algorithms/AirportOptimizationSimulator/main.cpp | /*
NOT COMPLETED
*/
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <iterator>
#include "Simulation.h"
#include <list>
using namespace std;
template <class Container>
void split1(const string& str, Container& cont)
{
istringstream iss(str);
copy(istream_iterator<string>... | ALGO | 0.975089 | 3.024329 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2020-01-17T12:23:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 30
},
"file_meta": {
"content_id": "c553226... |
01aaa821-ec7e-4c2d-a5e0-830a34210344 | Chan-Heee/baekjoon | BFS/2583v1.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
int map[102][102];
int n;
int m;
int k;
int result;
bool visited[102][102];
int main()
{
cin >> m >> n >> k;
int l_x;
int l_y;
int r_x;
int r_y;
queue<pair<int, int>> q;
vector<int> v;
in... | ALGO | 0.999878 | 3.115392 | {
"github_metadata": {
"branch": "main",
"commit_count": 191,
"repo_created_at": "2023-06-21T13:48: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": "77aafcf88a... |
1d7e8dd2-36e3-4330-946c-5fba436f7b83 | sauravranjan07/leetcode-with-CPP | 0236-lowest-common-ancestor-of-a-binary-tree/0236-lowest-common-ancestor-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* helper(TreeNode* root, TreeNode* p, TreeNode* q) {
if (root == NULL)
... | ALGO | 0.999953 | 6.314209 | {
"github_metadata": {
"branch": "main",
"commit_count": 810,
"repo_created_at": "2024-09-10T06:33: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": "c1f097b74e... |
eb2a2211-dcc8-44c1-b1f3-f4971264510f | Kitware/VTK | Common/DataModel/vtkTriQuadraticPyramid.h | // SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME>
// SPDX-License-Identifier: BSD-3-Clause
/**
* @class vtkTriQuadraticPyramid
* @brief cell represents a parabolic, 19-node isoparametric pyramid
*
* vtkTriQuadraticPyramid is a concrete implementation of vtkNonLinearCell to
* represent a second or... | TOOL | 0.926358 | 6.678364 | {
"github_metadata": {
"branch": "master",
"commit_count": 94968,
"repo_created_at": "2010-04-27T15:12:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2910,
"forks": 1246,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3... |
441b5cab-caca-4fdf-9586-8c77f9845b2d | redsimmba/Intern-Preparation-Material-Shared | Sorting and Searching/Min Stack.cpp | //Max STack is done similarly, just maintain a max stack.
class MinStack {
public:
stack<int> data;
stack<int> mina;
MinStack() {
}
void push(int val) {
data.push(val);
if(mina.empty()){
mina.push(val);
}
else{
if(mina.top()<=val... | ALGO | 0.999951 | 6.188914 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-03-20T04:25: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": "fdc4a755009f... |
85de7a1a-2828-465c-9146-a8b928e2041e | 2yujeong/Algorithm | Graph/lv2_36.cpp | /*
문제 출처 : https://programmers.co.kr/learn/courses/30/lessons/17679 (프로그래머스 Level 2)
같은 모양의 카카오프렌즈 블록이 2×2 형태로 4개가 붙어있을 경우 사라지면서 점수를 얻는 게임을 구현하는 문제.
블록이 지워진 후에 위에 있는 블록이 아래로 떨어져 빈 공간을 채우게 된다.
만약 빈 공간을 채운 후에 다시 2×2 형태로 같은 모양의 블록이 모이면 다시 지워지고 떨어지고를 반복하게 된다.
(m - 1) x (n - 1) 개의 각 블럭에 대해 자신과 자신의 오른쪽, 아래, 오른쪽 아래 대각선에 있는 ... | ALGO | 0.999934 | 5.501388 | {
"github_metadata": {
"branch": "master",
"commit_count": 260,
"repo_created_at": "2021-02-15T14:08: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": "c63c3d91... |
d82e0aae-13cb-47db-88cb-fcfe09e808ba | ishandutta2007/codeforces-p | popovicirobert/normal/1416/B.cpp | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define Test(tt) cout << "Case #" << tt << ": "
using namespace std;
struct Move {
int i, j, x;
};
int main() {
#ifdef HOME
ifstream cin("A.in");
ofstream cout("A.out");
#endif
int t, i;
ios... | ALGO | 0.998756 | 3.158175 | {
"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": "d7c1b2e171df... |
ff83a406-ffd2-47ca-99e6-a6a5d5e44157 | fpGHwd/pat_macos | pat/greatest-sum-sequence.cpp | //
// greatest-sum-of-subsequence.cpp
// pat
//
// Created by 帝君 on 2018/3/14.
// Copyright © 2018年 Rumi. All rights reserved.
//
#include <stdio.h>
#include <algorithm>
using namespace std;
#define MAXV 1010
static const int INF = -100000;
static int A[MAXV],sum[MAXV], N;
static int dp(int x){
if(sum[x] ==... | ALGO | 0.99998 | 4.016166 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-03-22T10:12:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed26b4370... |
f0245479-597d-478a-9059-25170bf14eb2 | rootkonda/LeetCode | 779. K-th Symbol in Grammar.cpp | /*
On the first row, we write a 0. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence of 1 with 10.
Given row N and index K, return the K-th indexed symbol in row N. (The values of K are 1-indexed.) (1 indexed).
https://leetcode.com/problems/k-th-sy... | ALGO | 0.999931 | 5.913518 | {
"github_metadata": {
"branch": "master",
"commit_count": 430,
"repo_created_at": "2020-04-11T11:28:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd9f83cc... |
55a2abaf-b1ad-4615-b3e5-eff4b6915359 | tshu-w/ICPC | training/POJ/2114.cpp | // written at 13:00 on 13 Mar 2017
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <complex>
#include <deque>
#include <list>
#include <map>
#include <qu... | ALGO | 0.999714 | 3.775677 | {
"github_metadata": {
"branch": "master",
"commit_count": 269,
"repo_created_at": "2016-04-24T03:41:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 154,
"forks": 33,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d836... |
26d426f2-e0f8-4785-959a-291121759677 | liaojh1998/Competitive-Programming | CodeChef/JUNE17/SUMQ.cpp | #include <bits/stdc++.h>
using namespace std;
class FastIO{
//#define getchar() (getchar_unlocked()) //For hackerrank
private:
//inline if read speed is needed, huge compilation time required though
//safe no fread implementation
int readInt(int &n){
register int c;
n = 0;
bool neg = false;
c = getchar();
... | ALGO | 0.99996 | 4.23554 | {
"github_metadata": {
"branch": "master",
"commit_count": 134,
"repo_created_at": "2016-09-19T22:10:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75099e7d... |
3a641ccf-8bcc-4292-bb03-50d536eb104a | JnathanCarter/Codebreaker | JDC_Project1/Project1.cpp | #include <iostream>
#include <cstdlib>
#include "Project1.h"
using namespace std;
// FUNCTION DEFINITIONS
// GET PLAYER CODE
string get_player_code() {
/* Prompts the user to enter a four-digit code, then checks code length and whether digits are in bounds */
/* Local Variables */
string player_code = strin... | TOOL | 0.919803 | 3.218587 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-12-06T05:55:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df5d1e475631... |
4e75d1bb-ad69-4c16-943f-57489c6eedb4 | ishandutta2007/codeforces-t | tadijasebez/normal/1238/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define ldb long double
#define mt meke_tuple
template<typename T> bool ckmn(T &a, T b){ T c=a;a=min(a,b);return a!=c;}
template<typename T> bool ckmx(T &a, T b){ T c=a;a=max(a,b);return a!=c;}
const int N=50005... | ALGO | 0.999905 | 3.219755 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca2219db6f99... |
32c8f8cf-0f96-4ca3-bf7d-31e3c4cfea22 | Essoz/CS225_ZJUI | HW/HW8/Lecture template/btree/Btree_template.cpp | /*
*Copyright@Naveen
*6:24:49 PM
*Btree.cpp
*
*/
#include <iostream>
#include <stdio.h>
using namespace std;
/* In BtreeNode class
We just store the key and we do not store value
if you want, you can modify the class definition of Btree Node.
*/
class BtreeNode
{
int *a;
BtreeNode **C;
int n;
int t;
bool ... | ALGO | 0.999834 | 3.825614 | {
"github_metadata": {
"branch": "main",
"commit_count": 314,
"repo_created_at": "2020-12-27T08:39:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1f6426bfe... |
6a4a6124-b915-4c68-b175-2857e27d5b07 | BETuncay/visibility-color-optimization | raw_data/Transformer/LineDistanceMetrics.cpp | #include "LineDistanceMetrics.hpp"
namespace vispro
{
Eigen::MatrixXd LineDistanceMetrics::Compute_Metric(const Lines5d& lines, const DistanceMetrics metric)
{
switch (metric)
{
case MeanL2:
return LineDistanceMetrics::Compute_Mean_L2_Naive(lines);
case rMCPD:
return LineDistanceMetrics::Compute_rMCP... | ALGO | 0.999425 | 5.834985 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-03-25T20:07:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d997eada5cbc... |
640e61f3-5cd5-4df8-96f0-29a9bc4324de | anamargaridaborges/competitiveprogramming | codeforces/treejumps.cpp | #include <bits/stdc++.h>
#define MAXN (int)(3e5+10)
using namespace std;
int dist[MAXN], vis[MAXN];
vector<int> adj[MAXN];
const int inf = 998244353;
void dfs (int x, int d) {
dist[d]++;
for (int i=0; i<(int)(adj[x].size()); i++) {
int at = adj[x][i];
if (vis[at] != 0) continue;
vis[a... | ALGO | 0.999869 | 4.457293 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2024-08-03T12:49:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b999402e0d... |
0bb87d54-b79b-46fd-a6e1-9ec0e6596914 | DariaGazkaeva/ParallelProgramming | mpi/task2_5.cpp | #include <mpi.h>
#include <random>
int main(int argc, char** argv)
{
int rank, size;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Status status;
const int ZERO_PROCESS = 0;
const int ROWS = 10;
const int COLUMNS = 10;
const... | ALGO | 0.999451 | 5.387525 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-09-19T19:54: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": "26858b2188b... |
bb4d49df-761d-4728-bf92-6b675c25d5fc | DreamDreames/OJ | Hackerrank/BotCleanLarge.cpp | #include<iostream>
#include<vector>
#include<string>
using namespace std;
void next_move(int posr, int posc, int dimh, int dimw, vector <string> board) {
if (board[posr][posc] == 'd'){
cout << "CLEAN" << endl;
return;
}
int minstep = 100000, minx, miny;
for (int i = 0; i < dimh; ++i){
const auto& b = board[i]... | ALGO | 0.999887 | 4.609004 | {
"github_metadata": {
"branch": "master",
"commit_count": 376,
"repo_created_at": "2016-04-26T13:51: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": "6c045316... |
f7b23508-c7bd-4e08-86c2-7ed894efeece | jvdss/Biblioteca | stress/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i_ , e_ ) for(int i_ = (int) 0 ; i_ < (int) e_ ; ++i_ )
#define rall(x) x.rbegin(),x.rend()
#define all(x) x.begin(),x.end()
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define int long long
typedef long long ll;
typedef long do... | ALGO | 0.999948 | 3.59014 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-25T14:10: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": "73bfcc747160... |
863f715c-588e-4695-8f53-b700cb1f6916 | google/monster-mash | third_party/libigl/include/igl/planarize_quad_mesh.h | // This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2015 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.... | ALGO | 0.988272 | 6.608764 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-01-28T21:04:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1312,
"forks": 182,
"issues": 24,
"pull_requests": 0
},
"file_meta": {
"content_id": "712ae1... |
ee2fc0a1-7ed9-4c4c-9900-b2f391b4eef7 | meetrainier/ManojMath | TriangleSoup/IntersectTrianagleSoupeAndPrism.cpp | #include "pch.h"
#include <iostream>
#include <vector>
#include <array>
#include <cmath>
#include "TriangleSoupApi.h"
using namespace std;
//Implementation 1
/*
// Helper function to check if a point is inside a polygon using ray-casting
bool point_in_polygon(const Point3d& point, const Polygon& polygon) {
int cr... | ALGO | 0.98152 | 6.66153 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2014-07-22T20:58: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": "229a5149... |
cf5227b9-2c6c-405e-a86c-e561943ff808 | duycc/LeetCode | LeetCode/cpp/lc_0257.cpp | /**
* @file binaryTreePaths.cpp
* @brief https://leetcode-cn.com/problems/binary-tree-paths/
* @author DuYong
* @date 2021-03-07
*/
//===----------------------------- 回溯 ------------------------------===//
class Solution {
public:
vector<string> binaryTreePaths(TreeNode *root) {
if (root == null... | ALGO | 0.99981 | 6.293191 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2021-09-23T14:51: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": "a409dd4dc... |
a2f9f1dd-320b-455d-9a6a-be29591a8dbe | mySoftSnail/MyCodingTestStudy | 백준/2630_색종이 만들기.cpp | #include <bits/stdc++.h>
using namespace std;
int paper[130][130];
int one = 0;
int zero = 0;
bool check(int r, int c, int n) {
bool same = true;
for (int i = r; i < r + n; ++i) {
for (int j = c; j < c + n; ++j) {
if (paper[r][c] != paper[i][j]) {
same = false;
break;
}
}
if (!same) break;
}
... | ALGO | 0.999936 | 4.415402 | {
"github_metadata": {
"branch": "master",
"commit_count": 302,
"repo_created_at": "2022-06-17T11:50:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48f92db6... |
800b87a4-cd3a-4f72-867f-888ef3c1038b | chenzeyin9867/algorithm | 2021_11/findKthLargest.cpp | /**
* @file findKthLargest.cpp
* @brief exercise for heap sort/ and Q-sort / merge-sort
* @author chenzeyin (<EMAIL>)
* @date 2021-11-26
* @copyright Copyright (c) 2021 chenzeyin9867
*/
#include "head.h"
class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
// sort(nums.be... | ALGO | 0.999897 | 5.001573 | {
"github_metadata": {
"branch": "master",
"commit_count": 439,
"repo_created_at": "2021-01-26T12:43:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa853e5d... |
7d1dcb79-7c85-4c07-a13b-6147accf1bf0 | achen228/DS | LearnDay/LinkList_OJ/对链表进行插入排序/Test.cpp | //对链表进行插入排序
#include <iostream>
using namespace std;
struct ListNode
{
int val;
ListNode* next;
ListNode(int x) : val(x), next(NULL) {}
};
typedef struct ListNode Node;
ListNode* insertionSortList(ListNode* head)
{
if (head == NULL || head->next == NULL)
{
return head;
}
Node* s... | ALGO | 0.999977 | 5.093469 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2020-01-01T14:24:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60eb3f48... |
6003c5a6-8729-40de-aa32-fbb8fb2fcdb9 | DemonReaper30/Conquian | Cards/Game.h | #include <iostream>
#include <unordered_map>
#include <algorithm>
#include "Deck.h"
#include "Players.h"
class Game {
private:
Deck deck;
std::vector<Player> players;
const int maxPlayers = 3;
public:
void playGame() {
// Create players
for (int i = 0; i < maxPlayers; ++i) {
... | TOOL | 0.956656 | 5.077759 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-10-29T02:50:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "164773dcc4f... |
fcb56f07-dd50-49b0-91ff-f77df232be04 | MathProgrammer/Hacker-Earth | Contests/May Easy 2019/Programs/Minimum Flip.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#define LEFT(n) (2*n)
#define RIGHT(n) (2*n + 1)
#define min(a, b) (a < b ? a : b)
#define max_3(a, b, c) max(a, max(b, c))
#define min_3(a, b, c) min(a, min(b, c))
#define all(v) (v).begin(), (v).end()
using namespace std;
int is_bit_set(int n, int positi... | ALGO | 0.999856 | 4.558021 | {
"github_metadata": {
"branch": "master",
"commit_count": 362,
"repo_created_at": "2017-04-16T06:49:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 47,
"forks": 42,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "f24041... |
ef299a96-2e95-4cb6-8d5d-a481676a2f8c | faisal-ahmed/acm | UVA/607/607.cpp | #include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for (i=a; i<b; i++)
#define mx ((1<<31)-1)
int dt[1010][1010], n, L, C, T[1010];
int min(int a, int b)
{
if (a>b) return b; return a;
}
int f(int d, int t)
{
int ret = mx, i;
if (t==0) r... | ALGO | 0.999393 | 3.027325 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-10-29T16:19: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": "f27d7fb04d... |
a311308e-62c4-4791-a109-6f04b5a495f7 | gzshawnliang/competitive-programming | myCpps/other/CF_1385G_ColumnsSwaps/CF_1385G_ColumnsSwaps.cpp | /*
-------------------------------------------------------------------
* @Name: 1385G Columns Swaps
* @Author: Shawn
* @Create Time: 2020/7/20 17:28:13 (UTC+08:00)
* @Url: https://codeforces.com/contest/1385/problem/G
* @Description:
-------------------------------------------------... | ALGO | 0.99999 | 4.705792 | {
"github_metadata": {
"branch": "master",
"commit_count": 1963,
"repo_created_at": "2019-01-17T06:33:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b8243a... |
77531034-1f9a-4157-b24e-69a7ec84cbc1 | thodrek/sampler | src/app/gibbs/gibbs_sampling.h |
#include <iostream>
#include "io/cmd_parser.h"
#include "dstruct/factor_graph/factor_graph.h"
#ifndef _GIBBS_SAMPLING_H_
#define _GIBBS_SAMPLING_H_
namespace dd{
/**
* Class for (NUMA-aware) gibbs sampling
*
* This class encapsulates gibbs learning and inference, and dumping results.
* Note the facto... | ALGO | 0.905603 | 6.448519 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2015-07-29T02:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea240ee4a... |
c00d621c-715b-40ec-859a-249c7c856332 | dmlc/dgl | graphbolt/src/unique_and_compact.cc | /**
* Copyright (c) 2023 by Contributors
*
* @file unique_and_compact.cc
* @brief Unique and compact op.
*/
#include <graphbolt/cuda_ops.h>
#include <graphbolt/unique_and_compact.h>
#include "./concurrent_id_hash_map.h"
#include "./macro.h"
#include "./utils.h"
namespace graphbolt {
namespace sampling {
std::t... | ALGO | 0.922149 | 7.5473 | {
"github_metadata": {
"branch": "master",
"commit_count": 4416,
"repo_created_at": "2018-04-20T14:49:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13984,
"forks": 3049,
"issues": 444,
"pull_requests": 134
},
"file_meta": {
"content_id"... |
ed0a1125-b5df-41a0-bd55-e92e7bf6c0a6 | TooSchoolForCool/Pedestrian-Vehicle-Detection | src/vetoptflowdetector.h | /**
* [
* Copyright (c) 2016 by Vehicle-Eye Technology
* ALL RIGHTS RESERVED.
*
* The software and information contained herein are proprietary to, and comprise
* valuable trade secrets of, Vehicle-Eye Technology. Disclosure of the software
* and information will materially harm the business of Vehicle-Eye Techn... | ALGO | 0.986997 | 6.621537 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2017-02-21T11:57:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "529d9764... |
51cf92f4-3a23-405d-8953-9620e1fd0372 | brahmsjiang/Exe_Cplspls | sword to offer/40.cpp | #include <iostream>
int Partition(int* numbers, int len, int start, int end)
{
if (numbers == nullptr || len <= 0 || len <= (end - start))
return -1;
int pivot = numbers[0], i = start, j = end;
while (i < j)
{
while (i < j && numbers[j] >= pivot)
--j;
if (i < j && numbers[j] < pivot)
... | ALGO | 0.999937 | 5.077757 | {
"github_metadata": {
"branch": "master",
"commit_count": 353,
"repo_created_at": "2018-01-09T15:18:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bd1ae53... |
9af520e0-9aee-46f3-9163-8cf644193e6f | Ryan10101996/Code | main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <queue>
using namespace std;
int clockerino = 0;
double sumSSD = 0;
double totalSSD = 0;
double coreAccess = 0;
//splits up the request type and time
vector<string> divide(string x) {
vector<string> temp;
string b... | ALGO | 0.995629 | 3.546486 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-13T05:19:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fce580693... |
99436b86-98ef-4bd4-98c9-972b92a71724 | imran7955/Problem-Solving-on-different-OJ | CSES/1 Introductory Problems/1092 Two Sets.cpp | #include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
typedef unsigned long long ull;
typedef long long ll;
using namespace std;
int main() {
ll n; cin >> n;
ll sum = n*(n+1)/2;;
if(sum%2) cout << "NO" << endl;
else
{
cout << "YES" << endl;
ll l ... | ALGO | 0.99988 | 3.033275 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2023-02-17T16:53: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": "8bf1f45fca... |
b3903299-0eaa-43cf-9017-3addec545641 | downs990/ProjectsUdacityCPP | Threads/StartingThreadsWithVariadicTemplates/example_2.cpp | #include <iostream>
#include <thread>
#include <string>
void printName(std::string name, int waitTime)
{
std::this_thread::sleep_for(std::chrono::milliseconds(waitTime));
std::cout << "Name (from Thread) = " << name << std::endl;
}
int main()
{
std::string name1 = "MyThread1";
std::string name2 = "MyT... | TOOL | 0.927043 | 5.441671 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2021-09-30T15:12: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": "82903bedf96... |
d3b61504-e43f-4855-9443-1f13c0870104 | Sudhir769/LeetCode-GFG-Daily | 20 October 2024/gfg/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
class DLLNode{
public:
int data;
DLLNode *next;
DLLNode *prev;
DLLNode(int data){
this->data = data;
this->next = NULL;
this->prev = NULL;
}
};
class Solution
{
public:
// function to sort a k sorted doubly linked list
... | ALGO | 0.999798 | 4.855416 | {
"github_metadata": {
"branch": "main",
"commit_count": 375,
"repo_created_at": "2024-01-01T18:09:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba012485ec... |
c5f63e39-e304-46e6-89e8-87cc53a3547a | rajneesh069/DSA-CPP | DSA/graphs_and_trees/height_and_depth_of_a_tree.cpp | #include <bits/stdc++.h>
using namespace std;
void dfs(int v, int par, vector<vector<int>>& g, vector<int>& depth, vector<int>& height) {
// going down into the vertex
for (int child : g[v]) {
// going down into the child
if (child == par) continue;
depth[child] = depth[v] + 1;
... | ALGO | 0.99994 | 4.355524 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2024-08-05T14:58:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d6f202ae8... |
0fc20a69-3b8b-44ce-8cd2-f9cd1f760caf | akshatjindal/MarchLeetcode | decodeString.cpp | //March 27
//https://leetcode.com/problems/decode-string/
#include <string>
#include <stack>
#include <ctype.h>
using namespace std;
class Solution {
int ptr = 0;
int count = 0;
stack<int> nums;
string decoded = "";
public:
string decodeString(string s) {
string temp = "";
w... | ALGO | 0.998707 | 5.8294 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-03-19T15:14: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": "4909a9dc3d2... |
1aa9ef2d-0b07-4beb-8e30-99efb320bcb2 | AnimismFudan/Animism | 2017-02-26 NEERC 2016/J/J.cpp | #include <bits/stdc++.h>
using namespace std;
const int MaxN = (int)1e4 + 7;
const int MaxH = 5007;
const double eps = 1e-7;
struct nodetype
{
double x, y, w;
void Print()
{
printf("(%lf, %lf) - %lf\n", x, y, w);
}
};
int N, W, H, Q;
int l[MaxH], r[MaxH];
bool flg[MaxH][MaxN];
nodetype f[MaxH], sf[MaxH];
node... | ALGO | 0.999961 | 3.488561 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2016-10-05T12:54:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57d6f93711... |
fa69c523-f976-4d3b-a05c-571a47b0dfed | jas-karan/myLeetcode | 1170-compare-strings-by-frequency-of-the-smallest-character/1170-compare-strings-by-frequency-of-the-smallest-character.cpp | class Solution {
public:
// vector<int> numSmallerByFrequency(vector<string>& queries, vector<string>& words) {
// int n = words.size(),q = queries.size();
// for(string&s:queries) sort(s.begin(),s.end());
// for(string&s:words) sort(s.begin(),s.end());
// vector<int>ans;
... | ALGO | 0.999961 | 5.580102 | {
"github_metadata": {
"branch": "main",
"commit_count": 2643,
"repo_created_at": "2021-12-25T09:57: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": "28fb9c2f3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.