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 |
|---|---|---|---|---|---|---|---|
0d971635-92b4-4a5d-b1cc-a12daa387173 | 07legion/Leetcode-Problems | 1325-delete-leaves-with-a-given-value/1325-delete-leaves-with-a-given-value.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.999946 | 6.364018 | {
"github_metadata": {
"branch": "main",
"commit_count": 1371,
"repo_created_at": "2021-12-24T07:14: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": "9a02770b5... |
42342d34-5320-40ce-bffa-01e54b59df56 | syrota-roman/LeetCode | zigzag.cpp | /*
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S I I G
Y I R
And then read line by line: "PAHNAPLSIIGYIR"
Write the code that will take a string and make this con... | ALGO | 0.999992 | 6.19799 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-03-02T17:24: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": "e7eada0a02... |
1439a74c-a43b-47f2-86c0-5cd49e10c8b5 | Kushal997-das/Hacktoberfest-2024 | Beginner Level 📁/The Battlefield/Solution.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define MOD 30041975
long long dp[2001][2001];
long long fun(int i, int j) {
if (j < 1)
return 0;
if (j >= i)
return 0;
if (i < 2)
return 0;
return dp[i][j];
}
main ()
{
dp[2][1] = 2;
for (int... | ALGO | 0.999973 | 4.053152 | {
"github_metadata": {
"branch": "master",
"commit_count": 337,
"repo_created_at": "2021-03-15T05:26:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 138,
"forks": 271,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29a2... |
13a889fb-024f-4d10-8861-981ba0113913 | bluesky0904/codetree-TILs | 240321/포탑 부수기/destroy-the-turret.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <tuple>
using namespace std;
#define MAX_NUM 10
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
int dx2[9] = {-1,-1,-1,0,1,1,1,0,0};
int dy2[9] = {-1,0,1,1,1,0,-1,-1,0};
int n, m, k;
int turn = 0;
int board[MAX_NUM][MAX_NUM];
int r... | ALGO | 0.999974 | 4.535118 | {
"github_metadata": {
"branch": "main",
"commit_count": 1377,
"repo_created_at": "2023-11-12T08: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": "6c79a6e74... |
3f677a98-18ef-411e-ba42-c976e439c82d | AnkitMohapatra/Lab_3 | Question_39.cpp | #include <iostream>
using namespace std;
int main()
{
int a,b,c1=0,c2=0,c3=0,c4=0,c5=0,c6=0,c7=0,c8=0,c9=0,c0=0;
cout << "Enter a number : ";
cin >> a;
while(a>0)
{
b = a % 10;
a = a / 10;
switch(b)
{
case 1: c1++;
break;
c... | ALGO | 0.998513 | 3.668836 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2017-09-02T06:06:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4457175... |
2ed491a1-cfca-40eb-981c-71bec95a88bf | mmahfud8/Data-Structure | DoubleLinkedListStackCircular/main.cpp | #include <iostream>
using namespace std;
struct Node{
int data;
Node *next;
Node *prev;
};
Node *head, *tail;
void awal(){
head = NULL;
tail = NULL;
}
bool isEmpty(){
if (head == NULL){
return true;
}else{
return false;
}
}
void tambahBelakang(int dataBaru){
//... | ALGO | 0.993496 | 4.277941 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-06-20T17:43: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": "c2c7272cf7... |
9cd584b3-18fc-4516-9006-761f8ebbacf2 | anilchoudhary/DSA | LeetCode/July_Challenge/Day8.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
int n = nums.size();
int sum = 0;
vector<int> sans;
vector<vector<int>> fans;
sort(nums.begin(), nums.end());
for (int i = 0; i < n - 2; i++)
{
int a = i + 1, b = n - 1;
... | ALGO | 0.99999 | 5.996669 | {
"github_metadata": {
"branch": "master",
"commit_count": 554,
"repo_created_at": "2020-01-31T16:58: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": "2a10798e... |
3fbe1497-e74f-44f7-9791-4175e758f9fc | oosquare/OI-Codes | Storage/YbtOJ/791-「CDQ 分治 & 整体二分」子集最值.cpp | #include <bits/stdc++.h>
using namespace std;
constexpr int maxn = 1e5 + 10;
struct querys {
int x, y, type;
long long ans;
};
querys qs[maxn * 2], tmp[maxn * 2];
int n, m, a[maxn], b[maxn], c[maxn], p[3][3][maxn];
long long ans, tree[maxn];
inline int lowbit(int x) {
return x & (-x);
}
void add(int p,... | ALGO | 0.999953 | 4.118623 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2020-01-15T14:44:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc5aa51bf... |
027d7f79-738a-4a55-a9fc-6927a987e7db | ishandutta2007/codeforces-s | sd0061/normal/526/B.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cassert>
using namespace std;
typedef long long LL;
const int N = 200005;
const int Q = 1e9 + 7;
int n , a[N];
int m , b[N];
int res;
void work() {
int i;
scanf("%d",&m);
n = (1 << m + 1) - 1;
for (i = 2 ; i <= n ; +... | ALGO | 0.999874 | 3.542155 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "ba087cc56911... |
7d08291a-9855-4029-a7ec-9b0e9ceeb374 | 2youngjae/LeetCode | 42.TrappingRainWater/bruteforce.cpp | /*
Approach 1
시간복잡도 O(n^2)
공간복잡도 O(n)
Runtime: 12 ms, faster than 47.35% of C++ online submissions for Trapping Rain Water.
Memory Usage: 14.8 MB, less than 22.14% of C++ online submissions for Trapping Rain Water.
풀이과정:
1. 가장 높은 블록을 찾는다.
2. 가장 높은 블록을 기준으로 왼쪽에서 가장 높은 블록을 찾고 계산한다.
3. 2번에서 찾은 블록을 기준으로 다시 왼쪽에서 가장 높은 블록을 ... | ALGO | 0.999965 | 6.247919 | {
"github_metadata": {
"branch": "main",
"commit_count": 111,
"repo_created_at": "2021-01-05T11:19: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": "4d92a5e9ef... |
a0d27155-3f07-477c-ba73-6708548d68e9 | SanjeevYadavcr7/CodingBox | POTD/Split Array Largest Sum.cc | #include<bits/stdc++.h>
using namespace std;
bool isPossibleSum(int temp, vector<int>& nums, int k){
int sum = 0;
int cnt = 1;
for(int& j : nums){
sum += j;
if(sum > temp){
cnt++;
sum = j;
}
}
return (cnt <= k);
}
int splitArray(vector<int>& nums, int m){
int n = nums.size();
int min_sum = 0, max_s... | ALGO | 0.999974 | 4.199828 | {
"github_metadata": {
"branch": "master",
"commit_count": 400,
"repo_created_at": "2021-09-27T12:09:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76a60eec... |
2b6224f1-0dd7-4e18-9ff9-125e2cc7a007 | debris69/DS | QUEUES.CPP | #include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define MAX 5
typedef struct Queue{
int items[MAX];
int front, rear;
}Queue;
void enqueue(Queue *q, int x){
int temp;
//1st element check
if(q->front == MAX-1 && q->rear == MAX-1){
q->front = 0;
q->rear = 0;
q->items[q->rear] = x;
re... | ALGO | 0.997247 | 3.664968 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-03-25T07:15:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "493d5b882e55... |
ad0068f2-9341-4670-a847-f79767d7d47a | csarofeen/pytorch | caffe2/perfkernels/batch_box_cox_avx2.cc | #include <immintrin.h>
#ifdef CAFFE2_PERF_USE_MKL
#include <c10/util/irange.h>
#include <caffe2/perfkernels/common.h>
#include <folly/SingletonThreadLocal.h>
#include "vectorizer.h"
// Enable compiler vectorized version only if numerical consistency is not
// required between dev and opt versions - disabled for now
#... | DATA | 0.993451 | 6.487311 | {
"github_metadata": {
"branch": "devel",
"commit_count": 56434,
"repo_created_at": "2017-04-12T16:02:31.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "pytorch/pytorch",
"stars": 26,
"forks": 7,
"issues": 160,
"pull_requests": 17
},
"file_meta": {
"conte... |
d3b5d252-8b70-4bcb-9790-be8ab3ecd683 | OwLRUS/TSU-labs | C++/classFunc.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <stack>
using namespace std;
class Function {
private:
vector <string> expression;
bool Letter(char);
bool Digit(char);
bool Operation(char);
public:
Function(string);//заполнение полиза из строки
... | ALGO | 0.996875 | 3.448891 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2025-02-12T06:03: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": "a7a9adefda3... |
85fb2fe8-cbff-4526-80e2-e92ca5578696 | Bilal-Z/2018_Data_structures | Q2.cpp | #include <iostream>
#include "lists.h"
using namespace std;
template <class T>
class queue{
SLL<T> container;
public:
queue(){
}
void enqueue(T x){
container.appendSLL(x);
}
T dequeue(){
if(container.head == NULL){
cout << "Error: Queue already empty" << endl;
exit(1);
}
T x = conta... | ALGO | 0.986574 | 4.860882 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-02-16T16:35: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": "6848185377... |
804f144f-894f-4ed3-9a89-5302272df247 | satyamtiwari736182/CP | pepcoding/Level 1/5_Recursion_Backtracking/2_Target Sum Subsets.cpp | // 1. You are given a number n, representing the count of elements.
// 2. You are given n numbers.
// 3. You are given a number "tar".
// 4. Complete the body of printTargetSumSubsets function - without changing signature - to calculate and print all subsets of given elements, the contents of which sum to "tar". Use sa... | ALGO | 0.997922 | 4.724607 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2022-02-26T18:00: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": "87faee8f5b9... |
3cbfd1ba-cbb3-4738-a7f1-3fa31e0cad5d | FSund/FY8904 | Assignment 01/cpp_bond_percolation/src/sites.hpp | #pragma once
#include <armadillo>
using namespace std;
using namespace arma;
class Sites
{
public:
Sites(const uword m, const uword n);
void activate(const uvec& bond);
void activateMat(const umat& bonds);
const ivec& sites() const { return m_sites; }
double giantComponent() const { return m_gi... | ALGO | 0.935769 | 6.013687 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-04-24T11:48:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a355d8f25... |
22a86fb4-8b60-40d2-ad71-1c88e8f3416d | cbj0304/StudyNotes | 3算法类/leetcode刷题/leetcode_bingchaji.cpp | #include <iostream>
#include <cstdlib>
#include <vector>
#include <cassert>
using namespace std;
/*
并查集:
B站: https://www.bilibili.com/video/av12408792
作用检查图上是否有环。
什么是并查集?
用一维数组保存当前节点的父节点的树结构。
并查集是用数组实现将点编为一个个集合的简单树形结构。
功能:
1. 合并集合?
2. 查找某个点所在集合所拥有点的数量?
3. 询问某两个点是否处于同一个集合等操作?
扩展:查找连通图的数量。
实现:
定义并查集数组为parent, 这些点被分成... | ALGO | 0.999887 | 5.333705 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2019-11-05T01:21:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e95660e5... |
0d6be924-3cf0-465d-b54d-8112a34b7641 | lc19890306/Exercise | Miscellaneous/Average_Value_of_Binary_Tree.cc | #include "TreeNode.hh"
#include <iostream>
#include <stack>
using namespace std;
double avg(TreeNode *root, double ret, int &count) {
if (nullptr == root)
return ret;
++count;
ret -= (ret - root->val) / count;
ret = avg(root->left, ret, count);
return avg(root->right, ret, count);
}
double avg(TreeNod... | ALGO | 0.998999 | 5.193419 | {
"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": "470c90e6... |
cc0a0914-efb6-407c-8e78-9d632315d027 | ShyamB123/Contests | Codeforces/Round-908/c.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double
#define fast_io \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define mod 1000000007
#define inf 1e18
#define F first
#define S second
#define p... | ALGO | 0.999919 | 3.819236 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2023-07-14T03:49: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": "ed10d49fe05... |
d416b68d-8361-4701-b18b-b0c3e7aa3288 | szefany/acm-icpc | training/my-training/old/autumn-2012/3-strings-and-datastructure/K.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
using namespace std ;
const int N = 2000005 ;
char total[N] , rtotal[N] , buffer[N] , buffer2[N] ;
int next[N] , extend[N] , len[N] ;
int n ;
void extended_kmp ( char *S , char *T , int len ) {
int len_T = len ;
next[0] = len_T ;
int... | ALGO | 0.999756 | 3.243495 | {
"github_metadata": {
"branch": "master",
"commit_count": 489,
"repo_created_at": "2013-01-17T12: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": "26c623d0... |
53fe8c60-d414-4ad0-af63-a725ee97efe2 | burigolucas/fanoTest | TOPASextensions/MagneticFieldDipoleExtraParameters.cc | // Magnetic Field for MagneticFieldDipoleExtraParameters
//
#include "MagneticFieldDipoleExtraParameters.hh"
#include "TsParameterManager.hh"
#include "TsVGeometryComponent.hh"
#include "G4LogicalVolume.hh"
#include "G4Mag_UsualEqRhs.hh"
#include "G4FieldManager.hh"
#include "G4ChordFinder.hh"
#include "G4SimpleHeu... | TOOL | 0.929426 | 5.834838 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-06-10T18:51: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": "852175952d9e... |
e4de9e83-f9dd-42f8-bf78-1fc8c6a0f95a | hkrds1996/csci455 | lab12/filt.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
using std::cin;
using std::cout;
using std::vector;
using std::string;
vector<int> readVals();
void printVals( vector<int> v );
vector<int> valsGT0(vector<int> v);
int main(){
vector<int> vTemplate = readVals();
cout << "Vector : ";... | ALGO | 0.998664 | 4.032186 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-12-05T03:57:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b75f95ac16f1... |
64fdedf7-3989-422d-b3d3-76d10f2778b7 | haydenych/codeforces | 34A.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#define ll long long
#define ld long double
using namespace std;
void solve() {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; ++i) {
cin >> v[i];
}
int a = n - 1;
in... | ALGO | 0.999952 | 4.502255 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-07T20:55: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": "de467961e82d... |
cac7b06e-fdcf-49e8-b6b0-4eaff1daef45 | DKDiep/CVRP | SimpleGA.cpp | #include "SimpleGA.hpp"
#include <cstdio>
#include <iostream>
#include <limits>
#include <algorithm>
#include <ctime>
#include <map>
#include <iterator>
SimpleGA::SimpleGA(vector<Node*>* n, int d, int c, int p)
{
nodes = n;
dimension = d;
capacity = c;
samples = p;
mutationProbability = 0.2f;
}
void SimpleGA::ge... | ALGO | 0.999968 | 5.520986 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2016-11-17T18:47:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfd27c738... |
f8721334-4ced-4702-9396-9712180a11ec | zetsux/one-problem-per-day | D64_Codeforces_356A/Codeforces_356A.cpp | #include <stdio.h>
#include <set>
#define gc getchar
#define pc putchar
inline void numput (int n)
{
int N = n, rev, count = 0;
rev = N;
if (N == 0) {
pc('0');
pc(' ');
return;
}
while ((rev % 10) == 0) {
count++;
rev /= 10;
}
rev = 0;
while (N != 0) {
rev = (rev<<3) + (rev<<... | ALGO | 0.999995 | 3.471222 | {
"github_metadata": {
"branch": "main",
"commit_count": 432,
"repo_created_at": "2023-04-09T15:08: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": "4291007c01... |
859a13fc-4c94-41f2-b990-8b0a4061ca7b | Pisces311/vscode_workspace | ACM/Online Judges/HDUOJ/2020 Multi-University Training Contest/Contest #7/1009.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int maxn = 1e5 + 5;
int T, n, x, y;
int a[maxn];
bool solve(int n) {
if (x > n || y > n) return false;
int cur = n, tar = x;
bool flag = (y == 1);
while (cur > tar) {
int len = min(n - x + 1, y);
if (len == ... | ALGO | 0.999912 | 4.495347 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2020-03-21T02:52:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eff525dc... |
6ac088b1-be69-4424-a973-7ee250e69b2f | luisaM735/luisaM735.github.io | projects/Uni/Loan Calculator.cpp | /*<NAME>
Loan Calculator
Assignment 2
9/23/23*/
#include<iostream>
#include<cmath>
#include<cstdlib>
#include <iomanip>
using namespace std;
double monthly_interest(double apr);
double amortization_calc(double p, double r, int n);
void interest_balance_calculation(double& p, double r,int n, double& interest, ... | ALGO | 0.993951 | 4.256346 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2024-02-19T15:21: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": "4318c323c... |
a703f86d-6d5f-4fca-a300-e6ba4cce84a1 | cWonp/ikwalk_sydney | src/ikwalk.cpp | //2019 Robocup_Sydney_Open Technical_Challenge Push_Recovery ikwalk.cpp
#include "../include/ikwalk/ikwalk.hpp"
#include <cmath>
using namespace std;
run walk;
int Push_Recovery_mode = 1;
extern int Push_re_front;
extern int Push_re_back;
void timer_callback(const ros::TimerEvent&)
{
static int ms_1 = 0;
ms... | ALGO | 0.94384 | 4.311409 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-12-21T15:57: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": "0df2c3ca05... |
e7cf53c0-6b25-4124-a77e-cc91ce65901e | imtahirabatool/Leetcode | 3348-minimum-cost-walk-in-weighted-graph/minimum-cost-walk-in-weighted-graph.cpp | class Solution {
public:
void bfs(int node, vector<int>& vis, vector<vector<pair<int, int>>>& adj,
int& band, int& cnt) {
queue<int> q;
q.push(node);
vis[node] = cnt;
while (!q.empty()) {
int u = q.front();
q.pop();
for (auto child : a... | ALGO | 0.999961 | 5.579981 | {
"github_metadata": {
"branch": "main",
"commit_count": 1358,
"repo_created_at": "2024-05-05T17:58: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": "113d5ca3f... |
7d9494b0-6794-4a10-a323-0e108caac226 | kushalarora/codes | ads/graph.hpp | /*
* GRAPH ALOGRITHMS
*
* 1. Types of Graphs
* Undirected vs Directed
* Weighted vs Unweighted
* The difference is particularly apperant in shortest path problem.
* For Unweighted graph its BFS. For Weighted Graph we need Djzxtra and Bellman Ford.
* Simple vs Non Simple
* ... | ALGO | 0.998781 | 5.08771 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2013-08-28T13: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": "c1ecb9ff4... |
d2e630f0-f54a-4b96-8350-c7e1301b780e | feelpp/benchmarking | examples/matrixvector/matrixvector.cpp | #include <mpi.h>
#include <iostream>
#include <random>
#include <fstream>
#include <vector>
#include <numeric>
#include <string>
#include <filesystem>
namespace fs = std::filesystem;
void fill_matrix_vector(std::vector<double>& matrix, std::vector<double>& vector) {
std::mt19937 gen(42);
std::uniform_real_d... | ALGO | 0.981652 | 5.420958 | {
"github_metadata": {
"branch": "master",
"commit_count": 1935,
"repo_created_at": "2023-11-23T12:27:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 37,
"pull_requests": 2
},
"file_meta": {
"content_id": "04653d0... |
0950d6d7-eac6-46cc-9a7e-d313aaf9564d | EtherSphere01/DSA | Number Theory/BigMod.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
typedef long long ll;
typedef unsigned long long ull;
ll bigmod(ll a, ll b)
{
if (b == 0)
return 1LL;
ll x = bigmod(a, b / 2);
x = (x * x) % MOD;
if (b % 2 == 1)
x = (x * a) % ... | ALGO | 0.999963 | 5.133707 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2021-07-25T16:20: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": "0ad945e5271... |
21c23ae6-a843-4f61-ab36-dfaf66d50ba3 | neelaryan2/CompetitiveProgramming | CodeForces/C++/1252H.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define forn(i, a, b) for (int i = a; i < b; i++)
#define rfor(i, b, a) for (int i = b; i > a; i--)
#define rep(i, n) for (int i = 0; i < n; i++)
#define forv(i, v) for (auto i = v.begin(); i != v.end(); i++)
#define all(v) v.begin(), v.end()
#define fi ... | ALGO | 0.999978 | 3.487312 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2019-10-22T18:55:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5aec0d7d9... |
8286c7a1-4b5f-419e-96e1-58092d5e52bb | CXinsect/Daily_Learning | algorithm_structure/tree/Trie/Trie.h | #pragma once
#include <iostream>
#include <map>
#include <memory>
using namespace std;
class Node {
public:
Node() {
Word = false;
nums = 0;
}
Node(bool IsWord,int num) {
Word = IsWord;
nums = num;
}
~Node() {}
public:
bool Word;
int nums;
... | ALGO | 0.979485 | 3.718626 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2019-03-06T09:37: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": "f2dccba3... |
9497e944-5884-405a-bb93-12f4c3d28715 | Zhu-Bei-Jian/ACM-Template | Template/图论/2-sat.cpp | //判断是否有解 输出任意一组解 O(n+m)
int scc, top, tot;
vector<int> mp[MAX];
int low[MAX], dfn[MAX], belong[MAX];
int stk[MAX], flag[MAX];
int pos[MAX], degree[MAX], ans[MAX], outflag[MAX], cnt;
vector<int> dag[MAX];
void init(int n)
{
int i;
for (i = 0; i < 2 * n; i++)
{
mp[i].clear();
dag[i].clear();
low[i] = 0;
dfn[i]... | ALGO | 0.999977 | 3.582763 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-07-08T12:55: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": "7e83d4c0c... |
eea714ed-39fd-4a2d-b1d0-fb14e08b04fb | MBraedley/Advent-Of-Code-2019 | Day23/Day23/Day23.cpp | // Day23.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "IntcodeComputer.h"
#include "readerwriterqueue.h"
#include <iostream>
#include <vector>
#include <functional>
#include <thread>
#include <mutex>
#include <chrono>
int main()
{
auto program = IntcodeComputer... | ALGO | 0.999423 | 5.063911 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2019-12-06T02:48: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": "9821a448b... |
86f4fe6e-5e8e-444d-b0fa-44e481baef8e | assassint2017/leetcode-algorithm | Find Minimum in Rotated Sorted Array II/Find_Minimum_in_Rotated_Sorted_Array_II.cpp | // Runtime: 8 ms, faster than 100.00% of C++ online submissions for Find Minimum in Rotated Sorted Array II.
// Memory Usage: 8.8 MB, less than 100.00% of C++ online submissions for Find Minimum in Rotated Sorted Array II.
class Solution
{
public:
int findMin(vector<int>& nums)
{
return helper(nums, ... | ALGO | 0.999998 | 5.956778 | {
"github_metadata": {
"branch": "master",
"commit_count": 646,
"repo_created_at": "2018-10-10T03:44:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eaa9a49f... |
7bdcf07d-0bde-4d98-ac0d-4e351c84a464 | lazymonday/PS | baekjoon/15591_2.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 5000;
const int INF = 1e9;
typedef long long ll;
int n, q;
struct Edge {
int u, v, w;
bool operator<(const Edge& other) const {
return w > other.w;
}
};
struct Query {
int k, v, index, ans;
bool operator<(const Query& other) ... | ALGO | 0.999978 | 4.555661 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2020-10-14T05:57: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": "e153d339320... |
8aa3ada2-9071-47d8-8baa-67fa62fb5460 | Rejeq/CellNta | include/Cellnta/World/Rule.h | #pragma once
#include <unordered_map>
#include <vector>
#include <Cellnta/Cell.h>
#include <Cellnta/Iterator.h>
namespace Cellnta {
class Rule {
public:
enum class Neighborhood {
// TODO: None - Any relative cell
Moore, // All neighbors ((3 ^ dim) - 1)
VonNeumann, // Orthogonal neighbors only ... | ALGO | 0.971194 | 6.212286 | {
"github_metadata": {
"branch": "main",
"commit_count": 227,
"repo_created_at": "2022-10-11T14:35: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": "cce22aa011... |
54466360-5219-49ee-a7a1-3ad7f409a166 | singhsanket143/CppCompetitiveRepository | UnacademyCourse/GraphMarch/Lecture7/famtree.cpp | #include <iostream>
#include <vector>
#define ll long long int
ll ma[100005], mi[100005];
ll w[100005], p[100005];
std::vector<std::vector<ll> > tree;
ll ans = 0;
void famtree(ll root, ll par) {
for(ll child : tree[root]) {
if(child != par) {
famtree(child, root);
ma[root] = std::max... | ALGO | 0.999944 | 3.938655 | {
"github_metadata": {
"branch": "master",
"commit_count": 304,
"repo_created_at": "2018-06-26T07:06:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 348,
"forks": 160,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "fb62... |
5e2ee3f6-4eef-4477-b458-f21c57e5f19e | reddytocode/jv-juez-patito | O_factoresPrimos/main.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void mostrar_criba(vector<int> criba)
{
cout << endl;
for (int i = 0; i < criba.size(); i++)
cout << criba[i] << "\t";
cout << endl;
}
vector<int> criba_eratostenes(int n)
{
vector<int> criba;
int current_primo;... | ALGO | 0.999932 | 3.912735 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-05-22T00:25:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0f38fb11f... |
f6c95ce8-643a-4415-add5-0a9d1b1b8a1b | avtomato/Basics-of-C-plus-plus-development-yellow-belt | week-01/04-Programming-Assignment/team_tasks.cpp | #include <iostream>
#include <map>
// Перечислимый тип для статуса задачи
enum class TaskStatus {
NEW, // новая
IN_PROGRESS, // в разработке
TESTING, // на тестировании
DONE // завершена
};
// Объявляем тип-синоним для map<TaskStatus, int>,
// позволяющего хранить количество за... | ALGO | 0.922898 | 6.541489 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-01-09T20:41:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b80a49f... |
530348e1-747f-46d0-9a0f-cd85467b3932 | vkeshav300/spacetime-renderer | src/calculations.cpp | #include "calculations.hpp"
#include <algorithm>
#include <cmath>
namespace apple_math {
matrix_float4x4 APPLE_SIMD_OVERLOAD make_matrix4x4(
const float m00, const float m01, const float m02, const float m03,
const float m10, const float m11, const float m12, const float m13,
const float m20, const float ... | ALGO | 0.973402 | 7.351715 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2025-03-18T00:31:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52d456378... |
8c781e2a-c327-4f65-9079-c080bceb3085 | Boyaowang/boyao_learn_cpp | C++_Primer/chapter15/15_9_new_query.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <memory>
#include <map>
#include <sstream>
#include <set>
#include <algorithm>
using namespace std;
typedef std::vector<string>::size_type line_no;
class QueryResult;
class TextQuery {
private:
shared_ptr<std::vector<string>> file;
std::map<string,... | TOOL | 0.988164 | 3.915533 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2020-04-11T12:56: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": "21baf817a... |
3187d68b-0d2a-4dcb-9c36-e369f3dc57b9 | blumzi/ASCOM.Wise40 | FilterWheelArduino/FilterWheelArduino.ino | //instalation version July 18, 2010
//connections on the VGA 15 pin connector and on arduino board:
// Func Arduino VGA Conncetor
// -=-=-=-==- =-=-=- -=-= =-=-=-=-=--==-=-=-
// common Pin 53 ... | TOOL | 0.97233 | 5.830768 | {
"github_metadata": {
"branch": "master",
"commit_count": 1315,
"repo_created_at": "2016-03-15T07:09:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "fcd6a17... |
14c4dc1b-c850-4097-b95c-26c2d60e658b | lezyCoder/DSA2.0 | Day10/Consecutive1.cpp | // Write a program to count the consecutive one's in binary array.
// input - > 1 , 0 , 0 , 1 , 1
//Output -> 2
#include<iostream>
using namespace std;
int consecutive1(int arr[], int size)
{
int count = 0; // To count consecutive 1's
int consecutive = 0; // To store the maximum consecutive ... | ALGO | 0.999975 | 6.094697 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-03-06T12:48: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": "8c7bd8d7325... |
a52f6536-640e-4afe-a103-5fcda5353d5a | sinhadiptiprakash/dsa | Binary Search Tree/replace_every_element_with_its_least_greater_element_on_its_right_side.cpp | #include <bits/stdc++.h>
using namespace std;
struct BSTNode
{
int data;
BSTNode *left;
BSTNode *right;
BSTNode(int d)
{
data = d;
left = NULL;
right = NULL;
}
};
// below insert function inserts a data in bst and store the inOrder successor of it in inOrderSuccessor
void... | ALGO | 0.999996 | 5.290353 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-01-08T07:31:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "479ca48570ca... |
04b9abb6-544c-4f3d-be82-494596b3ff68 | knockcat/CodeForces | Codeforces Round #405 (rated, Div. 2, based on VK Cup 2017 Round 1)/a.cpp | // KNOCKCAT
#include <bits/stdc++.h>
using namespace std;
#define fast \
std::ios::sync_with_stdio(false); \
cin.tie(nullptr);
#define int long long int
#define endl "\n"
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
const ll e... | ALGO | 0.99992 | 3.90145 | {
"github_metadata": {
"branch": "main",
"commit_count": 571,
"repo_created_at": "2022-05-03T01:30:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa75a713e... |
10b68dcf-23ca-4870-a31d-443aae508b47 | xin-lover/leetcode-explore | main1161.cpp | //1161. 最大层内元素和
#include <cstdio>
#include <queue>
using namespace std;
//Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
int maxLevelSum(TreeNode* root) {
//思路:就是层序遍历
if(root == nullptr)... | ALGO | 0.999962 | 4.572257 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2019-07-17T03:13: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": "e80961cd8... |
a8befa85-dfcb-4907-95a3-63a568e5cec3 | StandardCyborg/StandardCyborgCocoa | StandardCyborgFusion/Sources/StandardCyborgFusion/Algorithm/maxrects.cpp | /**
Obtained from MaxRectsBinPack.cpp in the repo:
https://github.com/juj/RectangleBinPack/
MIT License
Copyright (c) 2019 <NAME>, Standard Cyborg
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 ... | ALGO | 0.999885 | 7.253699 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2018-12-21T23:06:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 159,
"forks": 54,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8cc82... |
621e3070-717c-46b0-847f-b93a44c01aed | unjambonakap/prog_contest | codeforces/yandex/13/r2/e.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdli... | ALGO | 0.999842 | 3.733675 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-08-16T18:21:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d934950877... |
c1b2d822-5a2c-41f2-861a-71f7e6f55676 | xirc/cp-algorithm | atcoder/abc187/E/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N;
vector<int> A, B;
vector<vector<int>> G;
vector<int> depth;
vector<ll> cs;
void build() {
// Graph
G.assign(N, vector<int>());
for (int i = 0; i < N - 1; ++i) {
int a = A[i], b = B[i];
G[a].push_back(b);
... | ALGO | 0.999928 | 5.220899 | {
"github_metadata": {
"branch": "main",
"commit_count": 2676,
"repo_created_at": "2019-12-07T23:53:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e5f5fd8... |
71a174b1-7f8a-4fc9-af73-dc36ee9921b6 | rms80/libgeometry | WildMagic4/LibFoundation/Intersection/Wm4IntrLine3Torus3.cpp | // Geometric Tools, LLC
// Copyright (c) 1998-2010
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
//
// File Version: 4.10.0 (2009/11/18)
#include "Wm4FoundationPCH.h"
#include "Wm4IntrLine3Torus3.h"
#... | ALGO | 0.991068 | 4.441299 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2012-11-20T16:38:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fc8ee423... |
b47ad436-04d7-4c15-9da7-4a715081c6a1 | kabirbatradev/competitive-programming | leetCode/hard/239. Sliding Window Maximum.cpp | class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
// idea: manage window maxes using deque
// front will have max, remove from front when window is out of range
// back will have latest element added to window, remove from back if it is smaller than latest e... | ALGO | 0.99998 | 6.689977 | {
"github_metadata": {
"branch": "main",
"commit_count": 377,
"repo_created_at": "2022-05-15T20:58: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": "115a55ef39... |
9997b5e8-26bd-4682-8360-f33d97d8ccbb | Vanshika35/-CrackYourPlacement | day30/Coin Change.cpp | class Solution {
public:
int minCount(int n, vector<int>& coins, int amount, vector<vector<int>>& dp){
if(n == 0){
if(amount%coins[0]== 0){
return amount/coins[0];
}
else{
return 1e9;
}
}
if(dp[n][amount] != -1)... | ALGO | 0.999982 | 5.375224 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-07-15T14:05: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": "528a9bdcb04... |
96fe4459-1569-4dd0-b43e-6a5863224bad | Jack21c/java | PV.cpp | # include <stdio.h>
void copyarr(int a[], int b[], int n)
{
for(int i = 0; i < n; i++)
{
a[i] = b[i];
}
}
void sortik (int a[], int n)
{
int minn = 0;
int iminn = 0;
int r[n];
for(int i = 0; i < n - 1; i++)
{
minn = a[i];
iminn = i;
for(int j ... | ALGO | 0.999998 | 3.467484 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-11-01T16:09: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": "06a25d21247c... |
ee398c81-0b57-45e2-9a68-62f8b6251afd | CHOcho-quan/OJ-Journey | LeetCode/Leetcode532_距离为k的数.cpp | //
// Leetcode532_距离为k的数.cpp
//
//
// Created by 铨 on 2019/1/20.
//
//
void DeleteTheSame(vector<int> &nums)
{
for (int i = 0;i < nums.size();i++)
{
if (i==nums.size()-1) break;
if (nums[i]==nums[i+1])
{
nums.erase(nums.begin()+i);
i--;
}
}
}
cla... | ALGO | 0.999858 | 5.506399 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2019-01-20T13:35:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b173d209... |
cde94c66-50a9-4ee9-bf32-c83242ac69e2 | C-Coupler-Group/c-coupler-lib | src/CoR/remap_operator_grid.cxx | /***************************************************************
* Copyright (c) 2017, Tsinghua University.
* This is a source file of C-Coupler.
* This file was initially finished by Dr. <NAME>.
* If you have any problem,
* please contact Dr. <NAME> via <EMAIL>
**************************************... | ALGO | 0.995239 | 3.257426 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-05-25T02:23:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 38,
"forks": 9,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4e49083a74... |
46d76ea3-9468-4762-97b0-74c3b113f25c | Sang-Yoon/cs-training | DoublyLinkeddList.cpp | #include <iostream>
struct Node
{
int data;
Node* next;
Node* prev;
};
class DoublyLinkedList
{
public:
DoublyLinkedList() {
std::cout << "Doubly Linked List implementation in c++" << std::endl;
head = NULL;
list_size = 0;
}
~DoublyLinkedList() { /*delete*/ }
voi... | ALGO | 0.98679 | 5.34403 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-09-14T01:20: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": "23ef08758ba... |
ca5cc17a-5d9b-4b03-af30-ef6cb8d80e88 | shuvomdhar/Notes-Helper | SNU Coding/CPP Assignments/Question 1/code9.cpp | /* Write a program to print the ASCII Value of a character. */
#include <iostream>
using namespace std;
void character_to_ASCII_1(char c)
{
cout << "It is the 1st process" << endl;
cout << "ASCII value of " << c << " is: " << int(c) << endl;
}
void character_to_ASCII_2(char c)
{
int i;
if (c >= 65 &&... | TOOL | 0.994204 | 3.884278 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2025-02-04T10:44:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e734bc8ec1... |
05c09def-00c2-4137-845a-5ae3594a28b6 | o01eg/gfp | src/gpoptimize.cpp | /*
* Copyright (C) 2010-2012 O01eg <<EMAIL>>
*
* This file is part of Genetic Function Programming.
*
* 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 wi... | TOOL | 0.947631 | 4.755737 | {
"github_metadata": {
"branch": "master",
"commit_count": 300,
"repo_created_at": "2010-11-08T20:22:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90c71c1f... |
8be73558-9967-4f37-af30-7731663d057f | moron-coder/cp | leetcode/818. Race Car.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mii map<int, int>
#define mll map<ll, ll>
#define pii pair<int, int>
#define pbi pair<bool, int>
#define pic pair<int, char>
#define pdd pair<double, double>
#define pll pair<ll, ll>
#define vvi vector<vector<int>>
#define ull unsigned long lon... | ALGO | 0.999973 | 4.162621 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2022-02-01T13:05: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": "32c6814025... |
34dc94b2-afca-42f7-baf9-f9b47d0deabd | MediocreVs14/LearnDSA | new.cpp | #include<iostream>
#include<string>
using namespace std;
void pattern1(int n){
for(int i = 0 ; i < n ; i++){
for(int j = 0 ; j < n ; j++){
cout << "* ";
}
cout << "\n";
}
}
void pattern2(int n){
for(int i = 0 ; i < n ; i++){
for(int j = 0 ; j <= i ; j++){
... | ALGO | 0.999963 | 3.125695 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-10-01T12:38:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3db10d245c0... |
1b0f0273-9c46-4176-959f-d19d057417c8 | meltyblend/DataStuctureF23 | SortArenChavez.cpp | /*Write a sort function that takes an array and sorts the values.
*/
/*
* Bubble sort is terrible for large data sets
* Big-O is O(n^2)
* small data sets like the one I implemented its justafiable
*
* it sorts in pairs by comparing two pars of elements and swapping if they are not in order.
* */
#include <iostre... | ALGO | 0.999988 | 5.507905 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-08-24T20:12:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b9a3d9507e... |
098be053-20dc-4913-b451-53fd4b0202d0 | mkaouer/Code-Smells-Detection-in-JavaScript | JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/502988/desmume-0.9.5/src/cli/main.cpp | /* main.c - this file is part of DeSmuME
*
* Copyright (C) 2006,2007 DeSmuME Team
* Copyright (C) 2007 <NAME> (evilynux)
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, o... | TOOL | 0.904294 | 4.426302 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2016-11-16T11:47:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 18
},
"file_meta": {
"content_id": "1ebf58c6... |
d8115781-3060-4898-98fd-f9b8bc3ee429 | ckc9759/CODING_resources | Codechef/Bit Manipulation/Ceil and Receipt.cpp | # Approach - We have 2 to the power every time, so we take it till we have a number which is closer to next power of 2.
Like if we have 4096, then we can take 2048 or a smaller power till we get 4096.
If we have something like 257 or 259, we take 256 then we have 1 or 3 left, therefore we go to a smaller power of 2 lik... | ALGO | 0.999904 | 4.949965 | {
"github_metadata": {
"branch": "main",
"commit_count": 402,
"repo_created_at": "2022-05-29T03:50:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "6ddcec65f1... |
199e96f3-c409-488f-af12-e05cf2b7b56a | isbhargav/Programming-Problems | 735uva.cpp | #include <bits/stdc++.h>
using namespace std;
int ans[311][2];
int main()
{
vector<int> ranges;
for (int i = 0; i <= 20; i++)
{
ranges.push_back(i);
ranges.push_back(2 * i);
ranges.push_back(3 * i);
}
ranges.push_back(50);
int n;
cin >> n;
while (n > 0)
{
... | ALGO | 0.999619 | 3.870055 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-12-12T21:28:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "283527e6f... |
36de9f4c-3199-4c52-87b5-fa738efbb122 | bhanuprakasheagala/Cpp-Programming | 4.FileHandling/WordCounter.cpp | /*
Program that reads a text file and counts the number of words in it.
You can also track the frequency of each word and save the results to
another file.
*/
#include<iostream>
#include<fstream>
#include<string>
#include<map>
#include<sstream>
int main(){
std::string inputFilename, wordCountFilename;
std::co... | TOOL | 0.930064 | 5.651268 | {
"github_metadata": {
"branch": "bhanuprakash_eagala",
"commit_count": 393,
"repo_created_at": "2023-01-27T08:35:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_i... |
601934c3-935a-40d8-8b7d-3a9b00f633cb | Srivaths-P/Competitive-Programming | CodeForces/GNU C++17/1214D | Treasure Island/69853615.cpp | #include<bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define all int i=0; i<n; i++
#define INF 9999999999999999
using namespace std;
typedef long long int ll;
#define int ll
#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
int32_t main(){
FAST_IO;
int n,m, ans = 0;
cin>>n>>m... | ALGO | 0.999927 | 3.195482 | {
"github_metadata": {
"branch": "main",
"commit_count": 6921,
"repo_created_at": "2022-06-04T05:01:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b7fdd4fe... |
45b4bc45-0e28-48be-82f2-15a7d8c88ba9 | BurningFalls/algorithm-study | Codeforces_Contest/2020년/(2020.09.07) CR_668/D [FAILED].cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FASTIO cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
vector<int> v[100001];
int n, a, b, da, db;
int visited_b;
int visited[100001] = { 0, ... | ALGO | 0.999935 | 3.626019 | {
"github_metadata": {
"branch": "main",
"commit_count": 3832,
"repo_created_at": "2020-08-04T06:46:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4798a8eb5... |
ec013a0b-eb6b-42cf-942f-b4fed4260ad3 | shivamgohri/ds_codes | Old/valid.cpp | unsigned long int solve(unsigned int n)
{
unsigned long int temp[n + 1];
temp[0] = temp[1] = 1;
for (int i = 2; i <= n; i++) {
temp[i] = 0;
for (int j = 0; j < i; j++)
temp[i] = ( temp[i]%mod + ( ( temp[j]%mod * temp[i - j - 1]%mod )%mod )%mod )%mod;
}
ret... | ALGO | 0.999997 | 4.312638 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2020-04-08T19:59: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": "57ad6b15... |
58bd60a5-baa5-4a2d-9519-3e3367129131 | shivanksingh01/Data-Structure | array/sum-closest-to-zero-pair.cpp | // Two elements whose sum is closest to zero
// An Array of integers is given, both +ve and -ve.
// We need to find the two elements such that their sum is closest to zero.
// input arr : 1, 60, -10, 70, -80, 85
// output pair : (-80, 85) --> -80+85=5 , closest to zero
#include<iostream>
#include<bits/stdc++.h>
usin... | ALGO | 0.999992 | 4.978971 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2021-08-16T15:15:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba93c53d760... |
bdcdec8a-c67e-4ffb-b0e8-dd48f6135304 | Vxlimo/IOI2020-Homework | Atcoder/AGC029F.cpp | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <vector>
using namespace std;
inline int read()
{
int f = 1, x = 0;
char ch;
do{
ch = getchar();
if (ch == '-')
f = -1;
}while(ch < '0' || ch > '9');
do{
x = x * 10 + ch - '0';
ch = getchar();
}while(ch >= '0' && ch <= ... | ALGO | 0.999701 | 3.476476 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2020-12-18T14:46:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "350001dc9... |
9e32d091-3bfe-4d03-bd9b-7df750b3663f | x7Azi/Collection-of-USTB-CS | 第4学期/数据结构/2021-USTB-数据结构实验 (计蒜客)/Work1/src/vector.cpp | #include "vector.h"
#include <string>
#include <iostream>
#include <cstdlib>
int vector::insert(Worker *new_worker) {
if(length!=size){
data[length++]=new_worker;
return 0;
}
expand();
data[length++] = new_worker;
return 1;
}
Worker *vector::remove(int index) {
try{
if (!... | TOOL | 0.903542 | 3.42748 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-06-28T07:34: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": "130dfde374c... |
daa713e6-d549-46e3-b810-efa9ceba51ba | justinlee007/CarND-PID-Control-Project | src/Tracker.cpp | #include <cmath>
#include <iostream>
#include "Tracker.h"
Tracker::Tracker() {}
Tracker::~Tracker() {}
void Tracker::init(int sample_size) {
sample_size_ = sample_size;
}
double Tracker::getAveTps() {
return count_ / difftime(time(NULL), init_time_);;
}
void Tracker::onMessageProcessed(double cte, double speed,... | ALGO | 0.908922 | 5.534458 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2017-06-10T21:36:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcd22db71... |
3104bdda-0e26-4043-96c4-ec1c855d36ec | AdityaSingh1707/Cpp-Programs | OOPs/Matrix/OperatorOverloaded/Matrix_main.cpp | #include"Matrix.h"
int main()
{
int row, column;
cout<<"Enter the number of rows and columns are :\n";
cin>>row>>column;
Matrix m1(row, column), m2(row, column), res1(row, column), res2(row, column);
cout<<"Enter the elements of the Matrix m1 :\n";
cin >> m1;
cout<<"Enter the elements of... | ALGO | 0.976803 | 4.358077 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-08-29T11:08: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": "750057a8f9e... |
421ba023-4a50-4ed4-9deb-d4f273d4d38b | jookbooin/Algorithm | 10week_Algorithm/ch1/B_11655/m11655.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* 65 ~ 90
* 97 ~ 122
*
* 대문자 -> 대문자
* (((input - 'A') + 13 ) % 26 ) + 'A'
* 소문자 -> 소문자
* (((input - 'a') + 13 ) % 26 ) + 'a'
*
*/
string input;
int main(void){
getline(cin, input);
for(int i =0; i<input.size(); i++){
if('A'<=inp... | ALGO | 0.999748 | 4.682222 | {
"github_metadata": {
"branch": "main",
"commit_count": 147,
"repo_created_at": "2024-01-19T06:37: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": "aaf0a0dbdc... |
f94ed5bc-cd3c-48ca-9d3d-f65d884d35a6 | kumarnitinsingh/CP | DSAlgoUdemyCourse/rain.cpp | // Created by <NAME>
#include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include<ext/pb_ds/trie_policy.hpp>
//using namespace_-gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define mod 10000000... | ALGO | 0.999986 | 4.060123 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-08-05T13:38: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": "eec496d0c43... |
84958613-f3d9-4c2c-ab20-55daf45fe9e1 | SPEAROW486/resume | Algorithm/BaaaaaaaaaaarkingDog_0x09/tomato/main.cpp | #include <iostream>
#include <queue>
struct Point
{
public:
Point() = default;
Point(int r, int c) : row(r), col(c)
{
}
Point operator+(const Point &rhs) const
{
return Point(row + rhs.row, col + rhs.col);
}
int row = 0;
int col = 0;
};
// 상하좌우
static Point SearchDirectio... | ALGO | 0.999988 | 4.9523 | {
"github_metadata": {
"branch": "main",
"commit_count": 359,
"repo_created_at": "2023-07-07T06:31: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": "69b0f88452... |
587526e8-21a6-44a3-a633-4f7153e5761d | ROCm/MIOpen | src/solver/conv/conv_ocl_dir2D11x11.cpp | /*******************************************************************************
*
* MIT License
*
* Copyright (c) 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* ... | TOOL | 0.960878 | 5.850171 | {
"github_metadata": {
"branch": "develop",
"commit_count": 10212,
"repo_created_at": "2017-06-27T17:51:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1169,
"forks": 266,
"issues": 228,
"pull_requests": 40
},
"file_meta": {
"content_id":... |
bfbe73d6-902c-4b70-bcb8-1891fda6412b | saminahmed197/CSE225-Data-Structure-and-algorithm- | Lab-12/main.cpp | #include <iostream>
#include <cmath>
using namespace std;
int fib(int n);
int factorial(int n);
int sumOfDigits(int x);
int findMin(int a[], int size);
int DecToBin(int dec);
double SumInvSeries(int n);
int main()
{
int fibonacci_num=fib(5);
cout << "Nth fibonacci number is: "<<fibonacci_num << endl;
int fa... | ALGO | 0.999307 | 3.136352 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-01-01T17:52: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": "b3b4db155a... |
303d6710-5d40-4d41-bbc3-e0612d5a62ee | raparks02/schoolprojects | Advanced Data Structures/Hash Tables/driver.cpp | /*
I pledge that I have never given nor
received any help on this assignment
mfleschner & raparks
*/
#include <iostream>
#include <fstream>
#include "HashTableArray.h"
#include "HashTableCuckoo.h"
#include "HashTableChaining.h"
#include "HashTable.h"
//functions for each hashtable
void linearProbing();
void quadratic... | ALGO | 0.99202 | 3.558311 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-12-02T18:52:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3458bcc281... |
745b559d-61ce-46d8-a902-d8fd4392da0f | Jo-Minseok/algorithm-problem | 백준/Bronze/2476. 주사위 게임/주사위 게임.cc | #include <stdio.h>
int main() {
int max,result_max;
int dice[3];
int result[1000];
int count;
scanf("%d", &count);
for (int i = 0; i < count; i++) {
for (int j = 0; j < 3; j++) {
scanf("%d", &dice[j]);
}
if (dice[0] == dice[1] && dice[0] == dice[2] && dice[1] == dice[2]) {
result[i] = 10000 + dice[0]... | ALGO | 0.999821 | 3.758389 | {
"github_metadata": {
"branch": "study",
"commit_count": 828,
"repo_created_at": "2022-03-04T19:35: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": "b766f5f70... |
4ca70262-5510-4cc9-a13b-5b6618a657b8 | ASHUdev05/2022 | DSA/revlinkedlist.cpp | #include <iostream>
using std::cout;
using std::endl;
struct Node
{
int data;
struct Node* next;
};
typedef struct Node Node_t;
void printList(Node_t *head)
{
Node_t *temp = head;
while (temp != NULL)
{
cout << temp->data << " -> ";
temp = temp->next;
}
cout << endl;
}
vo... | ALGO | 0.999842 | 5.892471 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2022-01-01T07:14: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": "609f7afe3... |
35bc3bd2-a30a-496d-b228-59f5f8972e98 | zqy1018/sjtu_oj_solutions | codes/4321.cpp | #include <bits/stdc++.h>
#define REP(temp, init_val, end_val) for (int temp = init_val; temp <= end_val; ++temp)
using namespace std;
typedef long long ll;
typedef pair<int, int> intpair;
int read(){
int f = 1, x = 0;
char c = getchar();
while (c < '0' || c > '9'){if(c == '-') f = -f; c = getchar();}
wh... | ALGO | 0.99998 | 4.218912 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2020-03-22T06:11:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24fe471a5... |
f80e14cd-de00-4d6d-a163-698b529a47cf | scholli/gpucast | gpucast_volume/src/isosurface/octree/split_traversal.cpp | /********************************************************************************
*
* Copyright (C) 2007-2011 <NAME>
*
*********************************************************************************
*
* module : split_traversal.cpp
* project : gpucast
* description:
*
***************************************... | ALGO | 0.978426 | 6.392018 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2013-12-20T14:09: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": "c5b7b6dc... |
1ad2ed6e-1112-4920-be4b-dcafbd41e5b3 | pippi0057/Competitive-Programming | AtCoder/ABC/-190/190/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
const double pi = 3.14159265358979;
const int inf = 1e13;
#define pii pair<int,int>
#define endl "\n"
#define dtor(deg) (((deg)/360)*2*pi)
#define all(a) a.begin(),a.end()
#define overload(_1,_2,_3,_4,name,...) name
#define _rep1(n) for(int i = 0; ... | ALGO | 0.999941 | 3.931316 | {
"github_metadata": {
"branch": "master",
"commit_count": 452,
"repo_created_at": "2020-11-28T14:59:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee71395d... |
33c2ad13-793a-47dc-8631-d4582deebb8a | daviddoria/PCLMirror | surface/include/pcl/surface/impl/marching_cubes_rbf.hpp | /*
* Software License Agreement (BSD License)
*
* Copyright (c) 2010, <NAME>, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must reta... | ALGO | 0.990872 | 6.72245 | {
"github_metadata": {
"branch": "master",
"commit_count": 5416,
"repo_created_at": "2012-06-07T17:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e429a0c... |
4b51d943-3129-461e-8c6c-e3c777666ff1 | helloliuc/Leetcode | 173_Binary Search Tree Iterator.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class BSTIterator {
private:
TreeNode *p;
stack<TreeNode*> s;
public:
BSTIterator(TreeNode *root) {
if(root == N... | ALGO | 0.99999 | 5.857568 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2015-05-04T09:32:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fbe76fd4... |
439d2405-0caa-4399-8d23-aa62f12cab6c | Vishalyadav0804/CP_Algorithm | Leetcode solutions/Number of good ways to split a string.cpp | class Solution {
public:
int numSplits(string s) {
vector<bool> v(26,false);
vector<int> prefix(s.size(),1);
vector<int> sufix(s.size(),1);
int count=0;
v[s[0]-'a']=true;
for(int i=1;i<s.size();i++){
int val=s[i]-'a';
if(v[val]==false){
... | ALGO | 0.999978 | 5.020268 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2020-02-13T01:47:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5289699b... |
c0142d1b-eda9-4219-8933-477be659aae5 | gozzarda/CITS4404_Project | Player.cpp | #include "Pong.cpp"
#include "NeuralNet.cpp"
#include <cmath>
#include <chrono>
#include <random>
#include <thread>
#include <vector>
#include <fstream>
using namespace std;
struct NeuroPlayer : PlayerController {
vector<int> layers;
vector<double> weights;
NeuroPlayer(vector<int> layers, vector<double> weights) :... | ALGO | 0.971572 | 4.204814 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2015-10-06T09:34:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e09a25dfc... |
fe9a1e0b-56c7-48bf-bfda-5e911108e28b | dylanclarke890/Krystal | include/MTL/Hyperbolic/Sinh.hpp | #pragma once
#include "Base/Attributes.hpp"
#include "Base/Concepts.hpp"
#include "MTL/Common/Abs.hpp"
#include <cmath>
namespace Krys::Impl
{
/// @brief Helper function for computing sinh using Taylor series expansion.
template <IsArithmeticT TNumber>
constexpr TNumber ComputeSinh(TNumber x, int n, TNumber po... | TOOL | 0.979311 | 6.7307 | {
"github_metadata": {
"branch": "main",
"commit_count": 693,
"repo_created_at": "2024-03-24T11:12:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b71dc1122... |
e98f0339-a3c3-46c1-9fad-9a380244c97e | NOGUEN/Baekjoon | C++/BaekjoonC++2805.cpp | #include <iostream>
#include <algorithm>
using namespace std;
long long N, M;
long long tree[1000001];
long long answer = 0;
void input() {
cin >> N >> M;
for(int i = 0; i < N; i++) {
cin >> tree[i];
}
sort(tree, tree + N);
}
void binarySearch() {
long long left = 0;
long long right = tree[N - 1];... | ALGO | 0.999997 | 4.712931 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2020-08-11T08:23: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": "367ee6b8... |
d1a70639-0d36-432b-871c-bc20535ab3bd | dsptanmay/LeetCode-Solutions | 0493-reverse-pairs/0493-reverse-pairs.cpp | #define vti vector<int>
#define ll long long
#define pb push_back
class Solution
{
public:
void merge(vector<int> &arr, int low, int mid, int high)
{
vector<int> temp;
int left = low;
int right = mid + 1;
while (left <= mid && right <= high)
{
if (arr[le... | ALGO | 0.999969 | 5.148571 | {
"github_metadata": {
"branch": "main",
"commit_count": 207,
"repo_created_at": "2023-01-18T08:27: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": "de482784ac... |
68fb5859-5048-4c44-bf27-2582b6c99319 | jesushilarioh/DelMarCSi.cpp | SourceCode/Chapter 07/Pr7-15.cpp | // This program uses two parallel arrays: one for hours
// worked and one for pay rate.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const int NUM_EMPLOYEES = 5; // Number of employees
int hours[NUM_EMPLOYEES]; // Holds hours worked
double payRate[NUM_EMPLOYEES]; // Holds pa... | ALGO | 0.999653 | 3.694612 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2016-09-20T01:58:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "056fb6f9... |
2e8f2f87-2dbf-45dd-b9a4-fee70f7bceeb | klb3713/aoapc-book | TrainingGuide/exercises/ch1/BruteForce/LA5844.cpp | // LA5844/UVa1509 Leet
#include<cstdio>
#include<string>
#include<cstring>
using namespace std;
int n, m, k;
char s[20], t[50];
int st[256], L[256];
// match s[d:] and t[p:]
int dfs(int d, int p) {
if(p > m) return 0;
if(d == n) return p == m ? 1 : 0;
if(m - p < (n-d) || m - p > (n-d)*k) return 0;
if(L[s[d]]... | ALGO | 0.999706 | 3.693027 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2013-09-22T01:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 181,
"forks": 56,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "05aa5... |
c0021c0a-4a31-441d-a876-1c18f5818fab | eyangch/competitive-programming | Codeforces/230/b.cpp | #include <bits/stdc++.h>
#define bignumber 1000001
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
template <typename T1, typename T2>
ostream &operator <<(ostream &os, pair<T1, T2> p){os << p.first << " " << p.second; return os;}
template <typename T>
ostream &operator ... | ALGO | 0.999899 | 4.610768 | {
"github_metadata": {
"branch": "master",
"commit_count": 1164,
"repo_created_at": "2019-04-01T01:31:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0929ec... |
c7d1c234-d08f-4b9e-8aa3-8299d8c73c2c | ishandutta2007/codeforces-j | joyfun/normal/493/C.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 400005;
int n, m;
struct Man {
int v, tp;
Man() {}
Man(int v, int tp) {
this->v = v;
this->tp = tp;
}
} man[N];
int tot;
bool cmp(Man a, Man b) {
return a.v < b.v;
}
int prea[N], pre... | ALGO | 0.99989 | 3.150738 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a75ca7766bd... |
29f1a176-fa9f-4220-94a1-d97a85ef1256 | karmugilan28/leetcode_problems | 0063-unique-paths-ii/0063-unique-paths-ii.cpp | class Solution {
//memoization
// public:
// int fn(int i,int j,vector<vector<int>>&grid,vector<vector<int>>&dp){
// if(dp[i][j]!=-1)
// return dp[i][j];
// if(i==0 && j==0)
// return 1;
// if(i<0 || j<0)
// return 0;
// int l=0,r=0;
// if(... | ALGO | 0.999966 | 5.656004 | {
"github_metadata": {
"branch": "main",
"commit_count": 868,
"repo_created_at": "2024-10-09T11:04:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1eeeb1ab3b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.