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 |
|---|---|---|---|---|---|---|---|
f1558c64-59a4-4ed1-9dc3-10eb904d9647 | monolife506/problem_solving | 대회/Codeforce/Educational #142 (Div. 2)/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
void solve()
{
int a1, a2, a3, a4;
cin >> a1 >> a2 >> a3 >> a4;
if (a1 > 0)
{
int ans = 0, m1 = 0, m2 = 0;
ans += a1;
m1 += a1;
m2 += a1;
ans += min(a2, a3) * 2;
... | ALGO | 0.999961 | 4.154611 | {
"github_metadata": {
"branch": "master",
"commit_count": 433,
"repo_created_at": "2019-09-18T12:56: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": "7250b5f3... |
2850f918-002a-415e-8155-ba0caf21a12b | zykgithub1/data-structure | ds_2_20_study(quick sort)/testGit/test.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
//冒泡排序
//void burboSort(int arr[],int sz)
//{
// int bound,exchange;
// exchange = sz-1;
// while (exchange)
// {
// bound = exchange;
// exchange = 0;
// for (int j = 0; j < bound; j++)
// {
// if (arr[j]>arr[j + 1])
// {
// int tmp = arr[j];
// ... | ALGO | 0.999846 | 4.192044 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2021-01-16T12:30: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": "2f65ecda0... |
138796d6-59ed-45ed-be3a-47280a6d8861 | childast/LeetCode-problems | 109-convert-sorted-list-to-binary-search-tree/109-convert-sorted-list-to-binary-search-tree.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
/**
* Definition for a binary tree node.
* struc... | ALGO | 0.999988 | 6.151274 | {
"github_metadata": {
"branch": "main",
"commit_count": 381,
"repo_created_at": "2022-06-12T12:12: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": "e6f5003dba... |
a59d27b8-25da-44d8-b395-5d44bd18dd95 | silentkiller18/100daysofcode | 794-swim-in-rising-water/swim-in-rising-water.cpp | class Solution {
public:
// Binary search on answer
int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
int n;
bool dfs(int x,int y, int t,vector<vector<int>> &grid, vector<vector<int>> &visit){
visit[x][y]=1;
if(t< grid[x][y]) return false;
if(x== n-1 && y== n-1... | ALGO | 0.999987 | 6.192254 | {
"github_metadata": {
"branch": "main",
"commit_count": 517,
"repo_created_at": "2022-09-01T12:02: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": "de18744e6e... |
818bcf85-99bf-4b44-8272-4ec5c353db0c | PrincetonUniversity/athena | src/fft/turbulence.cpp | //========================================================================================
// Athena++ astrophysical MHD code
// Copyright(C) 2014 <NAME> <<EMAIL>> and other code contributors
// Licensed under the 3-clause BSD License, see LICENSE file for details
//=====================================================... | ALGO | 0.991968 | 5.655907 | {
"github_metadata": {
"branch": "main",
"commit_count": 5233,
"repo_created_at": "2014-05-02T16:11:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 270,
"forks": 152,
"issues": 24,
"pull_requests": 4
},
"file_meta": {
"content_id": "b04f8... |
3eb58ff7-e385-421d-9a50-74c08ffde6d7 | Hhaseo/MetaheuristiqueDevoir | sources/celar.cc | /* Tout ce qui concerne le celar ... (sauf les spécifités pour l'incrémentalité qui se trouvent
dans celarincr.cc et celarfullincr.cc) */
#include <cerrno>
#include <stdio.h>
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <set>
#include <cstdlib>
using namespace std;
#include <fst... | ALGO | 0.997183 | 3.085974 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2015-01-07T14:52: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": "7401baa05... |
974d00f2-f53a-47db-91f6-8ebc81a4b8fe | YuvalG22/NBALeague | LinkedList.h | #ifndef LINKEDLIST_H
#define LINKEDLIST_H
#include <iostream>
template <typename T>
struct Node {
T data;
Node* next;
Node(const T& value) : data(value), next(nullptr) {}
};
template <typename T>
class LinkedList {
private:
Node<T>* head;
public:
LinkedList() : head(nullptr) {}
~LinkedList(... | TOOL | 0.99599 | 6.39009 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2024-07-22T12:53: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": "3f44f5c1b... |
f553a4c8-5a67-4e1a-b56b-aea27ee70e7b | byteps/examples | mxnet/bert-large/gluon-nlp/scripts/word_embeddings/tools/cooccur.cc | // Tool to calculate word-word cooccurrence statistics
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under ... | ALGO | 0.989878 | 7.067985 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-08-24T08:25:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 11,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "6cdf693... |
d8a45238-7e39-423a-89e3-6e9b14e08f9f | Ganadalam/codetree-TILs | 240914/숫자들의 배수/multiple-of-numbers.cpp | #include <iostream>
using namespace std;
int main() {
int num;
cin >> num; // 입력받을 정수
const int MAX = 10; // 출력할 최대 배수 개수
int multiples[MAX]; // 배수 저장할 배열
int count = 0; // 5의 배수를 카운트할 변수
int index = 0; // 배열의 인덱스
// 배수들 배열에 저장
for (int i = 1; i <= MAX; ++i) {
i... | ALGO | 0.999619 | 4.279263 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2024-08-01T15:50: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": "d752cf7462... |
c0c77a88-7cfd-40f8-9fa6-98e5196ee43b | manmeet0307/Pepcoding-IP | Arrays-and-Strings/number-to-words.cpp | #include<bits/stdc++.h>
using namespace std;
string got(int n)
{
vector<string> v{ "" , "Thousand " , "Million " , "Billion " , "Trillion "};
return v[n];
}
string teens(int n)
{
vector<string> v{ "" , "One " , "Two " , "Three " , "Four " , "Five " , "Six " , "Seven " ,
"Eight " , "Nine " , "Ten ", "El... | ALGO | 0.999311 | 3.816644 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2020-04-18T13:39:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d2d3ec1... |
0c0ed6d8-f4b8-4722-9ae6-f3e28ee0dd5d | rakibulhasan-swe/CandC_plus_plus | DSA/LinkList/insert_at_tail.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
void insert_at_tail(Node *&head, int v)
{
Node *newNode = new Node(v);
if (head == NULL)
{
head = newNode;
... | ALGO | 0.99924 | 4.68811 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2022-12-16T16:05:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d1de7adfc4... |
cf4a3a04-bb0b-4013-ad16-5cc78b8d6ecd | dzejzi/Cplusplus-Learning | Combinations-nesting_loops.cpp | //masz pięć pudełek, w każdym pudełku możesz umieścić jedną liczbę całkowitą
//z przedziału od 1 do 3 włącznie.
// Napisz program, który wypisze na ekranie wszystkie możliwe kombinacje w jaki
//sposób można zapełnić pudełka
#include<iostream>
using namespace std;
int main()
{
for ( int a = 1; a <=3; a++)
{
... | ALGO | 0.998248 | 3.859283 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-02-22T16:59: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": "8c8b90652... |
863bcac6-afc6-495c-8914-220ac0e82448 | finallie/USACO | 3.2/msquare.cpp | /*
ID: aleksil1
TASK: msquare
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
using array8 = array<char, 8>;
int target;
constexpr int max_index = 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1;
pair<int, char> pre[max_index];
int index(array8 a) {
static constexpr int product[8]{7 * 6 * 5 * 4 * 3 * 2 * 1, 6 * 5 * 4 * ... | ALGO | 0.999896 | 3.450071 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2022-03-14T17:46: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": "a1104337b... |
c7ade88e-0524-4f3f-a826-16cae4c842ed | gilbo/toptop | common/src/isct/collide.cpp | // +-------------------------------------------------------------------------
// | collide.cpp
// |
// | Author: <NAME>
// +-------------------------------------------------------------------------
// | COPYRIGHT:
// | Copyright <NAME> 2012
// | See the included COPYRIGHT file for further details.
// |
// | ... | ALGO | 0.999882 | 6.075597 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-06-05T23:44:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 8,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "7a42615d5... |
477f422c-7993-47a0-aebc-a6d84f6fa3f1 | AveePB/Algorithms-and-Data-Structures | codeforces/kuriyama-mirais-stones.cpp | #include <bits/stdc++.h>
using namespace std;
void question(int l_idx, int r_idx, vector<long long int>& sum);
vector<long long int> sum_of_stones(1);
vector<long long int> sum_of_sorted_stones(1);
int main(){
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
//STONES SECTION
... | ALGO | 0.999813 | 5.263389 | {
"github_metadata": {
"branch": "main",
"commit_count": 307,
"repo_created_at": "2023-02-16T15:39: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": "2ae6b0070c... |
9120ff07-999c-46bf-92b7-f1e523c212e4 | JNArrazola/Leetcode_Files | 74_search2DMatrix/main.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <array>
#include <set>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <bits/stdc++.h>
using namespa... | ALGO | 0.999929 | 3.884466 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2024-04-01T02:23: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": "0b842606e... |
296be306-d4c0-444a-bbfa-6d1e2575ea88 | anmolgera/Codeforces_Solutions | CodeForces/GNU C++17/735B | Urbanization/95622261.cpp | /* Author : <NAME>
NSIT 4th Year */
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define vi ... | ALGO | 0.999857 | 3.635447 | {
"github_metadata": {
"branch": "main",
"commit_count": 1267,
"repo_created_at": "2022-11-24T19:09:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b9919d8c... |
5eb1daf3-2f18-47b2-aa0e-19c54a816ee9 | gespo89/USACO | Section01.02/namenum/namenum.cpp | /*
ID: gespo891
PROG: namenum
LANG: C++11
*/
#include <fstream>
#include <string>
using namespace std;
int main() {
ifstream fin ("namenum.in");
ofstream fout ("namenum.out");
ifstream names ("dict.txt");
char nums[256] = {};
nums['A'] = nums['B'] = nums['C'] = '2';
nums['D'] = nums['E'] = nu... | ALGO | 0.999563 | 3.801214 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2015-04-06T16:52: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": "0f1cc42a7... |
36ccfad0-49d3-4bda-82ef-2f536b272fed | tafaB/problems | study/graph.cpp | #include <vector>
#include <queue>
using namespace std;
template <typename T> using min_heap = priority_queue<T, vector<T>, greater<T>>;
//bfs
void bfs(int start, vector<vector<int>> &g, vector<bool> &visited) {
queue<int> q;
q.push(start);
visited[start]=true;
while(!q.empty()) {
int u = q.front();
q.p... | ALGO | 0.999645 | 3.902488 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-10-14T15:45: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": "b0a4cbcba9d8... |
31020e9c-de2d-4eb7-b48a-63a4d344ef4d | ishandutta2007/codeforces-nonalphabetic | .tx/normal/958/A1.cpp | #ifndef CONTESTSMTH_HEADER_H
#define CONTESTSMTH_HEADER_H
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
template <typename K, typename V = __gnu_pbds::null_type>
using tree = __gnu_pbds::tree<K, V, less<K>, __gnu_pbds::rb_tree_tag, __gnu_pb... | ALGO | 0.999987 | 4.547482 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:49: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": "9d899b77ffff... |
b001b097-1833-4bd6-9d25-741bb5584c79 | Marwan-Mashaly/ICS3U-Unit4-05 | positive_add.cpp | // Copyright (c) 2019 St. <NAME> HS All rights reserved.
//
// Created by: <NAME>
// Created on: October 2019
// This program adds all positive numbers from the loop
#include <iostream>
#include <string>
int main() {
int counter = 0;
int totalNumber = 0;
std::string number;
int numCheck;
std::stri... | ALGO | 0.981758 | 3.852725 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-11-03T19:50:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f189a80008... |
3b085343-0263-4de0-8297-4a8d6208feb4 | swithun-liu/practice-leetcode | offer/_35.offer.cpp | #include "TreeNode.h"
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <unordered_set>
#include <unordered_map>
using namespace std;
class Node {
public:
int val;
Node *next;
Node *random;
Node(int _val) {
val = _val;
next = NULL;
rando... | ALGO | 0.989428 | 4.500068 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-03-01T08:09: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": "4a37e1c8587e... |
10926432-7738-4c8a-a735-e12bcd222ec1 | swpuzhang/algorithm | AVLTree/cpp/AVLTree/AVLTree.h | #pragma once
#include <iterator>
#include <vector>
#include <algorithm>
#include <functional>
#include <assert.h>
template <typename T>
struct TreeNode
{
TreeNode(const T& data) :
_data(data),
_height(0),
_balance(0),
_left(nullptr),
_right(nullptr),
_parent(nullptr)
{
}
T _data;
int _height;
int _... | ALGO | 0.998245 | 5.225748 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-03-08T09:37: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": "08c73f6436... |
31b50fbb-7bdd-446c-aa14-cba633a4a972 | Jackson2706/TA_IT3040 | Practice_2/Bai12.cpp | #include <iostream>
#include <vector>
using namespace std;
struct dict{
int key;
int value;
};
void swap(dict &source1, dict &source2){
int value, key;
key = source1.key;
value = source1.value;
source1.key = source2.key;
source1.value = source2.value;
source2.key = key;
source2.val... | ALGO | 0.999949 | 4.907509 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-09-24T05:28: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": "c8f8a504328... |
80b76c56-f825-442a-9797-78cb627e4b64 | suraj1611/Competitive_Programming | CP-Codes/cf_363c.cpp | /* Code by : Suraj (@suraj1611) */
#include<bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<n; i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define mx INT_MAX
#define mn INT_MIN
#define md 1000000007
#define pb push_back
#define mp make_pair
#define maxs... | ALGO | 0.999993 | 3.319746 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-02-13T16:34: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": "ad235d72e... |
5854629b-a67f-4105-a021-b36e67bdaae1 | AnumoyMurmu/pr0blem.solving.gfg.dsa | POTD/DeleteNodesHavingGreaterValueOnRight.cpp | // Given a singly linked list, remove all the nodes in the list which have any node on their right whose value is greater. (Not just immidiate Right , but entire List on the Right)
// Example 1:
// Input:
// LinkedList = 12->15->10->11->5->6->2->3
// Output: 15 11 6 3
// Explanation: Since, 12, 10, 5 and 2 are
// the... | ALGO | 0.999997 | 5.290233 | {
"github_metadata": {
"branch": "main",
"commit_count": 175,
"repo_created_at": "2023-08-26T17:08:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e61f35da8... |
1de847ee-7805-4a6d-a4a7-2e9a72e0e17e | jeetsavsani1173/LeetCode-Solution | Add two numbers represented by linked lists - GFG/add-two-numbers-represented-by-linked-lists.cpp | //{ Driver Code Starts
// driver
#include <bits/stdc++.h>
using namespace std;
/* Linked list Node */
struct Node {
int data;
struct Node* next;
Node(int x) {
data = x;
next = NULL;
}
};
struct Node* buildList(int size)
{
int val;
cin>> val;
Node* head = new Node(val)... | ALGO | 0.999809 | 5.894708 | {
"github_metadata": {
"branch": "main",
"commit_count": 2980,
"repo_created_at": "2022-06-26T12:08:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "422c7a16a... |
9adb0784-5af0-44f0-a83e-519ba852d47c | Gireeshsuresh/Arduino-Robotics | Bluetooth-Robot/Bluetooth_Controlled_Robot.ino | int lmt1=3,lmt2=5,rmt1=11,rmt2=6; //variables for motor terminals is declared
char value;
void setup()
{
Serial.begin(9600); //Serial communication starts
//Declaring motor terminals as output
pinMode(lmt1,OUTPUT);
pinMode(lmt2,OUTPUT);
pinMode(rmt1,OUTPUT);
pinMode(rmt2,OUTPUT);
}
void loop()
{... | ALGO | 0.985157 | 4.398816 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-09-30T22:40: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": "2995e88b96... |
fb412b20-54d2-43b1-ba40-d1577afefc84 | AirGuanZ/Rtrc | External/geometry-central/src/pointcloud/point_cloud_heat_solver.cpp | #include "geometrycentral/pointcloud/point_cloud_heat_solver.h"
namespace geometrycentral {
namespace pointcloud {
PointCloudHeatSolver::PointCloudHeatSolver(PointCloud& cloud_, PointPositionGeometry& geom_, double tCoef_)
: tCoef(tCoef_), cloud(cloud_), geom(geom_) {
// WARNING: these routines mix indexing ... | ALGO | 0.994651 | 6.386076 | {
"github_metadata": {
"branch": "main",
"commit_count": 634,
"repo_created_at": "2022-05-15T03:02:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94923ac57... |
83f2baac-aea2-4d76-975a-d78357d1df1c | Frostyume/PSO-LLSVM | CPP Code/main.cpp | #include "liblssvm.h" // MATLAB生成的库头文件
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <tuple>
using namespace std;
vector<double> calculateColumnMeans(const vector<vector<double>>& data) {
if (data.empty() || data[0].empty()) return {}; // 检查数据是否为空
size_t ... | DATA | 0.996976 | 6.265749 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-31T09:18: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": "2480c7e874f... |
44cb5a1b-403e-49cd-8482-ffbd543aa004 | Easoncer/swordoffer | sword_c++/滑动窗口的最大值.cpp | //
// Created by 李先生 on 2018/9/4.
//
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> maxInWindows(const vector<int>& num, unsigned int size)
{
vector<int> res;
vector<int> indexqueue;
if (num.empty() || size <= 0 || num.size() < size)
... | ALGO | 0.999988 | 5.634741 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2017-11-07T14:20: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": "711425a14... |
81e23562-0c4b-48da-a792-8586ba7992d5 | ksw1220/BOJ-Problem-Solving | 3055.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int R, C;
int answer = -1;
typedef struct POS
{
int x, y, t;
} pos;
vector<int> dx = {-1, 0, 1, 0};
vector<int> dy = {0, 1, 0, -1};
vector<pair<int, int>> water;
vector<vector<char>> map;
vector<vector<bool>> visited;
queue<POS> que;
void ... | ALGO | 0.999908 | 3.961024 | {
"github_metadata": {
"branch": "master",
"commit_count": 350,
"repo_created_at": "2018-09-14T17:55: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": "c17ac138... |
f047af19-3437-4b23-bf1f-ab5aef1cd444 | kythe/kythe | kythe/cxx/indexer/textproto/recordio_textparser.cc | /*
* Copyright 2023 The Kythe Authors. All rights reserved.
*
* 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 ap... | TOOL | 0.91299 | 7.745017 | {
"github_metadata": {
"branch": "master",
"commit_count": 5535,
"repo_created_at": "2015-01-13T05:39:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2019,
"forks": 264,
"issues": 232,
"pull_requests": 26
},
"file_meta": {
"content_id": "... |
da722ff4-c328-4209-b794-a345a40c6892 | shub-coder/DSA | sort/QuickSort.cpp | #include<bits/stdc++.h>
using namespace std;
int Lomuto_Partition(int arr[], int start, int end){
int pivot = arr[end];
int s = start-1;
for(int p = start; p<=end-1; p++){
if(arr[p]<pivot){
s++;
swap(arr[s], arr[p]);
}
}
swap(arr[s+1], arr[end]);
return (... | ALGO | 0.999976 | 5.27169 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2021-06-16T04:55:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8fbf66437e... |
846792ed-05ad-4d48-a3ae-99f9cc26ba3a | syw2045/Coding-Test | BOJ/4963.cpp | #include <iostream>
#include <vector>
#define MAX 51
using namespace std;
int result[MAX][MAX];
bool visited[MAX][MAX];
vector<int> v;
int island;
int w, h;
int dx[8] = { -1, -1, -1, 0, 0, 1, 1, 1 }; // 대각선까지 포함
int dy[8] = { -1, 0, 1, 1, -1, -1, 0, 1 };
void DFS(int x, int y)
{
visited[x][y] = true;
island++;
... | ALGO | 0.999729 | 4.240722 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2022-09-13T05:29: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": "76acb9886f4... |
30f0ece9-21e3-4e40-a323-cbb3f0aa6a3f | Silver439/SimpleCNN | main.cpp | #include"head.h"
using namespace std;
using namespace cv;
extern conv_param conv_params[3];
extern fc_param fc_params[1];
float* mat_1d(Mat&);
float* conv_relu(int, int, int, float*, conv_param&);
float* maxpool(int, int, int, float*);
void geem(float*);
float* quick_conv_relu(int cha, int row, int col, float* inp, ... | DATA | 0.99769 | 3.131086 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2020-12-24T14:39: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": "b8253e3e2c0... |
8cc646cd-e595-4583-bfac-a609dedf572b | katharinazwick/Programmiertechnik-2 | ex3-sorting/src/sorting.h | #pragma once
#ifndef SORTING_H
#define SORTING_H
class Comparator
{
public:
virtual int compare(int data[], int x, int y); //change to virtual ==> überschreiben möglich
};
class CountingComparator
{
protected:
Comparator ∁
int counter;
public:
void resetCounter();
int getCounter() const;
in... | ALGO | 0.997609 | 5.571666 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-06-26T11:17:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73535dfdbf44... |
726884c3-4bd9-4b83-93a6-66d5c932dda4 | senju1507/AnToanBaoMatThongTin-BtLab1 | lab1.1_NguyenVanTan.cpp | #include <cmath>
#include <string>
#include <map>
#include <iostream>
using namespace std;
double calculate_entropy(const string& text) {
map<char, int> freq;
// Ð?m t?n su?t xu?t hi?n c?a t?ng k? t?
for (size_t i = 0; i < text.size(); ++i) {
char c = text[i];
freq[c]++;
}
doubl... | ALGO | 0.997127 | 4.45891 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-15T04:11:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1da144d1fa2... |
e87cf151-9b15-41ae-a906-c2f089409b3f | biswass101/Phitron_DATA_STUCTURE | Module-15(Stack-queue Problem Solving)/valid_parenthesis.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution1 {
public:
bool isValid(string s) {
stack<char> st;
for(int i = 0; i < s.size(); i++)
{
if(!st.empty())
{
if(s[i] == ')')
{
if(st.top() == '(') st.pop();
... | ALGO | 0.997307 | 5.881935 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-06-09T05:34: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": "c124fe835da... |
17614f4e-0bb5-4ae2-ac5a-0253a1f097cb | HnpawsPham/CP-PROBLEMS | J4F/THREE.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define el "\n"
int m;
ll n;
const int maxn = (int)1e6 + 5;
bool nprime[maxn];
void sieve(){
for(int i = 2; i * i < maxn; i++)
if(!nprime[i])
for(int j = i + i; j < maxn; j+=i) nprime[j] = 1;
return;
}
bool check(ll x){
... | ALGO | 0.999863 | 4.258796 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2024-07-14T14:00: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": "511ec9ddd8... |
502e5dbf-891a-47e6-91a7-41583a56fcdd | kpspablo/cpeprogla2-e21 | collatz.cpp | //pablo
#include<iostream>
#include<fstream>
using namespace std;
main(){
ifstream input("input.txt");
int num1,num2, n, count;
while( input >> num1 >> num2){
if((num1 > 0 && num1 < 1000000) && (num2 > 0 && num2 < 1000000)){
int max(0), a = num1, b = num2;
if(num1 > num2){
a=num2;
... | ALGO | 0.999822 | 3.552993 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2016-09-10T01:32: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": "d107065ef... |
7409eac8-2b96-4031-a76f-8fbbe5a71882 | Akrobatik/ps | BaekJoon/18000/18352.cpp | // Title : 특정 거리의 도시 찾기
// Link : https://www.acmicpc.net/problem/18352
// Time : 332 ms
// Memory: 21608 KB
#include <bits/stdc++.h>
using namespace std;
bool visited[300001];
vector<int> edges[300001];
int ans[300000];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m, k, x;
cin >> n... | ALGO | 0.999981 | 4.158364 | {
"github_metadata": {
"branch": "main",
"commit_count": 2030,
"repo_created_at": "2025-01-18T13:13:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3f9bc8d3... |
d8d836bc-6d80-4909-9d4f-ae0b02a66398 | tonykhoapro/Metroid | Framework/GameFramework/GameComponent/SimulatePhysics.cpp | #include "SimulatePhysics.h"
#include "GameFramework\GameObject\GameObject.h"
SimulatePhysics::SimulatePhysics(const Vec2& bodySize, const Vec2& velocity) :
bodySize(bodySize),
bodyRect(RectF(0, 0, 0, 0)),
velocity(velocity),
normal(Vec2(0, 0)),
isTrigger(false),
mass(1.0f),
isStatic(true)
{
}
SimulatePhysics:... | ALGO | 0.977691 | 5.367679 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-01-20T12:56:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3871a2912e... |
94aba6e6-2d19-45b6-8878-296b8d2a2aa5 | dleopold/optimTFE | src/perimeter.cpp | #include <Rcpp.h>
using namespace Rcpp;
//' Compute perimeters for many subsets in C++
//' @param subsets list of integer vectors of polygon-IDs
//' @param keyPolygonIds list of integer vectors (per segment)
//' @param lengths numeric vector of segment lengths
//' @param Pmax integer maximum polygon ID
//' @return num... | ALGO | 0.969682 | 5.013348 | {
"github_metadata": {
"branch": "main",
"commit_count": 199,
"repo_created_at": "2024-12-26T21:35:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4a870e80c... |
83c68a11-8d2b-42f1-b76c-f845ed8f3ca1 | sujal-aggarwal/LeetCode-Solutions | 0273-integer-to-english-words/0273-integer-to-english-words.cpp | class Solution {
public:
unordered_map<int, string> name = {
{1, "One"}, {2, "Two"}, {3, "Three"}, {4, "Four"}, {5, "Five"},
{6, "Six"}, {7, "Seven"}, {8, "Eight"}, {9, "Nine"}, {10, "Ten"},
{11, "Eleven"}, {12, "Twelve"}, {13, "Thirteen"}, {14, "Fourteen"},
{15, "Fifteen"}, {16, "Si... | ALGO | 0.99885 | 6.037685 | {
"github_metadata": {
"branch": "main",
"commit_count": 1837,
"repo_created_at": "2023-01-30T17:51: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": "a444707b0... |
826459fa-c9a7-4260-9218-2e6ad9660432 | josiahcollmer/Portfolio | CS 162 Assignment 5, Recursion and Linked Lists/linked_list/linked_list.cpp | /*********************************************************************
** Program Filename:linked_list
** Author:<NAME>
** Date:12/10/23
** Description:manipulate a linked list.
** Input:values and indexes for given manipulations
** Output:values inserted, removed, and sorted in linked list
****************************... | ALGO | 0.999395 | 5.131026 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-12-21T23:33:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "107093e90e18... |
b2c75616-96b5-4546-9e57-32078df1060b | vllm-project/vllm | csrc/cpu/pos_encoding.cpp |
#include "cpu_types.hpp"
namespace {
template <typename scalar_t>
void rotary_embedding_impl(
const int64_t* __restrict__ positions, // [batch_size, seq_len] or
// [num_tokens]
scalar_t* __restrict__ query, /// [batch_size, seq_len, num_heads,
... | ALGO | 0.960704 | 7.493759 | {
"github_metadata": {
"branch": "main",
"commit_count": 7842,
"repo_created_at": "2023-02-09T11:23:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 52761,
"forks": 8817,
"issues": 1824,
"pull_requests": 832
},
"file_meta": {
"content_id":... |
d3d4fc58-75ed-4a8c-a6b6-89c8ba5652b5 | ySalaun/LineSfM | third_party/arpack++/include/arbsmat.h | /*
ARPACK++ v1.2 2/20/2000
c++ interface to ARPACK code.
MODULE ARBSMat.h.
Arpack++ class ARbdSymMatrix definition.
ARPACK Authors
<NAME>
<NAME>
<NAME>
Dept. of Computational & Applied Mathematics
Rice University
Houston, Texas
*/
#include "arbspen.h"
#ifndef ARBS... | ALGO | 0.994258 | 6.248308 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-03-20T07:52:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 46,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e20ac... |
5ff903bd-60fd-4081-97d2-242a0bb14b95 | iridescent2836/LeetCode | 212.cpp | #include "header.h"
// to much time, but correct
class Solution {
public:
bool helper(vector<vector<char>>& board,vector<vector<bool>>& visited, string & word, int i, int j ,int& idx ){
if(!visited[i][j] && board[i][j] == word[idx]){
idx++;
if(idx == word.size()) return true;
... | ALGO | 0.999938 | 5.773371 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2025-02-22T03:13: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": "c0d081c2c43... |
6bcddd43-d5dd-4a50-a328-9385dadb5314 | gabriel88766/C-CPP-AlgorithmsAndContests | At-Coder/Regular/201/A.cpp | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
const ll INF_LL = 0x3f3f3f3f3f3f3f3f, MOD = 998244353; //1e9+7
const int INF_INT = 0x3f3f3f3f;
const long double PI = acosl(-1.), EPS = 1e-9;
using namespace std;
//cout << fixed << setprecision(6)
int main(){
ios_base::sync_wi... | ALGO | 0.999984 | 5.267893 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2020-08-21T00:21: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": "a72e287d... |
86062ca8-0fc8-4a7d-bb6a-dbf003315ab0 | mwiesenberger/solvers | blob/toefl.h | #pragma once
#include <exception>
#include "dg/algorithm.h"
#include "parameters.h"
namespace toefl
{
template< class Geometry, class Matrix, class Container >
struct Explicit
{
Explicit( const Geometry& g, const Parameters& p );
const Container& phi(unsigned i ) const { return m_phi[i];}
const Contain... | ALGO | 0.999721 | 6.105635 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2022-10-06T12:16:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54aa82ea595... |
390749ad-44cf-44f7-8ac9-a514151e0318 | ARUNREDDY1777/operating-system | os exe-37.cpp | #include <stdio.h>
#include <stdlib.h>
#define TOTAL_REQUESTS 10 // Total number of disk requests
// Function to calculate the total head movement for FCFS
int calculateTotalHeadMovement(int requests[], int headPosition) {
int totalHeadMovement = 0;
for (int i = 0; i < TOTAL_REQUESTS; ++i) {
totalHead... | ALGO | 0.999931 | 6.335187 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-11-27T04:18: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": "e9cdf948648c... |
bd1ee786-680d-4b54-8cc9-fbd2cf4f3f12 | marglvn/Data-Structures | PalindromeRecursion.cpp | /*
A palindrome is any word, phrase, or sentence that reads the same forward and backward.
Design a function that uses recursion to determine if a string argument is a palindrome.The function should return true
if the argument reads the same forward and backward.Demonstrate that the function works in a program.For thi... | ALGO | 0.999437 | 6.362898 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-02-27T03:17: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": "e2276dedd88... |
1befea29-86f5-4b8c-bcca-c999dddcd4d9 | kg1992/CppAlgorithms | src/Program3.8.cc | // Program 3.8 Closest-point computation
//
// This program illustrates the use of an array of structures, and is representative of the typical situation
// where we save items in an array to precess them later, during some computation. It counts the number of
// pairs of N randomly generated points in the unit square ... | ALGO | 0.999504 | 5.419744 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-05-18T13:33: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": "2d4726f748... |
f796ab27-d49b-4503-89de-9e429ebaf4ba | DollarAkshay/C-and-CPP-Programs | 3rd Semester Programs/Stack_using_Linked_List.cpp | #include <stdio.h>
#include <stdlib.h>
#include <process.h>
#include <conio.h>
struct node {
int data;
struct node *link;
};
typedef struct node* NODE;
NODE getNewNode(){
NODE temp = (NODE)malloc(sizeof(struct node));
if (temp == NULL){
printf("Insufficient Memory");
exit(0);
}
return temp;
}
NODE push(... | ALGO | 0.993895 | 3.445954 | {
"github_metadata": {
"branch": "master",
"commit_count": 666,
"repo_created_at": "2014-02-07T06:31:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 53,
"forks": 61,
"issues": 2,
"pull_requests": 2
},
"file_meta": {
"content_id": "34aece... |
8e7e112e-908e-4baf-8c1d-0b31e73dbf91 | Nandani-koli/Striver-SDEsheet-Challange | Day-31/flattenBT.cpp | /*
You are given a binary tree consisting of integer values. Your task is to convert the given binary tree into a linked list where the nodes of the linked list follow the same order as the pre-order traversal of the given binary tree.
Note:
Use the right pointer of the binary tree as the “next” pointer for the linked... | ALGO | 0.999999 | 5.746092 | {
"github_metadata": {
"branch": "main",
"commit_count": 184,
"repo_created_at": "2022-06-06T08:40: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": "c1d710a843... |
fcea694a-2c7b-47d1-be38-e301117d8c2a | cesarcerbino/cpp_practices | unidad3/ejs/ej3/main.cpp | // * Dado un archivo que contienen una serie de números enteros, obtener a partir
// * de él dos archivos. En el primero solo habrá números pares, y en el segundo
// * solo impares.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream archivo;
ofstream archivoimp, archivopar;
... | TOOL | 0.987505 | 4.272556 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-06-09T01: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": "e4d87d4c3aed... |
59f90dd9-c1ac-4629-bbe0-de4533c5a1a8 | simone-silvestri/CudaNavierStokes | postproc/post.cpp | #include <iostream>
#include <vector>
#include <math.h>
#include <cmath>
#include <algorithm>
#include "mpi.h"
#include "../src_multiGPU/globals.h"
#include "../src_multiGPU/comm.h"
using namespace std;
double dt;
double dx,dxv[mx_tot],x[mx_tot],xp[mx_tot],xpp[mx_tot],y[my_tot],z[mz_tot];
double r[mx*my*mz];
double... | ALGO | 0.999816 | 4.40613 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2021-03-15T18:58:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "a9dc119ce3... |
9ff9946d-89c4-45da-be89-f5e64d3b9b44 | bfrmtx/MTHotel | hdf5/ffts/main_o.cpp |
#include <QCoreApplication>
#include <complex>
#include <iostream>
#include <valarray>
#include <QFile>
#include <QFileInfo>
#include <QTextStream>
#include <QTime>
#include <QDebug>
#include <functional>
#include "FFTReal.h"
#include "FFTRealFixLen.h"
#include <fftw3.h>
using namespace std;
//using namespace fff... | ALGO | 0.913973 | 4.36068 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2022-05-06T08:11:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "881abc5af69... |
1525c445-0c7c-4f7f-9a01-b810d74bf077 | yooniversal/PS | BOJ/SegmentTree/10277.cpp | //10277
#include <bits/stdc++.h>
using namespace std;
#define INF 1000000001
#define MAX 4587525
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vii;
typedef pair<int, int> ii;
class lazySeg {
private:
vi mintree, maxtree, minlazy, maxlazy;
void MI... | ALGO | 0.999764 | 4.763047 | {
"github_metadata": {
"branch": "master",
"commit_count": 664,
"repo_created_at": "2020-04-24T15:46:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b957404... |
a9e38588-b425-48b2-9f34-baf2dfa58b07 | GMNazmul55/XPSC | Week9/day6/A_Avoiding_Zero.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long int
#define all(v) v.begin(), v.end()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
void solve(){
int n;
cin >> n;
vector<ll> a(n);
ll total = 0;
for (int i = 0; i < n;... | ALGO | 0.999955 | 3.738044 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2023-06-19T17:49:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe0b762d93d... |
f4a5911d-c4fb-4a06-9c9a-8dc43159ed00 | anesin/ctci | Chapter 05 Bit Manipulation/Question 05/C++/Q-05-05.cpp | // Q-05-05.cpp
// Write a function to determine the number of bits required to convert
// integer A to integer B.
//
// EXAMPLE
// Input: 31, 14
// Output: 2
//
#include "stdafx.h"
#include <iostream>
using namespace std;
// Time Complexity: O(N)
// Space Complexity: O(1)
int count_bit(int n)
{
int i = 0... | ALGO | 0.999614 | 5.883181 | {
"github_metadata": {
"branch": "master",
"commit_count": 224,
"repo_created_at": "2017-03-15T08:16:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad28b5f9... |
7ae12edf-fbe7-47fc-b56d-a103049854a6 | crimson000000/OIcode | luogu/1337.cpp | #define LOCAL
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
inline int read()
{
int x = 0, f = 1;
char ch = getchar();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = -1;
... | ALGO | 0.999974 | 4.031338 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-07-06T06:03:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8307d0ee32... |
b4495f25-a1fc-4c04-b9b0-d8b35cda3398 | yangzq08/leetcode | mergeSortList.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *sortList(ListNode *head) {
// special case
if(head == NULL) return NULL;
if(head->next == NULL) re... | ALGO | 0.999999 | 5.549003 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2014-08-20T04:30: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": "51acaadd8c... |
6d963d27-ae70-42c0-b53e-1031ecd678b3 | GraceeeQ/map | src/my_sort.hpp | //
// Created by qiuyuhang on 24-4-11.
//
#ifndef MAP_MY_SORT_HPP
#define MAP_MY_SORT_HPP
#include <iterator>
#include <algorithm>
#include <type_traits>
#include "map.hpp"
#include <cassert>
// sjtu::map<int, int>::iterator::operator +(int n) const;
namespace sjtu {
template<typename _Tp>
static constexpr b... | ALGO | 0.976376 | 4.688211 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-04-10T02:15: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": "1e3261fa0e... |
536389d0-70e6-46ca-803c-98ffb0c9f751 | OpenChemistry/avogadrolibs | thirdparty/cppoptlib/solver/newtondescentsolver.h | // CppNumericalSolver
#include <iostream>
#include <Eigen/LU>
#include "isolver.h"
#include "../linesearch/armijo.h"
#ifndef NEWTONDESCENTSOLVER_H_
#define NEWTONDESCENTSOLVER_H_
namespace cppoptlib {
template<typename ProblemType>
class NewtonDescentSolver : public ISolver<ProblemType, 2> {
public:
using Supe... | ALGO | 0.999888 | 6.132884 | {
"github_metadata": {
"branch": "master",
"commit_count": 6367,
"repo_created_at": "2012-04-28T18:56:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 539,
"forks": 199,
"issues": 115,
"pull_requests": 22
},
"file_meta": {
"content_id": "5... |
5b3e6490-8839-4959-96d4-3ae511878548 | sash7410/coding | c++/Odd_sum.cpp | #include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll unsigned long long int
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define ss(s) scanf("%s",s)
#define pi(x) printf("%d\n",x)
... | ALGO | 0.999976 | 3.864134 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2020-09-27T22:08:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a736827d4... |
f7354e8c-6b7f-4d88-9b1f-ec173f81d682 | dowobeha/multialign | src/align.c++ | #include <iostream>
#include <cstdlib>
#include <vector>
#include <fstream>
#include <regex>
#include <cmath>
#include <utility>
#include "util.h"
#include "Coordinate.h++"
#include "Coordinates.h++"
#include "Cost.h++"
#include "DynamicProgrammingTable.h++"
#include "Dimensions.h++"
#include "Europarl.h++"
using st... | TOOL | 0.956062 | 4.100302 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2016-01-21T13:41:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f9e90aab4... |
ee417cf5-621d-40ba-a65b-34da9af7b623 | prathprabhudesai/Panaromic-Image-Stitching-SIFT | src/main.cpp | #include <iostream>
#include <stdlib.h>
#include <ifs.h>
#include <flip.h>
#include <math.h>
using namespace std;
#define PI 3.1416
#define MAX(X, Y) (((X) > (Y)) ? (X) : (Y))
#define MIN(X, Y) (((X) > (Y)) ? (Y) : (X))
#define ISODD(X) ((X%2) ? (X) : (X+1))
// Function Prototypes
float ** create_kernel(float sigma... | ALGO | 0.989775 | 4.170339 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-07-22T06:53:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2584bf05db... |
3a228484-9bb6-4700-b6bd-3a794e3c4a43 | DenBy1726/ModelingFramework | StudyModule/Statistic.cpp | #include "Statistic.h"
namespace Statistic
{
StatisticTable::StatisticTable(int ammountOF)
{
StateTable.resize(ammountOF);
WorkTable.resize(ammountOF);
}
void StatisticTable::Register(Model::Node* node, Model::Transact* haveEntered, const int& time)
{
OnEnter(node, time);
haveEntered->Cell = WorkTable[nod... | ALGO | 0.951482 | 3.248358 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-11-30T13:49: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": "f492eadb50... |
f2932d2d-47b4-4880-a2eb-9e88fea8272d | EnnSou/ooss-paddle2.3 | paddle/fluid/operators/math/matrix_solve.cc | /* Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
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 applicable law or... | ALGO | 0.992717 | 6.915879 | {
"github_metadata": {
"branch": "air",
"commit_count": 35433,
"repo_created_at": "2022-07-29T08:29:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddcd1b13b... |
cf49d0e1-01b3-4d7e-b23b-995630d11314 | dmnunez1993/fractal_bitmap_creator | src/FractalBitmap.cpp | #pragma once
#include <cstdint>
#include <iostream>
#include <math.h>
#include <memory>
#include <FractalBitmap.h>
#include <Mandelbrot.h>
namespace bitmap {
FractalBitmap::FractalBitmap(int width, int height): Bitmap::Bitmap(width, height),
histogram_((new in... | TOOL | 0.921239 | 5.455647 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-12-14T11:08:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "436cf175b6... |
0e061a8d-e6d9-4060-8193-730d17018859 | NaikTanaya/LeetCode-75-solved | DP - Multidimensional/Edit Distance.cpp | class Solution {
public:
int helper(string &word1, string &word2, int i, int j, vector<vector<int>> &dp){
//Base case...
if(i >= word1.length())
//word1 ki length choti h word2 ki length se...
return word2.length() - j;
if(j >= word2.length())
//word2 k... | ALGO | 0.999987 | 6.03336 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2023-12-21T17: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": "4c6274fd243... |
7625a36e-2d3d-48d2-acd1-86251e87a7c4 | steveleong25/BMCS3003-Multi-Commodity-TFS | Old-CUDA-TFS/CUDA-TFS/PathFinder.cpp | #include <vector>
#include <string>
#include <queue>
#include <limits>
#include <utility>
#include <algorithm>
#include <iostream>
#include <unordered_map>
#include "NetworkGraph.hpp"
const int INF = std::numeric_limits<int>::max();
using namespace std;
// Dijkstra's algorithm to find the shortest path
std::vector<s... | ALGO | 0.999909 | 5.9207 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2024-12-08T09:44: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": "58394bf9f82... |
2965cd8a-c24d-4a28-8e93-c11a0eb25d4e | noko206/AtCoder | edpc/i.cpp | #include <bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _REP(i,n) REPI(i,0,n)
#define REPI(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,REPI,_REP,)(__VA_ARGS__)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
typedef... | ALGO | 0.999945 | 4.490364 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2023-05-21T12:02: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": "7d0bff9fe4... |
9559c06f-5808-4a16-a5b8-335e89716e8d | jungahshin/algorithm | c:c++/15685_review.cpp | //드래곤 커브 복습
#include <iostream>
#include <vector>
using namespace std;
int n, x, y, d, g;
vector<pair<pair<int, int>, pair<int, int>>> curve;
int a[102][102] = {0, };
vector<int> dir[22];//각 드래곤커브 마다 방향 축적된 것 저장
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, -1, 0, 1};
//0(오), 1(위), 2(왼), 3(아래)
void go(){
for(int i=... | ALGO | 0.999431 | 3.932393 | {
"github_metadata": {
"branch": "master",
"commit_count": 645,
"repo_created_at": "2019-07-26T10:26:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1c0949f... |
e24e8908-dad2-4e71-b796-6683a5012805 | Vaa3D/vaa3d_tools | released_plugins/v3d_plugins/bigneuron_siqi_stalker_v3d/lib/ITK_include/itkQuadricDecimationQuadEdgeMeshFilter.h | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... | ALGO | 0.995502 | 6.443259 | {
"github_metadata": {
"branch": "master",
"commit_count": 7983,
"repo_created_at": "2016-01-27T18:19:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 110,
"forks": 70,
"issues": 11,
"pull_requests": 12
},
"file_meta": {
"content_id": "165... |
bcfb295d-e31d-4fdd-975a-cc63b42a3a5f | deepakantony/competitive_programming | hacker_rank/interview_street/NonTimedChallenges/SearchProblems/XorKey.cxx | // XOR key
//
// Xorq has invented an encryption algorithm which uses bitwise XOR
// operations extensively. This encryption algorithm uses a sequence of
// non-negative integers x1, x2, ... xn as key. To implement this algorithm
// efficiently, Xorq needs to find maximum value for (a xor xj) for given
// intege... | ALGO | 0.998968 | 5.446993 | {
"github_metadata": {
"branch": "master",
"commit_count": 785,
"repo_created_at": "2011-12-16T19:45:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38fd12a9... |
8f895a42-39ee-4774-bc9e-ba4f1043b5ff | RitaRublevskaya06/1kurs_labs | KPO/KPO_LAB_03/DOP/main.cpp | #include<iostream>
using namespace std;
int daysBetweenDates(int day1, int month1, int year1, int day2, int month2, int year2) {
int daysInMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
int days1 = day1;
for (int i = 0; i < month1 - 1; i++) {
days1 += daysInMonth[i];
}
days1... | ALGO | 0.999851 | 4.293291 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2024-08-06T15:08: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": "f37ab0356d6... |
8ab13567-c052-42e5-90ed-34de59a36e2a | ishandutta2007/codeforces-c | chelly/normal/707/D.cpp | #include<cstring>
#include<cstdio>
#include<algorithm>
#include<bitset>
#include<iostream>
#include<vector>
using namespace std;
const int Q(111111);
const int M(1111);
vector<pair<int, int> > q;
vector<int> adj[Q];
int n, m;
bitset<M> bt[M];
bitset<M> bak[Q];
int fa[Q], ans[Q];
struct Oper {
int tp, i, j;
Oper(int t... | ALGO | 0.999651 | 3.866468 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "662f4e5857b5... |
321c7670-9982-4ac1-91a0-26ea34ff5463 | mazbox/ofxmarek | mareklib/audio/effects/BitCrusher.h | /*
* BitCrusher.h
* Thumper-iPhone
*
* Created by <NAME> on 12/07/2009.
* Copyright 2009 __MyCompanyName__. All rights reserved.
*
*/
#define MULTIPLIER 32767.f
#ifndef ABS
#define ABS(x) (((x) < 0) ? -(x) : (x))
#endif
class BitCrusher {
public:
BitCrusher() {
shift = 0;
out = 0;
k = 0;
distortio... | ALGO | 0.982701 | 5.26746 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2011-01-07T11:56:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6c06d64... |
cb0af064-88f8-4f26-8c86-e1f789486730 | solve-boj/weekly-challenges | 2021W30/B0neh3ad/boj_1991.cpp | /*
트리 순회
https://www.acmicpc.net/problem/1991
*/
#include <iostream>
#include <vector>
using namespace std;
class Tree{
public:
int tsize;
vector<int> parent;
vector<int> lchild;
vector<int> rchild;
Tree():tsize(0) {}
Tree(int n):tsize(n){
parent.resize(n, -1);
lchild.r... | ALGO | 0.999983 | 4.158757 | {
"github_metadata": {
"branch": "master",
"commit_count": 525,
"repo_created_at": "2021-01-23T13:12:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdfeab1a2... |
821d285a-752f-46e9-84b8-3bdcb7b2156c | tlsdba/CodeTraining | Wangyi1209/Wangyi1209.cpp | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int constantTeamNum = 16;
vector<int> idx_vec(constantTeamNum, -1);
int idx_ = 0;
int checkState(vector<int>& label)
{
int s = 0;
for (int i = 0; i < constantTeamNum; i++)
{
s += label[i];
}
if (s == constantTeamNum)
return 1;
else
... | ALGO | 0.999857 | 4.634139 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-12-12T06:07: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": "2a0e9c62e1... |
064a8011-23ad-48be-b0be-b3b82e757379 | xvisox/mimuw-assignments | asd/Playground/EgzaminPP2021/Sortowanie.cpp | #include <bits/stdc++.h>
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0)
#define ll long long
#define endl '\n'
using namespace std;
constexpr int base = 1 << 18;
int t[base << 1], lazy[base << 1];
void push(int v) {
if (lazy[v] == 0) return;
if (lazy[v] > 0) {
t[v * 2] = la... | ALGO | 0.999975 | 4.73341 | {
"github_metadata": {
"branch": "master",
"commit_count": 550,
"repo_created_at": "2022-07-28T15:43: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": "aac2956c... |
75bc9223-4cbf-4811-9052-d1549261ca6e | DawnCoody/Algorithm | 1.基础篇/三、优化算法的基本技巧/信息数字化/成绩预测.cpp | /**
* 三位老师对某次数学竞赛进行了预测。他们的预测如下。
* 甲:学生 A 得第一名,学生 B 得第三名
* 乙:学生 C 得第一名,学生 D 得第四名
* 丙:学生 D 得第二名,学生 A 得第三名
*/
/*问题分析:
* 用数 1,2,3,4 分别代表学生 a,b,c,d 获得的名次,试编程输出 a,b,c,d 就可以利用三重循环来解决了
*/
#include <iostream>
using namespace std;
int main() {
for (int a = 1; a <= 4; a++)
for (int b = 1; b <= 4; b++)
... | ALGO | 0.999925 | 3.321588 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-09-13T02:00: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": "89b7c293930... |
b7b36d96-958d-42a8-b8f4-261b107ffce1 | NVIDIA/cuda-samples | Samples/4_CUDA_Libraries/conjugateGradientUM/main.cpp | /* Copyright (c) 2022, NVIDIA CORPORATION. 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 retain the above copyright
* notice, this list of condi... | ALGO | 0.999819 | 4.226378 | {
"github_metadata": {
"branch": "master",
"commit_count": 376,
"repo_created_at": "2018-03-27T17:36:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7763,
"forks": 2076,
"issues": 55,
"pull_requests": 29
},
"file_meta": {
"content_id": "8... |
639026f2-8959-416d-bbf9-5e5daa60dcbb | dwijrajhari/Crystal-Pole-Figure | Win64/m3d_crystals.cpp | #include <M3D\m3d_crystals.h>
constexpr auto eps = 1e-7;
# define feq2(A, B) (glm::abs((A)-(B)) < eps)
# define fneq2(A, B) (!feq2(A, B))
# define feq3(A, B, C) (feq2(A, B) && feq2(B, C))
Lattice::Lattice()
:a(1.0f), b(1.0f), c(1.0f), alpha(90.0f), beta(90.0f), gamma(90.0f) {
fGenerateBasis();
fGenerateLatticeSyst... | ALGO | 0.921442 | 5.989268 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-07T17:49:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0336997a4024... |
924539d8-8bd6-4f11-9da4-c783d42c2bcf | ananyaSingh5040/PEP | singly_linkedlist.cpp | #include <iostream>
using namespace std;
class LinkedListNode
{
// LinkedListNode class datatype ka pointer to store address of next node.
public:
int data;
LinkedListNode *next;
// Constructor to assign values.
LinkedListNode(int value)
{
data = value;
next = NULL;
}
};
v... | ALGO | 0.9999 | 3.748088 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2025-01-22T19:18: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": "91dd6bba9... |
e1a3b0a1-0cb1-40ce-8c28-03b9689b54ba | impolska742/leetcode-practice | my-folder/problems/minimum_moves_to_reach_target_score/solution.cpp | class Solution {
public:
int minMoves(int target, int maxDoubles) {
int ans = 0;
// cout << target << " : " << ans << endl;
while(target > 1 and maxDoubles >= 1) {
if(target % 2 != 0) {
target--;
target /= 2;
ans += 2;
... | ALGO | 0.999709 | 5.10368 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2022-03-02T20:05: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": "9afd5d97... |
be420a83-a88c-42ae-bb9b-5b793c13a546 | sarafanshul/Bible | library/Methods/Graphs/longest-path-dag.cpp | /// DOES NOT WORK FOR NEGATIVE WEIGHTS
// Solution to finding the shortest (and longest) path on a Directed Acyclic Graph (DAG) using a topological sort in combination with dynamic programming
// for longest path
// 1) reverse all the edge-distances (a = a*(-1) )
// 2) find the shortest path
// 3) reverse the disa... | ALGO | 0.999853 | 4.039082 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2020-07-16T12:09:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a186ee48e... |
b9cbcd81-5141-47e7-bd0d-a0ec75a4c1e1 | erik808/ProjectEuler | 49/main.cc | #include <iostream>
#include "../primes/primes.h"
#include <vector>
#include <array>
using namespace std;
vector<size_t> digitToVector(size_t number);
array<size_t, 10> digitMap(vector<size_t> &digit);
void printVec(vector<size_t> vec);
size_t const maxbound = 10000;
int main()
{
Primes P(maxbound);
vector<size_t>... | ALGO | 0.999731 | 3.713526 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2016-02-25T18:15: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": "d1048e241... |
cbc599f9-14a7-4480-a354-0e9915887602 | AkashSingh3031/The-Complete-FAANG-Preparation | 1]. DSA + CP/2]. Competitive Programming/03]. LeetCode/1]. Problems/C++/0010]. Regular Expression Matching.cpp | /*
Example 1:
Input: s = "aa", p = "a"
Output: false
Explanation: "a" does not match the entire string "aa".
Example 2:
Input: s = "aa", p = "a*"
Output: true
Explanation: '*' means zero or more of the preceding element, 'a'. Therefore, by repeating 'a' once, it becomes "aa".
Example 3:
Input: s =... | ALGO | 0.999825 | 5.810027 | {
"github_metadata": {
"branch": "master",
"commit_count": 1827,
"repo_created_at": "2021-05-29T04:41:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11343,
"forks": 2526,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
d6863c47-8401-40ad-815a-2b9147da7e0f | simonnguyen175/cp-repo | daily/thayvong/extra/co_ban/buoi_31/CheckMonoSeq.cpp | #include<bits/stdc++.h>
#define FASTio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define simon "CheckMonoSeq"
using namespace std;
const int N = 1e2 + 5;
int t, n, a[N], b[N];
bool check(){
for (int i = 1; i <= n; i ++)
b[i] = a[i];
sort(b+1, b+1+n);
int cnt, tmp = 0;
for (int i = ... | ALGO | 0.999736 | 3.452261 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-16T14:21: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": "4e2c3ce5a8... |
4df1bbb8-2e99-46f5-a7a7-dd90281eb727 | whdgur9121/CodeTree_PS | 25_2월말_코드트리 코딩캠프/5일차/바구니 안의 사탕 2/candy-in-the-basket-2.cpp | #include <iostream>
using namespace std;
//1차원 직선, N개의 바구니
//바구니 안에는 사탕
// 중심점 C를 잡아 [c -k, c+k 구간에 있는 사탕 수 최대]
//input
//N과 K
//N개의 줄에 걸쳐 바구니 좌표, 사탕 개수
int main() {
int N, K;
cin >> N >> K;
int arr[501];
for(int i = 0; i<501; i++) {
arr[i] = 0;
}
int candy = 0;
int index = 0;... | ALGO | 0.999976 | 4.266612 | {
"github_metadata": {
"branch": "main",
"commit_count": 609,
"repo_created_at": "2025-01-31T06:34: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": "52a045e621... |
af0c4c9c-d5e4-4fa3-836c-fe1218971268 | JoaoFurlanCosta/Linguagem-de-Programa-o---Faculdade | Exercicios/AgendaDeContato/AgendadeContato.cpp | #include <iostream>
#include <string>
#include <vector>
#include <limits>
using namespace std;
class Contato {
public:
string nome;
string telefone;
string email;
Contato(string n, string t, string e) : nome(n), telefone(t), email(e) {}
};
void limparBuffer() {
cin.ignore(numeric_limits<streamsi... | TOOL | 0.991674 | 6.461195 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2025-06-12T13:17: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": "9364b0621... |
67114c12-010b-4934-911a-5fb2e2f753be | saarang123/Competitive-Programming | codeforces/792D.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// ----------------------------------------Defines and Template-------------------------------------//
#define ll long long
#define double long double
#define f first
#... | ALGO | 0.99986 | 4.145206 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2021-05-13T07:29:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9aa89614... |
801b14cd-b548-4a41-a450-88198919078c | networkit/networkit | include/networkit/generators/ErdosRenyiEnumerator.hpp | /*
* ErdosRenyiGenerator.hpp
*
* Created on: 07.08.2018
* Author: <NAME> (<EMAIL>)
*/
#ifndef NETWORKIT_GENERATORS_ERDOS_RENYI_ENUMERATOR_HPP_
#define NETWORKIT_GENERATORS_ERDOS_RENYI_ENUMERATOR_HPP_
#include <omp.h>
#include <atomic>
#include <cassert>
#include <cmath>
#include <random>
#include <networ... | TOOL | 0.987672 | 7.464585 | {
"github_metadata": {
"branch": "master",
"commit_count": 9146,
"repo_created_at": "2017-02-04T13:04:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 811,
"forks": 235,
"issues": 23,
"pull_requests": 24
},
"file_meta": {
"content_id": "0e... |
a6cf8888-e833-4c68-9c95-8af739f704e1 | uscar/software | ROS/art_laser/src/obstacle_avoid.cpp | #include <ros/ros.h>
#include <sensor_msgs/LaserScan.h>
#include <sensor_msgs/PointCloud.h>
#include <geometry_msgs/PointStamped.h>
#include <cmath>
#include <vector>
#include <iostream>
using namespace std;
class Avoid
{
public:
float min_range;
float avoid_angle;
float roll;
float pitch;
float avoid_thres... | TOOL | 0.944382 | 4.838042 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2013-09-10T03:30:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bca8c72a0... |
aa016174-0310-458c-8eca-9c50b269fc29 | Helianthusss/Learn-CPP | C++/cau_truc_du_lieu/Linked list/Ly Thuyet/baitap1.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
Node *pNext;
};
struct singleList{
Node *pHead;
};
void Initialize(singleList &list){
list.pHead = NULL;
}
// tao node
Node *CreateNode( int d){
Node *pNode = new Node;
if(pNode != NULL){
pNode->data=d;
pNode->pNext=NULL;
}
else{
cout<<"... | ALGO | 0.999957 | 4.175486 | {
"github_metadata": {
"branch": "main",
"commit_count": 134,
"repo_created_at": "2021-03-22T13:36:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "349b72b25c... |
06b65e93-8164-4340-a830-aadd561f8e77 | AlwaysUnwilling/Linux- | 6_24_LeetCode/leetcode.cc | #include<iostream>
#include<vector>
#include<queue>
#include<limits.h>
using namespace std;
//515. 在每个树行中找最大值
/*
*给定一棵二叉树的根节点 root ,请找出该二叉树中每一层的最大值。
* */
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullp... | ALGO | 0.999912 | 4.248885 | {
"github_metadata": {
"branch": "main",
"commit_count": 334,
"repo_created_at": "2021-09-02T01:40: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": "1315182713... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.