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 |
|---|---|---|---|---|---|---|---|
195d2a32-feb2-4e66-a268-aa79f95a4a3e | Scommegna/exercicios-ed | Pilhas/ordenar_pilha.cpp | /* Classe pilha estatica
*
* by <NAME>, 2023, Estruturas de Dados
*
*/
#include <iostream>
using namespace std;
// Imprime informações de um dado qualquer.
void imprimir_dado(const int& umDado){
cout << umDado << " ";
}
class Pilha {
private:
int* mPilha;
int posTopo;
int tamanho;... | ALGO | 0.999938 | 5.623737 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-03-06T00:31: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": "9d9c3486a8d... |
d1b4fbbd-d30e-428e-8cd5-ea799175d245 | ishandutta2007/codeforces-m | merkurev/normal/1394/D.cpp | #ifndef LOCAL
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,tune=native")
#endif
#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <cassert>
#include <numeric>
#include <string>
#include <cstr... | ALGO | 0.999955 | 3.72157 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "da426966eed1... |
f0249666-c8b1-47ec-ac7d-e35a39d56e65 | shohan2032/Competitive-Programming-Practice-Codes | B_Keep_it_Beautiful.cpp | #include <bits/stdc++.h>
using namespace std;
#define db long long
#define ll long long
#define vi vector<int>
#define vs vector<string>
#define vl vector<ll>
#define pii pair<int, int>
#define vpi vector<pair<int, int>>
#define vpl vector<pair<ll, ll>>
#define vpd vector<pair<double, double>>
#define vps vector<pair... | ALGO | 0.999974 | 4.184196 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-12T11:31:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b68f06b585b7... |
2ab6a592-0530-47b0-896d-77145aff26a9 | Dishant2001/DSA_Practice | Binary_Search_Trees/delete_node.cpp | //3 possibilities
//Node to be delete is:
//1. Leaf Node(root node or not a root)
//2. Has left
//3. Has only right(root node or not a root)
TreeNode* father(TreeNode* root, TreeNode* q){
TreeNode* p=root;
while(p!=NULL)
{
if(p->left==q||p->right==q)
return p;
... | ALGO | 0.99999 | 3.795599 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2021-11-27T07:19:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbdd7a67ec9... |
98d24802-efb1-409a-9b86-904d9602d45e | jke-zq/my_lintcode | Combination_Sum_II.cpp | class Solution {
public:
/**
* @param num: Given the candidate numbers
* @param target: Given the target number
* @return: All the combinations that sum to target
*/
vector<vector<int>> combinationSum2(vector<int> &num, int target) {
// write your code here
vector<vector<int>> ret;
... | ALGO | 0.999989 | 5.982026 | {
"github_metadata": {
"branch": "master",
"commit_count": 399,
"repo_created_at": "2015-06-17T08:42:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "609320f3... |
7c626053-166c-43e6-bbd0-6f493a16d0ed | yongsoonko/solved-problems-2 | 063-10814.cpp | #include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
using ll = long long;
struct Pos {
int i;
int j;
string name;
bool operator<(const Pos &p) const {
if (j == p.j)
return i < p.i;
return j < p.j;
}
};
Pos p[1000... | ALGO | 0.999683 | 4.216582 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-04-07T03:43:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8eaa4682b... |
ed947a41-5a50-4a5e-8481-bc75eb7bd8c9 | ishandutta2007/codeforces-v | vepifanov/normal/8/E.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
using namespace std;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(in... | ALGO | 0.999986 | 3.047688 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "4ca9bfd8c4a7... |
5162c8f4-f8ba-4f36-b486-8afbd5a8a93f | ferrufino/Algorithms | greedy/greedy/main.cpp | //
// main.cpp
// greedy
//
// Created by <NAME> on 3/24/14.
// Copyright (c) 2014 <NAME>. All rights reserved.
//
#include <iostream>
#include <climits>
#include <cmath>
#include <iomanip>
#include <stdio.h>
#define Max 1000000
using namespace std;
double distancia(double x1, double y1, double x2, double y2){
... | ALGO | 0.999808 | 4.388153 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2014-02-21T20:58:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d73f9ed2f... |
c40e427e-c0d8-4d6a-89c7-97049ab9c795 | pedropaiola/unesp-progcomp | Soluções/spoj/LINEUP.cpp | /*
Problema: Lineup
Categorias:
dynamic programming > bitmask
Dificuldade: medio
Descricao:
Dica:
Autor: Paiola
*/
#include<bits/stdc++.h>
using namespace std;
const int maxb = 1 << 11;
int strength[11][11];
int dp[maxb];
int count_set_bits(int mask){
int cnt = 0;
while(mask > 0){
cnt += mask & 1;... | ALGO | 0.999957 | 4.779301 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2021-01-06T04:45:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb225880ab... |
b7a75fb1-4c36-48ed-8684-afe47100050a | Rosthouse/TSM_ProgAlg | 06_Exercise_MPI/Node.h | #pragma once
#include <iostream>
#include <cassert>
#include <cstdint>
#include <type_traits>
#include <mpi.h>
using namespace std;
//////////////////////////////////////////////////////////////////////////////////////////////////
// Types
typedef uint8_t PathLenT;
//////////////////////////////////////////////////... | ALGO | 0.988576 | 5.705259 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2018-03-03T15:38: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": "fe0cd8b6d... |
e0176abe-7829-44fe-97b8-4284510d3bf7 | srikar-ayyala/ANC_Algorithm_ESP32Code | lib/filters/NLMS/NLMS.h | #ifndef NLMS_FILTER_H
#define NLMS_FILTER_H
#ifdef ARDUINO
#include <Arduino.h>
#else
#include <cstddef>
#endif
#include "iostream"
#include "vector.h"
class NLMS
{
private:
float alpha;
int order;
float a[50];
float c[50];
// vector<float> c;
int xHead;
float x[50];
float dcap[50];
... | ALGO | 0.990591 | 5.713142 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-13T10:43: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": "561e08cdc889... |
d1e80c07-97d3-49e8-b53a-d324d5db2cef | Xushi8/Code | 2023/2023_August/test6/c.cpp | // 2023/08/03 15:13:03
#ifndef LOCAL
#pragma GCC optimize(2)
#endif
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdint>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <functional>
#include <iomanip>... | ALGO | 0.999567 | 4.035544 | {
"github_metadata": {
"branch": "main",
"commit_count": 690,
"repo_created_at": "2022-12-29T08:34:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b0ecc1ce7... |
9f13de3f-e832-478c-b146-bedaa95b468e | AmanKathait15/Data-Structure-and-Algorithm | cp/CoinChnage.cpp | #include<bits/stdc++.h>
#define num long int
using namespace std;
/*
Given a value N, if we want to make change for N cents, and we have infinite supply of each of S = { S1, S2, .. , Sm} valued coins, how many ways can we make the change? The order of coins doesn’t matter.
For example, for N = 4 and S = {1,2,3}, there... | ALGO | 0.999866 | 3.789162 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2020-09-21T16:47:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29469c33c... |
e89ffbd8-ca91-45d9-8e4b-03dada9a3e46 | yancouto/maratona-sua-mae | SuaMae/contests/AcampIME2015/Semana3/Dia2/card.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 29;
int getCard(char a) {
if (a >= '2' && a <= '9')
return a - '2';
else if (a=='T')
return 8;
else if (a=='J')
return 9;
else if (a=='Q')
return 10;
else if (a=='K')
return 11;
else
return 12;
}
int getSuite (char a) {
if (a == 'H')
... | ALGO | 0.999269 | 3.420028 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2015-06-27T20:54:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8cceaf2a... |
d30ee178-80c4-47de-8da1-f4367821a08d | Muhammad-Huzzaifa/Number-Conversions | BinaryToOctal.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <sstream>
using namespace std;
bool isBinary(string str);
int decimalPoint(string str);
double calculationInitial(string str);
string calculationFinal(string str);
int main()
{
string binaryNumber;
cout << "Binary Number:";
do
{
cin... | ALGO | 0.984808 | 4.464269 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-01-27T23:41:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a8484ec038a... |
c90feef8-e5c8-445c-83d1-293d94df9e8d | Jagadhish3/CompetitveProgramming | Linear_dp/linkedListInsert.cpp | #include<iostream>
using namespace std;
struct node
{
int data;
node* next;
node(int val){
data=val;
next=nullptr;
}
};
void print(node* head){
node* curr = head;
while(curr!=nullptr){
cout<<curr->data<<" ";
curr=curr->next;
}
}
void insertBegin(node*& head,... | ALGO | 0.999882 | 4.106826 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2024-09-17T13:52: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": "7f35b24fb... |
5a0aa1e9-2784-44d1-8ebb-6d8d76f05799 | systematicinvestor/systematicinvestor.github.io | public/doc/quantile.cpp | #include <Rcpp.h>
using namespace Rcpp;
using namespace std;
// [[Rcpp::plugins(cpp11)]]
// quantile setup
struct quantile {
int lo, hi, n, total;
double hlo, hhi;
};
quantile make_quantile(int n, double prob) {
quantile res;
double index = (n - 1) * prob;
res.lo = floor(index);
res.hi = res.lo + 1;
res.hhi = ... | ALGO | 0.999677 | 6.719688 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2014-11-14T03:36:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 23,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ad389f... |
2312dc27-7ccd-414d-a245-9cb48036d9a5 | miemie486/My_Project | TEG_Faddeev/src/util/3nj.cpp | // Calculation of wignerJSymbol (3, 6, 9 j symbols)
// The source of 6-j's exact formula is lost. Yet all 3nj simbols have been checked by http://dentonwoods.nfshost.com/3j6j9j.html, thus follow the convention in Wiki. CG coefficient's formula comes from formula (7) in http://mathworld.wolfram.com/Clebsch-GordanCoeffic... | ALGO | 0.999633 | 3.141863 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-01-15T11:26:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0cddd846... |
4bf1a4b5-e89c-4914-b0b2-a9e50cf4d55d | raincross7/code-similarity | codes/train_code/problem213/problem213_95.cpp | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author <NAME>
*/
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#inc... | ALGO | 0.999844 | 3.789558 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e075782e649... |
abeddc74-9f3d-4254-9056-81f6aaedb1cc | nvatuan/CP | web@atCoder.jp/abc/150-199/177/e.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = (int(1e6)) + 5;
int minPrime[N];
void sieve() {
for (int i=0; i<N; i++) minPrime[i] = i;
minPrime[0] = 1;
for (int i=2; i<N; i++)
if (minPrime[i] == i)
for (int j=2*i; j<N; j+=i)
minPrime[j] = (minPrime[j] == j... | ALGO | 0.999681 | 4.465022 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-08-26T03:48:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2dd30bca0... |
fa9bdc6d-f590-4a71-9457-f6d5eacd5b75 | syedharishussain1717/DSA-LAB-OFFICIAL | LAB_02/LAB_02_task_02.cpp | // <NAME>
// L1F23BSCS0697
#include <iostream>
using namespace std;
// Abstract class Employee
class Employee {
protected:
string name;
public:
Employee(string n) : name(n) {}
virtual double calculateSalary() = 0;
virtual void display() {
cout << "Employee Name: " << name << endl;
}
};
... | TOOL | 0.987007 | 5.731556 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-03-24T08:34:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18722883971... |
847ba726-89f9-47aa-9085-61846d3093ef | facebookresearch/faiss | faiss/impl/ProductAdditiveQuantizer.cpp | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <faiss/impl/ProductAdditiveQuantizer.h>
#include <cstddef>
#include <cstdio>
#include <cstring>
#include <memory>
#inc... | ALGO | 0.995217 | 6.629957 | {
"github_metadata": {
"branch": "main",
"commit_count": 1500,
"repo_created_at": "2017-02-07T16:07:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 36174,
"forks": 3965,
"issues": 228,
"pull_requests": 47
},
"file_meta": {
"content_id": "... |
c8e8f4b0-c273-4520-92fe-8674c80aef98 | k2font/atcoder | abc158_E.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<ll, ll>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, -1, 0, 1};
string char_to_string(char val) {
return string(1, val);
}
int ... | ALGO | 0.999873 | 4.248252 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-07-08T09:21:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "065a9d189... |
2bc36295-b686-4acd-b647-415b8a2283a8 | vikman90/crypto-stream | lfsr.cpp | /*
* <NAME> (Vernam stream cipher)
* Copyleft 2012 <NAME> - All rights revoked.
* September 7th, 2012
*/
#include "lfsr.h"
//------------------------------------------------------------------------------
// Crea un nuevo objeto con semilla 'seed'
Lfsr::Lfsr(unsigned int seed)
{
state = seed;
}
//-----------... | TOOL | 0.965181 | 5.62919 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-02-12T19:02: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": "57af68137f... |
fbfd00e7-f6b1-45e5-b523-8d0237e21f54 | ZhaiMen-Hub/CppAlgorithmExercise | code/93_Restore_IP_Addresses.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
bool isIpAddresses(const string::iterator stIt, const int count) {
// 不传入空字符串
// 长度>1时起始!=0
if (count > 1 && *stIt == '0') return false;
// 满足范围
else {
... | ALGO | 0.999575 | 4.923578 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-03-01T08:21:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5cd177c6e9... |
1f4dcfb9-db8d-47aa-af9f-b9009a564220 | kyohei8937/ProgramingContest | ABC/ABC228/ABC228_C_.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1LL << 60;
const int MOD = 1000000007;
// マクロ
#define rep(i,n) for(int i=0;i<n;++i)
#define rep2(i,n,m) for(int i=n;i<m;++i)
#define ALL(x) (x).begin(),(x).end()
// 便利関数
// ...最小値・最大値交換
template<class T> inline bool chmin(T& a, T b) ... | ALGO | 0.999979 | 4.160819 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-11-07T16:22:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61dc531d7d... |
972963fb-99f2-4a2c-ba98-3dd6eed52b3e | ishandutta2007/codeforces-p | pikel_rik/normal/346/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define all(x) (x).begin(), (x).end()
using namespace __gnu_pbds;
using namespace std;
using ull = unsigned long long;
using ll = long long;
using ld = long double;
template <typename T> using ordered_set = tree<T, null_type, less<>, rb_tree_tag, tree_... | ALGO | 0.99972 | 4.256335 | {
"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": "58504fcf6348... |
f7c147f3-5084-41da-97ae-19b7d4365dfb | immuntasir/computer-graphics | afasf.cpp | /*
This code implements the Midpoint algorithm for line drawing.
To help with visualization, it uses different colors for different zones of slopes.
The code has two options.
You may choose to draw n random lines, either from origin, or from anywhere.
freeglut was used in this code.
You must have freeglut and freeglu... | ALGO | 0.996551 | 5.0189 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-21T14:32: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": "064f4a70c8... |
90c81a45-f166-4522-82cc-25da0f90fa08 | injeChoi/Problem_Solving | BOJ/BOJ_1475_방번호.cpp | #include <iostream>
#include <algorithm>
using namespace std;
void init() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
int main(int argc, char const *argv[]) {
init();
string s; cin >> s;
int arr[10] = {0};
int cnt = 0;
for(int i = 0; i < s.size(); i++) // 숫... | ALGO | 0.99977 | 3.77902 | {
"github_metadata": {
"branch": "master",
"commit_count": 497,
"repo_created_at": "2019-05-21T04:43: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": "e7eb198e... |
5f19477b-bb9b-4b4a-9fc7-0a98db3059f4 | marufkhan-ahmad/DSA-basics-Array | maxandmin.cpp | #include <iostream>
using namespace std;
int findmaxmin(int arr[], int n)
{
int min = arr[0], max = arr[0];
for (int i = 1; i < n; i++)
if(arr[i]>max)
max = arr[i];
return max;
// if(arr[i]<min)
// min = arr[i];
// return min;
}
void PrintArray(int arr[], int n)
{
... | ALGO | 0.999002 | 4.13516 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-01-26T15:46:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c789fc64a39... |
23b75ef9-47b8-49ba-aa71-57386dc59ff8 | kowsalya-duraisamy/Problem_Solving | 0103-binary-tree-zigzag-level-order-traversal/0103-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.999998 | 6.282472 | {
"github_metadata": {
"branch": "main",
"commit_count": 690,
"repo_created_at": "2025-01-03T12:06: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": "716852ff34... |
81e2d762-0627-4bc6-9624-f94b962848a0 | sd-james/skills-to-symbols | s2s/planner/mdpsim-1.23/mtbdd.h | /* -*-C++-*- */
#ifndef MTBDD_H
#define MTBDD_H
#include <config.h>
#include "client.h"
#include <cudd.h>
#include <util.h>
/* ====================================================================== */
/* MTBDDPlanner */
/*
* An MTBDD planner.
*/
struct MTBDDPlanner : public Planner {
/* Constructs an MTBDD plan... | ALGO | 0.996788 | 5.568669 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2020-02-10T06:33:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 4,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "85dbcbec6... |
64284a04-0381-42b3-a2d1-1e9d97823402 | Yonghui56/ogs6 | MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.h | /**
* \file
* \author <NAME>
* \date 2012-01-02
* \brief Definition of the AdjMat class.
*
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http:... | ALGO | 0.911741 | 6.418478 | {
"github_metadata": {
"branch": "master",
"commit_count": 7218,
"repo_created_at": "2016-04-14T09:05: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": "ff1edf3... |
6f09b145-f6e9-4ac4-931f-15ac8be8cc61 | spamwax/make_tetmesh_refine_sphere | make_tetmesh_refine_sphere.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
// #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Mesh_3/Robust_intersection_traits_3.h>
#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h>
#include ... | TOOL | 0.972198 | 5.982615 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-07-29T07:17:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e584b5ed4... |
0632520d-7ffa-488e-9ca4-82a133d78bc4 | Sriharsha-R/Assignment4-SysLab | qn2.cpp | #include <iostream>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <cstring>
using namespace std;
#define MAX_QUESTIONS 10
#define MAX_ANSWERS 10
struct Question {
long type;
char text[50];
};
struct Answer {
long type;
char text[50];
};
int main(int ar... | ALGO | 0.994745 | 3.403463 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-21T10:18: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": "48cdf9a9c7b5... |
7b987014-9340-434c-93d1-84818ddf9c13 | Cnewbeee/code_one | C++/icpc/5.21/4.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;
//#define int long long
#define PII pair<int,int>
const int mod = 1e9 + 7;
const int N = 5e5 + 10;
int a[N];
void solve()
{
int n, q;
cin >> n >> q;
int p = 1;
set<int> se;
vector<int> ans;
while(q--){
... | ALGO | 0.999743 | 4.323631 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2024-09-28T07:23: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": "1574617f9... |
dd00e2c6-1349-4ee1-93ed-52d99da07ffc | zini9188/programmers | [LV.2]/더 맵게/solution.cpp | #include <string>
#include <vector>
#include <queue>
using namespace std;
int solution(vector<int> scoville, int K) {
int answer = 0;
priority_queue<int, vector<int>, greater<int>> pq(scoville.begin(), scoville.end()); // 우선 순위 큐 가장 작은 값을 마지막으로 두게 함
while(1){
if(pq.top() >= K) // 큐의 마지막이 K이... | ALGO | 0.999939 | 5.107777 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2022-10-08T14:18: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": "99d3bd475bc... |
b16c776b-16e9-4b41-9dce-53f1c3931065 | SMiles02/CompetitiveProgramming | Codeforces/CF 1800 - 1899/CF1836/CF1836E.cpp | #include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// uniform_int_distribution<int>(1000,10000)(rng)
string to_upper(string a) {
for (int i=0;i<(int)a.size();++i) if (a[i]>='a' && a[i]<='z') a[i]-=... | ALGO | 0.999878 | 3.546588 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2020-07-06T09:54:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5edabc0... |
db0be89b-5e0a-448a-8c01-f18ff24aa44f | Riyad0001/Phitron-Practice | DSA Doubly linked list/Queries_Again.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node *prev;
Node(int val)
{
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
void print_normal(Node *head)
{
Node *tmp = head;
while (tmp != nullptr)
{
c... | ALGO | 0.999829 | 4.394652 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-02-06T14:26: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": "bfed7a2e892d... |
5486db3d-d514-4e72-bc85-7433dab3ecbf | ysqm/Code | Qbank/Question Bank 2019 - 9 ——— 2020 - 8 - 15/P1852 跳跳棋/P1852 跳跳棋 - 1.cpp | # include <cstdio>
# include <iostream>
# include <algorithm>
typedef long long LL;
const LL INF = 0x7f7f7f7f7f7f;
template <class T>
inline T Min(const T& a,const T& b){return a > b ? b : a;}
inline void Swap(LL& a,LL& b){a^=b^=a^=b;}
inline void Swap(int& a,int& b){a^=b^=a^=b;}
LL A[3],B[3],C[3],D[3],ans;
int Ance... | ALGO | 0.999968 | 3.585214 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-08-19T09:25:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66c32ae39... |
6cf55b9f-0cc8-4ad7-a167-7a252884816f | thsrhwk01/BOJ | 백준/Silver/1931. 회의실 배정/회의실 배정.cc | #include <iostream>
#include <algorithm>
using namespace std;
bool cmp(const pair<int, int>& rhs, const pair<int, int>& lhs) {
if (rhs.first == lhs.first) return rhs.second < lhs.second;
else return rhs.first < lhs.first;
}
int main () {
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
... | ALGO | 0.999982 | 4.040206 | {
"github_metadata": {
"branch": "main",
"commit_count": 371,
"repo_created_at": "2022-10-05T00:05:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "543642bc8d... |
6f1a181f-d586-4324-8a3a-692d59450c69 | otavioon/COLA-2022-Tools | datasets/src/algo/codenet/3/s131574941.cpp | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#defi... | ALGO | 0.999842 | 3.653749 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2022-06-08T12:17:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a0e77b1b... |
fb366f30-9c80-4d79-a16a-64d1bf9a9a1d | MKGAURAB/Hackerrank | cut-the-tree.cpp | //Md. <NAME>
//CSE, SUST 20th
//<EMAIL>
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <cstdio>
#include <cstring>
#include <limits>
#include <vector>
#include <cstdlib>
#include <numeric>
#include <utility>... | ALGO | 0.999851 | 3.66825 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-08-11T12:08:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ef2572a91... |
633fc8a3-5fa6-4e86-8a64-a50172e9eb9e | LuisAlbertoVasquezVargas/CP | otherRepos/Codes/Laptop_Maria/luis/2966_ZJU.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define all(v) v.begin() , v.end()
#define rall(v) v.rbegin() , v.rend()
#define FOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define vi vector<int>
#define v... | ALGO | 0.999956 | 3.910432 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-02-12T20:18: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": "465ba15217... |
53f4d534-1c96-4c1c-8476-a96c0ad75455 | Jaeyoung-Lim/mavros_controllers | geometric_controller/src/jerk_tracking_control.cpp | /****************************************************************************
*
* Copyright (c) 2018-2022 <NAME>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions o... | ALGO | 0.907892 | 6.23648 | {
"github_metadata": {
"branch": "master",
"commit_count": 310,
"repo_created_at": "2018-07-11T15:43:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 471,
"forks": 177,
"issues": 26,
"pull_requests": 0
},
"file_meta": {
"content_id": "b72... |
6c34e5b4-78fd-4b2a-a68b-01e819805030 | mnxoid/GL | Task_4/coins_3/coins_3.cpp | /**
* @file coins_3.cpp
* @brief C++ source of the app that flips coins and determines
* the sequence in which they should be placed so that
* after K flips of every 5th coin there were I coins
* placed heads up.
* Parameters:
* N - coin quantity
* M - tails up
* K - number of flips
* I -... | ALGO | 0.999429 | 3.541044 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2014-02-14T20:47:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff3593a56... |
60e5e98e-d307-4e29-833e-89126f757f2d | Smita-Sarkate/Daily-CP-Codes- | 17-7-2021/A_Helpful_Maths.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define MOD 1000000007
#define inf 1000000000000000001
#define mp(x,y) make_pair(x,y)
#define mem(a,val... | ALGO | 0.999959 | 3.944643 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-10-07T08:16: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": "08d21cb9f0... |
1ef92504-c06a-4f9e-a9eb-f3b4fcc79328 | abhishekangale/Competitive-Programming | B_Disturbed_People.cpp | #include "bits/stdc++.h"
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define iOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(15);
#define MOD 1000000007
#def... | ALGO | 0.99995 | 4.332391 | {
"github_metadata": {
"branch": "main",
"commit_count": 94,
"repo_created_at": "2021-07-20T13:15:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0523100c167... |
3862f2f3-68a4-410d-8e63-a4ff011dbd4c | SpepFirsov/-22.11.2021 | ConsoleApplication1/ConsoleApplication1.cpp | #include <conio.h>
#include <iostream>
#include <random>
#include <time.h>
using std::cout;
using std::cin;
using std::endl;
int* arr, size;
int numb2;
int last;
int main()
{
setlocale(LC_ALL, "Russian");
cout << "введите длину массива: ";
cin >> size;
srand(time(NULL));
arr = new int[size];
co... | ALGO | 0.997086 | 3.847093 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-11-22T07:16:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7add48ac4a... |
a4e2d3a7-9626-4997-a831-788566ee0a1e | KaHIP/KaHIP | lib/partition/coarsening/matching/gpa/gpa_matching.h | /******************************************************************************
* gpa_matching.h
* *
* Source of KaHIP -- Karlsruhe High Quality Partitioning.
* <NAME> <<EMAIL>>
*****************************************************************************/
#ifndef GPA_MATCHING_NXLQ0SIT
#define GPA_MATCHING_NXLQ0... | ALGO | 0.990455 | 5.463308 | {
"github_metadata": {
"branch": "master",
"commit_count": 648,
"repo_created_at": "2013-10-16T15:25:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 442,
"forks": 101,
"issues": 13,
"pull_requests": 8
},
"file_meta": {
"content_id": "1af5... |
687db766-13b4-496d-8e94-18c10f50474d | Justin-Kwan/leetcode | cpp/product_of_array_except_self.cpp | class Solution {
public:
// optimal bottom up dp approach
vector<int> productExceptSelf(vector<int>& nums) {
vector<int> productsExceptSelf(nums.size(), 1);
// compute and store product to right of each number
for (int i = nums.size() - 2; i >= 0; --i) {
productsExceptSelf[i... | ALGO | 0.999948 | 6.992222 | {
"github_metadata": {
"branch": "master",
"commit_count": 178,
"repo_created_at": "2021-03-08T00:33:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "901db36d... |
4e840a32-2933-4bc8-a672-0a645eb84e44 | maruf0011/Programming | NSU-ICPC-2016/C.cpp | #include "bits/stdc++.h"
#pragma comment(linker, "/STACK:2000000")
#define maxx 100100
using namespace std;
using VI = vector<int>;
vector<int>vadj[maxx];
set<int>vuni[maxx];
int joy[maxx];
int cost[maxx];
int par[maxx];
int addValue[maxx];
int sol[maxx];
void dfs(int u) {
if(((int)vadj[u].size()) == 0) {
p... | ALGO | 0.999876 | 3.718593 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-07-05T14:48: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": "b7def3c24... |
ebaf0cac-61f8-4a22-87fc-c36bc35af68a | VishardMehta/DAA | DAA code/mergesort.cpp | #include <iostream>
using namespace std;
void merge(int arr[], int l, int m, int r) {
int n1 = m - l + 1, n2 = r - m;
int a[n1], b[n2];
for (int i = 0; i < n1; i++) a[i] = arr[l + i];
for (int i = 0; i < n2; i++) b[i] = arr[m + 1 + i];
int i = 0, j = 0, k = l;
while (i < n1 && j < n2) {
... | ALGO | 0.999997 | 5.963818 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-05-21T07:10: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": "008a9e44ae68... |
4424f542-6d52-4008-b479-b857b08227d3 | LittleYang0531/CQ-CSP-S-2022 | CQ-S00094/game/game.cpp | #include<bits/stdc++.h>
#define File(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
#define all(x) begin(x), end(x)
#define int long long
using namespace std;
bool mem1;
const int N = 1e5 + 5, LOG = 21, inf = 1e16;
int n, m, q, a[N], b[N];
int lg2[N];
struct ST {
int len, mn[N][LOG], mx[N][LOG];
vo... | ALGO | 0.999696 | 4.007426 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-31T10:15: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": "c992b79b5bbd... |
7690ba5b-9e1a-46e6-987e-798098c054d0 | zero-rp/ZUI | AGG/include/agg_vertex_sequence.h | //----------------------------------------------------------------------------
// Anti-Grain Geometry (AGG) - Version 2.5
// A high quality rendering engine for C++
// Copyright (C) 2002-2006 <NAME>
// Contact: <EMAIL>
// <EMAIL>
// http://antigrain.com
//
// AGG is free software; you can redistribut... | ALGO | 0.933633 | 6.385892 | {
"github_metadata": {
"branch": "master",
"commit_count": 367,
"repo_created_at": "2016-10-20T07:08:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 52,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "0046f... |
6119dc2e-1a43-4139-bee5-5a4245142ab8 | Guilherme-Kraemer/Faculdade | Trabalhos/Trabalho Estrutura de Dados 5.cpp | #include <iostream>
using namespace std;
const int a = 4;
const int b= 5;
void somaa(int matriz[a][b], int vetorSomas[]) {
for (int j = 0; j < b; ++j) {
vetorSomas[j] = 0;
for (int i = 0; i < a; ++i) {
vetorSomas[j] += matriz[i][j];
}
}
}
int main() {
int matriz[a][b... | ALGO | 0.999444 | 4.610832 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-04-01T12:35: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": "0374cf2df1a... |
c18a9657-c1ae-41f5-b09a-0fd8cfe50430 | raincross7/code-similarity | codes/train_code/problem148/problem148_242.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vect... | ALGO | 0.999768 | 3.563664 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "807dabe0e88d... |
e13b688c-7ce8-4b3c-80e3-0f13846b58cb | caio86/codeforces | problems/500/A/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<bool> vb;
bool dfs(int start, vb& visited, const vi& list, const int want) {
visited[start] = true;
// cout << "Start: "
// << start+1
// << '\n';
if (visited[want])
return true;
// next
size_t next = list[sta... | ALGO | 0.99998 | 4.493368 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2024-10-28T14:08: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": "7d9a1003c2d... |
b0b8bdcd-80b8-4d4b-953f-4026bb08b3e3 | wiorz/CSI_1430_Gp_Proj | source/collision.cpp | #include "collision.h"
bool circleIntersect(circle_t c1, circle_t c2)
{
int distSq = (c1.getCenter().x - c2.getCenter().x) *
(c1.getCenter().x - c2.getCenter().x) +
(c1.getCenter().y - c2.getCenter().y) *
(c1.getCenter().y - c2.getCenter().y);
int radSumSq = (... | ALGO | 0.990925 | 5.715786 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2019-11-01T19:05:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ca14a9921... |
c9d848a6-bc96-4888-b6fb-08f8a105335d | open-space-collective/open-space-toolkit-physics | src/OpenSpaceToolkit/Physics/Environment/Utility/Eclipse.cpp | /// Apache License 2.0
#include <algorithm>
#include <cmath>
#include <OpenSpaceToolkit/Core/Error.hpp>
#include <OpenSpaceToolkit/Core/Type/Size.hpp>
#include <OpenSpaceToolkit/Core/Utility.hpp>
#include <OpenSpaceToolkit/Mathematics/Geometry/3D/Object/Segment.hpp>
#include <OpenSpaceToolkit/Mathematics/Geometry/An... | TOOL | 0.993529 | 6.326471 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2018-06-10T18:44:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 26,
"forks": 7,
"issues": 5,
"pull_requests": 5
},
"file_meta": {
"content_id": "e8951339e6... |
efa4b86a-528e-41f3-b5a1-82cda3a72d54 | AdithyaIniesta/DSA-course--GeeksforGeeks | minimum_difference.cpp | #include <bits/stdc++.h>
class Node{
public:
struct Node* left;
struct Node* right;
int value;
Node(int key){
value = key;
left = NULL;
right = NULL;
}
};
class BinarySearchTree{
public:
BinarySearchTree();
~BinarySearchTree();
template<class... | ALGO | 0.99985 | 5.187797 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-01-23T17:24:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0b8d81f6... |
0ea1a00a-b7cd-459a-be93-771817be3b55 | william-o-s/leetcode-solutions | 2772-apply-operations-to-make-all-array-elements-equal-to-zero --ranges/sunny/solution.cpp | #include <algorithm>
#include <vector>
using std::max;
using std::min;
using std::vector;
class Solution {
public:
template <typename T>
class range_tree {
public:
range_tree<T>(size_t n) : range_tree<T>(n, 4 * n) {}
void update(size_t uL, size_t uR, T v) {
_update(uL, uR, v, 1, 0, n_);
... | ALGO | 0.999975 | 5.608944 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2024-10-23T02:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6c1eca339f... |
1b130fcb-a316-42c7-938e-ae1bb02e2f40 | ValentinaManferrari/CSC317-ComputerGraphics | 8-computer-graphics-mass-spring-systems/src/fast_mass_springs_step_sparse.cpp | #include "fast_mass_springs_step_sparse.h"
#include <igl/matlab_format.h>
void fast_mass_springs_step_sparse(
const Eigen::MatrixXd & V,
const Eigen::MatrixXi & E,
const double k,
const Eigen::VectorXi & b,
const double delta_t,
const Eigen::MatrixXd & fext,
const Eigen::VectorXd & r,
const Eigen::Spar... | ALGO | 0.999948 | 5.441059 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2022-09-19T01:43:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ba75fd6c53... |
c820f18a-2b4d-4dbd-9a7b-396a750dee75 | rishabhjain0099/Hamming-code | hc.cpp | #include<iostream>
#include<cmath>
using namespace std;
int parbit[100];
void paritybit(long dataSend[],int size , int parity)
{
int flag=parity;
int sum=0;
for(int i=parity;i<=size;)
{ flag--;
if(dataSend[i-1]==1)
{sum+=1;
}
i++;
if(flag==0)
{flag+=parity;i+=parity;
}
}
if(sum%2==1)
{dataSend[... | ALGO | 0.999996 | 4.396457 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-09-09T10:25: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": "5f8a1aba99... |
65c46618-d3f5-485b-a0ac-32dc8907199b | irajgreenberg/CLOSED_Research | Protobyte_v02/ProtoMatrix4.h | /*! \brief ProtoMatrix4.h: 4D Matrix implementation
ProtoMatrix4.h
Protobyte Library v02
Created by Ira on 7/23/13.
Copyright (c) 2013 <NAME>. All rights reserved.
Library Usage:
This work is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 Unported License.
To view a copy of t... | TOOL | 0.973267 | 5.317393 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2013-02-09T05:05:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca07eca0b7... |
75c15399-1c63-4d16-94a6-0677cd2a04d1 | adamek82/LeetCode | LeetCodeCpp/LowestCommonAncestorOfBST_235.cpp | #include "LowestCommonAncestorOfBST_235.h"
TreeNode<int> *LowestCommonAncestorOfBST_235::lowestCommonAncestor(TreeNode<int> *root, TreeNode<int> *p, TreeNode<int> *q)
{
while (root) {
// If both p and q are smaller than root, LCA lies in the left subtree.
if (p->val < root->val && q->val < root->va... | ALGO | 0.999939 | 6.493412 | {
"github_metadata": {
"branch": "master",
"commit_count": 204,
"repo_created_at": "2024-11-07T23:09:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd9c0a03... |
ecbc99dc-21b1-40ac-bbc7-83752debc037 | trustcrypto/libraries | Crypto/SpeckSmall.cpp | /*
* Copyright (C) 2016 Southern Storm Software, Pty Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, ... | ALGO | 0.998422 | 7.192959 | {
"github_metadata": {
"branch": "master",
"commit_count": 339,
"repo_created_at": "2016-04-07T14:17:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 48,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "c75b192... |
a54973ff-e99a-4472-87b7-71e6ff5d2b89 | donbasta/leetcode-submissions | Medium/2981.cpp | class Solution {
public:
int maximumLength(string s) {
int n = s.length();
char cur = s[0];
int len = 1;
map<pair<int, int>, int> cnt;
for (int i = 1; i < n; i++) {
if (s[i] == cur) len++;
else {
for (int j = 1; j <= len; j++) {
... | ALGO | 0.999982 | 4.818326 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-05T03:05: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": "0d2014dc5153... |
b2fbac68-13eb-4289-a024-97dbedb0e46e | yuhyeon0809/algorithm | Stack_Queue/boj_4949.cpp | // author : yuhyeon0809
// problem : #4949 균형잡힌 세상
// url : https://www.acmicpc.net/problem/4949
#include <iostream>
#include <stack>
#include <string>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string str;
while(1) {
getline(cin, str);
stack<char> s;
... | ALGO | 0.999683 | 4.574533 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2022-01-24T11:30:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2016f43b... |
2cd66eb9-6d0d-47ed-a8ab-2eff7931eaf7 | lky473736/problemsolving | 백준/Silver/2004. 조합 0의 개수/조합 0의 개수.cc | #include <bits/stdc++.h>
using namespace std;
// 그냥 조합 구하고 2랑 5 소인수분해했을 때 최소 쌍 구하면 될듯
// 분자가 가진 5갯수 - 분모가 가진 5갯수
// 분자가 가진 2갯수 - 분모가 가진 2갯수
// 둘 중 최소
#include <bits/stdc++.h>
using namespace std;
long long cnt_factors (long long n, int factor) {
long long cnt = 0;
while (n) {
n /= factor;
... | ALGO | 0.999974 | 4.862092 | {
"github_metadata": {
"branch": "main",
"commit_count": 813,
"repo_created_at": "2023-10-01T04:43:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f1f62ba89... |
91c64d0e-1332-4799-b7db-fc3f02e0ebb4 | bramkuijper/parental_effects_freq_dep | src/ibm/all_p_freq_dep.cpp | // Gillespie simulation
// for the evolution of nongenetic effects
// in a hawk-dove game
// (c) <NAME> 2016
#include <ctime>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <string>
#include <cmath>
#include <cassert>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#includ... | ALGO | 0.999097 | 4.090439 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2016-09-05T15:00: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": "c4d790047... |
3d541a0d-b8af-47b2-a456-dae36f2d90f3 | fishsuperbear/EP41 | nos/service/update_manager/config/config_manager.h |
#ifndef UPDATE_CONFIG_MANAGER_H
#define UPDATE_CONFIG_MANAGER_H
#include "update_manager/config/hz_xml.h"
#include "update_manager/taskbase/task_object_def.h"
#include "update_manager/download/package_manager.h"
#include "update_manager/config/update_settings.h"
#include <string>
#include <unordered_map>
#include <v... | TOOL | 0.901622 | 5.232983 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-10-30T07:07: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": "79c93ee9f083... |
143293e8-d544-44fe-858f-705113803a6a | LandonHolt94/Chess-Project | CheckWin.h | #pragma once
bool Check_Win(char Grid[][8], char player)
{
if (Player_In_Check(Grid, player) == true)
{
if (player == BLACK_PLAYER) std::cout << "White player (UPERCASE/ALL CAPS) is in CHECK! " << std::endl;
else std::cout << "Black player (LOWER CASE) is in CHECK! " << std::endl;
//Anlaisis Checkmate
//look... | ALGO | 0.997348 | 3.946086 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-10-14T20:51: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": "efec1286d5... |
2751aaae-9d13-4045-861d-ec831ebd0465 | kiwibrowser/src | chrome/browser/chromeos/options/vpn_config_view.h | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_
#define CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_
#include <memory>
#include <str... | TOOL | 0.915428 | 7.529637 | {
"github_metadata": {
"branch": "master",
"commit_count": 672,
"repo_created_at": "2020-04-18T07:16:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2888,
"forks": 414,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "fb9... |
f195a70f-7e3b-4523-905b-941122032817 | grain1101/LeetCode | C++/037_SudokuSolver.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <cstring>
#include <algorithm>
#include <stack>
#include <queue>
#include <cstdio>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
// 37. Sudoku... | ALGO | 0.999695 | 6.013371 | {
"github_metadata": {
"branch": "master",
"commit_count": 445,
"repo_created_at": "2017-01-21T06:07:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "194e75c4... |
3664fc5f-2cae-4302-9c49-c40f52d61f88 | Xaiwu/Deteccion-de-patrones | include/BM.h | #ifndef BM_H
#define BM_H
#define N_CHARS 256 // Número de caracteres ASCII
#include <bits/stdc++.h>
#include <vector>
/**
* @brief Construye la tabla de desplazamientos para la heurística "mal carácter" del algoritmo Boyer-Moore
* @param patron El patrón de búsqueda
* @param pLen Longitud del patrón
* @param badc... | ALGO | 0.999454 | 3.913761 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2025-06-14T23: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": "bc9ccd059aa... |
a2c64902-d7ef-4cc7-adf0-cb956ec61af8 | 7oSkaaa/LeetCode_DailyChallenge_2023 | 02- February/21- Single Element in a Sorted Array/21- Single Element in a Sorted Array (Nayra Mohammed).cpp | // Author: <NAME>
// 1st Solution : Time Complexity = O(n)
class Solution
{
public:
int singleNonDuplicate(vector<int> &nums)
{
/*
- Thinking of bitwise xor:
a ^ a = 0
b ^ b = 0
a ^ b = (a ^ b)
We can xor all nums's elements to... | ALGO | 0.999934 | 5.809901 | {
"github_metadata": {
"branch": "main",
"commit_count": 6874,
"repo_created_at": "2023-01-02T11:28:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 104,
"forks": 86,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "5bcd36... |
1c6c19f9-851d-40de-bd5c-5472b043c00f | ishandutta2007/codeforces-f | ffao/normal/1240/A.cpp | #if 1
#ifdef LOCAL
#define _GLIBCXX_DEBUG 1
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif
#include <bits/stdc++.h>
using namespace std;
#if 0
#include <bits/extc++.h>
using namespace __gnu_pbds;
template<class T>
u... | ALGO | 0.999077 | 3.688777 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a81e8f66285... |
15c8f7ee-1132-4d38-9770-16c9c6ec885d | 1Amankabra/babbar | trie/trieintro.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
class TrieNode {
public:
char data;
TrieNode *children[26];
bool isTerminal;
TrieNode(char ch){
data=ch;
for(int i=0;i<26;i++){
children[i]=NULL;
}
isTerm... | ALGO | 0.999546 | 4.434357 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2022-11-20T06:03:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbc8e7d00... |
517eff32-a0e5-4feb-8f81-0d811ce0d457 | jim-og/EPIJudge | epi_judge_cpp/k_closest_stars.cc | #include <algorithm>
#include <cmath>
#include <vector>
#include "test_framework/generic_test.h"
#include "test_framework/serialization_traits.h"
#include "test_framework/test_utils.h"
using std::vector;
struct Star
{
bool operator<(const Star &that) const
{
return Distance() < that.Distance();
}
double ... | ALGO | 0.999878 | 6.151776 | {
"github_metadata": {
"branch": "master",
"commit_count": 284,
"repo_created_at": "2020-06-28T12:43:16.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "adnanaziz/EPIJudge",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content... |
d534530c-bc0e-4eac-be99-834e225e1908 | rogeriobarbosa07/Trabalho-listas-filas-e-pilhas---Projeto-de-algoritmos | Questao 1/main.cpp | #include "pilha.h"
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
int main() {
// Onde guardaremos a palavra.
string palavra;
// Variável que guarda a opção do usuário
int opcao;
cout << "Digite uma palavra: ";
cin >> palavra;
// Criação da pilha dinamicamente
char ... | ALGO | 0.997026 | 5.254388 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-09-10T22:26: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": "c38d6650db55... |
14aa605e-4c65-49ea-a413-e12d9698be7a | Nicolas3094/BB3D | src/metaheuristics/ArtificialBeeColonyAlgorithm.cpp | #include "ArtificialBeeColonyAlgorithm.hpp"
Poblacion ArtificialBeeColonyAlgorithm::evolve()
{
int iteration, eliteSite, noneEliteSite, eliteBee, nonEliteBee, restOfSites;
Poblacion sites =
initialHeuristicPoblation(numberOfIndividuals, dataSet.bin, dataSet.totalItems, rotationType);
for (auto &s... | ALGO | 0.999963 | 4.760676 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2021-12-31T19:15: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": "0b0d605e5... |
b4ddbec8-635c-4d3c-9f69-77a5c4fd74b0 | jrskg/coding_practices | Data structure and algorithms/heap/heap.cpp | #include <iostream>
#include <vector>
using namespace std;
// heap is a data-structure which is a complete binary tree which satisfy a order property
// complete binary tree is a binary tree in which every level, except the last, is completely filled and all node in the last level are as far left as possible
// Order... | ALGO | 0.99981 | 4.919638 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2023-07-17T10:33: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": "f85dda194... |
a74467b3-5c32-41a6-b9a9-4be037933acc | vatsalsinha/leetcode | numbersAtMostNGivenDigitSet.cpp | class Solution {
public:
int atMostNGivenDigitSet(vector<string>& digits, int n) {
// a lot of help from leetcode solution
//DP
string S = to_string(n);
int K = S.size();
int dp[K+1];
memset(dp, 0, sizeof dp);
dp[K] = 1;
for(int i = K-1; i > -1; i--){
... | ALGO | 0.999894 | 6.723186 | {
"github_metadata": {
"branch": "main",
"commit_count": 801,
"repo_created_at": "2021-03-25T07:18:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e61c70b19d... |
2de4e285-046f-4ed9-be78-0fe6f4ec753e | iShubhamRana/Dynamic-Programming | WildcardPattern.cpp | /*
Given an input string (s) and pattern (p),implement wildcard pattern
matching algorithm that finds if wildcard pattern is matched in the input string.
The wildcard pattern can include characters '?' and "*"
'?' matches any single character
'*' matches any sequence of characters(includeing empty spaces.
The matchi... | ALGO | 0.999992 | 3.82468 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2021-10-05T08:01: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": "59f385dbd... |
8b69c2bc-6ab7-4359-86a9-dfa743389d3e | Kawaboongawa/OpenCV-Chroma-Key | src/alphaBlending.cpp | #include "alphaBlending.h"
#include <limits>
void AlphaBlend::alphaBlend(cv::Mat& foreground, cv::Mat& background, cv::Mat& alpha, cv::Mat& outImage)
{
auto f = [&](float F, float B, float A)
{
return (A * F) + (1 - A) * B;
};
for (int j = 0; j < foreground.rows; j++)
{
const cv::Vec3b * MF = foreground.ptr... | ALGO | 0.998047 | 6.466654 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-12-08T18:24:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9dc6a04cff... |
b357536d-74ab-45ff-8438-f09e4bff4a17 | laohuu/minirender | includes/utils.h | #ifndef RAYTRACING_UTILS_H
#define RAYTRACING_UTILS_H
#include "glm/glm.hpp"
#include "enable_stb_image.h"
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "glm/gtc/type_ptr.hpp"
#include "filesystem.h"
#include <iostream>
#include <cmath>
#include <limits>
#include <memory>
#include <random>
... | TOOL | 0.974337 | 6.057563 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-03-22T09:37:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f25e47b4022... |
3ef24c5f-88a3-4a31-b3e7-99373b3c0e9b | ledinhquy123/algorithms | QuyHoachDong(DynamicAlgorithm))/SoduongDiTrongMeCung.cpp | #include<bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
using ll = long long;
ll dp[1001][1001];
int main(){
int n; cin >> n;
char a[n + 1][n + 1];
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++) cin >> a[i][j];
}
dp[1][0] = dp[0][1] = 1;
for(int i = 1; i <= n; i++){
... | ALGO | 0.999934 | 4.369028 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-18T12:36:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9efbca152b0e... |
a6edbfd5-3275-489d-a63e-529d52a31606 | keijak/comp-pub | eolymp/contests/21041/H/main.cpp | #include <bits/stdc++.h>
#define REP_(i, a_, b_, a, b, ...) \
for (int i = (a), END_##i = (b); i < END_##i; ++i)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(x) std::begin(x), std::end(x)
using i64 = long long;
template <typename T, typename U>
inline bool chmax(T &a, U b) {
re... | ALGO | 0.99947 | 4.412048 | {
"github_metadata": {
"branch": "master",
"commit_count": 2362,
"repo_created_at": "2020-04-12T08:07:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0515b1c... |
11fdb893-a657-4abd-b0f2-5ff8fca0d5ef | arypravin10/CE-2019_DSA-LAB4_-Roll-No-07_08- | include/graph.h | #pragma once
#include<iostream>
class Node
{
public:
int data;
Node *next;
Node *down;
Node(int data)
{
this->data = data;
}
Node() : next(nullptr), down(nullptr) {}
~Node()
{
if (next)
{
delete next;
}
if (down)
{
... | ALGO | 0.985726 | 3.895749 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2021-08-18T09:48: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": "89182cec2... |
4409342b-c04f-48b5-8f1f-e6f8feb5fffe | zhLei02/Rectangling-Panoramic-Images-via-Warping | include/SeamCarving.h | #ifndef SeamCarving_h
#define SeamCarving_h
#include <common.h>
using namespace std;
using namespace cv;
enum class Border
{
TOP = 0, // 上
RIGHT = 1, // 右
BOTTOM = 2, // 下
LEFT = 3 // 左
};
enum class SeamDirection
{
VERTICAL = 0, // 垂直
HORISENTAL = 1 // 水平
};
class... | ALGO | 0.99413 | 4.558326 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-03T10:48:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fecf9de4631... |
78a6792e-2267-43de-834c-8c3c4d1cda66 | RosettaCommons/rosetta | source/src/core/scoring/packstat/SimplePDB.cc | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | TOOL | 0.985083 | 6.202743 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "10a4... |
6f862c62-80ed-4252-8991-7819275e2aa4 | chestnutprog/CODING | cf354c.cpp | #include <bits/stdc++.h>
#define si(n) scanf("%d", &n);
#define pi(n) printf("%d\n", n);
#define pl(n) printf("%lld\n", n);
#define sl(n) scanf("%lld", &n);
#define pd(n) printf("%lf\n", n);
#define ss(s) scanf("%s", s);
#define ps(s) printf("%s\n", s);
#define ll long long
#define mod 1000000009
#define b 1000000007
#... | ALGO | 0.999918 | 3.579007 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-04-03T04:07:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1f1e99d8... |
7b2cfe14-16fa-4575-b78b-56016214e523 | ishandutta2007/codeforces-b | bhaskartm/normal/1194/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)
#define sz(a) int((a).size())
#define x first
#define y second
typedef long long li;
typedef pair<int, int> pt;
template<class A, class B> ostream& operator <<(ostream& out, const pair<A, B> &p) {
return out... | ALGO | 0.999974 | 4.25735 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6de2cf2b131... |
164c7621-440e-47d4-8a59-febab46a2e86 | SovietPower/My-OI-ACM | 图论/二分图/BZOJ.5404.party(树链剖分 bitset Hall定理).cpp | /*
220140kb 7192ms(好慢啊)
$Description$
给定一棵树,每个点有一种特产$a_i$(可相同)。$q$次询问,每次给$2\leq c\leq 5$个人及其位置,他们会走到他们的公共LCA处。
每个人可以从他走的路径上带一些特产,但需满足:所有人带的特产数量相同;不能有两种相同特产。
求最多一共能带多少种特产。
$n\leq 3\times 10^5,\ q\leq 5\times 10^4$,特产种数$\leq 1000$。
$Solution$
只有指向父节点的单向道路,所以c个人肯定在LCA处汇合。那么就成了有c条到LCA的路径,求最大的x,满足能从c条路径中各选出x个数,且它们不同。
先要维护一条... | ALGO | 0.999899 | 3.875046 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-01-03T14:20:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4098fef0a8ed... |
ca219c2e-ce91-4a91-ac2f-29e0831e5042 | ishandutta2007/codeforces-h | heart_blue/normal/35/A.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999936 | 3.245511 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e155d4a7c5a... |
c0a6cfed-8f2f-4a57-9348-68cd0ba866d3 | KnightWXW/Algo-CPP | ProgramDesign/AlarmSystem.cpp | #include <stdio.h>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <unordered_map>
using namespace std;
// Huawei: 简易闹钟系统
// 请给新款儿童手表设计一个简易闹钟系统。实现如下功能:
// bool AddAlarm(int id, int hour, int minute, vector<int> weekdays, int typeId):
// ... | ALGO | 0.994833 | 4.616162 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2022-07-30T13:34:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e9420503... |
c831f9aa-3874-4aad-9073-e91db9f15ddf | sianke1991/BOJ_CPP | 20240810_unionFind/17619.cpp | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
/*
union-find 방법을 응용, 점프하여 도달할 수 있는 통나무 번호를 하나의 집합으로 묶는다.
이후 통나무 a에서 통나무 b로 점프가 가능한지 여부를 조회하는 것은
a와 b가 하나의 집합에 속하는지 여부를 조회하는 것으로 대체될 수 있다.
입력받은 통나무를 정렬하되, 그 시작 위치를 기준으로 오름차순 정렬한다.
가장 왼쪽에 있는 통나무에서 시작하여 오른쪽으로 진행하면서
이번 통나무가 [바로 직전 통나무가 속한 그룹]에 속하는지 여부를 조사... | ALGO | 0.999981 | 5.057572 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2022-08-21T06:54:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed2b86f4... |
ec63a1c5-05b4-4e6c-9b23-4fa90003a53e | VLTHellolin/zroi23 | 7.24/2.cpp | // * HELLOLIN'S CP CODE TEMPLATE v2.0.1
#define _EXT_CODECVT_SPECIALIZATIONS_H 0
#define _EXT_ENC_FILEBUF_H 0
#include <bits/extc++.h>
namespace hellolin {
using ll = long long;
using ull = unsigned long long;
using lll = __int128;
using ld = long double;
constexpr static ull mod_1e97 = 1e9 + 7, mod_998 = 998244353, m... | ALGO | 0.999931 | 4.450617 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-07-20T03:17:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ec7f7dee8c... |
983d2812-3903-489a-b713-0f10c4799b0a | IlonaAK/AdressBook | main.cpp | #include <iostream>
#include <windows.h>
#include <fstream>
#include <sstream>
#include<vector>
#include<algorithm>
using namespace std;
struct Person
{
int id;
string firstname="", lastname="", phoneNumber="", email="", address="";
};
vector<string> splitTextToSingleWord (string text)
{
vector<string>si... | TOOL | 0.954568 | 3.820286 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-07-07T21:11:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f47d9c18f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.