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 |
|---|---|---|---|---|---|---|---|
39d9f1fe-8be2-47e5-bcc8-ce1d58cb0138 | costashatz/GeometricTools | include/geometric_tools/Distances/PolylineToPolyline.h | /**
Copyright (c) 2014, <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 of source code must retain the above copyright notice, this list of conditions and the following disclaime... | ALGO | 0.992423 | 5.627775 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2014-01-29T17:34:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10688d4f... |
df52d009-cc15-46f3-ab28-3944ef7b2292 | K-Software-BootCamp/2023KEB_DA01 | Linked List/Linked_List_SingleThread.cpp | #include <iostream>
#include <random>
#include <cstdlib>
#include <vector>
#include "Linked_List.hpp"
using namespace std;
int main(void) {
DoublyLinkedList<int> dll; // list 만들고 이름 지정
clock_t makestart, makeend;
double makeduration;
random_device rd;
mt19937 gen(rd());
uniform_int_distribut... | ALGO | 0.995047 | 4.557499 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2023-08-15T09:02:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0050bb99bdd2... |
38990461-0eb4-41d3-b23a-7349f9974057 | nafi103/Solved-Problems | Practice/2024/B_Fear_of_the_Dark.cpp | #include <bits/stdc++.h>
using namespace std;
/********************************Macros********************************/
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define inf 0x3f3f3f3f
#define MAXN 100005
#define ff first
#define ss second
#define set_bits(x) __builtin_popcount(x)
... | ALGO | 0.999845 | 4.472878 | {
"github_metadata": {
"branch": "main",
"commit_count": 224,
"repo_created_at": "2024-09-04T14:52: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": "a2c92d80da... |
d0b7da33-eac4-4e4b-8972-81e0fd22f1a9 | fernandomorato/competitive-programming | Seletiva IOI/2019/Dia 1/times.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const long long MOD = 1e9 + 7;
bool eh_bipartido;
int cor[MAXN], cnt[3];
vector<int> adj[MAXN];
void dfs(int v) {
cnt[cor[v]]++;
for (int u : adj[v]) {
if (cor[u] > 0 && cor[u] == cor[v]) {
eh_bipartido = false;
} else if (cor[u] == 0... | ALGO | 0.999977 | 4.30856 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2021-02-28T00:16: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": "059f31ddf4b... |
b60db42d-0a78-4c99-986e-831eaa35a5af | FoxySmile/HomeWorkCPP | 30.01.24/DefaultHomeWork.cpp | #include <iostream>
#include <string>
#define random(a,b) a + rand() % (b - a + 1)
using namespace std;
const int countNames = 5;
const string names[] = { "Олег", "Паша","Коля","Вика", "Оля" };
class Student {
static int id;
int uniqId;
string name;
int* marks = nullptr;
int countMarks = 0;
public:
Student() {
... | TOOL | 0.93307 | 3.496851 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2024-01-16T16:33: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": "ef8f5695091... |
e7899bb8-281d-45ee-8ba4-46b95649734c | r-barnes/BarnesClark2017-Salamanders | src/salamander.hpp | #ifndef _salamander
#define _salamander
#include "params.hpp"
#include <cstdint>
#include <bitset>
class Salamander {
public:
///Gene Type - used for storing genetic information that is used to
///determine whether individuals are of the same species, based on a bitwise
///comparison of the binary expression o... | ALGO | 0.989898 | 6.587201 | {
"github_metadata": {
"branch": "master",
"commit_count": 560,
"repo_created_at": "2017-01-27T01:33:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "443f0b2e... |
5223a2a0-809d-48ce-81db-150b1fb0a0d2 | Gabriel123Duarte/maratona-final | Contests/IV Escola de Inverno da Unifei/Intermediário - Dia 3/1123Gustavo.cpp | /*input
4 6 3 3
0 1 10
1 2 10
0 2 1
3 0 1
3 1 10
3 2 10
6 7 2 5
5 2 1
2 1 10
1 0 1
3 0 2
3 4 2
3 5 3
5 4 2
5 5 2 4
0 1 1
1 2 2
2 3 3
3 4 4
4 0 5
0 0 0 0
*/
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
vector<vii> graph;
#define pb push_bac... | ALGO | 0.99995 | 3.956161 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2017-05-04T18:13:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ad8008... |
82011713-eb31-4380-bac6-507b77499540 | palilo815/ps | baekjoon/2000/2982.cpp | #include <bits/stdc++.h>
#define loop(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef pair<int, int> p;
typedef tuple<int, int, int, int> tup;
const int max_N = 1000;
vector<tup> adj[max_N + 1];
int dist[max_N + 1];
int main() {
cin.tie(NULL), cout.tie(NULL);
ios::sync_with_stdio(false);
int N, M... | ALGO | 0.99996 | 4.005422 | {
"github_metadata": {
"branch": "master",
"commit_count": 6725,
"repo_created_at": "2020-01-12T04:58:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be34d2b... |
0fa4706f-9280-4646-b423-4103906e2c93 | porres/pd-else | Source/Audio/plaits~/stmlib/dsp/hysteresis_quantizer.h | // Copyright 2015 <NAME>.
//
// Author: <NAME> (<EMAIL>)
//
// 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, mo... | ALGO | 0.994492 | 7.108858 | {
"github_metadata": {
"branch": "master",
"commit_count": 6211,
"repo_created_at": "2016-04-22T16:45:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 354,
"forks": 43,
"issues": 273,
"pull_requests": 2
},
"file_meta": {
"content_id": "13... |
3d5ae179-a27d-4f26-a643-aaa874ab7ea6 | StravopodisNikos/smm_screws | src/OperationalSpaceControllers.cpp | #include "smm_screws/OperationalSpaceControllers.h"
using namespace OperationalSpaceControllers;
// ****************** INVERSE DYNAMICS CONTROLLER ******************
InverseDynamicsController::InverseDynamicsController() {};
InverseDynamicsController::InverseDynamicsController(ScrewsKinematics *ptr2kinematics, Screw... | ALGO | 0.994323 | 4.666001 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2023-10-04T12:46:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6efee938b... |
582e7eca-ec42-4385-803d-12f716e15ed3 | ThatDNS/UVa-solutions | UVA/Ch 5. Mathematics/10916 - Factstone Benchmark.cpp | // Problem: 10916 - Factstone Benchmark
/**
* Author: DNS404
**/
#include <bits/stdc++.h>
using namespace std;
/*---------------Bitmask---------------*/
#define setBit(S, pos) (S |= (1 << pos))
#define resetBit(S, pos) (S &= ~(1 << pos))
#define checkBit(S, pos) (S & (1 << pos))
#define toggleBit(S, pos) (S ^= (1 <... | ALGO | 0.999439 | 3.35899 | {
"github_metadata": {
"branch": "master",
"commit_count": 285,
"repo_created_at": "2018-08-29T12:08: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": "dd28daa5... |
72b9a0d4-2c5e-49b8-ad73-8ad65e2fb142 | prateek27/design-patterns-java | cpp/LLDProject/RideSharingApp/V1/RideSharingAppService.cpp | #include <vector>
#include <iostream>
#include <cmath>
#include "Driver.cpp"
#include "Passenger.cpp"
class RideSharingAppService {
private:
std::vector<Driver> drivers;
std::vector<Passenger> passengers;
double calcDistance(const Location& one, const Location& two) {
double dx = one.getLatitude()... | TOOL | 0.92012 | 5.738392 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-10-01T05:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 114,
"forks": 114,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "047faae... |
5042437b-686d-45a1-a044-309ff2877f38 | anudeeps28/DSA-cpp | 10-Basic-Sorting-Algorithms/7-assignment.cpp | #include<iostream>
using namespace std;
// sort the array in descending order using all the 4 basic sorting algorithms
void printArray(int arr[], int n) {
for(int i=0; i<n; i++) {
cout << arr[i] << " ";
}
cout << endl;
}
void reverseBubbleSort(int arr[], int n) {
for(int i=0; i<n-1; i++) {
... | ALGO | 0.99993 | 5.176293 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2025-03-22T05:07: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": "e9e1c53b355... |
d3e369d4-0bab-4d23-9f05-cf31d1380202 | ht15/CPlusPlus | systemV/server_delete.cc | /*server.c:向共享内存中写入People*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <stdio.h>
#include <string.h>
/*信号量的P操作*/
void p(int semid)
{
struct sembuf sem_p;
sem_p.sem_num=0;
sem_p.sem_op=-1;
if(semop(semid,&sem_p,... | WEB | 0.963998 | 4.492594 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-11-24T15:29: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": "4f4f7bfa7... |
ba76f359-9eec-480f-ad80-9043f9aeb483 | Gecode/gecode | gecode/set/distinct/atmostOne.cpp | /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* <NAME> <<EMAIL>>
*
* Copyright:
* <NAME>, 2004
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, t... | ALGO | 0.995337 | 7.205982 | {
"github_metadata": {
"branch": "master",
"commit_count": 5620,
"repo_created_at": "2015-11-06T07:33:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 309,
"forks": 77,
"issues": 40,
"pull_requests": 9
},
"file_meta": {
"content_id": "9d68... |
5570770c-da91-4d91-8a07-54dcd215a11b | sqmedeiros/sblp2023-time-vs-energy | 1634-Minimizing_Coins/c++/rand/483031.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
#define imx INT_MAX
#define imn INT_MIN
#define llmx LLONG_MAX
#define llmn LLONG_MIN
#define INF 100000000000000... | ALGO | 0.999973 | 3.964355 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2023-07-26T18:18: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": "1027ab603f... |
e2950a80-2f0d-4c8a-a580-a086841f95b4 | ishandutta2007/codeforces-n | ngfam/normal/1016/F.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
const int MAXN = 300030;
int n, q;
int starting_cost;
vector<int> chain;
vector<pair<int, int>> g[MAXN];
bool inChain[MAXN];
int cost_prev[MAXN];
int cost_next[MAXN];
bool dfs_findchain(int v, int p) {
if(v == n - 1) {
chain.push_back(v);
... | ALGO | 0.999885 | 4.314737 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e244e98477de... |
564df261-e7a5-4533-9c39-1c780bdaeede | Krissny/cpp | Extra/9_ButterFly.cpp | /*This question is a bit difficult , here we have to print a pattern that
looks like butterfly
* *
** **
*** ***
********
********
*** ***
** **
* *
*/
#include <iostream>
int main(){
int n;
std::cin>>n;
int num =2*n; // Here I use num variable to store the total no of rows which is d... | ALGO | 0.999992 | 4.180186 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2022-08-18T10:30: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": "755e2d67a... |
617031dd-cfae-4921-a7ca-9766bd91e44a | wjxzju/leetcode_cpp | leetcode_cpp/leetcode_85.h | #ifndef __LEETCODE_85
#define __LEETCODE_85
#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
using namespace std;
class Solution {
public:
static int largestArea(vector<int>& heights) {
int maxArea = 0;
vector<int> copy = heights;
copy.push_back(0); //在原有的数组后面加个0保证最后一个元素也计算进去
stack... | ALGO | 0.999831 | 6.016747 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2016-09-13T10:29: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": "af0566cbd... |
7b5be737-b3c0-4a86-a7b5-426d245db90c | Kshitijvv1211/dlcoproject2passassembler | asm.cpp | #include <bits/stdc++.h>
using namespace std;
struct AsmTable {
string label;
string mnemonic;
string operand;
int operand_type;
bool label_present;
};
vector<AsmTable> asm_data;
map<string, pair<string, int>> opcode_map;
vector<pair<int, string>> error_list;
vector<string> cleaned_code;
map<stri... | TOOL | 0.929647 | 3.9116 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-10-25T07:37: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": "f2f7406ce2f3... |
7eed851f-1830-416e-8b50-f3b20129125e | ajeetkr77/My-DSA-Journey | LeetCode POTD/Array/9. April/3375. Minimum Operations to Make Array Values Equal to K.cpp |
class Solution {
public:
int minOperations(vector<int>& nums, int k) {
int n = nums.size();
int minOp = 0;
int Min = INT_MAX;
for(int i = 0; i < n; i++) Min = min(Min, nums[i]);
if( Min < k ) return -1;
set<int> st;
for(int i = 0; i < n; i++) st.ins... | ALGO | 0.999956 | 6.122762 | {
"github_metadata": {
"branch": "main",
"commit_count": 388,
"repo_created_at": "2025-03-21T07:29: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": "5735569089... |
20397308-971b-4a75-9176-18e81ae84bc9 | ganzhiruyi/leetcode | Bitwise AND of Numbers Range.cpp | // 自己的解法
class Solution {
public:
int rangeBitwiseAnd(int m, int n) {
int nowbit,bits[32],l = n-m+1;
memset(bits,0,sizeof(bits));
for(int i = 0;i < 31;++i){
nowbit = (n&1)&(m&1);
// 当前位与为1且长度不大于2^i,则这一位能得到1
if(nowbit && l <= (1<<i)) bits[i] = 1;
... | ALGO | 0.999981 | 6.138581 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2013-09-11T16:39: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": "334400d97... |
1a9d6847-900d-4f8a-9e83-135ba03be03c | NMRanaHamid/Problem_Solving | Personal/C_Assembly_via_Minimums.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
ll mod = 1e9+7;
#define n... | ALGO | 0.999548 | 3.695698 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2023-09-30T10:39: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": "ff697a619e3... |
dcac686b-95e2-41a2-b425-dff303f2d0f6 | phigratio/CP | Random/D_Very_Different_Array.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define faster \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ll maxi = 1e6 + 1;
#define pb push_back
#define F first
#define S second
void muqtu()
... | ALGO | 0.999983 | 4.028896 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2023-11-29T08:01: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": "8531bba7c... |
acdc2621-fe5f-4c9d-a03d-bf7207fc4bc8 | pradhumnarajput/Leetcode-Problems | 234-palindrome-linked-list/234-palindrome-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* middle... | ALGO | 0.999791 | 6.044139 | {
"github_metadata": {
"branch": "main",
"commit_count": 270,
"repo_created_at": "2023-05-22T10:46: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": "491f28f078... |
eacf9892-ae46-436c-a16e-43354a78792a | Momofil31/Unitn_Programmazione1_2018 | funzioni/es1Febbraio2015.cc | #include <iostream>
#include <iomanip>
using namespace std;
double calcola(double x, int n, double epsilon);
double potenza(double x, double esp);
double abs(double x);
int main () {
double epsilon, x;
int n;
cout << "Inserisci il numero di termini dell’approssimazione: ";
cin >> n;
cout << "Inserisci l’e... | ALGO | 0.999817 | 4.296082 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-12-22T10: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": "892e58181b... |
52205e4b-12cb-4f94-8e09-0ba8c6d9480f | justtshreyansh/Problem-Solving | CP Sheet/1000/raspberries.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
vector<int> arr(n);
for(int i=0;i<n;i++){
cin>>arr[i];
}
vector<int> divisible(6,0);
for(int i=0;i<n;i++){
if(arr[i]%3==0) ... | ALGO | 0.999936 | 3.616609 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2025-01-01T10:00: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": "408902d6a... |
9c0bb385-8bd4-4a72-94f7-42c78b69c2bf | 3DRX/adventofcode | 2021/C-C++/day3-2.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#define LINE 1000
#define LENGTH 12
int convertBinaryToDecimal(long n);
int main(void)
{
char data[LINE][LENGTH+1];
int co2[LINE];
int oxygen[LINE];
char co2res[LENGTH+1] = {'\0'};
char oxygenres[LENGTH+1] = {'\0'};
for ... | ALGO | 0.99973 | 3.57794 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2022-06-16T12:04:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e959c834a... |
f1ba18c3-4c01-4e8c-85a8-b44ff4e73437 | szcompressor/cpSZ | src/sz_compress_cp_preserve_3d.cpp | #include "sz_cp_preserve_utils.hpp"
#include "sz_compress_3d.hpp"
#include "sz_compress_cp_preserve_3d.hpp"
#include "sz_def.hpp"
#include "sz_compression_utils.hpp"
#include <unordered_map>
#include <ftk/numeric/inverse_linear_interpolation_solver.hh>
static const int coordinates[24][4][3] = {
// offset = 0, 0, 0
{... | ALGO | 0.99944 | 5.800319 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2021-06-10T22:39:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a79e7cff7943... |
26ca850d-e2e7-4da6-a3f9-86e50c12456a | spookymath/codeforces | Regular Rounds/801 - 850/819. (Div. 1 & Div. 2)/B - Mainak and Interesting Sequence.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int tst; cin >> tst;
while(tst--)
{
int n, m; cin >> n >> m;
if(n == 1)
{
cout << "Yes" << '\n';
cout << m << '\n';
}
else if(m == 1)
{
cout << "No" << '\n';
}
else
{
if(n > m) cout << "No" << '\n';
else if(n... | ALGO | 0.999842 | 3.467192 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2022-06-08T10:09: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": "431366e3eda... |
ba9a0f27-ecb7-4e13-8521-903723bf7cdf | SARIF-MALIK/DSA-code | Daily Practice/CPP049_smallestDIString.cpp | class Solution {
public:
bool num[10] = {false};
bool flag = false;
void helper(string pattern, string& ans, int idx){
if(ans.size() == pattern.size()+1){
flag = true;
return;
}
if(ans.size() == 0){
for(int d = 1; d<=9; d++){
... | ALGO | 0.999858 | 5.691073 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2022-07-26T17:39: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": "d6cf2c5ad... |
915f3624-5ae7-4115-a83b-b055ece2f398 | filipbiernat/AdventOfCode_2019_CPP | AdventOfCode/Day8/Day8A.cpp | #include "Day8A.h"
Day8A::Day8A()
{
}
Day8A::~Day8A()
{
}
void Day8A::ReadInput()
{
const std::string fileName = "Day8/Day8A.txt";
std::ifstream inputStream(fileName.c_str());
if (!inputStream)
{
std::cerr << "Cannot open the File : " << fileName << std::endl;
return;
}
std:... | ALGO | 0.995949 | 4.950551 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-12-01T11:18: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": "3da369b40... |
06446867-fae4-4477-9dbd-1cc59b2f67dd | QuinnQR/aoc2024 | day06/day6.cpp | #include <algorithm>
#include <array>
#include <chrono>
#include <ctime>
#include <fstream>
#include <iostream>
#include <sstream>
#include <unordered_set>
#include <vector>
struct V2
{
int x;
int y;
V2(int a, int b)
{
x = a;
y = b;
}
inline V2 operator+(const V2 &other)
{
... | ALGO | 0.999887 | 4.986181 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2024-12-05T19:37:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50c9c3da579... |
28cb0776-297b-4ad0-af1c-11c89b3fdc85 | mkury/PrograSistemas | Progra Sistemas/Progra Sistemas/Programas Segundo Parcial/pruebaArreglos/main.cpp | #include <iostream>
using namespace std;
int numero[4];
int maximo;
int prom;
int menor=100000;
void ingreso (int numero[]){
int i=0;
for (i=0; i<5;i++){
do{
cout<<"Ingresar Numero "<<i+1<<": ";
cin>>numero[i];
}while(!((numero[i]%2==0) && (num... | ALGO | 0.997963 | 3.273365 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-02-17T20:51: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": "4176ad444f... |
047fc9af-bd0a-4b18-bbfe-6e9be4f8e8f4 | prateek-4/Projects | corpus_Q&A_Tool/qna_tool.h | #include <iostream>
#include <fstream>
#include "Node.h"
#include "search.h"
using namespace std;
class QNA_tool {
private:
// You are free to change the implementation of this function
void query_llm(string filename, Node* root, int k, string API_KEY);
// You can add attributes/helper functions here
p... | ALGO | 0.956784 | 4.212522 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-11-27T06:42: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": "5969198a663... |
12d9a350-b29c-4963-bd89-e21f8d287846 | muhimin30/Other-OJ-Practice | UVA - 10474.cpp | //Muhimin
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define bismillah() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(16);cout.setf(ios::fixed,ios::floatfield);
#define endl '\n';
int n, k;
int main()
{
bismillah();
in... | ALGO | 0.999671 | 3.882147 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-12-29T17:23: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": "10b2567d7521... |
441a5ef4-fbab-4ad8-92b6-a85949c454e0 | fei0319/competitive-programming | code/atcoder/arc177_b.cpp | #include <bits/stdc++.h>
int main() {
int n;
std::cin >> n;
std::string s;
std::cin >> s;
std::vector<uint8_t> ans;
std::vector<std::pair<int, int>> a;
for (int l = 0, r; l < n; l = r + 1) {
r = l;
if (s[l] == '1') {
while (r + 1 < n && s[r + 1] == '1') {
... | ALGO | 0.999986 | 4.015992 | {
"github_metadata": {
"branch": "main",
"commit_count": 371,
"repo_created_at": "2022-11-12T12:44: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": "97689954a4... |
3f6afaeb-3fc8-4bc8-a013-4f1886c96a7d | SHIVANGISINGH1/DSA-codes | 02-05-2021_arrays1/diffofarrays.cpp | #include<iostream>
using namespace std;
// function to subtract two arrays
void diff_arrays(int size1,int size2,int* arr1,int* arr2)
{
int max= size2<size1?size1:size2; // size of diff array will be same as size of larger array
int range = max;
int *ans = new int[max];
int firs... | ALGO | 0.999886 | 4.195251 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2021-10-31T17:20: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": "50b089dd2... |
ccbdd96a-d4b4-4c32-a84b-6dd095b0441b | prajogotio/UVa | 437 - The Tower of Babylon/a.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int d[99][3];
int dp[99];
int N;
int rec(int k){
if(dp[k] != -1) return dp[k];
int ret = 0;
for(int i=0;i<N;++i){
if( (d[k][1] > d[i][1] && d[k][2] > d[i][2]) || (d[k][1] > d[i][2] && d[k][2] > d[i][1]) ){
... | ALGO | 0.999787 | 3.798553 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2014-07-16T13:00:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1779def52... |
0a61d481-d9dc-42a5-afb9-214de6260a07 | 2261819266/code_old | NOIP2022/answers/FJ-144/plant/plant.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
#define int long long
const int Mod = 998244353;
const int N = 1005;
inline int read() {
int x = 0 , ff = 1;
char ch = getchar();
while(ch < '0' || ch > '9') {
if(ch == '-') ff = -1;
ch = getchar(... | ALGO | 0.999857 | 4.620006 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-01-29T12:39: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": "57ecc8330c... |
050c5c01-798f-48dd-871e-ab0c972d2b73 | zhussupov/algo | LeetCode/54 - Spiral Matrix.cpp | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
int m = matrix.size();
if (m == 0)
return {};
int n = matrix[0].size();
if (n == 0)
return {};
int dir[4][2] = {{0, -1}, {-1, 0}, {0, 1}, {1, 0}};
int q = 2;
... | ALGO | 0.999998 | 6.354622 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2019-03-13T08:39:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c5bbf6dc... |
07bc933e-0050-42e6-821f-5ab10fcf192a | kr-computer-study/algorithm | 성진/기타 연습/이진 탐색 트리의 구현.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
};
int findMin(Node* root)
{
if (root == nullptr)
{
return -1;
}
else if (root->left == nullptr)
{
return root->data;
}
else
{
return findMin(root->left);
... | ALGO | 0.999777 | 4.210081 | {
"github_metadata": {
"branch": "main",
"commit_count": 204,
"repo_created_at": "2021-01-18T02:06:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47965876018... |
05c0de55-142d-429b-9f26-f9a34baac44e | Falcons-Robocup/code | packages/mixedTeamProtocol/mtp/src/RoleAllocation/KuhnMunkres.cpp | // Copyright 2021 <NAME> (Falcons)
// SPDX-License-Identifier: Apache-2.0
// header partially implemented in this file
#include "int/RoleAllocation.hpp"
// headers from this package
#include "int/Errors.hpp"
// headers from other packages
#include "tprintf.hpp"
// system headers
#include <cmath>
#include <sstream>
#... | ALGO | 0.998751 | 5.503007 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-09-06T18:22:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8bc32316d7d... |
2a562f07-e720-476a-ab90-3feb10e48805 | ishandutta2007/codeforces-d | dario2994/normal/1656/F.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define SZ(x) ((int)((x).size()))
#define all(x) (x).begin(), (x).end()
// Returns the time elapsed in nanoseconds from 1 January 1970, at 00:00:00.
LL get_time() {
return chrono::duration_... | ALGO | 0.999269 | 3.814636 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "c6b3d93d0058... |
aabc147f-e803-4741-8ca6-4adb527ef1fd | Icefin/LeetCode | 1660-correct-a-binary-tree/1660-correct-a-binary-tree.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.99997 | 5.644914 | {
"github_metadata": {
"branch": "main",
"commit_count": 1359,
"repo_created_at": "2023-03-10T15:00:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7dc006569... |
590f19fc-d711-4688-8f81-9af6a04b7f9d | alexandraback/datacollection | solutions_5658282861527040_1/C++/MauricioC/b.cpp | #include <string>
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int fix_cmp(int cmp, int left, int right) {
if (cmp != 1) return cmp;
if (left < right) return 0;
if (left == right) return 1;
return 2;
}
long long memo[32][3][3][3];
string A, B, K;
long long doit(int d... | ALGO | 0.999897 | 4.608282 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c87beb08... |
57c91bbf-2afb-4348-89bd-59710ac36de1 | jaydoshi/file-search-engine | search2.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <set>
#include <locale>
#include <cctype>
#include <vector>
#include <string>
#include <cstdlib>
#include <iterator>
#include <algorithm>
using namespace std;
vector<string> intersectVector(vector<string> f1, vector<string> f2);
void ma... | TOOL | 0.980324 | 3.446401 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-09-06T23:12: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": "687a2a7bf4... |
3fb6421f-c324-44bf-8c5e-8665a37b5084 | kkerrigan/GDP-Containers | Containers/cCustomList.cpp | /**
* @file cCustomList.cpp
* @author <NAME> <<EMAIL>>
*
* @section DESCRIPTION
*
* Implementation of the cCustomList class.
*/
#include <stdexcept>
#include <time.h>
#include <Windows.h>
#include <psapi.h>
#include <string>
#include <fstream>
#include <iostream>
#include "cCustomList.h"
cCustomList::cCustom... | TOOL | 0.98799 | 4.571953 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-01-23T15:32: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": "6f540a4d3e... |
8f9ffd64-d5db-423b-86e6-b788ab753a25 | ChiHongZ/Matlab-vision-deep-learning | Hough.cpp | // Hough.cpp: 定义控制台应用程序的入口点。
//
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
using namespace std;
Mat src, erosion_dst, dilation_dst;
int erosion_elem = 0;
int erosion_size = 0;
int dilation_elem = 0;
int dilation_size = 0;
int const max_elem = 2;
int const max_kernel_size... | TOOL | 0.930426 | 3.746582 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-09T08:47: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": "5202111db4... |
3bd8f358-9844-43ae-ad40-e758d4da223b | chef/dep-selector-libgecode | ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch.hh | /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* <NAME> <<EMAIL>>
*
* Copyright:
* <NAME>, 2002
*
* Last modified:
* $Date: 2011-05-11 20:44:17 +1000 (Wed, 11 May 2011) $ by $Author: tack $
* $Revision: 12001 $
*
* This file is part of Gecode, the gen... | ALGO | 0.995884 | 6.769563 | {
"github_metadata": {
"branch": "main",
"commit_count": 94,
"repo_created_at": "2014-04-07T05:23:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 25,
"issues": 7,
"pull_requests": 2
},
"file_meta": {
"content_id": "573126bd8d... |
9eb62e9b-5a9d-400d-a69c-fc4114a1a6b2 | aki-hsk/competitive_programming | shojin/1200-/1500-/1575-/Number_of_Amidakuji.cpp | #include<iostream>
#include<vector>
using namespace std;
const int mod = 1000000007;
int main() {
int h, w, k;
cin >> h >> w >> k;
vector<vector<int>> dp(h+1, vector<int>(w, 0));
dp[0][0] = 1;
for(int i=0; i<h; i++) {
for(int j=0; j<w; j++) {
for(int k=0; k<1<<(w-1); k++) {
... | ALGO | 0.999949 | 4.34883 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-03-22T12:47: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": "96c108ef7... |
63f0cbae-fe0f-4bdb-916e-851cf90bb9cd | ishandutta2007/codeforces-i | irkstepanov/normal/707/B.cpp | #include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int inf = int(1e9 + 10);
struct edge
{
int u, v, cost;
};
int main()
{
... | ALGO | 0.999761 | 3.640546 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "477c482f3458... |
4f7c758b-2708-46e1-b47e-0f0023a92954 | Atom-Heart/Leetcode | BFS/C++/695-Max-Area-of-Island.cpp | class Solution {
public:
int ans = 0;
int m, n;
vector<int> dx = {-1, 1, 0, 0};
vector<int> dy = {0, 0, -1, 1};
void BFS(vector<vector<int>>& grid, int x, int y){
queue<pair<int ,int>> q;
q.push(make_pair(x, y));
grid[x][y] = -1;
int cnt = 1;
while(!q... | ALGO | 0.999904 | 5.638275 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-08-06T03:34: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": "f2b5a3e4f... |
c6497f3d-3a7e-4d38-a704-359800be453a | KayMaN777/Huffman_archiver | archiver.cpp | #include "parser.h"
#include "node.h"
#include "code.h"
#include <deque>
void CompressFiles(const std::string& archive_name, const std::vector<std::string>& names) {
Code code;
std::map<Char9, MyNum> codes;
std::ofstream fout;
fout.open(archive_name, std::ios::out | std::ios_base::binary);
for (con... | TOOL | 0.989712 | 4.300126 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-24T18:11: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": "19a3bd2eda0e... |
c97ad1d6-38e6-4ffb-9316-fc41f97a00b9 | nishitsharma03/Competitive_Programming | codeforces/1374/D.cpp | //#pragma GCC optimize "trapv"
#include<bits/stdc++.h>
#define ll long long int
#define fab(a,b,i) for(int i=a;i<b;i++)
#define pb push_back
#define db double
#define mp make_pair
//#define endl "\n"
#define f first
#define se second
#define all(x) x.begin(),x.end()
#define MOD 1000000007
#define vll vector<ll>
#define... | ALGO | 0.999919 | 3.461895 | {
"github_metadata": {
"branch": "master",
"commit_count": 639,
"repo_created_at": "2020-12-24T09:57:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9c9412c... |
3e52724b-3695-45d7-ab6a-f33620ccec29 | wzh1994/Exercises | courses/courses/done/17051/uva508.cpp | #include <iostream>
#include <string>
#include <map>
using namespace std;
typedef struct node{
string first;
int fre;
}Morse;
typedef struct wnode{
string word;
int len;
wnode(){}
wnode(int l, string w) :len(l), word(w){}
}Word;
bool operator <(const Word& w1, const Word& w2){
return w1.word < w2.word;
//return... | ALGO | 0.999622 | 3.45883 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2017-03-29T14:36: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": "d2c78673e... |
3a25dadb-b28b-4296-ab0e-c609845d5b11 | blin04/dist-community | system/source/graph.cpp | #include <iostream>
#include <fstream>
#include "../includes/graph.h"
Graph::Graph(string nodes_file, string edges_file) {
/*
* constructor of graph class
*/
num_edges = num_nodes = 0;
/* reading nodes */
std::ifstream nodes_input(nodes_file);
// initalizing first vector in adj_list to b... | ALGO | 0.98369 | 5.082072 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2023-07-31T15:10:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ec05e60a... |
a0132ffd-dec7-476b-8657-b46488139017 | MalikCoderGreen/LeetCode_Problems | easy_problems/nextGreaterElem.cpp | /*
496. Next Greater Element I
You are given two integer arrays nums1 and nums2 both of unique elements, where nums1 is a subset of nums2.
Find all the next greater numbers for nums1's elements in the corresponding places of nums2.
The Next Greater Number of a number x in nums1 is the first greater number to its rig... | ALGO | 0.999814 | 5.857936 | {
"github_metadata": {
"branch": "main",
"commit_count": 135,
"repo_created_at": "2021-02-19T23:22: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": "9c151b7f91... |
82555cd1-f4ef-4f24-afba-3623dc5f4257 | Kanellian77/BaekJoon | 백준/Gold/3109. 빵집/빵집.cc | #include <string>
#include <vector>
#include <set>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <queue>
#include <stack>
#include <string.h>
#define infinity 125000000;
#pragma warning(disable:4996)
using namespace std;
typedef long long ll;
int r, c;
int gmap[10010][510];
bool d... | ALGO | 0.999847 | 4.076993 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2024-04-30T11:40: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": "27959b84e8a... |
92de80aa-8a9f-4778-88be-ff9cc4664e04 | ellenliuyx/Coding-Interview | 26_SubStructureInTree/26_SubStructureInTree/26_SubStructureInTree.cpp | //==================================================================
// 《剑指Offer》代码
//==================================================================
// 面试题26:树的子结构
// 题目:输入两棵二叉树A和B,判断B是不是A的子结构。
#include <iostream>
using namespace std;
//****************************************************************************... | ALGO | 0.998718 | 4.859866 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-02-28T08:08: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": "71a24f1974... |
5f8ff5f6-e2f8-4295-a2d6-1c55b473070a | DairyQueenXD/Competitive-Programming | DMOJ-Solutions/CCC/ccc13s4.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define boost() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
const int MM = 1e5;
vector<vector<int>> adj(MM+5);
bool vis[MM+5];
bool bfs(int start, int find) {
memset(vis,false,sizeof(vis));
queue<int> q; q.push(start)... | ALGO | 0.99999 | 4.924176 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2024-08-03T13:39:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "686061b3fc6... |
fc30e5da-c6eb-4a6e-bf6d-d82b74b5fe6b | DucPr0/Codeforces---Dynamic-Programming | 13C.cpp | #include <bits/stdc++.h>
#define int long long
#define INF 1e18
using namespace std;
int n,a[5001],b[5001],dp[2][5001],mini[2][5001];
signed main() {
//freopen("13C.inp","r",stdin);
cin>>n;
for (int i=0;i<n;i++) {
cin>>a[i];
b[i]=a[i];
}
sort(b,b+n);
/*
To solve this problem, we have to prove the optimal sub... | ALGO | 0.999967 | 3.81633 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-03-10T02:37:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "775b7ce6d... |
2e68cbbf-8267-446c-827f-4e1316b64684 | SakibulMowla/leetcode-solutions | solutions/0819. Most Common Word.cpp | class Solution {
public:
void normalize(string& s) {
for (auto& ch: s) {
ch = tolower(ch);
}
return;
}
void parse(int pos, int n, string& paragraph, string current, unordered_map<string, int>& hash) {
if (pos == n) {
if (current != "") {
... | ALGO | 0.999978 | 5.890775 | {
"github_metadata": {
"branch": "master",
"commit_count": 520,
"repo_created_at": "2019-02-02T00:59:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c25a6147... |
d25f8977-a53d-4e57-a604-5bf3ba9f9fdb | ishandutta2007/codeforces-k | kirill22/normal/1083/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int, int>
#define fi first
#define se second
struct line {
int k, b;
line() {};
line(int k, int b) : k(k), b(b) {};
};
deque<line> kht;
long double X(line a, line b) {
return ((long double) b.b - a.b) / ((long doubl... | ALGO | 0.999784 | 4.693429 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06: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": "10884513463e... |
2382e8d0-de37-4ca4-9591-19d318077f23 | rabbit0v0/Course-works | PPCA/frac1.cpp | //
// frac1.cpp
// PPCA
//
// Created by 施晓钰 on 2017/7/15.
// Copyright © 2017年 幺幺. All rights reserved.
//
/*
ID: yy_20161
PROG: frac1
LANG: C++
*/
#include <stdio.h>
#include <iostream>
#include <algorithm>
using namespace std;
int N, sum;
struct re{
int son, mot;
re(){
son = 0, mot = 0;
}... | ALGO | 0.999723 | 3.954708 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-04-07T03:47: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": "ae6e8268b... |
0b2c3a97-358e-441a-92f8-431e3dc440b0 | creep06/competitive-programming | TC/508/d1easy.cpp | #include <bits/stdc++.h>
using namespace std;
//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmin(... | ALGO | 0.999953 | 4.303995 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-12-03T05:31:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "edc01652c... |
2626029b-ac02-4b99-97b2-fad36a0e5316 | metehkaya/Algo-Archive | Problems/LeetCode/Solutions/0745.Prefix_and_Suffix_Search.cpp | typedef long long LL;
typedef pair<LL,LL> pi;
class WordFilter {
public:
map<pi,int> mp[10][10];
LL mod = (LL) 1e9+7;
WordFilter(vector<string>& words) {
int n = words.size();
for( int i = 0 ; i < n ; i++ ) {
int len = words[i].length();
LL p = 0;
vector<... | ALGO | 0.999949 | 4.781076 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-04-04T19:44:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df7c114c8f8... |
60409f70-3661-4f7c-ad44-4de19a864ecd | shivangisehgal/ds-algo | STRIVER/15-DP/28-min-insertions-deletion-to-make-string-palindromic.cpp | //Q. Min insertions or Min delettions
//number of elements that are not palindromic: n - len(LPS)
class Solution {
private:
int longestPalindromeSubseq(string s) {
int n = s.length();
string s1 = s;
string s2 = "";
for(auto ch : s)
s2 = ... | ALGO | 0.999977 | 5.721841 | {
"github_metadata": {
"branch": "main",
"commit_count": 453,
"repo_created_at": "2022-07-18T10:30:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bec5190197... |
68a33999-d8b7-4d2b-af60-5a059078a1bd | Altu-Bitu-6/Notice | 06_그리디/라이브코딩/1931.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<int, int> pi;
int main() {
int n, cnt = 0;
vector<pi> arr;
cin >> n;
arr.assign(n, {0, 0});
//시간 입력 : 끝나는 시간 기준으로 문제를 푸므로 편의상 끝나는 시간을 first로 입력.
for (int i = 0; i < n; i++) {
cin >> arr[i].se... | ALGO | 0.99994 | 4.413794 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2024-01-29T13:31:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f80c397f5046... |
1c07dfe5-e551-43a3-ba83-fee6bc7e526f | nordicolympiad/nordic-olympiad-2017 | yule/submissions/factor.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T> int size(const T &x) { return x.size(); }
#define rep(i,a,b) for (__typeof(a) i=(a); i<(b); ++i)
#define iter(it,c) for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> v... | ALGO | 0.999787 | 4.131253 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-03-07T18:54:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "43cd388f134... |
d64adb28-285c-44b6-bc0c-309d56872098 | zzethh/DSA-Practice | #leetcode contest/biweekly/#107/count-zero-request-servers.cpp | class Solution {
public:
bool static compare(vector<int> &a, vector<int> &b) {
return a[1] < b[1];
}
vector<int> countServers(int n, vector<vector<int>>& logs, int x, vector<int>& queries) {
vector<pair<int, int>> qs;
for (int i = 0; i < queries.size(); i++) {
qs.push_bac... | ALGO | 0.99969 | 5.656918 | {
"github_metadata": {
"branch": "master",
"commit_count": 579,
"repo_created_at": "2022-08-25T09:05: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": "17e0306b... |
591c325f-0083-432c-9a69-9fc9d31c6244 | gbm-developers/gbm | src/bernoulli.cpp | // GBM by <NAME> Copyright (C) 2003
#include "bernoulli.h"
CBernoulli::CBernoulli()
{
}
CBernoulli::~CBernoulli()
{
}
GBMRESULT CBernoulli::ComputeWorkingResponse
(
double *adY,
double *adMisc,
double *adOffset,
double *adF,
double *adZ,
double *adWeight,
bool *afInBag,
unsigned ... | ALGO | 0.999954 | 6.552266 | {
"github_metadata": {
"branch": "master",
"commit_count": 200,
"repo_created_at": "2017-03-27T13:53:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 54,
"forks": 28,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "3edd9d8... |
b721ee5a-5940-4716-974d-5934148365cf | tauhrick/Competitive-Programming | Upsolves/Project-Euler/23.cpp | /*
chirag11032000
<NAME>
*/
#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;
using ll = long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
template < typename T > using Orde... | ALGO | 0.999907 | 4.210541 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2019-06-24T10:51:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e96e6ea3... |
871c9b3d-bfa0-4ead-a3fd-0b7dbc544da6 | derco19/Programming-Contest- | April Lunchtime 2021/Intersection_Matrix.cpp | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define Pair vector<pair<ll,ll>>
#define vec vector <ll>
#define all(a) a.begin(),a.end()
#define mo 100000000... | ALGO | 0.999752 | 3.259413 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-02-20T19:59: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": "e51229940c... |
8d2bae3e-88a5-4941-aad8-7fc6d349ceb9 | kaniz-codes/cse222 | 01_array/05_imertion-deletion-1d-array.cpp | #include <iostream>
using namespace std;
void insertElement(int arr[], int &size, int element, int position)
{
for (int i = size; i > position; i--) {
arr[i] = arr[i - 1];
}
arr[position] = element; // Insert element
size++;
}
void deleteElement(int arr[], int &size, int position) {
// M... | ALGO | 0.999138 | 5.839916 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2025-01-24T18:06: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": "d0d03037094... |
0c9d7178-0e11-4bca-b419-477fda5dfa8d | luca-m/facegrabber | facegrabber/src/misc/Utils.cpp | /*
* Utils.cpp
*
* Created on: Jul 23, 2013
* Author: stk
*/
#include "Utils.h"
void showHistogram(char* window_title, IplImage* src, char* channel_name) {
IplImage* img, *canvas;
int bins = 256;
int hist[bins];
double scale;
int i, j, channel, max = 0;
CvScalar colors[] = { CV_RGB(0,0,255), CV_RGB(... | ALGO | 0.992671 | 4.280588 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2013-07-23T16:41:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "242bcff6e... |
e09889b0-48b1-4715-b9c4-18bd2c8206a6 | Poncirus/leetcode | 344.reverse-string/344.reverse-string.cpp | /*
* @lc app=leetcode id=344 lang=cpp
*
* [344] Reverse String
*
* https://leetcode.com/problems/reverse-string/description/
*
* algorithms
* Easy (65.78%)
* Likes: 1385
* Dislikes: 678
* Total Accepted: 740.5K
* Total Submissions: 1.1M
* Testcase Example: '["h","e","l","l","o"]'
*
* Write a funct... | ALGO | 0.999471 | 6.11716 | {
"github_metadata": {
"branch": "master",
"commit_count": 231,
"repo_created_at": "2019-07-27T07:29: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": "dbfcc5ea... |
cb3d9912-83ac-43d2-babc-c0084b3720c6 | shashank9aug/DSA_CB | Array_1D_2D/Day02/Q5.cpp | //Minimum no of jump to reach size
// i.e. :end of the array
//Question:
// Given an array of N integers arr[] where each element represents the max number of steps that can be made forward from that element. Find the minimum number of jumps to reach the end of the array (starting from the first element). If an eleme... | ALGO | 0.999959 | 3.747113 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2021-05-23T17:51:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da41fdd9a... |
9d2fc404-822c-4d7e-91cb-e687bb6217f8 | 0xntlong/leetcode-and-self-study | cpp/easy-solution/1640.cc | /*
1640. Check Array Formation Through Concatenation
You are given an array of distinct integers arr and an array of integer arrays pieces, where the integers in pieces are distinct. Your goal is to form arr by concatenating the arrays in pieces in any order. However, you are not allowed to reorder the integers in ... | ALGO | 0.999341 | 6.129785 | {
"github_metadata": {
"branch": "main",
"commit_count": 1296,
"repo_created_at": "2024-10-13T16:27: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": "6bdb24e5a... |
7db914e4-50d2-447d-a914-1067515e4513 | manishsundriyal/Algorithms-DataStructures | Search_Element_In_Rotated_&_Sorted.cpp | #include <iostream>
using namespace std;
int BinarySearch(int arr[],int low,int high,int key){
if(low>high) return -1;
//base case
int mid=(low+high)/2;
//calculate mid element
if(arr[mid]==key) return mid;
//key value is at mid index
if(arr[mid]>key) return BinarySearch(arr,low,mid-1,key);
//key value somewhe... | ALGO | 0.999994 | 5.308807 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2017-07-24T13:06:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "891052ad0... |
a4c17b80-e2c3-4f6c-bc90-c7f9d1571a6d | minjee12/SSAFY-Algorithm | jaegeun/14888.cpp | // 연산자 끼워넣기(1)
#include <iostream>
using namespace std;
int n = 0; // 피연산자 개수
int opt[4] = { 0, }; // 연산자 저장
int opr[100] = { 0, }; // 피연산자 배열
int min_result = 1000000001;
int max_result = -1000000001;
// opr1 : 피연산자1, opr2 : 피연산자2, opt : 연산자
int calc(int opr1, int opr2, int opt)
{
switch (opt)
{
case 0: // +... | ALGO | 0.999934 | 3.6841 | {
"github_metadata": {
"branch": "main",
"commit_count": 321,
"repo_created_at": "2021-07-27T01:15:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2f82011faa... |
18bf022f-46ea-41c2-81e1-66f741910e95 | Adeogo1/C---Projects | Data/Binary.cpp | //
// Created by adeog on 15/07/2022.
//
#include "Binary.h"
void BinaryTree::MakeTree(){
AddToLeftNode(Root, 2);
AddToRightNode(Root, 3);
AddToLeftNode(Root->right, 6);
AddToRightNode(Root->right, 7);
AddToLeftNode(Root->left, 4);
AddToRightNode(Root->left, 5);
}
void BinaryTree::AddToLeftN... | ALGO | 0.99976 | 3.008986 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-06-09T01:24: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": "d74bb22384c8... |
9f91c601-c590-4f75-99c5-aa7f269c6437 | shribadiger/interviewpreparation | HackerRank/NodeSwap.cpp | #include<iostream>
#include<queue>
using namespace std;
class Node {
public:
int key;
Node* left;
Node* right;
Node(int key) {
this->key=key;
this->left=nullptr;
this->right=nullptr;
}
};
void insertNode(Node* root, int key) {
if(root == nullptr){
root=new Node(key);
}
else {
queue<Node*> q;
q.pu... | ALGO | 0.999979 | 4.953218 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-09-18T17:56: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": "07b0d8da1... |
6d36a04f-a8fa-448a-abaf-8d5913324295 | banoni-dev/codeforces | cpp/A/767.cpp |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define vi vector<int>
#define vll vector<long long>
#define mp make_pair
#define ff first
#define ss second
#define all(c) (c).begin(), (c).end()
#define sz(a) int((a).size())
const int MOD = 1e9 + ... | ALGO | 0.999891 | 4.508758 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2023-11-19T11:25: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": "c8c4d70188d... |
e0a14c45-0e85-4cfc-acc6-42bf173b05ba | raghavg2004/DSA-Love_Babbar | Lacture44_Singly_LinkList_Deletion.cpp | #include<iostream>
using namespace std;
// Class definition for a singly linked list node
class Node {
public:
int data; // Data part of the node
Node* next; // Pointer to the next node
// Constructor to initialize the node
Node(int value) {
this->data = value;
this->next = NULL;
... | ALGO | 0.999876 | 6.199169 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-04-10T07:17: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": "3de8afab5d80... |
77d3894a-7364-4fe8-8fba-c75c7aad339c | vaibhavbichave/Leetcode | Difficulty: Basic/Third largest element/third-largest-element.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int thirdLargest(vector<int> &arr) {
int n = arr.size();
int first = -1, second = -1, third = -1;
for(int i=0;i<n;i++){
if(first<ar... | ALGO | 0.999616 | 5.389843 | {
"github_metadata": {
"branch": "main",
"commit_count": 1746,
"repo_created_at": "2023-04-07T16:37:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f92aa423b... |
78198e30-4ffa-4f4e-a83b-790a609ab921 | scientific-coder/FEATS | include/feats/segmentations/equal_nb_of_segments.hxx | #ifndef EQUAL_NB_OF_SEGMENTS_HXX
#define EQUAL_NB_OF_SEGMENTS_HXX
#include<vector>
#include <boost/shared_ptr.hpp>
namespace feats{
namespace segmentations{
/*
this class computes segmentations over a set of time series
Static Parameters
segmentation algorithm i.e. optimal_split<linear0_mod... | ALGO | 0.971327 | 4.270678 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2011-09-26T11:36:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "651862c8ec... |
cf0c832e-3811-4c8b-b2ef-1591a29bdd3e | moad6127/Study_Cpp | Programmers/Level2_Re/level2_shortestMap/main.cpp | #include<vector>
#include <queue>
using namespace std;
const int dy[4] = { 0,1,0,-1 };
const int dx[4] = { 1,0,-1,0 };
int solution(vector<vector<int> > maps)
{
int answer = -1;
int n = maps.size();
int m = maps[0].size();
vector<vector<int>> visit(n, vector<int>(m, 0));
visit[0][0] = 1;
queue<p... | ALGO | 0.99995 | 4.832519 | {
"github_metadata": {
"branch": "master",
"commit_count": 511,
"repo_created_at": "2023-05-20T09:33: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": "7d0bc93c... |
6b8d7673-1ebf-425a-bed4-f175522c7a0f | KarelCasier/frontier | src/math/include/math/Collision.hpp | #pragma once
#include <vector>
#include <math/ConvexShape.hpp>
#include <math/Rect.hpp>
#include <math/Vector2.hpp>
#include <utils/Optional.hpp>
namespace frontier {
struct Manifest {
};
/// Determine if two AABB rectangles intersect.
///
/// @param rect1 The first rect to consider.
/// @param rect2 The second re... | ALGO | 0.999289 | 7.725564 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-01-27T15:19:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b05401ac... |
5fb61497-fce8-43b5-863f-1ae530c1abb4 | QbitQuantum/Basics | Исходники/CovariateMatrix.cpp | void CovariateMatrix::buildDecorrelationProjectionMatrix()
{
// There's no use parallelizing this. Even though it might be
// computationally intensive, this operation only needs to be done once per
// chain per covariate matrix.
// Combine X and Z appropriately to one large ... | ALGO | 0.990958 | 3.536533 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-03-06T07:05: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": "33e37d03df4... |
ae6a53d5-66de-43d5-a7ae-b5e98414b8cf | wfdudley/T-watch-2020 | appCalc.cpp | // simple Polish Postfix four function calculator
#include <math.h>
#include "config.h"
#include "DudleyWatch.h"
const char *calc_labels1[]
= {
"1", "2", "3", "+",
"4", "5", "6", "-",
"7", "8", "9", "*",
".", "0", "y^x", "/",
}
;
const char button_values1[] = {'1', '2', '3', '+',
... | ALGO | 0.935006 | 4.178444 | {
"github_metadata": {
"branch": "master",
"commit_count": 211,
"repo_created_at": "2020-09-23T23:29:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 87,
"forks": 27,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "038c86... |
9d57c06f-d10d-4523-a7c6-2dafab8fe443 | annvi23/20230512DigitalDesign | LED蜂鳴器.ino | #define NOTE_C3 131
#define NOTE_D3 147
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_G3 196
#define NOTE_A3 220
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_D4 294
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_G4 392
#define NOTE_A4 440
#define NOTE_B4 494
#define NOTE_C5 523
//note in the melod... | TOOL | 0.960175 | 4.39563 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-05-12T07:05:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c646f4202586... |
7be53d26-80e7-4c80-8656-af64582e3885 | codesurvivor/noc-router | booksim2.0/branches/SRP_IAR/src/traffic.cpp | // $Id: traffic.cpp 5324 2012-10-12 05:12:48Z qtedq $
/*
Copyright (c) 2007-2012, Trustees of The Leland Stanford Junior University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributi... | ALGO | 0.998173 | 4.714874 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2015-03-14T03:44: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": "eedd6f904... |
2744b9f2-e6f8-47fe-9a60-8c663fa90850 | AbdulrahmanJ204/cp | B_Sorting_the_Coins.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define endl '\n'
#define cendl cout<<endl
#define cyes cout<<"YES"
#define cno cout<<"NO"
#define cin(v) for(ll i=0;i<v.size();i++)cin>>v[i];
#define cin1(v,n) for(ll ... | ALGO | 0.999964 | 3.803886 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-01-24T07:28:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bba343eaf26... |
4440c328-43b9-4d72-9ccc-3b78e0df9e91 | tkmoon/eccbook | PROGS/chap7/ModAr.h | // ******************************************************************
// MODAR.h -- MODulo ARithmetic
// Created by <NAME>, with modifications by <NAME>
// Copyright 2004 by <NAME>
// Permission is granted to use this program/data
// for educational/research only
#ifndef ModAr_H
#define ModAr_H
#include <iostream>
us... | TOOL | 0.905762 | 5.188351 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-19T02:23:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a00b5dd8... |
6134edae-a2a2-447c-b8f5-e96a19e61aea | jackfetkovich/aftermarket-fish | src/MoveGenerator.cpp |
#include <vector>
#include <bitset>
#include "MoveGenerator.h"
#include "Util.h"
/*
* A note on structure:
*
* A reference to the position object is passed to the move generator, so that the generator
* can populate the legal_moves vector of the position object.
* Logically, it makes sense that a list of legal m... | ALGO | 0.990248 | 5.646856 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2021-12-11T02:56:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c121bdfb... |
5e472eba-5755-43fa-8961-0b638566e0d5 | princebansal7/DSA-Sheets-Code | Miscellaneous-Codes/Linked List/1.Singly Linked List/8.InsertAfterGivenPos.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
void printList(Node *head) { // TC: O(n) , SC: O(1)
if (head == NULL) {
cout << "Empty!!\n";
}
cout << "Linked List is: \n";
while (h... | ALGO | 0.999706 | 4.438798 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2021-12-27T20:42:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10c4d660ec... |
b7e20c20-7d9b-4e21-8004-96131ebf1e03 | AanikaTahsin/LightOJ-Solutions | 1135.cpp | #include<bits/stdc++.h>
using namespace std;
const int sz = 4*100005;
int tree[10][sz],lazy[sz];
void gach(int root, int left, int right)
{
tree[0][root] = (right-left+1);
tree[1][root] = 0 ;
tree[2][root] = 0 ;
lazy[root] = 0 ;
if(left==right)
{
tree[0][root]= 1 ;
return;
... | ALGO | 0.999901 | 4.366276 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-04-02T18:44: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": "0e76151f6... |
b365fa39-199b-4f01-9487-55990e453a96 | wondol2/ps | problems/baekjoon/11375.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "debug.h"
#define flush() cout.flush();
#else
#define debug(x)
#define flush()
#endif
int N, M;
vector<vector<int>> v(1001);
int vis[1001];
int assign[1001];
bool dfs(int n){
for(int i=0; i < (int) v[n].size(); ++i){
int x = v[n]... | ALGO | 0.99974 | 3.678384 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2022-01-12T06:44: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": "239f75de0... |
19c852ae-8e0e-4724-b775-f85e82a91a26 | northpoleforce/lesson_DS | 8赫夫曼与图/B赫夫曼编码长度.cpp | //https://blog.csdn.net/weixin_54186646/article/details/124376570
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#define ok 1
#define error -1
using namespace std;
const int MaxW = 9999999; // 假设结点权值不超过9999999
// 定义huffman树结点类
class HuffNode
{
public:
char val;
int weight; //... | ALGO | 0.999993 | 3.846582 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-10-12T03:39:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "62ec04f7928... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.