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 |
|---|---|---|---|---|---|---|---|
2a708908-0c16-43ea-a8dc-f5dac38c7e0c | archishmanghos/DSA-Contests | Interviews/Placement-Preparation/Day18-16August2023/SegTree-239-Sliding-Window-Maximum/code.cpp | #include <bits/stdc++.h>
using namespace std;
class SegTree {
private:
int n;
vector<int> arr;
const int INF = 1e9 + 7;
public:
SegTree(int n) {
this->n = 1;
while (this->n < n) this->n <<= 1;
this->n <<= 1;
this->arr.assign(this->n, -INF);
}
int buildAndAnswer(vector<int> &arr, int k) {
for (int i =... | ALGO | 0.999979 | 5.737867 | {
"github_metadata": {
"branch": "master",
"commit_count": 2328,
"repo_created_at": "2021-08-03T05:06:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c2faf0... |
7e4c9229-8eac-4dd3-b103-31edc838094d | m4ushold/ps | 백준/Platinum/31743. Grand Escape/Grand Escape.cc | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
struct LazySeg {
const static int sz=1<<17;
ll T[sz<<1], L[sz<<1];
ll& operator[](int i) {return T[sz|i];}
void bld() { for(int i=sz-1;i>=1;i--) T[i]=(T[i*2]+T[i*2+1]); }
void prop(int i, int s, int e) {
if(!L[i]) return;
... | ALGO | 0.999963 | 4.588754 | {
"github_metadata": {
"branch": "main",
"commit_count": 1504,
"repo_created_at": "2024-02-15T04:22: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": "f25490fa8... |
7edad519-8666-4d18-a219-3532a47b72f4 | cttdev/walk | walk/include/util.h | #include <Arduino.h>
#include <string>
#include <sstream>
#include <vector>
#include <iterator>
// Split a string into a vector of strings
// template <typename Out>
// void split(const std::string &s, char delim, Out result) {
// std::istringstream iss(s);
// std::string item;
// while (std::getline(iss, ... | TOOL | 0.919448 | 5.530462 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-05-07T03:20: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": "527b61331bfb... |
d2443f33-6064-4cb7-81d6-b05808c35a08 | seryogasx/VUZ | cpp/dm_fibonacci/main.cpp | //
// main.cpp
// dm_fibonacci
//
// Created by <NAME> on 08/12/2018.
// Copyright © 2018 SergioPetrovx. All rights reserved.
//
#include <iostream>
#include <vector>
using namespace std;
class MatrixException : exception
{
private:
string message;
public:
MatrixException(string message_) : message(... | ALGO | 0.99994 | 5.065528 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2018-09-29T09:37: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": "85c016903... |
b196d6d0-94a3-43b8-a727-a85fb081f334 | ndwannafly/Algorithm-and-CP | VOI 2019 SECOND ROUND/anh Nguyen/5 3/quite_town.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T> inline void read(T &x){
char c;
bool nega=0;
while((!isdigit(c=getchar()))&&(c!='-'));
if(c=='-'){
nega=1;
c=getchar();
}
x=c-48;
while(isdigit(c=getchar())) x=x*10+c-48;
if(nega) x=-x;
}
template <typena... | ALGO | 0.999956 | 3.741387 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-03-31T19:08: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": "e62901974a00... |
268c6a1d-73ea-469b-980a-723d53ffce1b | seongbin9786/algorithm-cpp | INFLEARN/081_Implement_Bellman_Ford/problem_81.cpp | #include "problem_81.hpp"
/*
유형: Graph
[풀이 전략]
벨만 포드 알고리즘
음의 사이클만 없으면 음수 가중치 포함한 최단 경로 발견 가능
일단 따라치는 것으로 시작
*/
struct Edge81
{
int u, v, cost;
Edge81(int u, int v, int cost)
{
this->u = u;
this->v = v;
this->cost = cost;
}
// PQ를 안 쓰므로 비교 연산자 오버로딩하지 않음
};
void problem... | ALGO | 0.999956 | 4.861889 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2021-01-29T05:14: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": "f831efb2f... |
d1c86f81-f41d-43cf-ad22-078a0b01b2db | ICtuvk123/my-first-file | HZOJ264.cpp | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
int main() {
long long n;
scanf("%lld",&n);
vector<long long> arr(n + 2),l(n + 2),r(n + 2);
stack<long long> s;
arr[0] = arr[n + 1] = -1;
for (long long i = 1; i <= n ; i++) {
scanf("%lld",&arr[i]);
}
for (... | ALGO | 0.999972 | 3.672899 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-03-05T03:00: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": "5b599ba061fc... |
bbcd4711-5aba-4408-a958-01f470ffadb7 | Bahubuli/DSA | Detect cycle in an undirected graph - GFG/detect-cycle-in-an-undirected-graph.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool bfs(int node,vector<int> adj[],vector<bool>&vis)
{
queue<pair<int,int>>q;
q.push({node,-1});
while(q.size())
{
int s= q.size();
... | ALGO | 0.999947 | 5.851915 | {
"github_metadata": {
"branch": "main",
"commit_count": 1481,
"repo_created_at": "2021-07-05T06:52: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": "61d136c04... |
e2baa851-1b86-4169-b59c-5e0becd28d76 | ViktorMaksimoski/competitive | cses/dynamic programming/Grid_Paths.cpp | #include <bits/stdc++.h>
#define ii pair<int, int>
#define il pair<int, long long>
#define ll long long
#define ull unsigned long long
#define pb push_back
using namespace std;
void setIO()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
int main()
{
setIO();
int n;
cin >> n... | ALGO | 0.999991 | 4.460526 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2023-06-07T09:26:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c541a004b... |
ceb8fa00-7b0a-4255-bdd5-bb0e5d28c5c0 | rjenez/W266-final-project | data/programming-homework-dataset-plagiarism-detection/src/B2016/Z3/Z1/student4628.cpp | /B2016/2017: Zadaća 3, Zadatak 1
//Autotestovi by <NAME> (<EMAIL>)
#include <iostream>
#include <functional>
#include <cmath>
#include <stdexcept>
#include <vector>
#include <utility>
#define eps 0.000001
using std::cout;
using std::cin;
using std::endl;
typedef std::vector<std::pair<double, double>> Cvorovi;
typedef ... | ALGO | 0.995273 | 4.964159 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2022-02-09T00:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26ce8060b4... |
91ecf44b-3754-4e0a-8082-454046a77d68 | microsoft/wdkmetadata | generation/WDK/IdlHeaders/um/DirectXCollision.inl | //-------------------------------------------------------------------------------------
// DirectXCollision.inl -- C++ Collision Math library
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// http://go.microsoft.com/fwlink/?LinkID=615560
//-------------------------... | ALGO | 0.996311 | 3.28424 | {
"github_metadata": {
"branch": "main",
"commit_count": 198,
"repo_created_at": "2022-09-14T16:29:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 103,
"forks": 11,
"issues": 17,
"pull_requests": 1
},
"file_meta": {
"content_id": "54410d8... |
b2934198-a472-41e8-8461-b93dcf49f1d9 | kwhershey/rev_soldiers | spouse/mergesort.h | // Mergesort
#include<vector>
using namespace std;
template <typename Comparable>
void mergeSort( vector<Comparable>& a, vector<Comparable>& tmpArray, int left, int right );
template <typename Comparable>
void merge( vector<Comparable> & a, vector<Comparable> & tmpArray, int leftPos, int rightPos, int rightEnd);
te... | ALGO | 0.999965 | 5.316432 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2012-07-28T22:32: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": "7683dc1dcb... |
890b53be-9f1a-4e45-a5e6-a7668d763cad | Mooliecool/windows | shared source/sscli20/palrt/src/crtstuff.cpp | // ==++==
//
//
// Copyright (c) 2006 Microsoft Corporation. All rights reserved.
//
// The use and distribution terms for this software are contained in the file
// named license.txt, which can be found in the root of this distribution.
// By using this software in any fashion, you are agreeing to ... | TOOL | 0.989789 | 5.074336 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-01-06T16:45:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 49,
"forks": 34,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95fb0a7... |
b761984d-771a-42cf-b750-872e79011ce8 | prajapatiraghulal/DSA_using_cpp_OOP | bst.cpp | #include<iostream>
using namespace std;
class BST;
class Node;
enum class option: char{
preorder,
postorder,
inorder
}op;
class Node{
int value;
Node *left;
Node *right;
friend class BST;
public:
Node(){
value=0;
left = NULL;
right = NULL;
... | ALGO | 0.999829 | 4.477488 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-01-03T01:45: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": "9cf93621a7a5... |
02cf89a7-9300-4eaf-a6f6-ce3560517f91 | KDE/libkleo | src/ui/treeview.cpp | /*
ui/treeview.cpp
This file is part of libkleopatra
SPDX-FileCopyrightText: 2022 g10 Code GmbH
SPDX-FileContributor: <NAME> <<EMAIL>>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <config-libkleo.h>
#include "treeview.h"
#include <models/keylist.h>
#include <KConfigGroup>
#include <KL... | TOOL | 0.909959 | 5.631073 | {
"github_metadata": {
"branch": "master",
"commit_count": 2581,
"repo_created_at": "2015-12-09T04:28:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8291855... |
6ab4e286-cf39-49d6-b75e-6909193bd02a | rjfahad44/leetcode-problemset-solved | 621. Task Scheduler.cpp | /* My Template (01-08-2022) */
#include<iostream>
#include<algorithm>
#include <iomanip>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<limits>
#include<iomanip>
#include<numeric>
#include<conio.h>
using namespace std... | ALGO | 0.99998 | 3.764134 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-01-09T17:05:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ccf73cf83b... |
28b81c52-4d59-4d55-8cf1-35412684481b | yancouto/competitive-programming | ojs/la/2865.cpp | #include <cstdio>
#include <cstring>
typedef unsigned long long ull;
int K[62];
int get(int i) {
<<<<<<< HEAD
// printf("%d\n", i);
if(K[i] == -1) K[i] = get(__builtin_popcount(i));
return K[i];
}
ull l[2];
int k;
int memo[2][62][2][62];
int solve(int x, int d, bool prev, int num) {
if(d == 61) return get(num) == ... | ALGO | 0.999189 | 3.465261 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2016-08-26T11:17:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5678910f... |
b62a6b04-e97d-4ba1-883d-e44fc57655e4 | hsoft-star/CLeetcode | 445. Add Two Numbers II.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
int carry = 0;
ListNode *p1 = l1;
ListNode *p2 = l2;
... | ALGO | 0.999994 | 6.112291 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2017-05-13T21: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": "f8dc376e... |
26699101-42fe-452e-9a57-28229ee2bc1a | faraaz-bot/HIPTraining | 004_cooperation_between_threads/moving_filter.cpp | #include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <hip/hip_runtime.h>
__global__ void movingFilter(const float* inData, float* outData, const int K)
{
//Your Code goes here!
}
/* Function to load from filesystem into vector. */
void loa... | ALGO | 0.908589 | 5.089595 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2025-05-09T22: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": "52bf245c23a... |
e7b7f302-91eb-4e86-940e-f59f49a72f07 | melissa-perez/absolute-cpp | CH3 FUNCTION BASICS/PP_3_12/main.cpp | #include <iostream>
#include <string>
using namespace std;
bool isLeapYear(int year);
int getCenturyValue(int year);
int getYearValue(int year);
int getMonthValue(int month, int year);
int numberOfDay(int day,int monthValue, int centuryValue,int yearValue);
string theWeekDay(int dayNumber);
int main(int argc, char *... | ALGO | 0.999785 | 3.980109 | {
"github_metadata": {
"branch": "master",
"commit_count": 207,
"repo_created_at": "2018-06-20T06:22:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bccba5d5... |
ac65faee-4377-4a53-a8b6-8f663d02d145 | EACcodes/TigerCI | tiger_ci/erkale/density_fitting.h | /*
* This source code is part of
*
* E R K A L E
* -
* DFT from Hel
*
* Written by <NAME>, 2010-2012
* Copyright (c) 2010-2012, <NAME>
*
* This program is free software; you can redistribute it and/or
* modify it under ... | ALGO | 0.997207 | 5.797351 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-05-27T16:13:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71f3794455a... |
cb829b6a-0515-4ccb-b892-4be2a45db725 | osak/POJ | 1538.cc | //Name: Extrapolation Using a Difference Table
//Level: 2
//Category: やるだけ
//Note:
/*
* 最初にテーブルを作る.
* 列の追加は,一番下の列だけを覚えておけばできる.
*/
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
while(true) {
i... | ALGO | 0.999898 | 4.417321 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2011-11-28T13:53:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdc7d4a... |
078aa61c-d35e-409e-bc58-1abfb18da5a5 | wuwendb/cccode | luogu/P2657.cpp | // Problem: P2657 [SCOI2009] windy 数
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P2657
// Memory Limit: 125 MB
// Time Limit: 1000 ms
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define rev(i, a, b) for (int i = (a); i >= (b); --i)
#define all(... | ALGO | 0.999878 | 4.53194 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-28T09:10: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": "5d144b3e8260... |
dcd22478-80e2-48ff-a6e6-7a4ad4bdaf3e | nhirsama/cppLearn | problem/LuoguOJ/P8319.cpp | //P8319 『JROI-4』分数
//记得把文件重定向注释掉
#include <bits/stdc++.h>
using namespace std;
int isPrime[2001005];
int prime[2001005];
int arr[500010];
int idx = 0;
void Init(int n){
isPrime[0] = isPrime[1] = 1;
prime[0] = 1;
for(int i = 2; i <= n; i++){
if(!isPrime[i]){
prime[++idx] = i;
}
... | ALGO | 0.999962 | 4.112945 | {
"github_metadata": {
"branch": "master",
"commit_count": 589,
"repo_created_at": "2024-11-03T03:37:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a77c26bf... |
cb34f7dd-8f2c-49cf-a079-3df4afa6de36 | edisonhello/waynedisonitau123 | Contest/Other/TTCPC2021/H.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, k, t;
cin >> N >> k >> t;
vector<int> A(N);
for (int i = 0; i < N; ++i) cin >> A[i];
vector<int> ds(A.begin(), A.end());
sort(ds.begin(), ds.end());
ds.resize(unique(ds.begin(), ds.end()) - ds.begin());
const int M = ds... | ALGO | 0.999952 | 4.822521 | {
"github_metadata": {
"branch": "master",
"commit_count": 411,
"repo_created_at": "2017-08-26T10:17:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bb7605... |
424044d2-994c-4eb1-97fe-69b2a0f83d16 | silent-lad/GFG | course/0.Recursion/subset_sum.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
bool subsetSum(ll arr[], ll sum, ll currSum = 0, ll index = 0)
{
if (sum == 0)
{
return true;
}
ll length = sizeof(arr) / sizeof(arr[0]);
if (index == length - 1 && currSum + arr[length - 1] == sum)
{
return tru... | ALGO | 0.999733 | 4.273917 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-09-18T10:08:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc34677f8... |
16418eec-55b7-4787-bbd7-f4dea6235b44 | Flymi61/StudyNotes | leetcode/655. 输出二叉树/655.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.999986 | 6.052329 | {
"github_metadata": {
"branch": "master",
"commit_count": 493,
"repo_created_at": "2022-09-13T08:59: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": "c5a55205... |
b2fa409d-410c-4bd2-8eee-384a37ad6c03 | suleesulee/TIL | Algorithm/boj/1986.cpp | #include<cstdio>
#include<cstring>
void check();
void check_queen(int x, int y);
void check_knight(int x, int y);
void print_map();
using namespace std;
int n, m;
int x, y;
int Queen, Knight, Pawn;
int map[1001][1001];
//안전함 0 안전하지 않음 1 퀸 2 나이트3 폰4
void check() {
for (int i = 1; i <= n; i++) {
for (int j = 1; j... | ALGO | 0.999536 | 4.355551 | {
"github_metadata": {
"branch": "main",
"commit_count": 114,
"repo_created_at": "2021-02-01T15:32: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": "2255a841c6... |
8b2a08d4-0fb9-4c30-9843-1d5c8e442701 | evalveny/MP20-21 | Tema 1/Exercici 6 - Poligon/Poligon.cpp | #include "Poligon.h"
#include <fstream>
using namespace std;
ifstream& operator>>(ifstream& input, Poligon& pol)
{
Punt pt;
input >> pt;
while (!input.eof())
{
pol.afegeixVertex(pt);
input >> pt;
}
return input;
}
ofstream& operator<<(ofstream& output, Poligon& pol)
{
for (int i = 0; i < pol.getNVertexs()... | TOOL | 0.93728 | 4.363984 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2021-02-17T16:03: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": "cbc0bee3a... |
848f54c2-23b9-4a12-bda8-6a3eff9852e1 | Qipu1220/BaiTapDeQuy | 23520493_23521082_23521462_23521604_23521672_BT06/Bai080/Bai080.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
void Nhap(float[], int&);
void Xuat(float[], int);
void LietKe(float[], int,float,float);
int main()
{
int n;
float a[100];
Nhap(a, n);
cout << "Mang ban dau: \n";
Xuat(a, n);
int x, y;
cout << "\n... | ALGO | 0.99724 | 3.484761 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-11-13T11:33: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": "4f4d4257652... |
3e7a8558-4130-4c31-87e4-55150a7f22c2 | Atum555/Path-Finder | src/util.cpp | #include "functions.h"
#include <algorithm>
#include <stdexcept>
using namespace std;
string <rim(string &s) {
s.erase(s.begin(), find_if(s.begin(), s.end(), [](unsigned char ch) { return !isspace(ch); }));
return s;
}
string &rtrim(string &s) {
s.erase(find_if(s.rbegin(), s.rend(), [](unsigned char c... | ALGO | 0.992147 | 5.303973 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2025-03-20T17:33: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": "c0ea5a2a7... |
5ec9d756-9b3b-4224-8dc5-e76b203731a7 | adembudak/algs4-cpp | include/algs4/Selection.hpp | #ifndef SELECTION_H
#define SELECTION_H
#include <algs4/StdOut.h>
#include <vector>
#include <cstdint>
#include <cassert>
namespace algs4 {
namespace Selection {
// clang-format off
template <typename T> void exch(std::vector<T> &a, const std::size_t i, const std::size_t j);
template <typename T> bool isSorted(const... | ALGO | 0.998768 | 6.150221 | {
"github_metadata": {
"branch": "main",
"commit_count": 111,
"repo_created_at": "2021-11-26T23:20: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": "9ac09c2aef... |
ec923022-97f1-4b84-b448-be8c9091dfc1 | ElwynCruz/CS32 | HW2/HW2 Queue/HW2 Queue/mazequeue.cpp | #include <string>
#include <iostream>
#include <queue>
using namespace std;
class Coord
{
public:
Coord(int rr, int cc) : m_r(rr), m_c(cc) {}
int r() const { return m_r; }
int c() const { return m_c; }
private:
int m_r;
int m_c;
};
bool pathExists(string maze[], int nRows, int nCols, int sr, int sc, int er, int... | ALGO | 0.999723 | 4.795848 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-11-11T05:30: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": "e7d81f9b0a... |
7cf2f39a-943e-4f65-a6bc-067073ac507f | strange-suraj/LeetCode-Susbmission | 1220-count-vowels-permutation/1220-count-vowels-permutation.cpp | class Solution {
public:
int mod = 1e9+7;
int solve(int cur, int n, char s, vector<vector<int>> &dp){
if(cur == n) return 1;
int ans = 0;
if(s == 'M'){
ans = (ans%mod + solve(1, n, 'a', dp)%mod)%mod;
ans = (ans%mod + solve(1, n, 'e', dp)%mod)%mod;
ans ... | ALGO | 0.999967 | 5.314875 | {
"github_metadata": {
"branch": "main",
"commit_count": 3434,
"repo_created_at": "2022-01-13T06:50:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6ee1dc7a... |
f6fcbc0c-66eb-4c82-abb6-540042babf16 | ichernichenko/2022-polytech-chernichenko | 04_search_sort/intro/src/intro.cpp | #include <iostream>
#include <chrono>
#include "search.h"
using namespace std;
int main()
{
int arr[] = {-996, -960, -944, -887, -865, -860, -846, -831, -790, -785, -700, -691, -662, -662, -647,
-640, -587, -532, -524, -519, -501, -497, -475, -471, -461, -457, -452, -442, -441, -416,
... | ALGO | 0.992575 | 4.458873 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-09-07T20:23: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": "3d24f597683... |
0dc4f250-1f49-491e-a1c4-dfd684250603 | mohamedraffat123/my-projects | X. Comparison/X. Comparison/X. Comparison.cpp | // X. Comparison.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
string s,sub,sub2,sub3,final;
cin >> s;
sub2 = s;
final = s;
for (int i = 0; i < s.size()-1; i++) {
sub += s[i];
... | ALGO | 0.999986 | 5.406276 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2024-04-07T15:03: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": "ae434742902... |
aba51829-bef4-4f1e-b209-e140b2bed020 | qasimza/Spring-2019-Course-Work | Lab 6/tesla (updated).cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <string>
using namespace std;
//Generator Postion (ob = item to be moved)
vector <int> generate_position(vector <vector <char>>& a, int boardsize, char ob) {
int row, column;
do {
row = rand() % boardsize;
column = rand() % boardsi... | ALGO | 0.956539 | 3.563733 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-06-01T21:01:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2eaef822a... |
76d38024-2b66-442b-947a-7ed9c98e2365 | 21A91A05G9/GFG | Fruit Into Baskets - GFG/fruit-into-baskets.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int totalFruits(int N, vector<int> &f) {
int a=-1,b=-1,p=0,q=0,s=0,m=0,n=f.size();
for(int i=0;i<n;i++){
if(a==-1){
a=f[i];
p=1;
... | ALGO | 0.99991 | 5.775477 | {
"github_metadata": {
"branch": "main",
"commit_count": 455,
"repo_created_at": "2023-06-27T09:02: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": "36d84f09ef... |
1bb980c5-b7be-4953-92e4-86fde527284f | blender/blender | source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp | /* SPDX-FileCopyrightText: 2011-2022 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup freestyle
* \brief Class to define a cell grid surrounding the projected image of a scene
*/
#include "AverageAreaGridDensityProvider.h"
#include "BLI_sys_types.h"
#include "BKE_global.hh"... | ALGO | 0.915529 | 6.836568 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4... |
db28cc56-1f60-4c66-8b89-ac0f9fc7e420 | tanishqmalik/cppdsa_2024 | end-term-practice/preorder final/pp4.cpp | #include <iostream>
#include <queue>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
public:
Node(int data){
this->data=data;
Node* left;
Node* right;
}
};
Node* builtTree(){
int data;
cin>>data;
Node* root = new Node(data);... | ALGO | 0.999935 | 4.071895 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-01-17T12:51: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": "99fe90d2b8b... |
bf5e0242-b42e-4ecd-9080-6d1bf4c9bda1 | wincle626/HLS_Legup | legup-4.0/tiger/memory_access_profiler/ORIGINAL_gxemul-0.6.0/src/old_main/float_emul.cc | /*
* Copyright (C) 2004-2009 <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 con... | TOOL | 0.914035 | 6.674099 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-09-29T15:48:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 19,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "727c2307... |
3881518d-6f55-4591-999d-19fd7db42b88 | ZapDos7/Spoj.com | trees.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main ()
{
long long trees, wood, sum, medium, temp, temp2=0;
scanf("%lld%lld", &trees, &wood);
long long height[trees];
for (int i=0;i<trees;i++)
{
scanf("%lld", &height[i]);
}
sort(height, height + trees);
temp = height[trees-1];
... | ALGO | 0.999973 | 3.563443 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-04-11T13:37: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": "d8d997c118... |
8f678058-345a-4a6a-b127-dee9626cbca9 | ml1150258/CSC_CIS_5 | Class/Gaddis_8thEd_Chap2_Prob5_FindAverage/main.cpp | /*
* File: main.cpp
* Author: Dr. <NAME>
* Created on June 24, 2021, 10:30 AM
* Purpose: Finding the Average
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <cstdlib> //Library containing the Random Functions
#include <ctime> //Time Library
using namespace std; //STD Name-... | ALGO | 0.996977 | 3.736143 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2023-01-04T18:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef8e75d... |
af662e89-f216-435a-be97-bbb928875a8d | FlowSight/coding | blind75/17_decode_ways.cpp | // 14 dec 2024..11 mins..no mistake...VERIDCT : PASS
// ektu komate hobe time taken
class Solution {
public:
long mod = 1e11+7;
int numDecodings(string s) {
int n = s.size();
vector<long> dp(n+1,0);
dp[0] = 1;
for(auto i=1;i<=n;i++){
string cur = "";
cur.... | ALGO | 0.999954 | 5.886861 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-05-31T15:31: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": "be3d5a458ee... |
c8fe8322-d919-4ed5-a7f6-7f28daf50026 | miao-hub/HUST_Cplus | 实验一/test1/Queue.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <iostream>
using namespace std;
struct Queue {
int* const elems;
const int max;
int head, tail;
};
void initQueue(Queue* const p, int m);//初始化p指队列:最多申请m个元素
void initQueue(Queue* const p, const Queue& s);//用s深拷贝初始化p指队列... | ALGO | 0.918728 | 3.180395 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-11-28T14:34:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a58ee5c7c9... |
d6c81cd6-a7e5-4fae-9b71-4354c5de1ce2 | xingwei-he/practice | lintcode/111_Climbing_Stairs.cc | /***************************************************
* Xingwei_He All Rights Reserved.
* File Name:111_Climbing_Stairs.cc
* Author:
* Mail:
* Created Time:2018年01月01日 星期一 17时52分25秒
***************************************************/
#include <iostream>
#include "practice/include/base.h"
using namespace std;
/... | ALGO | 0.999885 | 4.471693 | {
"github_metadata": {
"branch": "master",
"commit_count": 374,
"repo_created_at": "2017-08-06T10:30: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": "6cef5502... |
dcd7eb6a-c252-4ad8-a5b7-ef016011b9b2 | kfernandez31/Competitive-programming | leetcode/0000-0099/0004. Median of Two Sorted Arrays/solution_1.cpp | // Approach: K-th element. TODO:
// TC: O(?)
// SC: O(?)
class Solution {
public:
double findMedianSortedArrays(vector<int>& xs, vector<int>& ys) {
int m = xs.size(), n = ys.size();
function<int(int, int, int)> aux = [&](int i, int j, int k) {
if (i >= m)
return ys[j + ... | ALGO | 0.999957 | 6.425871 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-02-19T12:46: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": "9fe3e723dc7f... |
9f0e8aaf-e4a8-4538-86ce-cbff9de44ada | Cron191/DSA | ASS5/8.cpp |
#include <iostream>
using namespace std;
struct TNODE
{
int key;
TNODE *pLeft;
TNODE *pRight;
};
typedef TNODE *TREE;
void CreateEmptyTree(TREE &T)
{
T = NULL;
}
TNODE *CreateTNode(int x)
{
TNODE *p = new TNODE; // cấp phát vùng nhớ động
p->key = x; // gán trường dữ liệu của node = ... | ALGO | 0.999939 | 3.493414 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2024-11-01T07:58: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": "6eae2d7a8... |
ee41bbe8-ac46-4c81-8ae9-e7fb2f8ac53b | M-Arimase/School-Project | home/arimase/Desktop/数据结构与算法实习/树状数组/3.cpp | #include <iostream>
#include <algorithm>
#include <tuple>
#include <cstring>
using namespace std;
const int MAXN = 1000000;
int sum[MAXN], ans[MAXN];
struct Point {
int u, v, idx;
bool operator < (Point & x) {
return v > x.v || v == x.v && u < x.u;
}
} p[MAXN];
void Insert(int x) {
for (; x < MAXN; x += x &... | ALGO | 0.999668 | 4.466935 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2017-04-06T13:58: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": "d1cdddb5c... |
6e1fd0ad-b2c4-4d59-9842-84de84c25f29 | Ankit958/numerical-aproximation | Numerical Methods/01bisection.cpp | //bisection method
#include <iostream>
#include <cmath>
#include <vector>
#include <iomanip>
using namespace std;
vector<double> ask_coefficients(int degree)
{
cout << "Enter the coefficient for: \n";
vector<double> coefficients(degree + 1);
for (int i = degree; i >= 0; i--)
{
cout << " x^"... | ALGO | 0.999986 | 5.272701 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-09-06T19:52:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49beefff21a2... |
06e76b4b-5414-4c85-8d44-2ea34b0151d0 | happyhddey/programmersCodingTest | programmersCodingTest (200716~200807)/200727_종이접기.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
vector<int> solution(int n) {
// Imagine that you unfold the folded paper. It will show you the rule obviously.
string u = "", v = "";
int size = 0;
for(int i=0; i<n; i++){
if(!u.empty()){
// v equal... | ALGO | 0.999991 | 3.993685 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-02-20T10:36: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": "e64d25e6e1e6... |
21d7f1d5-a489-41db-9f65-13b9af2611bd | kumasento/LeetcodeCollection | easy/BinaryTreeLevelOrderTraversal.cpp | #include <cstdio>
#include <cstdlib>
#include <vector>
#include <queue>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode (int x): val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
vector< vector<int> > levelOrder(TreeNode *root) {
queu... | ALGO | 0.999982 | 5.152776 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2014-11-19T04:28:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b1a000ec... |
6ba9ccf7-0c37-4e6d-aaa9-48ae192ccb4c | madMAx43v3r/mmx-node | include/cuda_sha512.h | /*
* cuda_sha512.h
*
* Created on: Nov 13, 2023
* Author: mad
*/
#ifndef INCLUDE_MMX_CUDA_SHA512_H_
#define INCLUDE_MMX_CUDA_SHA512_H_
#include <cuda_runtime.h>
#include <cstdint>
__device__
static const uint64_t SHA512_K[80] = {
0x428a2f98d728ae22ull, 0x7137449123ef65cdull, 0xb5c0fbcfec4d3b2full, 0xe9b... | ALGO | 0.959951 | 6.439535 | {
"github_metadata": {
"branch": "master",
"commit_count": 6099,
"repo_created_at": "2021-11-25T12:02:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 192,
"forks": 37,
"issues": 28,
"pull_requests": 2
},
"file_meta": {
"content_id": "a79... |
55536388-5e9e-45ea-970a-99fa034c3380 | jasperzhong/usaco | Chapter 2/Section 2.1/frac1.cpp | /*
TASK: frac1
LANG: C++
*/
#include<cstdio>
#include<iostream>
#include<fstream>
#include<set>
#include<algorithm>
#include<functional>
using namespace std;
const int MAX = 160;
int n;
/*
class SafeDouble{
public:
explicit SafeDouble(double v) //forbit implicit transfer
:value_(v){};
SafeDouble(){}... | ALGO | 0.999859 | 3.804621 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-04-07T12:17:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a567dd64... |
0b23da35-1d2e-46c4-8d7e-f6330603afd7 | Niran-Chan/leetcode-practice | c++/SatisfiabilityofEqualityEquations.cpp | class Solution {
public:
static const int N=1e6;
int parent[N];
int Size[N];
void initialise ()
{
for(int i=0; i<26 ;i++){
parent[i]=i;
Size[i]=1;
}
}
int find(int v)
{
if(v==parent[v]) //Recursively search for parent
return v;
return parent[v]=find(parent[v]);
}
void Unio... | ALGO | 0.999964 | 5.530354 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-10-12T11:51: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": "08428582e0... |
2b73c5e8-e0db-4fd3-bcde-78691f991733 | VPBox/Dev | system/keymaster/key_blob_utils/software_keyblobs.cpp | /*
**
** Copyright 2017, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by appl... | TOOL | 0.927102 | 7.014036 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-08-15T05:28:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 84,
"forks": 32,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "3765d45... |
c82af2d5-14d1-4420-8acb-15dfacae94ae | OmarShamkh/competitive-programming-practise | CodeForces/893_C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
#define loop(n) for(int i = 0; i < (n); i++)
#define lp(x, s, e) for(int x = (s); x < (e); x++)
#define lpe(x, s, e) for(int x = (s); x <= (e); x++)
#define INGZzz cin.tie(0);cin.sync_with_stdio(0);
const int ... | ALGO | 0.999837 | 3.666635 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-06-23T08:56: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": "6e5c3429410... |
63b43c18-6573-4ef8-b579-12b6c71e1e93 | motasimmakki/CPP-Programs | sort_diagonally.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void sortUpperRight(vector<vector<int> >& matrix, int row, int col, int n, int m){
int r = row, c = col;
vector<int> elements;
while(r < n && c < m){
elements.push_back(matrix[r][c]);
r++; c++;
}
sort(eleme... | ALGO | 0.999969 | 5.385047 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2021-05-01T20:30: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": "c7dc440b5a0... |
422e69e4-0cd4-4eb5-afd8-12a1f28876b4 | JeongbinPark/ProblemSolving_BOJ | 1744_tieNumbers.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N, num;
vector<int> pos, neg;
int zero_length, one_length;
int result = 0;
int main() {
cin >> N;
for (int i = 0; i < N; i++) {
cin >> num;
if (num == 0) {
zero_length++;
}
else if (num == 1) {
one_length++;
}
else... | ALGO | 0.99998 | 4.104362 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2021-01-21T11:34: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": "54090893cd... |
a2123fc1-c0e2-4ff5-9d40-0c6320d01c4a | rnavares/Solving-Sudoku-with-Genetic-Algortihms- | GA.cpp | #include "GA.hpp"
#include "GeneticOperators/Selection.hpp"
#include "GeneticOperators/Mutation.hpp"
#include "GeneticOperators/CrossOver.hpp"
#include <algorithm>
#include <iostream>
#include <ctime>
#include <math.h>
//constructores y destructor
GA::GA()
{
pob_ini = 0;
generations = 0;
prob_mut = 0.0;
prob_co = ... | ALGO | 0.999815 | 5.121517 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2017-09-10T12:58: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": "e2e5f081d... |
9ab8abbd-8b0e-445b-9f85-0b6dd5b1ec51 | xnmng/LeetCode | 1922-count-good-numbers/1922-count-good-numbers.cpp | // https://leetcode.com/problems/count-good-numbers/discuss/1314322/C++-(-5-even-indices)-*-(4-odd-indices)-with-explanation
class Solution {
long long helper(int base, long long power, int modulo) {
if (power == 0) return 1;
long long res = helper(base, power / 2, modulo);
if (power % 2 == ... | ALGO | 0.999969 | 6.089195 | {
"github_metadata": {
"branch": "main",
"commit_count": 4708,
"repo_created_at": "2022-08-08T03:21: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": "41f2759cf... |
1fdec267-6e43-4716-9ae4-b20314ddea37 | harrySentinel/DSA | String/longestPalindromicSubstring.cpp | #include <iostream>
using namespace std;
string expandAroundCenter(string s, int left, int right) {
while (left >= 0 && right < s.length() && s[left] == s[right]) {
left--;
right++;
}
return s.substr(left + 1, right - left - 1);
}
string longestPalindrome(string s) {
if (s.empty()) re... | ALGO | 0.999911 | 5.82751 | {
"github_metadata": {
"branch": "main",
"commit_count": 238,
"repo_created_at": "2025-01-28T17:14:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4db6dd918a... |
63137287-2535-461e-917e-e8e2b0894e3b | firej/fizteh-C-2014-demos | demo_radix.cpp | #define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <memory.h>
#include <time.h>
void print_array(char **arr, size_t arr_size, bool carriage = true);
void radixsort(char **arr, size_t arr_size, size_t depth = 0);
int main(int argc, char ** argv) {
char *strings[1024];
... | ALGO | 0.999616 | 4.059986 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2014-09-29T08:49: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": "d9c702e76... |
0c098525-f973-4cfc-af8b-271f4a61489d | jlwwbo/leetcode | 7.整数反转.cpp |
class Solution {
public:
int reverse(int x)
{
int ans = 0;
int remains;
while (x) {
remains = x % 10;
if (x > 0 &&
(ans > INT_MAX / 10 || (ans == INT_MAX / 10 && remains > 7)))
return 0;
if (x < 0 &&
(... | ALGO | 0.999467 | 4.622768 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-01-27T09:48:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c9845c470... |
15222c5c-59c4-4d17-b94e-da04475672c9 | AgOpenGPS-Official/Boards | Misc/MTZ/ESP32/AOG_Autosteer_ESP32/AOG_Autosteer_ESP32/zAOG_ASt_PWM_calc_and_output.ino | void calcSteeringPID(void)
{
//Proportional only
pValue = Set.Kp * steerAngleError;
pwmDrive = (int)pValue;
errorAbs = abs(steerAngleError);
float newMax = 0;
if (errorAbs < Set.MotorSlowDriveDegrees)
{
newMax = (errorAbs * highLowPerDeg) + Set.lowPWM;
}
else newMax = Set.h... | ALGO | 0.969403 | 5.365656 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2024-01-24T20:24:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 49,
"forks": 25,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "d2894157b2... |
c9004e5c-ba24-4890-8fa1-56634d27c82e | lsry/LeetCode | cpp/L400/LeetCode0432.cc | #include <iostream>
using std::cin;
using std::cout;
#include <unordered_map>
using std::unordered_map;
#include <string>
using std::string;
#include <memory>
using std::shared_ptr;
class Node
{
public:
shared_ptr<Node> next, prev;
int count;
string val;
Node(string s, int count = 1): val(s), count(... | ALGO | 0.999831 | 5.30071 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2020-01-04T04:46: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": "cbb1ea3a... |
38b85874-5a6c-4a36-bba8-ae34e654a7f8 | kpjgit/study | baek/sort/basic.cpp | //-1
#include <bits/stdc++.h>
int main(void) {
//select
int arr[10] = {3, 2, 7, 116, 62, 235, 1, 23, 55, 77};
int n = 10;
for(int i = n - 1; i > 0; i--) {
int idx = 0;
for(int j = 0; j <= i; j++) {
if(arr[idx] < arr[j]) idx = j;
}
std::swap(arr[i], arr[idx])... | ALGO | 0.999878 | 4.975893 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2024-07-09T04:38: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": "7f1a9cf5643... |
ac32dcf4-38a8-4a15-9071-63c89859be8b | tacow/setup | CalcMD5/md5_calculator.cpp | // 编译: cl /EHsc /std:c++17 md5_calculator.cpp /Fe:md5_calculator.exe
#include <windows.h>
#include <bcrypt.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <filesystem>
#include <string>
namespace fs = std::filesystem;
#pragma comment(lib, "bcrypt.lib")
// 计... | TOOL | 0.974908 | 6.750837 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2013-03-20T04:05: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": "7baa6ee7... |
2a1073ec-4025-4b0f-8e54-10def6b297f6 | 113bommy/PathRepair | variable_trace/cpp/cpp_code/cpp_incorrect/cpp_incorrect_test_14_5.cpp | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
long long int mp(long long int a, long long int b) { return abs(a - b) / 2; }
void readFile() {}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long int t = 1... | ALGO | 0.999447 | 3.285364 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-11-11T15:46: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": "6983de0e8b3... |
de520879-655e-47a0-ae2c-54c811430e7b | mrushyendra/Chalk | src/solver.h | #ifndef SOLVER_H
#define SOLVER_H
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <utility>
#include <vector>
namespace solver {
using namespace std;
class VarAssignment {
public:
VarAssignment();
~VarAssignment();
... | ALGO | 0.999867 | 5.834256 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-11-25T05:09:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6955bd80... |
8ecaddf4-40d8-451f-9092-b82537a39037 | cs118/spring12-project1 | http-headers.h | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* @file Header for HttpRequest class
*
* Skeleton for UCLA CS118 Spring quarter class
*/
#ifndef _HTTP_HEADERS_H_
#define _HTTP_HEADERS_H_
#include <string>
#include <list>
/**
* Exception that will be thrown when parsing cannot be performed
... | WEB | 0.969127 | 5.754601 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2012-04-09T05:32:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b441f2bcd... |
50687fa6-5d65-45a4-a9f3-9d1dec670a0a | DeepakKush2194/CPP | Search in Array.cpp | #include <iostream>
using namespace std;
int main() {
int a[10] = {12, 23, 34, 45, 56, 67, 78, 89, 10, 99};
int num, found = -1; // Initialize found to -1 to indicate not found
cout << "Search in Array" << endl;
cout << "Enter element: ";
cin >> num;
for (int j = 0; j < 10; j++) {
if ... | ALGO | 0.99657 | 4.899851 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-09-03T10:06: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": "7956d0cf9e3... |
554f8134-60e8-4dd0-b1c4-75b978e05861 | Kingbadger3d/USD | pxr/base/lib/tf/pathUtils.cpp | //
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trad... | TOOL | 0.976571 | 7.03964 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-09-03T15:55:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c1b582c15... |
27415181-7798-4bbf-bd5a-130d139f7101 | yangguolong/HairEngine_reduced | jni/PaintSelectionAlgorithm/PaintSelection.cpp | //
// PaintSelection.cpp
// MyPainter
//
// Created by yangguolong on 13-5-9.
// Copyright (c) 2013年 yangguolong. All rights reserved.
//
#include "PaintSelection.h"
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <limits>
#include <opencv2/opencv.hpp>
#include "ImageUtility.h"
#include <stack>
... | ALGO | 0.971268 | 4.281375 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-13T04:04:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1d3f23507... |
eeacc684-d19b-4aab-ac3b-7b2c9307a4f0 | codebloded/DS-AlGO.cpp | Intermidiate/Stack/infixToPostFix.cpp | #include<bits/stdc++.h>
using namespace std;
int isOperator(char c){
if(c == '+' || c == '-' || c == '*' || c == '/' ){
return 1;
}
return 0;
}
int precedence(char c){
if(c=='/' || c=='*'){
return 3;
}
else if(c=='+' || c=='-'){
return 2;
}
return 0;
... | ALGO | 0.999901 | 4.558179 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2021-01-04T14:58:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "5f9ce837e... |
e4f13b7e-f539-4aed-9544-77ce1691b027 | tamadate/surfaceArea | src/functions.cpp | #include "sasa.hpp"
// Deterimine probe is aaccessible
bool SASA::accessible(void)
{
for (auto &a : pair){
double d1=dist(p.pnt,a.pnt);
double d2=p.radius+a.radius;
if(d1<d2) return false;
}
return true;
}
// Find all atoms within radius d of target
void SASA::getPair(Atom target)... | TOOL | 0.942687 | 3.377417 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-01-18T21:03:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82e71e18fd... |
51721330-8ac0-4592-9375-df099ba1deaa | Ezzkandeel1/ImageproccesingApp | filter10 (2).cpp | #include "Image_Class.h"
#include <iostream>
#include <cmath> // for mathematical functions
using namespace std;
int main() {
// Prompt user for image filename
string filename;
cout << "Enter the image you want to process: ";
cin >> filename;
// Load the image
Image image(filename);
// C... | ALGO | 0.918664 | 6.198478 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-04-08T00:09: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": "21098f3fa012... |
831fba7a-696e-4bf4-ad63-da2df915b90b | neerajv03/AES_OpenMP | project_utilities.cpp |
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <random>
#include <omp.h>
#include "project_utilities.hpp"
using namespace std;
// ---------------------------------------------------------------------//
// Reads the Message file from the file name and returns the byte array data.... | TOOL | 0.919504 | 4.230591 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-05-09T21:01:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0147b957... |
50dc65a9-cb5f-475d-8483-8b71228a9b3b | aleksander-rudolf/multi-threaded-calc-pi | calcpi.cpp | // count_pixels() calculates the number of pixels that fall into a circle
// using the algorithm explained here:
//
// https://en.wikipedia.org/wiki/Approximations_of_%CF%80
//
// count_pixels() takes 2 paramters:
// r = the radius of the circle
// n_threads = the number of threads you should create
#inclu... | ALGO | 0.997651 | 5.401604 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-07-04T16:10: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": "e502e9fc90f8... |
39c64fab-b4c2-43d7-9bf0-49bf1e01cad1 | primihub/hehub | src/fhe/primitives/keys.h | /**
* @file keys.h
* @brief TODO
*
*/
#pragma once
#include "fhe/common/permutation.h"
#include "rgsw.h"
#include "rlwe.h"
namespace hehub {
/**
* @brief TODO
*
*/
struct RlweKsk : public RgswCt {
using RgswCt::RgswCt;
/// @brief TODO
/// @param rgsw
RlweKsk(RgswCt &&rgsw) : RgswCt(std::move... | ALGO | 0.975883 | 3.011856 | {
"github_metadata": {
"branch": "develop",
"commit_count": 91,
"repo_created_at": "2022-10-24T03:24:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 95,
"forks": 21,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "679125e... |
08f9c756-125c-49de-b68f-a8b6389cfd3e | asu-xue-group/offloading-tdma-c | knapsack.hpp | #ifndef TDMA_KNAPSACK_KNAPSACK_HPP
#define TDMA_KNAPSACK_KNAPSACK_HPP
#include <algorithm>
#include <format>
#include <iostream>
#include <vector>
#include <tuple>
#include "global.h"
#include "structs.h"
#include "subs.hpp"
#include "output.hpp"
extern OPT *opt;
extern long long table_size;
void cartesian_recurse... | ALGO | 0.999881 | 5.61884 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-09-03T08:37:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3376713ee73c... |
fd75337d-19eb-4780-bda5-1e01f0697122 | nimiCurtis/stair_modeling_ros | src/utilities.cpp | #include "stair_modeling_ros/utilities.h"
#include <pcl/common/transforms.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/filters/crop_box.h>
#include <pcl/filters/statistical_outlier_removal.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/ModelC... | DATA | 0.931079 | 6.164181 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-10-18T16:34:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e83b800e04... |
53ec29c1-6bae-46b7-bfa0-5e4377b05243 | cpp-tutor/learnmoderncpp-tutorial | modules/07-find.cpp | // 07-find.cpp : find and erase a single element
import std;
using namespace std;
int main() {
string a{ "hello" };
vector v{ 1, 9, 7, 3 };
set s{ 3, 8, 6, 4, 3 };
cout << "Before:\nstring: " << a << "\nvector: ";
copy(begin(v), end(v), ostream_iterator<int>(cout, " "));
cout << "\nse... | TOOL | 0.979782 | 4.510021 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2022-02-23T11:30:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 137,
"forks": 19,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "299737dd... |
cc6ed6a6-3920-4443-bac5-9c4619ef66c1 | adwoama/pa04-adwoama | DSString.h | //
// Created by robot on 2/3/2021.
//
#ifndef DSSTRING
#define DSSTRING
#include <iostream>
#include <fstream>
#include <cstring>
#include <cctype>
using namespace std;
class DSString{
private:
/**
* You will need to add some private data members here.
* This is up to your discretion. However, we... | TOOL | 0.90207 | 4.570721 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-15T17:28: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": "57dd0fc3ed10... |
93060130-ade1-411e-a5f2-6092a9e18fc8 | vaibhavtale/ultimate-c-course-completed | min_coin.cpp | #include<iostream>
#include<vector>
using namespace std;
// Simple recursive solution to find min no. of coins need to reach the amount......
int min_coin(int amount,vector<int> arr){
if(amount == 0){
return 0;
}
if(amount < 0){
return INT_MAX;
}
in... | ALGO | 0.999948 | 5.115048 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-01-20T08:13: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": "9898e6877b... |
e2e48966-8730-4402-b8fa-80f39e8c6a2c | Quechol95/Practicas_Compi | Practica 5/Programa/Gramatica.cpp | #pragma
#include <string>
#include <unordered_set>
#include <set>
#include <vector>
#include <iostream>
#include <fstream>
using namespace std;
class Produccion {
private:
char cabeza;
string cuerpo;
public:
Produccion ( char cabeza_, string cuerpo_ ) {
cabeza = cabeza_;
cuerpo = cuerpo_;
}
bool contiene_si... | ALGO | 0.995793 | 3.886977 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-01-27T22:46:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3555cbcf97a... |
50e59e7f-e33a-4ae2-b6b5-40ee952e2ee5 | thenakulgupta/DSA-Practice | HashMaps/14. Sort by Frequency.cpp | /*
Probleam: Sort by Frequency.
Inout:
cccaaa
Output:
aaaccc
Inout:
trrree
Output:
rrreet
*/
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
class Node {
public:
string key;
string value;
Node* next;
Node(string key1, string value... | ALGO | 0.999987 | 4.236811 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2023-06-11T12:38:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46917a8d8... |
f057897b-60da-4a55-b10d-9c74df122a03 | t3nsor/SPOJ | giveaway-2.cpp | // 2014-03-30
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstddef>
#include <cstdio>
using namespace std;
int N;
int X[500000];
vector<vector<int> > ys(500000);
vector<vector<int> > trees(2000000);
vector<vector<int> > pts(2000000);
vector<int> init;
void build_tree_1d(int node1, int node2, int... | ALGO | 0.999974 | 4.887894 | {
"github_metadata": {
"branch": "master",
"commit_count": 392,
"repo_created_at": "2014-10-08T22:07:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 248,
"forks": 102,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f80... |
c3df14c0-b7e5-4a7a-b8f5-74da5d86ac32 | ATacoDev/Advent-of-Code | 2023/Day1/Day1Part2/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <regex>
using namespace std;
// regex patterns to replace string versions of integer values
regex onePattern("one");
regex twoPattern("two");
regex threePattern("three");
regex fourPattern("four");
regex fivePattern("five");
regex sixPattern("six");
re... | ALGO | 0.999817 | 5.555308 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2023-12-02T22:46: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": "9af4c11c7c5... |
806208f9-5d03-4dc9-950e-5363b173cc74 | luca-penasa/spc | spc/ceres_calibration/SimpleCalibration.h | #ifndef SIMPLECALIBRATION_H
#define SIMPLECALIBRATION_H
#include <spc/core/spc_eigen.h>
#include "ceres/ceres.h"
#include <spc/core/macros.h>
using ceres::AutoDiffCostFunction;
using ceres::CostFunction;
using ceres::Problem;
using ceres::Solver;
using ceres::Solve;
template <typename T>
T near_distance_effect(co... | ALGO | 0.996494 | 6.37141 | {
"github_metadata": {
"branch": "master",
"commit_count": 274,
"repo_created_at": "2013-05-20T11:59:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28d8f8ac... |
298b3ab0-8dbf-464a-a211-34d9f8133d26 | ChuanSWT/Codeforces_codes | C_Kevin_and_Puzzle.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <set>
#include <tuple>
#include <cmath>
#include <queue>
#include <iomanip>
#include <numeric>
#define int long long
#define gird grid
using namespace std;
void compete_solutio... | ALGO | 0.999984 | 4.457311 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-18T06:09: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": "c90aa4f7c7ff... |
3738e154-80c3-48a1-9f93-9aa26dc103d2 | lc19890306/Exercise | leetcode/Number_of_Islands.cc | // Union-Find version
class Solution {
public:
int numIslands(vector<vector<char>>& grid) {
if (grid.empty() || grid.front().empty())
return 0;
int row_size(grid.size()), col_size(grid.front().size()), dummy_node(row_size * col_size);
UnionFind uf(dummy_node + 1);
for (in... | ALGO | 0.999966 | 6.480708 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2015-08-16T04:26:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97a345c9... |
de6530c3-7e01-4e9e-9f56-9a0ccda06451 | lsolanka/cellular-ga | src/CellularGA.cc | /**
* Name: CellularGA.cc
* Project: ARC-2008-L Cellular GA
* Author: <NAME> <<EMAIL>>
* Date: 2008-04
* Description: Cellular genetic algorithm.
*/
#include <iostream>
#include <exception>
#include <sstream>
#include <cmath>
#include "CellularGA.h"
#include "debug.h"
#include "error.h"
using nam... | ALGO | 0.999829 | 5.913198 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2014-07-25T09:50:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04cbe86136... |
43a8156b-b55e-48a4-ab26-aa1fd69c30fd | qieguo2016/algorithm | cpp/leetcode/146.lru-缓存.cpp | /*
* @lc app=leetcode.cn id=146 lang=cpp
*
* [146] LRU 缓存
*
* https://leetcode.cn/problems/lru-cache/description/
*
* algorithms
* Medium (53.45%)
* Likes: 2565
* Dislikes: 0
* Total Accepted: 451.8K
* Total Submissions: 845.4K
* Testcase Example:
* '["LRUCache","put","put","get","put","get","put","... | ALGO | 0.990339 | 6.187081 | {
"github_metadata": {
"branch": "master",
"commit_count": 285,
"repo_created_at": "2016-11-24T16:17:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 372,
"forks": 76,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "79323... |
1eb4c838-5b67-4eb7-8cdb-37fc8ee658fc | beratkirik/algo | 02_algo-technique/05_DynamicProgramming.cpp | #include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <limits>
using namespace std;
int dynamic_coin_changing(vector<int> coins, int a)
{
vector<vector<int>> dp(coins.size() + 1);
for (auto & v : dp) v.resize(a + 1, 0);
for (auto i = 1u;... | ALGO | 0.999947 | 5.060947 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-02-01T20:03: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": "32f6f18aa... |
532d5a0a-cca5-428b-a6fa-d8eca6a36c04 | RedClusive/HashMap | hash_map.h | #include <algorithm>
#include <functional>
#include <list>
#include <stdexcept>
#include <utility>
#include <vector>
template <class KeyType, class ValueType, class Hash = std::hash<KeyType>>
class HashMap {
public:
typedef typename std::list<std::pair<const KeyType, ValueType>>::iterator iterator;
typedef typ... | ALGO | 0.970489 | 5.927493 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-02-09T10:18:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4eb02f5a75... |
e35208bb-dbf6-41dd-8c57-89f429e47712 | Mahboub99/CMP302_A6 | HW/hw3/Adel_Rizq/Encryption Key (DFS).cpp | //
// Created by Dandosh on --/11/2020.
//
// #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define IO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
const int MAXN = 1e6 + 5;
int n, k, arr[MAXN], sums[... | ALGO | 0.999944 | 4.226038 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2020-10-25T15:04:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c0c70f1bf... |
885db231-b676-4eba-82b0-e0cbf7460fca | lukemmtravis/BayesianDeconfounding | Codes/SASGibbsSampler.cpp | #include <Rcpp.h>
using namespace Rcpp;
// helper function for matrix vector multiplication
NumericVector matrix_vector_multiply(NumericMatrix mat, NumericVector vec) {
int nrow = mat.nrow(), ncol = mat.ncol();
NumericVector out(nrow);
for (int i = 0; i < nrow; i++) {
double sum = 0;
for (int j = 0; j... | ALGO | 0.995872 | 5.988822 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-08-01T13:46: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": "f258d1aa15d... |
11e99ce7-436e-4bb5-912d-a0936bdf852e | uyoove/ACMER | code/英语练习/zoj3875.cpp | //和爸爸一起学编程真好,不过要小学四年级分流考试了,最近没时间写代码了,呜呜呜
#include<bits/stdc++.h>
using namespace std;
#define out(x) cout << #x << '=' << (x) << endl
#define out2(x, y) cout << #x << '=' << (x) << ',' << #y << '=' << (y) << endl
#define int long long
#define lc u<<1
#define rc u<<1|1
#define pb push_back
#define vt vector
#define fi ... | ALGO | 0.999939 | 3.217547 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-03-31T02:18:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86b8f39678f3... |
6efb06d3-c433-43df-b520-56a26b99a0d3 | bulichuchu/huffman_compress | handle_article.cpp |
#include "handle_article.h"
void get_frequency_and_char(vector<int> &get_frequency, vector<char> &get_char) {
ifstream inputFile(R"(D:\CLionProjects\huffman_compress\article)");
if (!inputFile.is_open()) {
cout << "Error opening file" << endl;
exit(1);
}
char c;
while (inputFile.get... | ALGO | 0.997301 | 4.134243 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-01-01T13:54:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70ffe8e4723b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.