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
7ddbbfcd-b116-472c-a7f5-89ede4766ed5
joeyzhou98/Course-map
DAG.cpp
#include <typeinfo> #include "DAG.h" #include "Vertex.h" #include <algorithm> #include <iostream> #include <string> using namespace std; DAG::DAG(){} DAG::~DAG(){clean();} //clears all elements in vectors void DAG::fillRoot(vector<int> &root) const //fills argument with root vertex ids { for (unsigned int i = 0; i...
ALGO
0.999158
5.124611
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2018-03-23T07:59: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": "bb7ca5f9bf...
143ac8d7-7e82-4228-825f-0f06355745c2
afrozchakure/Competitive-Programming-Solutions
LeetCode/Algorithms/Easy/SymmetricTree.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.999995
6.919895
{ "github_metadata": { "branch": "master", "commit_count": 662, "repo_created_at": "2019-10-18T18:10:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 55, "forks": 26, "issues": 4, "pull_requests": 0 }, "file_meta": { "content_id": "cb5688...
4def41b5-0ff7-47bd-9988-f684603c5914
mishrabadal/data-structure-program
QUEUE/queue_operation.cpp
#include <iostream> using namespace std; //implementation using default array class queue { int *arr; int front, rear, size; public: queue(int n) { arr = new int[n]; front = -1, rear = -1; size = n; } bool isEmpty() { return front == -1; } bool isFu...
ALGO
0.996042
4.27977
{ "github_metadata": { "branch": "coder-army", "commit_count": 182, "repo_created_at": "2024-08-29T17:50: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": "0891...
95400cfb-42ee-44db-b5ba-4077664b03ee
samithasan142/AUST-CSE
CSE 2.2/Algorithms Lab (CSE-2208)/Lab-10(08-03-21)/B2_180204142_4b.cpp
/*Prims Algorithm*/ #include<bits/stdc++.h> using namespace std; struct node{ int v,cost; node(){} node(int vv,int cc) { v=vv; cost=cc; } }; bool operator<(node a, node b) { return a.cost>b.cost; } int adj_matrix[100][100]; int vertex,edge,u,v,weight,i,j,ans=0; bool visited[10...
ALGO
0.99999
4.303427
{ "github_metadata": { "branch": "main", "commit_count": 328, "repo_created_at": "2022-05-30T04:50: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": "ff92ae9081...
e0698f29-863f-430e-b747-ca282c669fa6
Hbrtjm/AoC-2023
day3_folder/day3.cpp
#include <iostream> #include <fstream> #include <vector> #include <math.h> using namespace std; bool number(char a) { return a >= '0' && a <= '9'; } bool valid(int a,int n) { return a < n && a >= 0; } int scan(int x, int y,vector<string> engine) { int left = 0,placement = y,ans = 0; ans = engine[x][y] - '...
ALGO
0.999395
3.577796
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2023-12-03T17:35:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dbf832b24...
d12b3b7f-4d43-4bbb-8f4b-9af66e7bfa56
otavioon/COLA-2022-Tools
datasets/src/algo/codenet/2/s292117906.cpp
//{ #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef double lf; typedef pair<ll,ll> ii; #define REP(i,n) for(ll i=0;i<n;i++) #define REP1(i,n) for(ll i=1;i<=n;i++) #define FILL(i,n) memset(i,n,sizeof i) #define X first #define Y second #define SZ(_a) (int)_a.size() #define ALL(_a) _a.begin(),_...
ALGO
0.999761
3.532699
{ "github_metadata": { "branch": "master", "commit_count": 70, "repo_created_at": "2022-06-08T12:17:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "26281df97...
a5d48129-dcd1-4f00-853d-2950cfce2519
krishna6431/DSA_ZeroToMastry
Section-10-Recursion-2/03_Check_Element_is_Present_or_Not.cpp
// All Rights Reserved &copy 2021 // Code is Written by Krishna // Data Structure and Algorithms Series 2021 #include <iostream> using namespace std; bool isPresent(int arr[], int n, int x) { if (n == 0) { return false; } if (arr[0] == x) { return true; } else { ...
ALGO
0.999955
4.972916
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2021-04-01T08:15:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "248257181...
56103fcb-bee8-4f7e-b3b4-76ac572d5a99
asomeJay/algorithm
Acm_icpc/C,C++/DFS_BFS/boj2146.cpp
/* 다리 만들기 */ #include <iostream> #include <stack> #include <queue> #include <algorithm> #include <cstring> #define MAX_MAP 100+1 #define OUT_RAGNE 0 #define IN_RANGE 1 #define MAX_INT 2100000000 using namespace std; int N, mini; int map[MAX_MAP][MAX_MAP], map_name; int dr[4] = { -1,0,1,0 }; int dc[4] = { 0,1,0,-1 ...
ALGO
0.999214
3.843957
{ "github_metadata": { "branch": "master", "commit_count": 636, "repo_created_at": "2020-03-05T05:29:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c172a738...
5d1d7597-4374-4e1c-b573-fe504b998cf4
kundan9170/Data-Structures-and-Algorithmss
Graphs/Euler Path_and_circuit/Teleporters_Path.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define fastio ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define pi 3.14285714285 #define pb push_back #define ppb pop_back #define mpr make_pair #define pp push #define pii pair<int,int> #define int lo...
ALGO
0.999954
3.830357
{ "github_metadata": { "branch": "main", "commit_count": 61, "repo_created_at": "2024-05-23T13:38: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": "0d1526b22f1...
13f61a1f-43b9-42cc-a80b-16e1047c32cb
Lxandqy/33team
33/CodeForces/CF_1355B_Young Explorers.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int T, n, ans, a[200005], l, r; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> T; while (T--) { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; sort(a + 1, a + n + 1); an...
ALGO
0.999804
4.416198
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-05-26T10:36:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d1a3146b9...
261d8003-b602-424e-bc02-a552c15290df
KiSeungMin/baekjoon_cpp
src/etc/6549.cpp
#include<iostream> #include<vector> #define sync_with_stdio(false); using namespace std; vector<long long> getInput(int N){ vector<long long>result; for(int i{0}; i < N; i++){ long long num; cin >> num; result.push_back(num); } return result; } long long getAnswer(int N){ lo...
ALGO
0.999898
3.983272
{ "github_metadata": { "branch": "main", "commit_count": 77, "repo_created_at": "2021-10-17T10:35: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": "bf97b67592a...
2c92fc07-fd93-4f53-a662-7790025aa431
Syedshajib55/Codeforces
1506B.cpp
#include <bits/stdc++.h> using namespace std; int LCS_Substr(string X, string Y, int m, int n) { int LCS[m + 1][n + 1]; int res= 0; for (int i = 0; i <= m; i++) { for (int j = 0; j <= n; j++) { if (i == 0 || j == 0) LCS[i][j] = 0; else if (X[i - 1...
ALGO
0.99998
4.700218
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-11-13T08:06: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": "ca776af161...
402c4e86-02ea-4c92-8612-75e478dc3235
mikemesi1/my-Experience
C++/Linked Lists/linkedList.h
#include "node.h" #include<iostream> #ifndef LINKEDLIST_H_INCLUDED #define LINKEDLIST_H_INCLUDED class linkedList { public: linkedList(){header=NULL;}; void Insert(Node* &p, const string &newkey, const int &newdata); //helper function to simplify insertion where it can. void _Delete(Node* &ptr)...
ALGO
0.992061
4.14718
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2022-04-14T14:18:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "018a3753fda8...
313b149b-4880-4e1f-988f-edf3416f10fb
jonnathan-romero/GBM-Stochastic-Volatility
Main.cpp
// main.cpp. <NAME>, March 2017 // compile with... // c++ -o hw3 homework3.cpp // execute with... // ./hw3 #include "Declarations.h" #include <iostream> #include <cmath> const double s0 = 100; // starting stock price const double rr = 0.05; // risk free rate const double T = 0.5; /...
ALGO
0.999964
5.164558
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-05-31T02:15:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6ccf37377f...
228fdbd0-b87d-48e4-ab52-598cf44316f6
dernDren161/DataStructuresAndAlgorithms
Facebook-Leet/Top79/LinkedLists/CopyListsWithRandomPointers.cpp
// Problem Link: https://leetcode.com/explore/interview/card/facebook/6/linked-list/3020/ // NOTE: Hint is @OC, i.e original node(key) and cloned node(value) /* // Definition for a Node. class Node { public: int val; Node* next; Node* random; Node(int _val) { val = _val; next = NULL; ...
ALGO
0.999443
5.532558
{ "github_metadata": { "branch": "master", "commit_count": 48, "repo_created_at": "2020-07-18T01:29: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": "850032603...
9bfb93d6-ecc2-49e2-93c7-2fcc43428055
prayasjain/c-c-codes
others/binary_search.cpp
// Invariant: A[l] <= key and A[r] > key // Boundary: |r - l| = 1 // Input: A[l .... r-1] int BinarySearch(int A[], int l, int r, int key) { int m; while( r - l > 1 ) { m = l + (r-l)/2; if( A[m] <= key ) l = m; else r = m; } if( A[l] == key ) ...
ALGO
0.999999
5.99071
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-07-23T18:53:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c66895d0c8...
447c5393-6750-408a-9adc-31f827188719
ccoliu/NTUST_OOP
C++Practice/CS1010301W08/TS0705/Source.cpp
#include <iostream> #include <string> using namespace std; string s = "VUCD"; string tab[4][4] = { {"V","U","C","D"}, {"U","C","D","VU"}, {"C","D","VU","UU"}, {"D","VU","UU","CU"} }; int main() { int T; cin >> T; cout << "COWCULATIONS OUTPUT" << endl; for (int i = 0; i < T; i++) { string a, b; cin >> a >...
ALGO
0.999928
3.773436
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2023-06-14T05:56: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": "dd126514dcf...
988954fd-c5c5-465a-b269-acba253564a6
smiz/adevs
include/adevs_rk_45.h
/** * Copyright (c) 2013, <NAME> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions...
ALGO
0.999914
5.416329
{ "github_metadata": { "branch": "main", "commit_count": 403, "repo_created_at": "2013-07-25T18:11:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 9, "forks": 11, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6d61a8bc4...
c7a4dccc-82d3-4198-ba38-7950d66d5078
burteth/6502
game-of-life/main.cpp
#include <iostream> using namespace std; const int WIDTH = 8; const unsigned char FULL = '#'; const unsigned char EMPTY = ' '; void print_state(unsigned char* state) { for (int i = 0; i < 10; i++) cout << '-'; cout << endl; for (int row = 0; row < WIDTH; row++) { cout << '|'; int...
ALGO
0.988934
4.321904
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-04-13T20:18:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4ebff8a5bbc4...
f0e85467-1390-440c-9de2-91041be45dd4
intmpg/PP
lab1/ConsoleApplication3/CThreadInverseMatrix.cpp
#include "stdafx.h" #include "CInverseMatrix.h" void StartParall(CInverseMatrix * matr, size_t num) { matr->DoInverseMatrix(num, num + 1); } void CInverseMatrix::GetMatrixSize(CMatrix & const matrix) { m_eMatrix = matrix.GetEMatrix(); m_matrix = matrix.GetMatrix(); n = matrix.GetSize(); } CInverseMatrix::CInve...
ALGO
0.999497
4.267231
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-01-16T21:03: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": "6a7e1f4d2b...
d6ad1a32-b332-4cc1-bb41-3cf08cc51b8b
Wind134/CppLearn
刷力扣/链表应用/142-环形链表-找入口节点.cpp
/** * 题目: * 给你一个链表的头节点head,判断链表中是否有环。 * * 思路: * 典型的快慢指针,如果有环,快慢指针终会相遇,但是要注意的一点是: * 我们需要找到那个入口的位置,快慢指针是终会相遇,但他们相遇的位置不一定是 * 入口位置,而我们要做的就是定位这个入口位置; * 通过数学方法来确认位置; * * 假设起点到环入口的长为a,慢指针在环里走了一段距离与快指针第一次相遇,假设这段距离为b,圆环的周长为c; * 显然快指针走过的距离:a + nc + b,n为相遇的次数,这个等量关系好算; * 那么接下来,快指针走的路呢,显然是慢指针的两倍:即2(a + b); * 两式一起推导:...
ALGO
0.999927
5.272913
{ "github_metadata": { "branch": "main", "commit_count": 277, "repo_created_at": "2023-03-01T11:27:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bc96377e2b...
77ecfbf9-6ea8-4524-9b4c-3eddcae54db1
bakumpai/tlx_toki
04/E.cpp
#include <iostream> #include <vector> #include <string.h> using namespace std; int direct[4][2] = {{0,1},{1,0},{0,-1},{-1,0}}; bool flag[1000][1000]; int arr[1000][1000]; int m,n; int cnt = 0; void dfs(int start, int i, int j){ if(!flag[i][j] && arr[i][j] == start){ cnt++; flag[i][j] = true; ...
ALGO
0.999958
3.044264
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-07-20T09:42: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": "c88ffe9e11...
fd64dd01-390b-47ce-a248-a1d008315898
toasa/aoj
DPL/1_A.cpp
#include <iostream> #include <cmath> #include <vector> #include <algorithm> #include <unordered_map> #include <ios> #include <iomanip> #include <string> #include <numeric> using namespace std; int main() { // m種類のコイン、n円支払う int n, m; cin >> n >> m; vector<int> dp(50001, 1 << 30); vector<int> c(m);...
ALGO
0.999992
3.81976
{ "github_metadata": { "branch": "master", "commit_count": 44, "repo_created_at": "2018-12-18T08:36: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": "905cf96d3...
794e89af-3fc9-4e9f-b3e0-27a46edefe71
sayakbanerjee1999/Coding-Notes
C++/MISC/LRU_cache.cpp
class LRUCache { list<pair<int,int>> cache; unordered_map<int,list<pair<int,int>>::iterator> mymap; //Key, address in dequeue PAIR void refreshPosition(int key,int value) { cache.erase(mymap[key]); cache.push_front(make_pair(key,value)); mymap[ke...
ALGO
0.999634
5.936285
{ "github_metadata": { "branch": "master", "commit_count": 436, "repo_created_at": "2021-05-21T06:54:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 78, "forks": 16, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "45306b...
e8236633-540e-4963-b285-522fa780d1e2
Vector-013/CP-Vector013
Codeforces/DIV2_C/Place_for_a_selfie.cpp
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <cmath> #include <math.h> #include <stdlib.h> #include <string> #include <numeric> using namespace std; const int INF = 2e9; typedef long long ll; typedef long double ld; ll power(ll n, ll i) { ll ans = 1; while (i--) ans...
ALGO
0.999943
4.166021
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2023-10-02T08:27: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": "91eb7e745...
3dbe6107-05da-43f4-8c25-c070914a4b6c
ccpang96/leetcode
leetcode/字符串/468.验证IP地址.cpp
#include<iostream> #include<string> #include<vector> #include<sstream> using namespace std; //具体思路 编写一个split class Solution { public: string validIPAddress(string IP) { if (isValidIPv4(IP)) return "IPv4"; if (isValidIPv6(IP)) return "IPv6"; return "Neither"; } //split函数,用来分割字符串,保存在vector<string>里面 //分隔符是默认的...
ALGO
0.975123
4.628955
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2020-05-18T07:48:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "afe8e8e40...
7529043b-bbd5-4b55-951c-9ab8b2f82712
lsils/mockturtle
include/mockturtle/algorithms/dsd_decomposition.hpp
/* mockturtle: C++ logic network library * Copyright (C) 2018-2022 EPFL * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights...
ALGO
0.998165
7.527973
{ "github_metadata": { "branch": "master", "commit_count": 828, "repo_created_at": "2018-04-25T12:15:49.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 240, "forks": 150, "issues": 9, "pull_requests": 2 }, "file_meta": { "content_id": "9d0b2...
6a3e2e9a-3923-4b1c-9448-8d218183cc28
zsiciarz/aquila
examples/dtw_path_recovery/dtw_path_recovery.cpp
#include "aquila/global.h" #include "aquila/functions.h" #include "aquila/ml/Dtw.h" #include <algorithm> #include <cstddef> #include <iostream> #include <iterator> #include <cstdlib> #include <ctime> #include <vector> void drawDtwPath(const Aquila::Dtw& dtw, std::size_t xSize, std::size_t ySize) { std::vector<std:...
ALGO
0.933467
5.680122
{ "github_metadata": { "branch": "master", "commit_count": 666, "repo_created_at": "2010-03-26T11:12:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 474, "forks": 114, "issues": 30, "pull_requests": 3 }, "file_meta": { "content_id": "50c...
0e91b588-ae60-4825-95fe-1574ca2ea1a4
thirofoo/atcoder-archives
abc110/abc110_c_61344532_AC.cpp
/* * Author: through * Submission URL: https://atcoder.jp/contests/abc110/submissions/61344532 * Submitted at: 2025-01-03 23:41:36 * Problem URL: https://atcoder.jp/contests/abc110/tasks/abc110_c * Result: AC * Execution Time: 30 ms */ #include <bits/stdc++.h> #include <atcoder/all> using namespace std; using n...
ALGO
0.999992
4.441914
{ "github_metadata": { "branch": "main", "commit_count": 5513, "repo_created_at": "2022-12-17T09:45:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "392629af5...
c8496245-45fe-4929-8101-5106e1a08d2a
nikizhelqzkov/OOP-CPP
Mnozhestvo/Set.cpp
#include "Set.h" #include <cassert> bool isItNotRepeatable(int *arr, size_t size) { for (size_t i = 0; i < size - 1; i++) { for (size_t j = i + 1; j < size; j++) { if (arr[i] == arr[j]) { return false; } } } return true; } Set:...
TOOL
0.965236
4.536729
{ "github_metadata": { "branch": "oop", "commit_count": 156, "repo_created_at": "2020-04-01T13:26:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5b340fe8c53...
62355baf-82d8-4879-b19a-647cd8c4df60
metaphysis/Code
UVa Online Judge/volume111/11181 Probability|Given/program.cpp
// Probability|Given // UVa ID: 11181 // Verdict: Accepted // Submission Date: 2018-06-05 // UVa Run Time: 0.030s // // 版权所有(C)2018,邱秋。metaphysis # yeah dot net #include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { cin.tie(0), cout.tie(0), ios::sync_with_stdio(false); int N, r, ca...
ALGO
0.999618
4.181738
{ "github_metadata": { "branch": "master", "commit_count": 1710, "repo_created_at": "2016-03-07T13:28:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 229, "forks": 50, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8ad1...
d2d79e1e-9b9a-4d27-bcaa-f3c343081d33
BangIjall/BangIjall
PID jungkat jungkit/PID_balance_code/PID_balance_code.ino
#include <Servo.h> #include <NewPing.h> ///////////////////////Inputs/outputs/////////////////////// Servo myservo; #define SONAR_NUM 1 #define MAX_DISTANCE 200 NewPing sonar[SONAR_NUM] = { NewPing(4, 5, MAX_DISTANCE) }; /////////////////////////////////////////////////////// ////////////////////////Variables/////...
ALGO
0.943552
4.876365
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2021-06-30T08:09: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": "535e7337f24...
4ef4260f-9b6f-4f66-9530-6bf90169457b
morris821028/UVa
volume111/11123 - Counting Trapizoid.cpp
#include <stdio.h> #include <math.h> #include <algorithm> #include <set> #include <map> #include <queue> #include <vector> #include <assert.h> using namespace std; #define eps 1e-9 struct Pt { double x, y; Pt(double a = 0, double b = 0): x(a), y(b) {} Pt operator-(const Pt &a) const { return Pt...
ALGO
0.999818
3.697624
{ "github_metadata": { "branch": "master", "commit_count": 1197, "repo_created_at": "2013-06-14T12:34:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 571, "forks": 269, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "06a...
620dad3a-0f81-498f-a41b-90b7a3d4fe36
BlueBrain/neuromapp
neuromapp/compression/kernel_measurements.h
/* * Neuromapp - kernel_measurements.h, Copyright (c), 2015, * <NAME> - University of Arizona * <EMAIL>, * <NAME> - Swiss Federal Institute of technology in Lausanne, * <EMAIL>, * All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Gener...
ALGO
0.998518
4.504557
{ "github_metadata": { "branch": "master", "commit_count": 945, "repo_created_at": "2016-01-28T10:26:49.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 13, "issues": 2, "pull_requests": 1 }, "file_meta": { "content_id": "9c8e6a9f...
c70fc216-1c22-4c9e-8e61-656136b6959c
jramirezpr/walnut290J2017
ABBACA3D/290J_2015/MollifierNd/SmoothPolyMollifier3d.h
/* * SmoothPolyMollifier3d.h * * Created on: Feb 13, 2014 * Author: anderson */ /* ############################################################################# # # Copyright 2015 <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the Lesser GNU General Pub...
ALGO
0.969878
6.296636
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2017-04-12T18:02:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dc1622c6ad...
496288c0-4362-43b3-9257-a24d895a07f0
myboyhood/ugv2uav
drone_pose/src/complx_tracker.cpp
// // Created by ljy on 19-4-22. // #include <fstream> #include "complx_tracker.h" #define DEBUG_SHOW_IMG #define OUTPUT_ARTICLE_IMAGE false using namespace std; using namespace cv; pointsDetector::pointsDetector() { if (algo == "MOG2") pBackSub = createBackgroundSubtractorMOG2(500, 16, false); //500 40...
ALGO
0.978698
4.445621
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2020-04-22T13: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": "e460d66076...
cbeb6bc1-5449-4fc8-a2cf-874e0f4024aa
ljoyed/CPP09
ex01/RPN.cpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* RPN.cpp :+: :+: :+: ...
ALGO
0.980048
4.954654
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-06-27T13:34: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": "628523543dd0...
0256e3e0-6f13-4c89-a3ad-fdabad4f3685
DarshRPatel/CP-Solutions
CodeChef/C++14/POSPREFS/40226281.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef pair<int, int> pi; typedef vector<long long> vl; typedef pair<long long, long long> pl; typedef vector<vector<long long>> matrix; #define F first #define S ...
ALGO
0.99997
3.777981
{ "github_metadata": { "branch": "main", "commit_count": 556, "repo_created_at": "2022-06-04T19:38: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": "bc54a23cee...
38770454-3940-400c-b43b-004e45e98b45
karpathy/llm.c
dev/cuda/common.h
#include <stdlib.h> #include <stdio.h> #include <cuda_runtime.h> #include <cublas_v2.h> #include <cublasLt.h> #include <float.h> #define WARP_SIZE 32U extern cudaDeviceProp deviceProp; template<class T> __host__ __device__ T ceil_div(T dividend, T divisor) { return (dividend + divisor-1) / divisor; } __device__ ...
TOOL
0.974777
5.707693
{ "github_metadata": { "branch": "master", "commit_count": 1536, "repo_created_at": "2024-04-08T16:58:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 27192, "forks": 3127, "issues": 88, "pull_requests": 120 }, "file_meta": { "content_id"...
5580b785-3eb5-48c5-a226-d77da0c163bf
Rishi2403/DSA_Journey
Graphs/all_path.cpp
// #include<iostream> // #include<vector> // #include<unordered_map> // #include<list> // #include<unordered_set> // using namespace std; // vector<vector <int> >result ; // class graph{ // public: // unordered_map<int , list<int> >adj; // unordered_set<int> visited; // //vector<vector <int> >result ;...
ALGO
0.99974
5.282659
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2023-08-18T10:39: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": "b18d2b7280b...
3b11e215-0d59-4e72-950c-8134af2d137c
Mshazavr/AOC2023
cpp/day3/day3_2.cpp
#include <iostream> #include <string> #include <vector> #include <fstream> #include <ranges> #include <unordered_map> constexpr char INPUT_FILE[] = "day3.in"; struct Annotation { int id; int number; }; int main () { std::ifstream inputStream(INPUT_FILE); std::vector<std::string> grid; for (const...
ALGO
0.999927
5.369462
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-12-27T05:50:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eee60379f960...
f4e6e6b3-34b5-4301-a948-f455bd7e9e77
SamuelRS2000/lista_5
lista5_2.cpp
/* Lista_5 Exercicio 2 Autor: <NAME> Data: 28/03/2024 */ #include <iostream> #include <cmath> using namespace std; bool e_primo(int num) { bool flag = 1; for(int i=2; i < num && (flag == 1);i++) num % i != 0 ? : flag = 0; return flag; } void imprimi_primo(float num){ if(floor(num) == num) if(e_pri...
ALGO
0.997405
3.710304
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-19T13:36: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": "a7da006e5fc1...
2b4985eb-3694-4377-b623-7602f97718ac
WilliamPhilippe/Questions
graphs and trees/#4 - Ambrósio e as Ilhas.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> par; int distancia[15000]; int processado[15000]; vector< par > vizinhos[15000]; void bfs(int x){ distancia[x] = 0; priority_queue< par, vector<par>, greater<par> > fila; fila.push(par(distancia[x], x)); while(true){ ...
ALGO
0.999843
4.119917
{ "github_metadata": { "branch": "master", "commit_count": 64, "repo_created_at": "2018-12-05T00:54:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6de5f487b...
4d447795-b700-45ff-ae82-eff6c535b720
GersonCavalheiro/OpenMPSnapshot
May2023/RepCPP/14143578/filter.h
#pragma once #include "dg/functors.h" #include "fast_interpolation.h" namespace dg { namespace create { template<class UnaryOp, class real_type> dg::Operator<real_type> modal_filter( UnaryOp op, const DLT<real_type>& dlt ) { Operator<real_type> backward=dlt.backward(); Operator<real_type> forward=dlt.forward(); O...
ALGO
0.999638
6.740552
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2024-08-19T17:35:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b15c554b63...
90683e0e-fdaa-4bcb-88e9-133ec481c223
dmnsn7/projecteuler
02/025.cc
// Copyright [2017] <<EMAIL>> #include <bits/stdc++.h> using std::vector; const int LEN = 1000; vector<int> add(vector<int> a, vector<int> b) { vector<int> c; int carry = 0; for (int i = 0; i < a.size() || i < b.size(); i++) { c.push_back(carry); if (i < a.size()) { c[c.size() - 1] += a[i]; ...
ALGO
0.997132
3.725236
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2019-10-18T10:16: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": "1aa6864f5...
342dc885-634d-4bc8-8a65-44d45c8f61df
HuyWibu/Source_Code_C_plus_plus
code_ADVANCE/Co_ban_ve_Vector.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { // Nhap do dai cua mang int n; cin>>n; vector<int> list; // khai vao vector list , ta coi list nhu 1 mang binh thuong int index; // Nhap mang for(int i = 0 ; i < n ; i++) { cin >> index; list.push_back(index); ...
ALGO
0.999986
4.987938
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2021-09-07T11:53: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": "fde2ebc5e...
3f0a3ff0-b0fd-47a0-b381-ea77eddc203f
KaziRifatAlMuin/Online-Judges
CSES/DFS - Counting Rooms.cpp
#include <bits/stdc++.h> using namespace std; typedef long long int ll; long long int const MOD = 1e9 + 7; int const N = 1005; int dx[4] = {1, -1, 0, 0}; int dy[4] = {0, 0, 1, -1}; int n, m; char s[N][N]; bool visited[N][N] = {false}; vector <pair<int,int>> graph[N]; void DFS(pair <int, int> node){ visited[node....
ALGO
0.999694
4.425591
{ "github_metadata": { "branch": "main", "commit_count": 119, "repo_created_at": "2023-04-27T10:28:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "444e4d0c84...
c74c5a79-2097-4ab2-a2d7-d8073367f471
DmitryLebetsky/OAIP
lab7/task4/task4/Source.cpp
#include <iostream>; #include <Windows.h>; #include <math.h>; using namespace std; string getSum(string firstNumber, string secondNumber, string base); string getSubstraction(string firstNumber, string secondNumber, string base); string getSum(string firstNumber, string secondNumber, string base) { if (firstNumber[0...
ALGO
0.998618
4.339514
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-11-30T08:55: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": "eb31a37d0f28...
e52bf6ce-4813-41f8-96b7-f6bda2c5e419
karthikeyan2022/leetcode_problems
reference/sorting_merge.cpp
/* * Merge sort implementation * ascending order sort */ #include <iostream> #include <vector> using namespace std; class Solution { // Recursive function // Split the array into half until it have 1 or 2 elements void splitAndMerge(int left, int right, vector<int>& nums) { // base case: if ...
ALGO
0.999999
6.17875
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2022-02-19T16:00:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "13141a4d12f...
f336dcba-69e6-442a-8d8d-9de64de92870
lsgarwood/CC_Cpp_Course
Hello.cpp
#include <iostream> int main() { std::cout << "Hello World!\n"; // will print Hello World! std::cout << " 1\n"; std::cout << " 2 3\n"; std::cout << " 4 5 6\n"; std::cout << "7 8 9 10\n"; // Will print the numbers as it seems in a triangle } // C++ programmes are stored in files which us...
TOOL
0.926579
3.80295
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2023-02-20T13:55:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "da327ec78b7...
1775bf55-4d3b-4a93-8834-4a1b291d7e22
SupremeWarrior108/Competitive-Programming
CodeForces/800[ExtremelyRound]Implementation.cpp
// https://codeforces.com/problemset/problem/1766/A #include <bits/stdc++.h> using namespace std; // Macros #define pb push_back #define pf push_front #define ff first #define ss second #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() // #define rep(...
ALGO
0.999871
5.443719
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-01-24T14:16: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": "b9dcb34365f3...
cc9013b4-06e8-4b02-b2fb-9fbe7f78ff54
RahulGhosh201/babbar_dsa_pl
practice/bit manipulation/Position of rightmost different bit.cpp
#include <bits/stdc++.h> using namespace std; // void different(int m, int n) // { // int arr1[10], arr2[10], j = 0, k = 0, ans = 0; // while (m > 0) // { // int rem = m % 2; // arr1[j++] = rem; // m = m / 2; // } // while (n > 0) // { // int rem = n % 2; // ...
ALGO
0.999976
5.016998
{ "github_metadata": { "branch": "main", "commit_count": 33, "repo_created_at": "2023-08-26T14:52:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2d23761c441...
f504eef9-06ac-4001-bfd8-5bb584681fce
Aadarsh-aadi/Leetcode-and-GeeksForGeek
Find number of closed islands - GFG/find-number-of-closed-islands.cpp
// { Driver Code Starts //Initial Template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function Template for C++ class Solution { public: // DFS Traversal to find the count of // island surrounded by water void dfs(vector<vector<int> >& matrix, int x, int y, ...
ALGO
0.999753
6.115682
{ "github_metadata": { "branch": "main", "commit_count": 498, "repo_created_at": "2022-05-04T08:01:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f32cadbb8c...
75df85cf-3bcc-4fa2-86fb-56396fbf5caa
umbralcalc/dennm-torch
src/SecondOrderProbsState.cpp
// SecondOrderProbsState.cpp #include "SecondOrderProbsState.h" SecondOrderProbsState::SecondOrderProbsState( torch::Tensor initialProbs, StateConfig stateConfig ) { probs = torch::ones({initialProbs.size(0), 0}); probs = torch::cat({probs, initialProbs}, TIME_AXIS); config = stateConfig; cur...
ALGO
0.987978
6.733225
{ "github_metadata": { "branch": "main", "commit_count": 41, "repo_created_at": "2023-10-09T12:04: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": "23a25f87a89...
e604f963-08ec-48d8-952d-66f52394ecfc
pimukthee/competitive-prog
acm/North/2014/Aedge.cpp
#include <iostream> #include <algorithm> using namespace std; bool path[30][30]; int node[30],deg[30],a[30],b[30]; bool isSafe(int k,int m) { for(int i=1; i<=25; i++) if( path[k][i] && m == node[i]) return false; return true; } bool colouring(int k,int m) { bool chk=false; for(int i=...
ALGO
0.999872
3.325996
{ "github_metadata": { "branch": "master", "commit_count": 55, "repo_created_at": "2017-06-19T07:47: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": "fb6fa6c5b...
297a1ca4-b3ad-4a63-aaca-1d08fcae79e2
ishandutta2007/codeforces-a
alex/normal/269/C.cpp
#pragma comment(linker, "/STACK:60000000") //#define _MY_OPT_MODE_ #define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_DEPRECATE #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <cmath> #include <algorithm> #include <vector> #include <set> #include <map> #inclu...
ALGO
0.999976
3.230171
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6bd5f57dd252...
6eaec783-f113-448d-880a-048363d817e5
nasa/icarous
Modules/ACCoRD/src/CriticalVectorsSI.cpp
/* * CriticalVectors.cpp * * Contact: <NAME> (<EMAIL>) * NASA LaRC * http://shemesh.larc.nasa.gov/people/cam/ACCoRD * * Copyright (c) 2011-2017 United States Government as represented by * the National Aeronautics and Space Administration. No copyright * is claimed in the United States under Title 17, U.S.Cod...
ALGO
0.99799
5.417287
{ "github_metadata": { "branch": "master", "commit_count": 2747, "repo_created_at": "2016-08-19T15:04:43.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 169, "forks": 74, "issues": 1, "pull_requests": 5 }, "file_meta": { "content_id": "f3aaf...
5292de68-d14b-490c-8337-2b6a5724bb25
devanshmesson/Competitive-programming
Striver's CP List/Implementation, Constructive/1360A.cpp
// taskkill /IM "a.exe" /F #include<bits/stdc++.h> using namespace std; #ifndef ONLINE_JUDGE #define freopen freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #else #define freopen #endif #define pb push_back #define pf push_front #define endl "\n" #define ios ios_base::sync_with_stdio(0);cin.tie(...
ALGO
0.99988
4.560314
{ "github_metadata": { "branch": "master", "commit_count": 1305, "repo_created_at": "2019-05-17T21:46:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "574b63...
14fb0465-17be-4f7a-80d8-817b5b4f0b91
Ramon-lrocha/estrutura_Dados
lista encadeada simples.cpp
//programa de lista encadeada simples #include <stdio.h> #include <stdlib.h> //definir estrutura struct no{ int numero; struct no *proximo; }; //decalrar variavel struct no *cabeca; //para enderešar o conteudo apontado pelo ponteiro eu uso " -> " //funcao para inserir elemento na lista void inserir(int parame...
ALGO
0.989736
4.667408
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-08-01T12:03: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": "f4ee991716e2...
4f552b4f-9b61-4c86-9e62-2a553cc1b914
SiyangShao/codes
codeforces/2021/R753/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll t, x, n; int main() { ios::sync_with_stdio(false); cin.tie(0), cout.tie(0); cin >> t; while (t--) { cin >> x >> n; if (x & 1 == 1) { if (n % 4 == 1) { cout << x + n << "\n"; } else if (n % 4 == 2) { cout << x - 1 << "\n"; } ...
ALGO
0.999942
3.890603
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-04-08T14:41:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "428f71475e6d...
da478ba2-e97c-4c6a-b8d6-3b312d3f3c47
Oein/PS
acmicpc/1___/19__/198_/1987/1987.cpp
#include <vector> #include <algorithm> #include <queue> #include <iostream> #include <map> #include <set> #include <math.h> #include <numeric> #include <cassert> #include <stack> #include <cstring> #include <climits> typedef long long ll; typedef unsigned long ull; #define interface struct #define zx3f 1061109567 ty...
ALGO
0.999913
3.927499
{ "github_metadata": { "branch": "main", "commit_count": 998, "repo_created_at": "2023-09-22T23:36:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9d483d6e66...
db6beb04-fd8a-470b-9e6a-3d6f12aa0b88
gillianczj/leetcode
352.Data Stream as Disjoint Intervals.c++
//solution one class SummaryRanges { public: SummaryRanges() {} void add(int val) { auto comp = [](Interval a, Interval b) {return a.start < b.start}; auto it = lower_bound(ret.begin(), ret.end(), Interval(val, val), comp); int start = val, end = val; if(it != ret.begin() && val...
ALGO
0.999986
6.175961
{ "github_metadata": { "branch": "master", "commit_count": 339, "repo_created_at": "2016-02-21T01:35: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": "4d0307e5...
daf3ff6b-af60-4805-ab50-7eab0573b0d6
harshraj22/problem_solving
solution/leetcode/146.cpp
class LRUCache { int cap, time; map<int, pair<int, int>> mp; // key -> (value, time) deque<pair<int, int>> dq; // dq.front() stores most recently used (key, time) public: LRUCache(int capacity) { cap = capacity; mp.clear(); time = 0; dq.clear(); } int...
ALGO
0.999795
6.326841
{ "github_metadata": { "branch": "master", "commit_count": 905, "repo_created_at": "2019-06-22T06:58:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 20, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "04c8130...
fec61c76-073b-4f15-8d7a-ee897462edf5
lovtens/pub-sub
pub.h
#include <list> #include <map> #include <utility> #include <string> #include <vector> #include <iostream> using namespace std; using std::string; class Sub { public: string port; string ip; Sub(string _port, string _ip) { port = _port; ip = _ip; } }; class Topic { p...
TOOL
0.940286
4.138811
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-08-21T05:54:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "ac56935e71...
2a757935-2b9e-49b1-9b9d-40d93b039ce4
tokarev-i-v/WinApi_Arkanoid
Ball.cpp
#pragma once #include "arkanoid_includes.h" extern Platform CurrentPlatform; bool Ball::screenOut(){ if ((this->position.Y <= 0)) { return true; } return false; } bool Ball::platformCollision() { //Столкновение с платформой! if ((this->position.X >= CurrentPlatform.position.X && //Если шарик находится над пла...
ALGO
0.937636
4.211936
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2015-07-03T06:07: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": "ce18b1a39...
96a6eadb-7a5f-488d-832c-7cd89f5a2a9f
i2-tum/pcm-optimization-tool
src/QubitState.cpp
// // Created by Jakob on 31/01/2023. // #include <bitset> #include "../include/QubitState.hpp" QubitState::QubitState(size_t _nQubits) { this->nQubits = _nQubits; this->map = std::unordered_map<BitSet, Complex>(); map[BitSet(_nQubits, 0)] = Complex(1, 0); } size_t QubitState::size() const { return...
ALGO
0.991964
6.459374
{ "github_metadata": { "branch": "main", "commit_count": 178, "repo_created_at": "2025-02-21T16:46:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d50316fb59d...
d5f146b0-b9d7-42df-bde8-9e024ebdc8b1
shanerbo/leetcode
C++(1st)/100.same-tree.cpp
/* * @lc app=leetcode id=100 lang=cpp * * [100] Same Tree * * https://leetcode.com/problems/same-tree/description/ * * algorithms * Easy (50.95%) * Likes: 1384 * Dislikes: 45 * Total Accepted: 436.6K * Total Submissions: 854.8K * Testcase Example: '[1,2,3]\n[1,2,3]' * * Given two binary trees, wri...
ALGO
0.999797
7.250799
{ "github_metadata": { "branch": "master", "commit_count": 398, "repo_created_at": "2019-09-27T03:03:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "38eef87f...
8eeb8acd-1672-4203-b9e1-fdc0e6759c8a
samo1228/Personal-work
Practice.cpp
#include <iostream> #include <vector> #include <algorithm> #include <functional> #include <string> class player_class { private: std::string player_name; int age; int goals_scored; int assists; std::vector <player_class> Squad_players; public: std::string get_player_name(){ return player_name; } ...
TOOL
0.988492
4.225533
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2019-10-28T22:09: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": "0c6f0f0e5e...
210373a0-1690-415c-bef2-8983b9cd7f9f
JsthcitPizifly/SCU_Review-
数据结构/课本习题答案/Programs Folder/TT.H
// Two-three tree implementation for the Dictionary ADT template <class Key, class Elem, class KEComp, class EEComp> class TTTree : public Dictionary<Key, Elem, KEComp, EEComp> { private: TTNode<Elem>* root; // Root of the tree int reccount; // Number of records stored // Private "helper" functi...
ALGO
0.964747
4.904753
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2019-06-27T02:50:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a7cea4d66...
240a4045-d8bb-4649-aa66-8bcf91724a02
JackTheRipperDempsey/Portfolio
src/Rasterizer/rasterizer.cxx
#include <iostream> #include <vtkDataSet.h> #include <vtkImageData.h> #include <vtkPNGWriter.h> #include <vtkPointData.h> #include <vtkPolyData.h> #include <vtkPolyDataReader.h> #include <vtkPoints.h> #include <vtkUnsignedCharArray.h> #include <vtkFloatArray.h> #include <vtkDoubleArray.h> #include <vtkCellArray.h> #inc...
TOOL
0.939061
4.713962
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-09-08T04:48: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": "bc809afea7...
b670d9ec-31ef-48df-92cf-7fc89df5bd95
stevenliu000/18645_Project
18645_Project/vert_conv.cpp
// // vert_conv.cpp // 18645_Project // // Created by <NAME> on 11/15/19. // Copyright © 2019 <NAME>. All rights reserved. // #include <iostream> #include <immintrin.h> #include <math.h> #include <string> #include <fstream> #include <opencv2/core.hpp> inline int index_transform(int index, int num_col, int pad_si...
ALGO
0.991371
4.186046
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2019-10-15T17:54: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": "a36dad3f3...
e2311783-cbd2-4f4c-8257-60e2ff746f3a
lenomirei/C-C-
RBTree.h
#pragma once enum Colour { RED, BLACK, }; template<class K, class V> struct RBTreeNode { // 链接结构 RBTreeNode<K, V>* _left; RBTreeNode<K, V>* _right; RBTreeNode<K, V>* _parent; // Key/Value K _key; V _value; // 颜色 Colour _col; RBTreeNode(const K& key, const V& value, Colour col = RED) :_left(NULL) ,_...
ALGO
0.969038
4.568555
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2016-04-05T15:03:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "73e948d0fd...
1a7b708c-2b44-4745-abad-ddab45035246
ishandutta2007/codeforces-h
hos.lyric/normal/1528/F.cpp
#include <cassert> #include <cmath> #include <cstdint> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #includ...
ALGO
0.999914
4.821098
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T02:01:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "88b143deaac8...
abda3325-f393-46ec-b129-d3b22b38929f
sarahmtz02/TC1031
Act 4.3 -- Grafos/ignore/.ccls-cache/@home@runner@LecturaBitacoraGrafos-Example/LinkedList.h
#ifndef _LINKEDLIST_H_ #define _LINKEDLIST_H_ #include<iostream> #include <stdexcept> #include "LLNode.h" template <class T> class LinkedList { private: LLNode<T>* head; LLNode<T>* tail; int numElements; public: LinkedList(); ~LinkedList(); int ge...
TOOL
0.908088
5.173436
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2022-06-21T14:54:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f27dc847d71a...
999dd7f5-ef30-43d1-833f-b643f0c7f747
misterecco/hpc
08_lab/floyd-warshall-seq.cpp
/* * A template for the 2019 MPI lab at the University of Warsaw. * Copyright (C) 2016, <NAME>. * Refactoring 2019, <NAME> */ #include <iostream> #include <string> #include <cassert> #include <mpi.h> #include "graph-base.h" #include "graph-utils.h" static void runFloydWarshallSequential(Graph* graph) { /* Fo...
ALGO
0.999759
6.272124
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2020-02-26T18:18: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": "366a9ee14...
8ee55359-99f9-437b-b4e0-4a63e13657de
Kal-Elx/competitive-programming
UVa Online Judge/612 - DNA Sorting/dnasorting.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; bool comp(pair<int, string> a, pair<int, string> b) { return a.first < b.first; } int getInversions(const string& str) { int res = 0; for (int i = 0; i < str.length() - 1; ++i) for (int j = i + 1; j ...
ALGO
0.999979
4.036503
{ "github_metadata": { "branch": "master", "commit_count": 104, "repo_created_at": "2018-11-24T10:55: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": "30caf212...
be37f0b9-eef9-4007-88a7-8d11624c0161
C9AX1LE/MergeSort
MergeSort/MergeSort/源.cpp
#include <iostream> using namespace std; void Merge(int arr[], int temp[], int start, int mid, int end) { int i = start, j = mid + 1, k = start; while (i != mid + 1 && j != end + 1) { if (arr[i] > arr[j]) temp[k++] = arr[j++]; else temp[k++] = arr[i++]; } wh...
ALGO
0.99998
4.826067
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-08-14T07:06: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": "2ce373beb00b...
7dfe4396-c710-490f-8e5a-10f339bc7cd8
vatsalsinha/leetcode
topologicalSortUsingBFS.cpp
// { Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: //Function to return list containing vertices in Topological order. // void dfs(int i, vector<int>& visited, vector<int>adj[], stack<int>& st){ // if(visited[i]) // return; // ...
ALGO
0.999933
6.459844
{ "github_metadata": { "branch": "main", "commit_count": 801, "repo_created_at": "2021-03-25T07:18:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2856ca47da...
bc3e3d63-c1f4-4b28-b0da-bd8eb1ac9417
VizKey01/My_Computer_Programing
vector/first_bestfit.cpp
#include <bits/stdc++.h> using namespace std; //--------------------- define zone ------------------------ #define ll long long #define db double #define pi pair<int,vector<int> > #define pis pair<string, string> #define stp() ios_base::sync_with_stdio(false);cin.tie(0); #define ending(x) if((x) == -1) break; #define ...
ALGO
0.997401
3.800469
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2023-11-21T20:06:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5174e759ac9...
11ecba98-c0a2-408b-b62c-f8467e967561
Himiks/C
OOP1/labG16.cpp
//G16.Count n elements from beginning of list.Create function to insert another list after n - th element in first list. //Input from keyboard integer n and all values in both lists.Create two lists in the beginning.Do no duplicate second list in memory. #include<iostream> using namespace std; struct Node { int num; ...
ALGO
0.99853
4.397084
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-12-10T21:29: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": "156b5511b025...
5d371288-2cd1-48f0-942f-e4e221083827
souamandaleal/Estruturas-de-dados
AVL/avl_tree.cpp
//Implementação de AVL com metódo no nó, by <NAME> // Versão 1 - 2020/1 para avaliação suplementar #include <iostream> #include <string> #include <stdexcept> #include <queue> class NohAVL; //declaracao avancada typedef std::string TChave; //chave da arvore typedef float TValor; //valor da arvore //Declaracoes das c...
ALGO
0.998502
4.936899
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-02-21T13:28: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": "9387906321...
b5c04d0c-f3b8-405e-a08c-922f536a2398
AleksMa/TexnoAlgorithms
Module_2/HomeWork_2/not_rec_BST.cpp
/* * Дано число N < 106 и последовательность целых чисел из [-231..231] длиной N. Требуется построить бинарное дерево поиска, заданное наивным порядком вставки. Т.е., при добавлении очередного числа K в дерево с корнем root, если root→Key ≤ K, то узел K добавляется в правое поддерево root; иначе в левое поддерево roo...
ALGO
0.999944
4.99251
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2019-03-03T10:40:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bc2f8dc6e...
3dba089a-ccd9-4394-909f-f0cb2c97537c
Andycode3759/competitions
2023_Q1/YZOJ.C1362_2.4/G/G.cpp
#include <bits/stdc++.h> using namespace std; const int MAXS = 1e5 + 5; int coins[4]; vector<int> items; int ans[MAXS]; int getAns(int leftover) { int &curAns = ans[leftover]; if (curAns != -1) return curAns; curAns = -100; } int main() { int n; for (int i = 0; i < 4; i++) { ...
ALGO
0.999493
3.652047
{ "github_metadata": { "branch": "main", "commit_count": 60, "repo_created_at": "2022-11-26T07:14:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "630b823fea5...
ebc86e1d-76f0-43eb-b5a3-a5f10f13c087
jarr786/DSA
Lecture_111-120/02_PerfectSquareSum.cpp
/* Given a number N. Find the minimum number of squares of any number that sums to N. For Example: If N = 100 , N can be expressed as (10*10) and also as (5*5 + 5*5 + 5*5 + 5*5) but the output will be 1 as minimum number of square is 1 , i.e (10*10). Example 1: Input: N = 100 Output: 1 Explanation: 10 * 10 = 100 E...
ALGO
0.999956
5.166082
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2023-02-06T19:38:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "baf473d2e90...
96bf1366-fd34-4f0f-9a31-bed614069ece
Petititi/gsoc2011sfm
src/bundle_related.h
#ifndef _GSOC_SFM_POINTS_BUNDLE_RELATED_H #define _GSOC_SFM_POINTS_BUNDLE_RELATED_H 1 #include <vector> #include <sba.h> #include "libmv/numeric/numeric.h" #include "libmv/base/vector.h" //A lot of these functions are extracted from Lourakis' SBA: //http://www.ics.forth.gr/~lourakis/sba/ #include "macro.h" //SFM_EXP...
ALGO
0.962179
4.76027
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2015-03-25T14:24:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "636a8d972...
0000243d-668a-47b3-bc95-175379385355
chuuuuu/algorithm
cses/dynamic-programming/2413/sol.cpp
// #include <ext/pb_ds/assoc_container.hpp> #include <bits/stdc++.h> using namespace std; // using namespace __gnu_pbds; using ll = long long; // template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; int mod = 1e9 + 7; int N = 1e6; vector<ll> as(N, 0); vec...
ALGO
0.999769
4.807328
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2021-06-17T19:16: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": "42396fde7ad...
94624be8-c39b-4b56-9946-60f66117ec0b
runqingc/Coding-Practice
leetcode/968. Binary Tree Cameras /main.cpp
#include <iostream> #include <list> #include <vector> #include <unordered_map> using namespace std; struct treeNode { int val; treeNode *left; treeNode *right; treeNode() : val(0), left(nullptr), right(nullptr) {} explicit treeNode(int x) : val(x), left(nullptr), right(nullptr) {} treeNode(int...
ALGO
0.999979
5.726328
{ "github_metadata": { "branch": "main", "commit_count": 53, "repo_created_at": "2023-09-12T12:44: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": "26ed41ed13b...
378514e3-eef1-437c-918c-e12595977349
mhomidi/OS-fault-tolerant
main.cpp
// // Created by <NAME> on 3/23/19. // #include "functions.h" int main() { vector<pid_t> pids; vector<string> fileDirs = ls("./databases/"); int numberOfChildren = fileDirs.size(); int in; cin >> in; for (int k = 0; k < numberOfChildren; ++k) { pids.push_back(0); } for (int ...
ALGO
0.985605
3.418571
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2019-03-23T16:54:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "52a3fb71a...
8bc17291-d009-430b-8c46-4352a4c244cf
bashtavenko/algo_cc
binary_trees/reconstruct.cc
#include "binary_trees/reconstruct.h" #include <cstdint> #include <functional> #include <memory> #include <vector> #include "absl/container/flat_hash_map.h" #include "binary_trees/binary_tree_node.h" namespace algo_alternative { std::unique_ptr<BinaryTreeNode> Reconstruct( const std::vector<int32_t>& preorder, co...
ALGO
0.999819
6.901471
{ "github_metadata": { "branch": "main", "commit_count": 95, "repo_created_at": "2024-07-19T13:53: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": "ff91f8abfb7...
7c56e3a8-a3bc-42d8-a320-acd1979616b5
colbyrush/schoolStuff
CS 121 - Basic CS 2/Lab12/quickSort.cpp
/* quickSort.cpp * * <NAME> * November 18, 1998 */ #include <iostream> #include <fstream> #include <string> typedef int aType; using namespace std; aType MAX_ARRAY = 10000; // prototypes void Quicksort( aType a[], int first, int last ); int Pivot( aType a[], int first, int last ); void Swap( aType &v...
ALGO
0.999626
5.70692
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2014-02-05T19:52:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "99c70af4f...
e5206962-a48c-4ce0-b26b-850c1885c095
jpbirdy/poj
华为杯/2013复赛/hw_y_07_2/main.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <climits> #include <iostream> #include <algorithm> using namespace std; #define maxn 100010 long long i,j,k,m,n; long long s[maxn],f[maxn],p[maxn],rank[maxn]; long long x,y,z; void swap(long long &x,long long &y) { long long t; t = x; x = ...
ALGO
0.999975
3.629162
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2013-02-20T06: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": "722e2c937b...
6ec9295d-7626-4339-b41b-709c22bd8033
Smomic/SyncVideo
src/contourFinder.h
/* * Title: Spatial synchronization of video sequences * Author: <NAME> */ #ifndef CONTOURFINDER_H #define CONTOURFINDER_H #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgcodecs.hpp" #include <algorithm> #include <map> class ContourFinder { std::vector<std::...
ALGO
0.99833
6.654413
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2018-12-29T15:59:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "68d6e0df1...
f12ce17f-6819-4158-8b1a-d4c0016ef004
CorgiMuzi/Algorithm_cpp
CodingTest/CodingTest/1509_DividePalindrome.cpp
#include <iostream> #include <string> #include <vector> using namespace std; vector<vector<bool>> isPalindrome; int palindrome[2501]; int main() { string phrase; cin >> phrase; string::size_type phraseLen = phrase.length(); isPalindrome = vector<vector<bool>>(phraseLen + 1, vector<bool>(phraseLen + 1, false))...
ALGO
0.999959
4.126139
{ "github_metadata": { "branch": "main", "commit_count": 194, "repo_created_at": "2023-04-30T05:21: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": "042e65f5f1...
7f0aa6c1-b50f-41a1-80d3-c9f6c1558e7e
ariloc/CompetitiveProgrammingCodes
CodeForces/1872C.cpp
#include <bits/stdc++.h> //#pragma GCC optimize("Ofast,unroll-loops") //#pragma GCC target("avx,avx2,fma") #define forn(i,n) for(int i = 0; i < int(n); i++) #define forsn(i,s,n) for(int i = int(s); i < int(n); i++) #define dforn(i,n) for (int i = int(n)-1; i >= 0; i--) #define dforsn(i,s,n) for(int i = int(n)-1; i ...
ALGO
0.9999
3.797318
{ "github_metadata": { "branch": "master", "commit_count": 183, "repo_created_at": "2020-08-19T01:48:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6d239d04...
fa47960a-bbc1-4233-8a77-ce06a27e830e
biurci-scrivener/DGP
src/ex3.cpp
#include "include/ex3.h" void Exercise3::generate_curve_simple() { std::cout << "Generating simple curve" << std::endl; std::default_random_engine generator; std::uniform_real_distribution<double> distribution(0., 5 * 3e-2); generator.seed(std::chrono::system_clock::now().time_since_epoch().count()); ...
ALGO
0.987169
4.753887
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2024-08-30T18:51:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "eda486be469...
e47f55af-cb16-4af4-a88d-090af83c036f
Bittu-kumar2003/GeeksForGeeks
Easy/Binary representation of next number/binary-representation-of-next-number.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: string binaryNextNumber(string s) { // code here. size_t firstNonZeroIndex = s.find_first_not_of("0"); if (firstNonZeroIndex == string::npos) { return "1"; ...
ALGO
0.999892
5.639351
{ "github_metadata": { "branch": "main", "commit_count": 212, "repo_created_at": "2024-04-19T19:25: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": "b8fb2f6fdf...
8f1964dc-ec8b-4192-aec5-e2494004685c
joehtet/CS211
hw1.cpp
// <NAME> // CS211 Section 22D Homework 1 // Write a program to find and print the first perfect square(i*i) whose last two digits are both odd. #include <iostream> using namespace std; // checks if the last two digits of num are both odd bool isOdd(int num) { int ones_digit = num%10; int tens_digit = (num/10)%10;...
ALGO
0.999836
4.60625
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2018-02-01T02:15: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": "ac4052a19...
0df5d573-4bc2-47bd-98a7-3eb4c498f247
ankit-0369/Solving-DSA-Problems
Find length of Loop - GFG/find-length-of-loop.cpp
//{ Driver Code Starts // driver code #include <bits/stdc++.h> using namespace std; struct Node { int data; Node* next; Node(int val) { data = val; next = NULL; } }; void loopHere(Node* head, Node* tail, int position) { if(position==0) return; Node* walk = head; ...
ALGO
0.999673
5.073587
{ "github_metadata": { "branch": "main", "commit_count": 943, "repo_created_at": "2023-01-10T16:45:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c055e8d52...
d5b8b42d-a2b7-4385-9cac-e609e50e7072
pedrinhoeu/CSES
rangeQueries/dynamicRangeSumQueries.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll n, q; vector<ll> nums; struct bit{ vector<ll> bt; void init(){ bt.resize(n+1, 0); } void update(ll id, ll val){ val = val - query(id, id); while(id <= n){ bt[id] += val; id += id & (-...
ALGO
0.9999
4.706736
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2023-07-07T22:44: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": "28d6765b169...
79324d79-4dad-4094-8ec1-9169867c511e
GHScan/DailyProjects
C++/EqualRange/main.cpp
#include "pch.h" #include <assert.h> #include <functional> template<typename IterT, typename T> IterT lowerBound(IterT begin, IterT end, const T& val) { IterT last = end - 1; if (val <= *begin) return begin; if (val > *last) return end; while (last - begin > 1) { IterT mid = begin + (last - ...
TEST
0.990728
5.598849
{ "github_metadata": { "branch": "master", "commit_count": 1116, "repo_created_at": "2013-02-19T15:11:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 33, "forks": 9, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dce371...