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 |
|---|---|---|---|---|---|---|---|
16c5dff5-8a68-47fd-9e04-7222ecf0de3d | mfem/mfem | linalg/tmatrix.hpp | // Copyright (c) 2010-2025, Lawrence Livermore National Security, LLC. Produced
// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
// LICENSE and NOTICE for details. LLNL-CODE-806117.
//
// This file is part of the MFEM library. For more information and source code
// availability visit ht... | ALGO | 0.999105 | 6.701057 | {
"github_metadata": {
"branch": "master",
"commit_count": 24273,
"repo_created_at": "2015-06-11T21:42:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1934,
"forks": 544,
"issues": 96,
"pull_requests": 189
},
"file_meta": {
"content_id": ... |
216b2ad0-6f4c-40bd-8ef1-e133a0ec584e | ttamx/Competitive-Programming | codeforces/1973C.cpp | #include<bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;
using db = long double;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<db>;
using pii = pair<int,int>;
using pll = pair<ll,ll>... | ALGO | 0.999988 | 4.145535 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2023-03-11T10:01:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6df62df86e2... |
2158c95c-f51f-42fa-ab12-f4afc26ef3c7 | parul-123/ADA | Assignment2/q3.cpp | /* Question 3 is based on to find an acyclic subset of E of maximum total weight
in an undirected graph G(V,E)
By <NAME> (B14116)
Input is taking from q3.in input file
Indirectly we have to find Maximum Spanning Tree of G.
Implementation is done using modified Prim Algorithm
Example -
--Input--... | ALGO | 0.999959 | 4.180276 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2017-03-20T11: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": "6a0c5cfba... |
e53088fe-b345-4a48-993e-414d1527ab12 | jjumillaf/Entrust-JoelJumillaFernandez | test/test.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
struct Violation {
int pageNumber;
int lineIndexInPage;
};
// Function to check if maxChars and maxLines conditions are met for all pages
bool checkMaxConditions(const std::string& inputFile, int maxChars, int maxLines, std::vector<Vio... | ALGO | 0.912001 | 6.114038 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-06-28T11:08:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b99c566c00a... |
48a25781-fd79-465a-b97a-191fb45ed318 | tdutanton/advent_of_code_2024 | 2/2.cpp | #include <algorithm>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
bool isSequenceSafe(const std::vector<unsigned>& seq) {
if (seq.size() < 2) return true;
bool is_increasing = seq[1] > seq[0];
for (size_t i = 1; i < seq.size(); i++) {
int diff = seq[i] - seq... | ALGO | 0.999027 | 4.095368 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-12-01T20:14:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fe9b06b1387... |
2832c560-bd57-4d94-8128-cb7ac593e7a6 | Resetz/usacoprac | SILVER/radiostation.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
#include <algorithm>
using namespace std;
long n, k;
#define d(x,y) ((2019201913*(min(x,y)+1) + 2019201949*(max(x,y)+1)) % 2019201997)
class Compare
{
public:
bool operator() (pair<long long,long> a, pair<long long,long> b)
{
re... | ALGO | 0.999974 | 3.775055 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-07-22T01:07: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": "150817c7bf8... |
09ec4ce1-d928-41b4-af81-9ab7ecd51537 | cloudfly03/ACM-Template | 模板/图论/二分图/二分图最大匹配(匈牙利算法).cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
#define lowbit(x) (x&-x)
#define endl '\n'
#define INF 1e14
#define MOD 998244353
#define lc p<<1
#define rc p<<1|1
const int N = 500 + 1;
int n, m, x;
vector<int> e[N];
... | ALGO | 0.999962 | 4.807149 | {
"github_metadata": {
"branch": "main",
"commit_count": 167,
"repo_created_at": "2024-06-28T06:50:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6717f3d06f... |
2c1da1df-cf71-4a29-b2ad-aed67872d7b9 | palawijaGit/CodeEuler | Question3.cpp | /*
Question:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
Algorthm:
Prime factor is find prime number in the original number
Example:
Find prime factor 12?
12 / 2 = 6 -> 6 is not prime, try again divide by prime number
6 / 2 = 3 -> 3 is prime factor.
P... | ALGO | 0.999962 | 3.66265 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-04-06T17:06: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": "6b949af7c9... |
71e724f9-8cbf-420e-a738-db5ac4b07594 | salim002/Cpp-Codes | 52_Codeforces/17_Codeforces 3/60_.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vd;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
const int mod = 1000000007;
// const int mod = ... | ALGO | 0.999962 | 4.327742 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-12-11T13:47: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": "66aac7eb36... |
50c828d5-4d04-4cb5-86e3-0f6307cdb934 | Algo-Phantoms/Algo-Tree | Code/C++/binary_string_to_decimal.cpp | /*
A string containing only 0's and 1's is called a binary string.
The equivalent decimal of a binary number is the sum of 2 raised to the power of the positional values where 1 is present.
The least significant bit is assigned positional value 0.
The following program illustrates how to convert a binary string to its... | ALGO | 0.99989 | 5.42562 | {
"github_metadata": {
"branch": "main",
"commit_count": 1165,
"repo_created_at": "2021-01-19T11:58:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 367,
"forks": 624,
"issues": 575,
"pull_requests": 166
},
"file_meta": {
"content_id": "e9... |
f8e572c3-b84c-4e09-88bf-b4fb3f04e736 | in-formant/in-formant | external/armadillo/tests2/decomp_eig_pair.cpp | // Copyright 2015 <NAME> (http://conradsanderson.id.au)
// Copyright 2015 National ICT Australia (NICTA)
//
// 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... | TEST | 0.948294 | 6.058378 | {
"github_metadata": {
"branch": "with-qt",
"commit_count": 197,
"repo_created_at": "2019-09-14T12:28:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 229,
"forks": 40,
"issues": 19,
"pull_requests": 1
},
"file_meta": {
"content_id": "5619... |
d856e391-396e-49d5-b692-678e21fa5d38 | maustin8/CAD_Project | lib/kahypar/kahypar/partition/initial_partitioning/random_initial_partitioner.h | /*******************************************************************************
* This file is part of KaHyPar.
*
* Copyright (C) 2015 <NAME> <<EMAIL>>
*
* KaHyPar is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software F... | ALGO | 0.99782 | 6.092817 | {
"github_metadata": {
"branch": "master",
"commit_count": 165,
"repo_created_at": "2019-05-09T22:50:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "026f41be... |
abdc043a-5139-418f-a3a4-d29a43c3f354 | Serphome/Sapper | Сапер/Game.cpp | #include "Game.h"
char** Game::Alocate_memory(int N, int M)
{
char** A = new char* [N];
for (int i = 0; i < N; i++)
{
A[i] = new char[M];
}
return A;
}
void Game::fill(char** A, char c)
{
for (int i = 0; i < N; i++)
{
for (int j = 0; j < M; j++)
{
A[i][j... | TOOL | 0.970379 | 3.277331 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-06-04T18:44: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": "3ee0d1ba0c... |
a4f7d54a-f29c-4630-8cb4-86ff89862f19 | dhwanish-3/Design-and-Analysis-of-Algorithms | Selection Algorithms/Adhoc Thinking/majority-element.cpp | // Q. Given an array of size n of which more than n/2 elements are the same.
// return this majority element.
#include <bits/stdc++.h>
using namespace std;
class MajorityElement {
public:
// Approach 1: Sort + Traverse
// Time Complexity: O(nlogn)
// Space Complexity: O(1)
int sorting(vector<int>& num... | ALGO | 0.99997 | 5.700881 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2023-08-03T18:28: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": "045f4aa04... |
a6bece54-797b-4d50-8a6e-30bdfb1ab875 | ishandutta2007/codeforces-z | zeliboba/normal/1119/C.cpp | #include <stdio.h>
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <set>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <map>
#include <unordered_map>
#include <queue>
#include <array>
#include <bitset>
#incl... | ALGO | 0.999978 | 4.034492 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "5486852e2463... |
c00f3d42-2152-4c8f-9506-805ba13fe9a5 | toshirokubota/straight_polygon_grouping_V2 | CommonFateGrouping/CommonFateGroupingV3.cpp | #include <iostream>
using namespace std;
#include <stdio.h>
#include <cmath>
#include <mex.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <limits>
#include <map>
#include <set>
#include <hash_map>
using namespace std;
#include <mexFileIO.h>
#include <szMexUtility.h>
#include <szMexUtilityTemplate.h... | ALGO | 0.999901 | 3.91606 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-06-05T12:33: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": "4ed7bec1e... |
f86b9b54-3ca5-4d33-9908-5d9641c5ff29 | chanil4129/Algorithm | 백준/Silver/10431. 줄세우기/줄세우기.cc | #include <bits/stdc++.h>
using namespace std;
int p, t;
vector<int> v;
int fun() {
int ans = 0;
vector<int> sv = {v[0]};
vector<int>::iterator it;
for (int i = 1; i < v.size(); i++) {
it = sv.begin();
int j = 0;
for (; j < sv.size(); j++) {
if (sv[j] > v[i]) {
... | ALGO | 0.999796 | 3.784343 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2023-07-11T06:51: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": "796d9da9e0c... |
c2805f3e-c7a5-404e-a66e-a6eba5625289 | justdotheg/Algorithm-Study | 백준/DP 1단계/[11054]가장 긴 바이토닉 증가 수열/길형.cpp | #include <vector>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cmath>
#define MAX 1001
using namespace std;
/*
이전에 풀었던 가장 긴 증가하는 부분수열을 앞에서 하는 것이랑 뒤에서 하는 것이랑해서
둘의 값을 저장하는 배열을 따로 만들고 Front[i] Back[i]의 합이 가장 큰 것
*/
int main()
{
int N;
int number[MAX] = { 0, };
int front[MAX]... | ALGO | 0.999966 | 3.815203 | {
"github_metadata": {
"branch": "main",
"commit_count": 571,
"repo_created_at": "2021-01-05T11:17:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a50e146f9... |
d29e97fa-659a-487f-bec5-121003468aa4 | SadiqVali786/DSA | 10.PointersAndBasicMaths.cpp/07.findGCDorHCF.cpp | #include <iostream>
#include <chrono>
using namespace std;
int gcd (int &A, int &B) {
if (A == 0) return B;
if (B == 0) return A;
while ((A > 0) && (B > 0)) {
if (A > B) A -= B;
else B -= A;
}
return A == 0 ? B : A;
}
int main() {
auto start = chrono::high_resolution_clock::now... | ALGO | 0.999473 | 5.745844 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-08-31T03:53: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": "0ef82f3cd40... |
feb3b809-0e0d-407d-b62c-96ef8fbf7e80 | iliyian/CompetitiveProgramming | luogu.com.cn/CF1477A/main.cpp | // date: 2024-03-24 15:54:37
// tag: 丢番图方程
#include <bits/stdc++.h>
#define int long long
using namespace std;
void solve() {
int n, k;
cin >> n >> k;
vector<int> a(n + 1);
int g;
for (int i = 1; i <= n; i++) {
cin >> a[i];
if (i > 1) {
a[i] -= a[1];
g = gcd(g, a[i]);
} else {
... | ALGO | 0.999967 | 4.667317 | {
"github_metadata": {
"branch": "main",
"commit_count": 354,
"repo_created_at": "2024-04-21T10:50:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bcc584a26... |
8654f619-e926-412c-9b01-8fe3e60ca62e | raysayantan/LeetCode | tree/BinaryTreeZigZagLevelOrderTraversal.cpp | /*
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right,
then right to left for the next level and alternate between).
For example:
Given binary tree [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
return its zigzag level order traversal as:
[
[3... | ALGO | 0.999999 | 6.442811 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2020-02-18T14:26:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "539504f7... |
e0c0298d-a32a-4fb9-b2b8-82c5a461a723 | devaoted/SportsProgramming | opencups/2b-imo/e.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <string>
using namespace std;
#define forn(i, n) for (int i = 0; i < n; ++i)
#define f0rn(i, a, n) for (int i = a; i < n; ++i)
typedef long long ll;
typedef double ld;
typedef unsigned long long ull;
ty... | ALGO | 0.999834 | 3.254131 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2021-09-03T11:00: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": "2a286739f... |
328c9b6e-9355-47d4-b6a4-8ef702063c6a | farmerboy95/CompetitiveProgramming | JuniorTraining/CF-A/Block 4/UVA 10106.cpp | /*
Author: <NAME>
Status: AC
Idea: Do as problem requirement
*/
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define F... | ALGO | 0.999997 | 4.287132 | {
"github_metadata": {
"branch": "master",
"commit_count": 867,
"repo_created_at": "2019-09-04T15:35:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0609dc0e... |
73fcb262-9055-441e-a1d2-bfedcdcb35ae | sharshach/sudoko | SudokoVerifier.cpp | #include<bits/stdc++.h>
#include<thread>
using namespace std;
int sudoko[9][9];
bool vc=false,vr=false,vg=false;
void verifyRows(){
int i,j;
int a[9]={0};
for(i=0;i<9;i++){
for(j=0;j<9;j++){
a[sudoko[i][j]-1]++;
}
if(count(a,a+9,1)!=9)
return;
for(j=0... | ALGO | 0.999686 | 5.522558 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-06-19T15:57: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": "d8a35b06df... |
d95f31a2-1175-4a30-99e2-a03d41f9e853 | LasseD/uva | P10171.cpp | typedef PI WeightAndVertex;
#define INF numeric_limits<int>::max()
/*
Dijkstra for shortest path to all targets.
N vertices
*/
void dijkstra(int N, vector<WeightAndVertex> *adjacencyLists, int source, int *minPath) {
bool *visited = new bool[N];
FORI(N) {
visited[i] = false;
minPath[i] = INF;
}
minP... | ALGO | 0.999655 | 3.693892 | {
"github_metadata": {
"branch": "master",
"commit_count": 886,
"repo_created_at": "2014-03-13T11:01:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82ab7b74... |
86758645-b205-4fca-b475-81aae05265cd | TGKerr/JH-Project | Microbit/source/rsa.cpp | //Code written by <NAME> - Group C6 Edited by our group.
#include "rsa.h"
#include <stdio.h>
#include <stdlib.h>
//perform rsa on a single 24 bit chunk
message_t rsa(exponent_t exponent, modulus_t modulus, message_t msg) {
//based on psudeo code section https://en.wikipedia.org/wiki/Modular_exponentiation
lo... | ALGO | 0.998117 | 4.787033 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-04-22T16:14:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9970735f13... |
e123bc96-f900-4855-86e2-b9b0385cbc50 | bugeer/cpp-primer | ch16/p16_4.cpp | #include <iostream>
#include <list>
#include <string>
#include <vector>
template <typename T_it, typename V>
T_it find_element(T_it it0, T_it it1, const V& v) {
for( ; it0 != it1; ++it0) {
if(*it0 == v) {
return it0;
}
}
return it0;
}
int main (int argc, char *argv[]) {
s... | ALGO | 0.944952 | 6.024934 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-03-24T14:53:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7cdc200640... |
2bf57373-5671-452f-ab6d-e603a794bdc1 | anmichi/Library | Series.cpp | #include "TaylorShift.cpp"
template <typename mint>
FormalPowerSeries<mint> stirling_first(int n, Binomial<mint>& bin) {
if (n == 0) return FormalPowerSeries<mint>{1};
auto f = stirling_first(n >> 1, bin);
f *= TaylorShift(f, -mint(n >> 1), bin);
if (n & 1) f = (f << 1) - f * (n - 1); // multiply x-(n-... | ALGO | 0.999942 | 4.84353 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2024-03-05T13:05: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": "408b6b0d1c9... |
9770adcf-24a2-44c7-aea5-9ff7ffa1a616 | david20571015/Object-Oriented-Programming | hw7/1.cpp | #include <stdio.h>
#include <stdlib.h>
struct Stack
{
int data;
Stack *next;
};
void push(Stack **s, int n)
{
Stack *p = (Stack *)malloc(sizeof(Stack));
p->data = n;
p->next = *s;
*s = p;
}
void pop(Stack **s)
{
Stack *p = (*s)->next;
free(*s);
*s = p;
}
void display(Stack *s)
{
... | ALGO | 0.97698 | 3.875852 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-06-10T11:33:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e646962d7b7... |
1c20447a-7892-4270-945a-acfaf76b460d | wonbae/Algorithm | BOJ/BOJ_6236/BOJ_6236.cpp | #include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0), cin.tie(NULL);
typedef long long ll;
using namespace std;
int n, m, k, num;
ll res;
vector<int> v;
bool check(int a){
k = a;
int cnt = 1;
for(int i = 0; i < n; i++){
if(k - v[i] >= 0){
k -= v[i];
}else{
... | ALGO | 0.999995 | 3.899696 | {
"github_metadata": {
"branch": "master",
"commit_count": 800,
"repo_created_at": "2019-02-13T10:35:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae618f95... |
b571c8d6-2851-42c3-b311-192e68a3b291 | sideraverso/CPP-Templates | Solutions/2_Templates/Find.cpp | /**************************************************************************************************
*
* \file Find.cpp
* \brief C++ Training - Function Template Programming Task
*
* Copyright (C) 2015-2021 <NAME> - All Rights Reserved
*
* This file is part of the C++ training by <NAME>. The file may only be used in the... | TOOL | 0.998708 | 6.691599 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-09-24T20:11: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": "4647b2adc3... |
6d5dac60-7c49-4104-8658-619ec54326d0 | tatvlogs0312/Data-Structure-and-Algorithms-C- | Sort_Thi/BubbleSort.cpp | #include<iostream>
using namespace std;
typedef struct SinhVien{
int ma;
string ten;
string lop;
float dtk;
}SV;
void nhap(SV *a , int n){
for (int i = 0; i < n; ++i)
{
cout << "Nhap ma : ";
cin >> a[i].ma;
cout << "Nhap ten : ";
fflush(stdin);
getline(cin,a[i].ten);
cout << "Nhap lop : ";
fflush... | ALGO | 0.998586 | 3.387985 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-03-05T13:21:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1578887c050b... |
d321087e-1a72-4475-92ca-ea80390c021b | jon-lumi/C-and-Cpp-homework | Assignment_12/a12_p6/testvirtual.cpp | #include <iostream>
using namespace std;
#include "Area.h"
#include "Circle.h"
#include "Ring.h"
#include "Rectangle.h"
#include "Square.h"
//Added a calcPerimeter method for every shape
/*
Area
||
==========||==========
|| ||
Circle Rectangle
|| ... | TOOL | 0.976323 | 4.43476 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-02-17T18:08: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": "15544a541c... |
e31273be-2811-4590-97ec-634014b94cc0 | Starblo/PAT | Basic Level/1045.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<int> qsort;
vector<int> main_ele;
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
int temp;
cin >> temp;
qsort.push_back(temp);
}
vector<bool> qst(qsort.s... | ALGO | 0.999995 | 3.861161 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2018-01-30T03:02: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": "24529c49... |
b91d355b-9a79-46f3-95cc-fb54b3402b05 | qlinhpoet/DataStructuresAlgorithms | Multithreading/DataParallelism/DataParallelism.cpp | #include <iostream>
#include <future>
#include <thread>
#include <vector>
#include <numeric>
#include <random>
#include <algorithm> // std::generate
double accum(double *beg, double *end)
{
double init;
while (beg != end) init += *beg++;
return init;
}
int randomNum()
{
return std::rand();
}
double... | ALGO | 0.99985 | 5.288762 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-11-14T16:23: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": "1204e8b0aaf... |
7d564bfa-b3b9-4743-a8d8-5235a56a1306 | ml1150258/CSC_CIS_5 | Class/MarkSort_Class_V2/Array.cpp | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
#include <iostream> //Input-Output Library
#include <cstdlib> //Setting Random Number Seed
#include <ctime> //Time Library
usin... | ALGO | 0.998703 | 3.811025 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2023-01-04T18:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0dad5c... |
846ded03-b17f-4de9-a835-63bc66d24e29 | ewust/telex | telex-station/station/bro-1.5.1/src/DFA.h | // $Id: DFA.h 6219 2008-10-01 05:39:07Z vern $
//
// See the file "COPYING" in the main distribution directory for copyright.
#ifndef dfa_h
#define dfa_h
#include <assert.h>
// It's possible to use a fixed size cache of computed states for each DFA.
// If the number of DFA states reaches the given limit, old states... | ALGO | 0.99114 | 6.866664 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2011-06-29T02:13:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 141,
"forks": 27,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "98e5d5... |
8240446f-fbdb-4392-af6b-7cadad7bd327 | j-hossain/Online-judge-solve | cf contest/650 div3/c.cpp | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
using namespace std;
#define MM int main()
#define li long long int
#define test() int t;cin>>t;while(t--)
#define fast() ios_base::sync_with_std... | ALGO | 0.999904 | 3.595409 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-05-29T12:51:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09c8643c5... |
6ff0a6c3-1553-4b67-9910-938bed43ff70 | hyjk826/baekjoon | 백준/Bronze/16171. 나는 친구가 적다 (Small)/나는 친구가 적다 (Small).cc | // 2022-12-14
#include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0);
#define vi vector<int>
#define vl vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pi pair<int, int>
#define pl pair<ll, ll>
#define vp vector<pi>
#define vpl vector<pl>
#d... | ALGO | 0.999871 | 4.761785 | {
"github_metadata": {
"branch": "main",
"commit_count": 2540,
"repo_created_at": "2022-05-26T21:55:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5c59cfed... |
8bf35f43-d770-4a26-bb1c-604eb76e94ab | narayanlaxmi-dev/All | Feb_2025 c++/Day15 swtw/amarsir4/operator overload 4.cpp | /*
operator overloading:
Create a C++ program that defines a Time class to store hours, minutes, and seconds.
Overload the + operator using a to add two Time objects. Ensure that the addition correctly handles
cases where seconds or minutes exceed their limits (i.e., 60 seconds = 1 minute, 60 minutes = 1 hour).
int ... | ALGO | 0.902869 | 4.234976 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-05-25T10:37: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": "daff223ce87b... |
d2c28a84-fc1c-4c58-b248-99d1e433d571 | qiaomein/phishing | 3state-following.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <string.h>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#inc... | ALGO | 0.998358 | 3.001703 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2021-06-30T15:00: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": "c8e82210792... |
a35b41e7-fb3f-4966-b26b-859768ca9c99 | Shell-Wataru/AtCoder | ABC/ABC147 copy/D.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
namespace mp = ... | ALGO | 0.999959 | 4.380888 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-04-23T13:44:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "777024091... |
7770b332-d431-4497-a61e-aacf0012c0cb | tejas-gk/mini-projects--cp-and-dsa- | ceaser-cypher.cpp | #include <iostream>
#include <string>
using namespace std;
string encryptCaesar(string message, int key) {
string encryptedMessage;
for (char c : message) {
if (isalpha(c)) {
char base = (islower(c)) ? 'a' : 'A';
char encryptedChar = (c - base + key) % 26 + base;
en... | ALGO | 0.998595 | 5.28333 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-06T11:13:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f78c95020f52... |
81a578c8-8913-4dc7-a7c0-bf129bc276c3 | mpfeifer1/Kattis | greetings.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, k;
ll inf = (ll)1 << 60;
ll states;
struct card {
ll w, h, q;
};
vector<ll> cost;
vector<vector<ll>> memo;
vector<card> cards;
ll solve(ll envelopes, ll state) {
// If in memo, use that
if(memo[envelopes][state] < inf) {
... | ALGO | 0.998545 | 3.792643 | {
"github_metadata": {
"branch": "master",
"commit_count": 881,
"repo_created_at": "2017-11-27T05:28:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 175,
"forks": 79,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "4350a... |
1a5efa12-4d10-4012-b7c9-540d4666ba9d | baohuy251210/7codecpp | Contest/644div3/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
#define INF 1000000000
#define debug3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n";
#define debug2(index, value) cout << index << " " << value << "\n";
#define debug... | ALGO | 0.999645 | 5.024775 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-06-17T12:49: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": "01522224a6... |
d282a6a1-818d-4835-ac59-0f1534db0fce | kleemedia/universal-tween-engine-cpp | paths/CatmullRom.cpp | //
// CatmullRom.cpp
//
// This code is derived from Universal Tween Engine
// Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
//
#include <math.h>
#include "CatmullRom.h"
namespace TweenEngine
{
float CatmullRom::compute(float t, float *points, int pointsCnt)
{
int segment... | ALGO | 0.999366 | 6.063323 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2014-01-21T09:06:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d2d722d8... |
6bdccebd-0bb4-4ac4-94a9-3e343fe2e424 | ishandutta2007/codeforces-m | meijer/normal/1363/B.cpp | #include <bits/stdc++.h>
using namespace std;
//macros
typedef long long ll;
typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vll;
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define RE(a,c) REP(a,0,c)
#def... | ALGO | 0.999762 | 4.162729 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "4ca91f9b3aaa... |
d12a5387-02c4-441c-a796-33d9f6bbd7bf | shobhitkrsks/cp | gfg-queuell.cpp | #include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct Node
{
int data;
Node *next;
Node(int x)
{
this->data=x;
this->next=NULL;
}
};
class Queue
{
private:
Node *front, *rear;
int size = 0;
public:
Queue()
{
front = ... | ALGO | 0.998355 | 4.054729 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-03-20T17:29: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": "4bb2f7c4d... |
7248c142-67cd-4f1a-9726-a583cd336fc3 | DannyKuo2000/finalProject | main.cpp | #include "mbed.h"
#include "bbcar.h"
#include <iostream>
#include <string.h>
#define CENTER_BASE 1500
#define unitsFC 360 // Units in a full circle
#define dutyScale 1000 // Scale duty cycle to 1/000ths
#define dcMin 29 // Minimum duty cycle
#de... | TOOL | 0.978753 | 3.708971 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-07T03: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": "b89c56b8dfaa... |
ea697f59-2070-4f44-99e3-d8e64593c798 | InsightSoftwareConsortium/ITK | Examples/Statistics/ExpectationMaximizationMixtureModelEstimator.cxx | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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
*
* https://www.apache.o... | ALGO | 0.994327 | 6.869583 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "8... |
99959d9f-9918-445d-a882-83b2bdfd08b7 | danieljcksn/BeecrowdSolutions | 1023.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int city = 1;
while(true){
int n; cin >> n;
if(!n) break;
if(city != 1) cout << '\n' << '\n';
// pessoas, consumo
vector<pair<int, int>> imoveis(n);
int total_pessoas = 0;
int total... | ALGO | 0.996636 | 4.005807 | {
"github_metadata": {
"branch": "master",
"commit_count": 480,
"repo_created_at": "2020-02-27T13:16:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "95d1653... |
153fdc0d-af8e-4942-b95f-2dcd926181c4 | Guney-olu/working-g2o-python | g2o/g2o/types/sba/edge_sba_cam.cpp | // g2o - General Graph Optimization
// Copyright (C) 2011 <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:
//
// * Redistributions of source code must retain the above copyright notic... | ALGO | 0.995554 | 7.190232 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-04T14:08:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5248d0227f06... |
6bd55375-5116-46b2-9e6a-ab9d0ca99e97 | igoingdown/leetcode | eat_cheese_1.cpp | #include <iostream>
#include <vector>
#include <math.h>
#include <limits.h>
using namespace std;
double eatCheese(vector<pair<double, double>>& cheeses);
void dfs(int len, vector<pair<double, double>>& cheeses, double sum, pair<double, double>& start, double& ans, vector<bool>& visit);
int main() {
vector<pair<do... | ALGO | 0.999855 | 3.755651 | {
"github_metadata": {
"branch": "main",
"commit_count": 536,
"repo_created_at": "2021-08-23T02:33:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "782c5aa9cf... |
6feef8b7-2346-4c57-a703-d369c578d29b | khushidjobanputra/AOA | AOA/bellman.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter the number of vertices: ";
cin>>n;
int cost[n][n];
cout<<"Enter the cost matrix: "<<endl;
for(int i=1; i<=n; i++){
for(int j=1; j<=n; j++){
cin>>cost[i][j];
}
}
int v;
cout<<"Enter ... | ALGO | 0.999976 | 3.936531 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-05-04T14:35: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": "9bce426828... |
f85db876-c3f0-483c-82db-87eb5321defd | iskilia/Coding-Challenges | Algorithms:ProblemSolving/hacker-rank-sherlock-and-anagrams.cpp | #include <bits/stdc++.h>
#include <string>
#include <vector>
using namespace std;
bool isAnagram(string s1, string s2){
if(s1.length() != s2.length()){
return false;
} else {
bool flag = true;
vector<int> letters1(26,0), letters2(26,0);
for (int i = 0; i < s1.length(); i++){
... | ALGO | 0.999958 | 4.41626 | {
"github_metadata": {
"branch": "master",
"commit_count": 145,
"repo_created_at": "2017-08-10T22:51: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": "109d5284... |
7e54589e-707b-49fd-a749-54c8f62f4610 | raincross7/code-similarity | codes/train_code/problem302/problem302_299.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long lo... | ALGO | 0.999938 | 4.943674 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0789726e8d3d... |
5b229f2c-c782-437a-9b19-3f1a567c1e30 | mcejp/fixed-point-math | sqrt.hpp | #ifndef FIXED_POINT_MATH_SQRT_HPP
#define FIXED_POINT_MATH_SQRT_HPP
#include <stdint.h>
#include "log2.hpp"
// Implementation is based on http://www.cs.uni.edu/~jacobson/C++/newton.html
template <int TOLERANCE_BITS = 6, int MAX_ITERATIONS = 10>
uint32_t Sqrtu(uint32_t number) {
if (!number) {
// special... | ALGO | 0.999051 | 6.725059 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-10-27T09:29:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a7f52cf36c2... |
b1154f00-a96f-4e25-bff4-8e2c0b5f6836 | Fresh-up/leetcode | 剑指 Offer 32 - III. 从上到下打印二叉树 III/双端队列.cpp | class Solution {
public:
vector<vector<int>> levelOrder(TreeNode* root) {
if (root == nullptr) return {};
vector<vector<int>> res;
bool ltor = true;
deque<TreeNode*> q;
q.push_back(root);
while (!q.empty()) {
int len = q.size();
vector<int> tmp... | ALGO | 0.999993 | 6.344407 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2022-03-17T02:36:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4960880a06... |
b52fda6f-71c7-4c4d-8eac-82052f4c8e28 | harshxtanwar/dsa-rev-AZ | dp/form_2/dp-form-2-max-area-square.cpp | /*
Maximum Area of Square
Description
Given a grid of size n*m with 0s and 1s, you need to find the area of the largest square containing only 1.
Input Format
The first line of the input contains one integer t - the number of test cases. Then t test cases follow.
The first line of each test case contains two space... | ALGO | 0.999821 | 5.401534 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-14T11:45: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": "4c61b1e95136... |
90d07dc9-6df6-4fae-ba89-7cb8b784f6ab | divyansh1511/Placement_prep | Compay Archieves/Autodesk/2_maximum_digits.cpp | // Given an array of integers a, your task is to calculate the digits that occur the most number of times in the array.
// Return the array of these digits in ascending order
#include<bits/stdc++.h>
using namespace std;
vector<int> MaximumDigits(vector<int> v){
vector<int> t(10 , 0);
for (int i = 0; i < v.siz... | ALGO | 0.999967 | 5.253649 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2023-03-15T12:07: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": "9998601d4e1... |
10843b65-012f-434d-a7b6-9afee2412516 | Jonathan-L-Davidson/AppliedMathematics | DX11Framework/Physics/Vector3.h |
/// IM AT PAGE 35 GO TO PAGE 35 DO NOT CONTINUE THIS UNTIL I COMPLETE CHAPTER 2
#ifndef VECTOR3_H
#define VECTOR3_H
#include "Core.h"
#include "math.h"
#include "DirectXMath.h"
namespace Physics {
// I do not like this implementation, it's from: https://web.archive.org/web/20100330183043/http://nlindblad.org/2007/... | TOOL | 0.973229 | 5.559554 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2024-01-08T14:40: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": "dd3d8aca... |
0717e60f-e207-4014-bed1-5c24ae38241e | ryanpsloan/cnm | C++/C++ III/Sorting/Sort.cpp | #include "Sort.h"
#include <sstream>
#include <fstream>
void Sort::bubblesort(int Arr[],int size) //This is sort A
{
for (int i = size -1 ; i >= 0; --i ) {
for (int j = 0; j < i; j++) {
if (Arr[j] > Arr[j+1]) {
int t = Arr[j];
Arr[j] = Arr[j+1];
Arr[j+1] = t;
}
}
}
}
void Sort... | ALGO | 0.999305 | 4.476229 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-11-21T20:02: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": "574eca165b... |
25cab57a-b0f5-4c96-97f8-b68aa96fe126 | yijunyu/demo | datasets/github_cpp_10/3/132.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <cstdlib>
template<class ValueType>
class Iterator;
template<class ValueType>
struct Node {
Node *left = nullptr;
Node *right = nullptr;
Node *parent = nullptr;
const ValueType value;
size_t size = 1;
Node(ValueType val) : va... | ALGO | 0.999057 | 5.533844 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2019-03-16T07:13:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b1d2121... |
50a73151-70de-4122-920a-c1f1d98c7773 | artemon87/C- | Binary/Binary/Binary.cpp | #include "Binary.h"
#include <iostream>
using namespace std;
////////////////////////////////////////////////////////////////////////////////
//invariant: Number that we want to convert to binary is limited to an integer//
////////////////////////////////////////////////////////////////////////////////
//Default con... | ALGO | 0.990833 | 4.526301 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-04-06T06:30: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": "e3454732c4... |
e7db40e3-ab1c-4efc-90ff-c442f7135e38 | idvr/pacs | Exercises/factory_Makefile_1/es/es/makefile/src/numerical_integration.hpp | #ifndef __NUMERICAL_INTEGRATION_HPP
#define __NUMERICAL_INTEGRATION_HPP
#include <vector>
#include "numerical_rule.hpp"
#include "mesh.hpp"
/*!
\file numerical_integration.hpp
\brief delegating the rule over a single interval
The previous organization is subject to various criticisms:
-# The class encapsula... | ALGO | 0.943666 | 6.133498 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2012-10-08T02:28:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 111,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0add318... |
30064d29-0369-44dc-8ba1-a17da0797335 | SI-Abid/Hello-world | Weekly/w114a.cpp | #include "bits/stdc++.h"
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define be begin()
#define en end()
#define all(x) (x).begin(),(x).end()
#define out cout<<setprecision(20)
typedef vector<int> vi;
typedef vecto... | ALGO | 0.999942 | 3.505881 | {
"github_metadata": {
"branch": "master",
"commit_count": 669,
"repo_created_at": "2017-11-14T13:37:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96842507... |
a1da1f74-ef69-46ad-8d4f-14b72e24eaec | xufuq/myLeetcode | program/395.cpp | #include <map>
#include <set>
#include <queue>
#include <string>
#include <time.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
// 分而治之
int longestSubstring(string &s, int startIndex, int endIndex, unordered_map<char, int> &totalMp, const int &k) {
unorde... | ALGO | 0.999922 | 4.416723 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-03-26T03:02: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": "54e87334f1... |
08aabe16-b5a7-4504-8f20-aad95c776634 | ishandutta2007/codeforces-p | peterr/normal/1148/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 3E5;
pair<int, int> s[MAXN];
int t[MAXN];
vector<tuple<int, int, int>> neg;
vector<tuple<int, int, int>> pos;
int main()
{
int n;
cin >> n;
long long sum = 0;
for (int i = 0; i < n; i++)
{
cin >> s[i].first;
s[i].secon... | ALGO | 0.999976 | 3.108578 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49: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": "9f7f02f80c27... |
fba5c994-cab3-401c-b976-167112235337 | aei1987/leetcode_test | Leetcode/conclusion/动态规划.cpp |
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<algorithm>
#include<deque>
using namespace std;
/**********************************************************************************************************
1. 最长公共子序列
2. 最长公共子串
3. 最... | ALGO | 0.99977 | 3.647076 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2020-10-12T15:01: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": "738ae5750... |
fdf1c437-3754-4539-b073-63cdce2c1752 | LRih/UVa-Problems | src/558 Wormholes.cpp | #include <cstdio>
#include <climits>
#include <vector>
#define MAX_NODES 1000
using namespace std;
struct edge
{
int start, end, cost;
};
int nodeCnt;
vector<edge> network;
int cost[MAX_NODES];
// bellman ford
bool findNegativeCycle()
{
cost[0] = 0;
for (int i = 1; i < nodeCnt; i++)
cost[i] = IN... | ALGO | 0.999084 | 4.306712 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2015-05-30T12:31: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": "421312d07... |
d0e3c0d7-754e-429f-80e5-dd6cdd0629a3 | ChoiDW614/algorithm_solve | question1463/question1463/main.cpp | #include <iostream>
#define FAST_IO std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr);
int table[1000001];
void Solve()
{
int N, cnt = 0;
std::cin >> N;
table[1] = 0;
table[2] = 1;
table[3] = 1;
for (int i = 4; i <= N; i++) {
table[i] = table[i - 1] + 1;
if (i % 6 == 0) {
if (table[i - 1] > ... | ALGO | 0.999953 | 3.715383 | {
"github_metadata": {
"branch": "main",
"commit_count": 114,
"repo_created_at": "2021-05-11T06:58:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b1bc96d41... |
a1515421-710c-4428-9877-424527cfb741 | Ch4n7/POJ_solutions | p2456-agressive_cows.cpp | #include <stdio.h>
#include <algorithm>
#define MAX_N 100000
#define MAX_X 1000000000
#define SUCC 1
#define FAIL 0
using namespace std;
int n, c, stalls[MAX_N];
int check(int dist);
int
main()
{
int i, left, right,
mid, ans;
scanf("%d%d", &n, &c);
for (i = 0; i < n; i++)
scanf("%d", stalls + i);
sort(s... | ALGO | 0.999997 | 3.416469 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-10-10T05:59:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a35c27361b... |
4e3e80d8-15e2-48a9-b445-5ef367d03bda | Md-Merazul-Islam/XPSC-Batch-3 | Weekly Task/11th week Supper XPSC/day-6/B_Grab_the_Candies.cpp |
/**************************************************************
** <NAME> **
** Author: <NAME> **
** CST, MPI **
** Sreepur, <NAME> **
*****************************************... | ALGO | 0.999877 | 4.288313 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2023-10-12T10:57:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7d1473e9d... |
b4caff98-2cbd-4bfd-8427-6c7d8a925087 | love2d/love-old | src/modules/physics/box2d/Source/Collision/b2TimeOfImpact.cpp | /*
* Copyright (c) 2007 <NAME> http://www.gphysics.com
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose,
* includi... | ALGO | 0.999863 | 7.000413 | {
"github_metadata": {
"branch": "master",
"commit_count": 330,
"repo_created_at": "2010-06-02T16:12:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 102,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d8680... |
9fd04978-11b5-4865-9d96-103f51c46fc5 | cquinn2020/Static-Sort-Library | ExchangeSort.cpp | #include "SortLib.h"
/* Exchange Sort:
- Simple sort in which every element in the list will be compared
to all other elements in the list. If the element on the left is greater
than the element on the right, they are swapped.
*/
template <typename T>
void SortLib::ExchangeSort(T arr[], int size) {
// Itera... | ALGO | 0.999636 | 5.417261 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-03-05T16:06: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": "3c6a41228205... |
78d797ed-35ab-4c2d-916a-0bd10aa9b387 | sandialabs/platoengine | base/src/optimize/Plato_Radius.hpp | /*
//@HEADER
// *************************************************************************
// Plato Engine v.1.0: Copyright 2018, National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain r... | ALGO | 0.997464 | 6.59884 | {
"github_metadata": {
"branch": "develop",
"commit_count": 3238,
"repo_created_at": "2024-01-09T20:36:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af799ac... |
e20db11b-ec00-4b41-a5f7-e361e9dc7cfb | dhruvramani/DSA-NITW | Graphs/bft_order.cpp | #include <iostream>
using namespace std;
# define n 5
int index(int a[], int m, int b)
{
for(int i=0; i<m; i++)
if(a[i] == b)
return i;
return -1;
}
int visited[n] = {0}, visit = 1;
void print_order(int G[][n], int start)
{
int init_visit = ::visit;
if(::visit >= n)
{
... | ALGO | 0.999982 | 4.600386 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2017-07-31T14:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cc34f5df... |
85899b87-cac9-4157-9418-35ee341ab505 | someshfengde/cses-problems-and-cp-practice | Sum_of_Two_Values.cpp | /*
You're my honeybunch, sugar plum
Pumpy-umpy-umpkin
You're my sweetie pie
You're my cuppycake, gumdrop
Snoogums, boogums, you're
The apple of my eye
And I love you so
And I want you to know
That I'm always be right here
And I want to sing
Sweet songs to you
Because you are so dear...
*/
#include <bits/stdc++.h>
#in... | ALGO | 0.999959 | 3.800166 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-09-24T10:16:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d81924761e... |
872529ad-60ec-4aaa-bf24-d62e5d6f304e | ReKrieg/Computer-Science-Practicum-UGM | Week7/Assignment7.cpp | #include <iostream>
using namespace std;
// Function to perform addition
int add(int a, int b) {
return a + b;
}
// Function to perform subtraction
int subtract(int a, int b) {
return a - b;
}
// Function to calculate factorial
int factorial(int x) {
if (x <= 1)
return 1;
else
return ... | ALGO | 0.977668 | 5.51154 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-09-21T01:40: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": "88454742e7b... |
ff262a64-b6ad-45f9-b617-3008ca918c9a | metehkaya/Algo-Archive | Problems/CSES/Sorting_and_Searching/Sliding_Median.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define maxn 200001
using namespace std;
typedef pair<int,int> pi;
typedef pair<pi,int> pii;
int n,k,m;
pii ar[maxn];
int val[maxn];
int tree[4*maxn];
bool comp(const pii& a , const pii& b) {
return a.se < b.se;
}
int query( int x , int y , int rem , int i... | ALGO | 0.99999 | 3.489041 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-04-04T19:44:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "979753b0fbd... |
6bec78fd-7584-451b-807b-6875451b0dab | xuyuanxin/notes | algocoding/leetcode/rotate_list.cpp | /*******************************************************************************
Rotate List(Medium)
*******************************************************************************
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2... | ALGO | 0.999958 | 5.415378 | {
"github_metadata": {
"branch": "master",
"commit_count": 590,
"repo_created_at": "2014-10-10T15:18:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 13
},
"file_meta": {
"content_id": "1db92eb... |
c788e6fa-3a7c-42cf-a0f7-22e12c6cc562 | zhuango/leetCode | nowcoder/score.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long long teamScore = 0;
void getScore(vector<vector<long long>> &score, long long index, long long sa, long long sb, long long ts)
{
if(sa == sb && ts > teamScore)
{
teamScore = ts;
}
if(index >= score.size())
... | ALGO | 0.999826 | 3.744941 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2016-02-02T11:11:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f30d98... |
5a18fa40-f78e-4311-bd6e-ca5037fa5344 | vietnakid/ACM-ICPC | CodeForces/1091/1091D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;
typedef vector<ll> vl;
typedef vector< vector<ll> > vvl;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector< vii> vvii;
#define INF 1000000007
#define INFLL 100000000000000000... | ALGO | 0.999949 | 4.110164 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-04-07T11:55: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": "6a90e7e05... |
17fb9817-8753-4669-a7cd-1fc1813a26b2 | Feisdhy/HUST-ComputerExamination | 2018/单词个数统计.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
int letter[26];
int main()
{
string s;
getline(cin, s);
int letters = 0, words = 0, max = 0;
for (int i = 0; i < s.size(); i ++ )
{
if (isalpha(s[i]))
{
while (isalp... | ALGO | 0.999908 | 3.51265 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-10-12T09:53:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7e667abbd2... |
69a35d85-bfaa-4712-834f-ff834f3ca123 | weekchen/learn_data_structure | Queue&Stack/decoder_string.cpp | //
// Created by chenzhiji on 18-10-18.
//
#include "iostream"
#include "stack"
#include "queue"
#include "cmath"
using namespace std;
class DecoderString {
public:
string decodeString(string s) {
string result;
stack<char> stack1;
for(auto i : s){
if(i != ']')
... | ALGO | 0.998443 | 4.489176 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2018-10-08T06:24:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb7356f04... |
de226351-1303-4cd8-9cb1-ab35f73bbf8a | lprdsb/acm | 2023/9/20/E2.cpp | #include<bits/stdc++.h>
#define For(i, a, b) for(int i = (a), en = (b); i <= en; ++i)
#define Rof(i, a, b) for(int i = (a), en = (b); i >= en; --i)
#define Tra(u, i) for(int i = hd[u]; ~i; i = e[i].net)
#define cst const
#define LL long long
#define i128 __int128_t
#define DD double
#define LD long double
#define pb pu... | ALGO | 0.999931 | 3.773542 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2023-12-25T11:03:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "100472af2... |
ed8e8bee-129d-4c42-92c5-34adf2cb9f8d | GOPIS28/c_plus0522 | pro (102).cpp | #include <iostream>
using namespace std;
int main() {
int rows, cols;
cout << "Enter the number of rows for the matrix: ";
cin >> rows;
cout << "Enter the number of columns for the matrix: ";
cin >> cols;
int matrix[rows][cols];
cout << "Enter elements of the matrix:" << endl;
for (int i... | ALGO | 0.999865 | 5.531395 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-14T07:41: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": "136e112d4436... |
6591d103-8aaf-481d-b04c-e47a97326ed1 | khanhnamle1994/technical-interview-prep | LeetCode/Roman-To-Integer.cpp | // Given a roman numeral, convert it to an integer.
// Input is guaranteed to be within the range from 1 to 3999.
class Solution {
public:
inline int map(const char c) {
switch (c) {
case 'I': return 1;
case 'V': return 5;
case 'X': return 10;
case 'L': return 50;
... | ALGO | 0.999568 | 5.820646 | {
"github_metadata": {
"branch": "master",
"commit_count": 1000,
"repo_created_at": "2017-05-22T05:00:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 668,
"forks": 203,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "799... |
4ef6a5b7-0628-459d-a406-8c447baac19c | ryuumorimoto/CppRepo | Algorithm/過去問/2022/1.cpp | #include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
template <typename T>
int find_nMax(T array, int n, bool isFirst) {
int order = n;
int count = 0;
int proceed = 1;
while (true) {
if (proceed == order) {
break;
}
... | ALGO | 0.99991 | 3.149101 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-07-06T10:08: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": "977bc6c3786f... |
947d919b-04c3-4f51-9d17-76402eb53b22 | arjungm/pr2_kinodynamics | pr2_trajectory/src/test/inverse_dynamics_computation_cost_test.cpp | //author: <NAME>
//email: <EMAIL> OR <EMAIL>
#include <ros/ros.h>
#include <pr2_mechanism_model/chain.h>
#include <pr2_mechanism_model/robot.h>
#include <kdl/chain.hpp>
#include <kdl/jntarray.hpp>
#include <kdl/jntspaceinertiamatrix.hpp>
#include <kdl_parser/kdl_parser.hpp>
#include <kdl/tree.hpp>
#include <kdl/chaini... | ALGO | 0.954408 | 4.626912 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2013-12-11T17:15: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": "be8f8a52a5... |
af4df69c-6f4e-430f-b237-6af59a4d3cf6 | zcy05331/code-backup | Codeforces/Codeforces Round #620 (Div. 2)/D.cpp | #include <bits/stdc++.h>
#define R register
#define ll long long
#define sum(a, b, mod) (((a) + (b)) % mod)
const int MaxN = 2e5 + 10;
char s[MaxN];
int n, now, a[MaxN];
int main()
{
int T;
scanf("%d", &T);
while (T--)
{
scanf("%d%s", &n, s + 1), s[n] = '>', now = n;
for (int i = 1; ... | ALGO | 0.999939 | 3.357313 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2020-02-19T14:44:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db8191d5b... |
2abdf6e2-57a7-4f9b-874e-f4d18f3d278b | Yash-YC/Source-Code-Plagiarism-Detection | gcj/gcj/188266/yangjunqi/168107/0/extracted/main.cc | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cassert>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <sstream>
#include <numeric>
#include <iostream>
using namespac... | ALGO | 0.99967 | 3.712986 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-08-24T05:46:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11430803144... |
fe18db15-f1bd-4169-b21f-08b2dbeb4fd9 | ishandutta2007/codeforces-s | s2speed/normal/594/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll , ll> pll;
typedef pair<int , int> pii;
typedef pair<pii , int> piii;
const ll MAX_N = 1e6 + 20 , md = 1e9 + 7;
struct segtree {
int sz = 0;
vector<ll> val;
void init(int n){
sz = 1;
while(sz < n) sz *= 2;
val.assign(2 *... | ALGO | 0.999984 | 4.529982 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74a0aa122be0... |
8f2c8060-119c-41a0-96de-b200c3d790ef | 1Kori256/skola_semester1 | byrokraticky_aparat.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <set>
#include <queue>
#include <map>
typedef long long ll;
using namespace std;
ll LcmOfArray(vector<ll> arr, ll idx){
if (idx == arr.size()-1){
return arr[idx];
}
ll a = ar... | ALGO | 0.999969 | 3.753897 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-18T13:07: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": "fd9056ee2668... |
83c931b9-42df-4172-8f4b-e4810d5fa715 | hsdaoqi/algorithms | 杂项/计算三元环,四元环.cpp | i64 CalcThree(std::vector<std::pair<int, int>> &edges, int n) {
std::vector<int> deg(n + 1);
for (auto &[u, v]: edges) deg[u]++, deg[v]++;
std::vector<std::vector<int>> adj(n + 1);
for (auto &[u, v]: edges) {
if (deg[u] > deg[v]) {
std::swap(u, v);
} else if ((deg[u] == deg[... | ALGO | 0.999594 | 5.230103 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-01-01T14:55:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8410364e9f... |
ef6becbe-1521-4702-bed0-b02f1219b536 | overhab/ft_containers | include/rbtree.hpp | #pragma once
#include "Includes.hpp"
#include "tree_iterator.hpp"
namespace ft {
template<class key_type, class T, class Compare = std::less<key_type>, class A = std::allocator<ft::s_Node<T> > >
class RBTree {
public:
typedef T value_type;
typedef ft::s_Node<T> Node;
typedef std::allocat... | ALGO | 0.966493 | 5.789045 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-01-05T16:58:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e99c0b918... |
70e297cc-b949-497f-9e61-5671ca0fa98f | kua-as-exe/coding-notebook | cpp/problems/omegaup/Mensajeria~5506/jorge.cpp | #include <bits/stdc++.h>
using namespace std;
#define value first
#define pos second
bool myfunction (pair<int, int> i, pair<int, int> j) {
return (i.value < j.value);
}
int main(){
int N, K, centrales = 0;
cin >> N >> K;
vector <pair<int, int>> c_o(N);
int t;
for (int i = 0; i < N; i++) {
cin >... | ALGO | 0.999862 | 3.865142 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2021-07-05T04:32:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2554739626e... |
b43df43a-5d42-44fd-ae03-d20b7e5d4a06 | Hamsik2rang/Today-I-Solved | Problems/Dynamic_Programming/11054.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
#define MAXN 100'002
vector<int> input;
int fmemo[MAXN], bmemo[MAXN];
int n;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
//freopen("input.txt", "r", stdin);
cin >> ... | ALGO | 0.999826 | 3.876688 | {
"github_metadata": {
"branch": "main",
"commit_count": 310,
"repo_created_at": "2021-03-05T00:53:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66c7c27b88... |
b1498c7a-127f-4bc5-9f30-76e9c089135b | urlagushka/polytech-labs | tp/T3/sub-commands.cpp | #include "sub-commands.hpp"
#include <algorithm>
#include <functional>
#include <cstddef>
#include <numeric>
#include <stdexcept>
#include <string>
#include "area-calc.hpp"
#include "data-structs.hpp"
#include "pred-comp.hpp"
turkin::ReturnType turkin::area_odd(data_t & data, std::string &)
{
std::vector< Polygon ... | ALGO | 0.932932 | 6.1755 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-05-14T14:20:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "838126bf0b9... |
3126c49b-8181-4330-9c51-d35a81e727fa | DmitriyVolkov/TCHMK1 | BigInt.cpp | #include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include "Struct.h"
#pragma warning(disable : 4996)
int main(int argc, const char * argv[])
{
struct BigInt A;
struct BigInt B;
struct BigInt Res;
if (argc < 5 || argc>7)
{
printf("Incorrect arguments!\n");
p... | ALGO | 0.966091 | 3.545652 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-06-23T05:26: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": "417b7d4262... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.