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 |
|---|---|---|---|---|---|---|---|
5c96e8d9-f550-435c-874f-4f56f35e4279 | rajanraj2/CodeForces | CF_Round_966_D3/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
unordered_set<int> st;
bool flag = true;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
st.insert(a[0]);
... | ALGO | 0.999974 | 4.919546 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2024-06-06T15:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "428fc66eb94... |
e568c2f9-3c64-4a78-a536-352915f38b1c | acfr/snark | point_cloud/applications/points-calc/types.h | // This file is part of snark, a generic and flexible library for robotics research
// Copyright (c) 2011 The University of Sydney
// 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. Redistr... | ALGO | 0.940828 | 6.688009 | {
"github_metadata": {
"branch": "master",
"commit_count": 4979,
"repo_created_at": "2012-10-05T04:59:05.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "vlaskine/snark",
"stars": 71,
"forks": 41,
"issues": 42,
"pull_requests": 2
},
"file_meta": {
"content_... |
50a6513e-4de4-4e32-8da1-84509c1b71dd | raykong1/Competitive-Programming-sols | Dmoj/ccc02s5.cpp | #include <bits/stdc++.h>
#define INF 0x3f3f3f3f
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pdd pair<double, double>
using namespace std;
int N, M, tot = 0;
double P, Q;
pii slope;
pdd pos;
vector<pdd> p;
vector<pair<pdd, pdd>> borders(4);
bool corner... | ALGO | 0.999918 | 3.736833 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-05-08T00:29: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": "b98257a90a... |
030aeff3-4bce-486c-a7d7-422b36ef6639 | NVIDIA/cutlass | include/cutlass/arch/mma_sm80.h | /***************************************************************************************************
* Copyright (c) 2017 - 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are p... | ALGO | 0.988834 | 6.168304 | {
"github_metadata": {
"branch": "main",
"commit_count": 667,
"repo_created_at": "2017-11-30T00:11:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8078,
"forks": 1336,
"issues": 322,
"pull_requests": 54
},
"file_meta": {
"content_id": "8d... |
93e4eaae-0806-4165-8f5f-b2c67fd896d4 | okmd/leetcode | greedy/lb-22-swap-and-maximize.cpp | // given an array of elements
// re arrange the array such that difference between consecutive elelment is minimum.
// diff(ai=ai+1) .. assume circular array
long long int maxSum(int arr[], int n) {
// sort the array and re-arrange such that consecutive elements have max diff
// it can only be possible if in s... | ALGO | 0.999948 | 4.829109 | {
"github_metadata": {
"branch": "main",
"commit_count": 529,
"repo_created_at": "2021-04-26T11:40:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b623ea157... |
e519254c-878e-4199-8d5a-90a3fda3448e | cuong02n/CodeArena | codeforces/archive/1882/1882C.cpp | /*
author : cuong2905say
created : 25-09-2023 22:17:32 UTC: +7
*/
#include <bits/stdc++.h>
#define all(A) (A).begin(), (A).end()
#define sc scan_single()
#define int long long
using namespace std;
using ll = long long;
using ull = unsigned long long;
template <class T1, class T2>
ostream& operator<<(ostream&... | ALGO | 0.999834 | 4.886595 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-02-07T13:48:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f612178f96... |
4fe81c9e-5122-4de8-94bf-2bac9ebe5911 | ba-ys/knu_cpp | C++ Chapter9/Chapter9_6.cpp | #include <iostream>
using namespace std;
class AbstractStack {
public:
virtual bool push(int n) = 0;
virtual bool pop(int& n) = 0;
virtual int size() = 0;
};
class SimpleStack : public AbstractStack {
int max_size;
int top_index;
int* stack_data;
public:
SimpleStack(int size);
~SimpleS... | ALGO | 0.922295 | 4.532634 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2025-03-06T05:35:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "798cce0a4... |
51a483cf-abdd-476b-9d1b-eb8f084fab24 | mdarify1337/cpp--module | cpp-01/ex04/main.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | TOOL | 0.908087 | 4.560977 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-03-20T09:49:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "236468973b... |
83499199-d27d-4ab1-aaec-c931777d01fa | Ziklon/algorithms | tc/testprograms/CarrotJumping.cpp | #include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
using namespace std;
typede... | ALGO | 0.999868 | 4.053791 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2012-12-28T20:25:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "494baf7e6... |
5a0dfc19-67d3-42db-bc04-03db4067249e | serge2nd/ifmo-mtp-2016 | src/dijkstra_main.cpp | #include <iostream>
#include "graph/graph_mpi.h"
using std::cout;
using std::setw;
using std::endl;
using std::string;
using std::to_string;
using std::stod;
using std::stoi;
using std::vector;
using std::fstream;
using std::istream;
using std::ios_base;
using std::out_of_range;
using std::invalid_argument;
using std:... | ALGO | 0.995901 | 5.196143 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-10-22T16:56: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": "d933ea55fe... |
ec95864f-c923-4c4e-8c16-f08a31ffccad | ulhaspawar/DSA | src/two_edge_connected_graph.cpp | #include <vector>
#include <stack>
#include <limits>
#include <algorithm>
using namespace std;
bool isBridgeFound(const int vertex, const int parent, const int time, vector<int> &discoveryTime, const vector<vector<int>> &edges);
bool areAllNodesVisited(const vector<int> &discoveryTime);
bool twoEdgeConnectedGraph(ve... | ALGO | 0.99939 | 5.65216 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-02-23T13:59:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "731bfb22b34... |
8001b294-4035-44c2-bff6-be446e111e04 | ishandutta2007/codeforces-j | jakube/normal/940/F.cpp | #include <bits/stdc++.h>
using namespace std;
struct Query
{
int t, l, r;
int i;
pair<int, int> idx = {0, 0};
bool operator<(Query o) {
if (idx == o.idx)
return r < o.r;
return idx < o.idx;
}
int result = -1;
};
int main() {
ios_base::sync_with_stdio(false);
... | ALGO | 0.99991 | 4.502658 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00cd3db05218... |
fad7c6b4-92a5-4ebe-bc68-fc542ac6ed48 | jeonggyunkim/problemsolving | boj/db82bcc0053f.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s;
int n, r;
cin >> s >> r;
n = s.size();
vector<bool> mask(n, 0);
for (int i = 0; i < r; ++i) mask[i] = 1;
int ans = 0, cnt = 0;
do {
int dir = 0,temp = 0;
for (in... | ALGO | 0.999805 | 3.762603 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-10-04T16:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2c3af712... |
b35dacd8-6d98-491c-94f8-c12320f3025e | aditya0567/GFG-Code-solution | Difficulty: Hard/Word Break (Trie)/word-break-trie.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:
// A : given string to search
// B : vector of available strings
int wordBreak(string A, vector<string> &B) {
//c... | ALGO | 0.997141 | 4.993701 | {
"github_metadata": {
"branch": "main",
"commit_count": 363,
"repo_created_at": "2024-08-02T07:00: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": "8bcb8069f7... |
945a9685-df14-4d7c-b5e7-36f676784c7a | monero-project/monero | src/common/updates.cpp | // Copyright (c) 2017-2024, The Monero Project
//
// 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 o... | TOOL | 0.913456 | 6.10604 | {
"github_metadata": {
"branch": "master",
"commit_count": 12102,
"repo_created_at": "2014-04-30T14:38:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9640,
"forks": 3235,
"issues": 477,
"pull_requests": 247
},
"file_meta": {
"content_id"... |
7f21b957-f0fe-407f-90fd-fe6c10c322fc | mkatliar/tmpc | tmpc/qp/CondensingN2.hpp | #pragma once
#include <tmpc/ocp/DynamicOcpSize.hpp>
#include <tmpc/ocp/OcpTree.hpp>
#include <tmpc/ocp/OcpSolution.hpp>
#include <tmpc/qp/OcpQp.hpp>
#include <tmpc/Math.hpp>
#include <tmpc/Exception.hpp>
#include <vector>
#include <numeric>
#include <array>
namespace tmpc
{
/**
* \brief CondensingN2 algorithm wit... | ALGO | 0.999302 | 4.504765 | {
"github_metadata": {
"branch": "master",
"commit_count": 817,
"repo_created_at": "2023-05-02T21:49:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "696c7ce5... |
a2717cec-6007-4022-b2c5-c43876b79388 | benjaminhuanghuang/ben-leetcode | 1572_Matrix_Diagonal_Sum/solution.cpp | /*
1572. Matrix Diagonal Sum
Level: Easy
https://leetcode.com/problems/matrix-diagonal-sum
*/
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <algorithm>
#include <functional>
#include "common/List... | ALGO | 0.999916 | 5.924392 | {
"github_metadata": {
"branch": "master",
"commit_count": 380,
"repo_created_at": "2020-01-26T01:12:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcf4a586... |
5e96cefa-b9a0-405e-b4bd-0e17dcdde99f | EPFLRocketTeam/2018_SP_FLIGHT_SIM-CONTROLLER | Triangulation/codegen/exe/find_rocket_c/find_rocket_c.cpp | //
// Academic License - for use in teaching, academic research, and meeting
// course requirements at degree granting institutions only. Not for
// government, commercial, or other organizational use.
// File: find_rocket_c.cpp
//
// MATLAB Coder version : 4.1
// C/C++ source code generated on : 18-Jun-20... | ALGO | 0.999963 | 5.13493 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2018-02-19T20:46:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e94a3bd36... |
a33bff1f-2d3a-4e29-b638-60c0b5311648 | cs-cshi/Algorithm | hot100/019.removeNthFromEnd.cc | // 给你一个链表,删除链表的倒数第 n 个结点,并且返回链表的头结点。
#include <iostream>
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
// 19. 删除链表的倒数第 N 个结点
// 快慢指针思路:快指针先移动 N+1 步,然后再同步移动
// N... | ALGO | 0.999929 | 5.465092 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2022-02-16T09:20:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5e5bb2d... |
2a239876-83cf-4821-92fc-aeab505937cb | schrodinger/coordgenlibs | sketcherMinimizerAtom.h | /*
* sketcherMinimizerAtom.h
*
* Created by <NAME> on 13/04/2010.
* Copyright Schrodinger, LLC. All rights reserved.
*
*/
#ifndef sketcherMINIMIZERATOM_H
#define sketcherMINIMIZERATOM_H
// #include <sketcherMinimizerPointF>
#include "CoordgenConfig.hpp"
#include "sketcherMinimizerMaths.h"
#include <iostream... | TOOL | 0.935499 | 4.881195 | {
"github_metadata": {
"branch": "master",
"commit_count": 201,
"repo_created_at": "2017-06-12T09:41:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 44,
"forks": 29,
"issues": 23,
"pull_requests": 2
},
"file_meta": {
"content_id": "7ec8ad... |
48d0fc3f-1368-4a89-896e-b7ea6220ac23 | Hikari9/UVa | 153 - Permalex.cpp | #include <iostream>
#include <cstring>
#include <map>
#include <set>
#include <algorithm>
#define MX 35
#define endl '\n'
using namespace std;
typedef long long lag;
map<int, int> factors[MX];
// pregen prime factors
void pregen() {
for (int i = 2; i < MX; ++i) {
factors[i] = factors[i - 1];
int x = i;
for (i... | ALGO | 0.999688 | 3.984253 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-01-03T04:44:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbc0309c... |
2adfe805-b521-4887-a85e-b2ba995f3ce0 | dlgldgldgld/algorithm-study | BOJ/clear/BOJ7562(나이트의 이동).cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
using namespace std;
struct Node {
int y, x, move;
Node(int a, int b, int c) : y(a), x(b), move(c) { }
};
int visit[301][301];
int dy[8] = { 2,1,-1,-2,-2,-1,1,2 }, dx[8] = { 1,2,2,1,-1,-2,-2,-1 };
int main(void) {... | ALGO | 0.999927 | 3.402084 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2017-08-30T19:14:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8278f17c... |
05bc8141-ed8a-4ef2-a709-9f1f64d66471 | vutuancong/C--Combination. | Chap 5-AVL_BST tree/CayTKNPCanBangAVL.cpp | #include <iostream>
using namespace std;
struct node
{
int info;
int height;
struct node *left;
struct node *right;
};
class AVL
{
public:
node *Tree;
node *create_node(int );
node *insert_node(node *,int);
node *search_node(node *,int );
node *rotate_right(node *);
node *rotate_left(node *);
node... | ALGO | 0.999874 | 3.986266 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-05T14:43:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5b9156349... |
216f5d5a-4059-46d2-8663-bbc73e957eda | ysmin709/Algorithm-Excercise | Programmers Level 2/캐시/cache.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int cacheSize, vector<string> cities) {
int answer = 0;
vector<string> vec;
if (cacheSize == 0) return cities.size() * 5;
for (int i = 0; i < cities.size(); i++) {
for (int j = 0; j < cities[i].size(); j++) {
... | ALGO | 0.999867 | 5.137026 | {
"github_metadata": {
"branch": "main",
"commit_count": 347,
"repo_created_at": "2021-02-09T02:52:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4b485a36f... |
04a2dd9e-d843-444e-b65a-045c06cf6d19 | firewood/topcoder | atcoder/abc_247/e.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std;
static const int64_t INF = 1LL << 60;
int64_t solve(int64_t N, int64_t X, int64_t Y, std::vector<i... | ALGO | 0.999958 | 4.565892 | {
"github_metadata": {
"branch": "master",
"commit_count": 4451,
"repo_created_at": "2011-04-18T02:33:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57c66b... |
3d82e42b-56d7-4e14-80b2-f6adf382e41f | LineYK/Algorithm | 백준/Silver/16567. 바이너리 왕국/바이너리 왕국.cc | /*
바이너리 왕국
시간 제한 메모리 제한
2 초 512 MB
문제
바이너리 왕국의 불쌍한 하인들은 매일 바이너리 길을 청소한다.
바이너리 길은 N개의 0 또는 1로 이루어진 수열이다.
0은 깨끗한 칸, 1은 더러운 칸을 의미한다.
그들은 "flip"이라는 기술만을 사용해서 청소를 한다. 이것은 연속된 더러운 칸을 깨끗하게 만드는 기술이다.
즉, 연속된 1을 모두 0으로 만든다.
바이너리 왕국의 악덕한 왕은 매일 하인들에게 M개의 시련을 내리는 것이 취미이다.
시련에는 2가지 종류가 있는데 다음과 같다.
- "0": 현재 길의 모든 칸을 깨끗하게 만들기 위... | ALGO | 0.999987 | 4.578753 | {
"github_metadata": {
"branch": "main",
"commit_count": 869,
"repo_created_at": "2022-03-12T10:20: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": "cbd9d760a5... |
64890a18-292f-4925-9398-405a6752d362 | Bill-Board/All-problem-solving | commonProblemSolved/quick sort.cpp | //<NAME>
//ALLAH IS WATCHING ME
#include<bits/stdc++.h>
#include<cstring>
#include<cmath>
//#include<quick.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//Sequence Containers : vector,deque,list....
#define vc vector<char>
#define vi vector<int>
#define vs vector<string>
#define dqi deq... | ALGO | 0.999969 | 3.467419 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-14T19:53:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "b72b778399bc... |
49ab1b1a-efbb-4b97-9a18-21addf840a77 | makio93/competitive-atcoder | abc207/abc207_d/main1.cpp | // 解説AC
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i))
#defin... | ALGO | 0.999915 | 3.489784 | {
"github_metadata": {
"branch": "main",
"commit_count": 925,
"repo_created_at": "2021-04-23T16:25: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": "d986e04810... |
5b57e69e-e3aa-4b69-a304-2a291c275db0 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/14/53/4.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
... | ALGO | 0.999789 | 3.55142 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-30T05:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c781995... |
a7831141-67e8-48a8-ab9c-fd122856f21b | Robin-Bjornsdotter/Graph_Labs | lab05/Matrix.h | #pragma once
#include <vector>
#include <fstream>
#include <iostream>
#include <algorithm>
enum RepresentationType {
AdjacencyList,
AdjacencyMatrix,
IncidenceMatrix,
DegreeSequence
};
enum GraphType {
Undirected,
Directed
};
class Matrix {
public:
// Any matrix will be converted to adjacency list beca... | ALGO | 0.954905 | 5.833787 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2018-03-02T13:09:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1f21831b... |
20b84ed8-eb05-4815-8ab7-9a066c0345b7 | rajeevt09/AlgorithmsCode | graphs/part2/distforguard.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
#include <string>
#include <queue>
using namespace std;
class cell
{
public:
cell(int x,int y):m_x(x),m_y(y){}
~cell(){};
int getX(){return m_x;};
int getY(){return m_y;};
private:
int m_x;
int m_y;
};
bool isOpen(char c)
{
if(c == ... | ALGO | 0.999847 | 4.541563 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-14T20:53: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": "c068d873c5... |
930611aa-e1b7-4e89-a785-254896b2ff1d | Sanchester4/ProcessesSemaphore | SemaphoreProcesses.cpp | #include <iostream>
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/types.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#define SHM_KEY 0x12345
struct shmseg {
int counter = 1;
int write_complete;
... | ALGO | 0.998743 | 5.057708 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-12-14T00:22: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": "a218bdd455... |
8336f36e-70d7-4ded-bfb2-c52a0ab3152c | wjdwocks/BaekJoon | 1074번 Z/1074번 Z/소스.cpp | #include <iostream>
#include <vector>
#include <cmath>
// (x, y)는 좌측 위 좌표, first, last는 그 네모에 포함되는 수들. length는 네모의 변 길이 r, c는 타겟값.
int func(int x, int y, int first, int last, int length, int r, int c)
{
if (length == 1)
{
return first;
}
if (r < length / 2 && c < length / 2) // 좌측 위 네모
{
return func(x, y, fir... | ALGO | 0.999698 | 3.353912 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-07-17T00:52:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3d4013105d0... |
21d78388-10af-4ee9-8e40-ce757a408fb4 | shubhampatil11/rubiks-cube-solver | Solver/DFSSolver.h | //
// Created by <NAME> on 02-01-2022.
//
#include<bits/stdc++.h>
#include "../Model/RubiksCube.h"
#ifndef RUBIKS_CUBE_SOLVER_DFSSOLVER_H
#define RUBIKS_CUBE_SOLVER_DFSSOLVER_H
// Typename T: RubiksCube Representation used (3d, 1d, Bitboard)
// Typename H: Corresponding Hash function
template<typename T, typename H... | ALGO | 0.999456 | 4.964375 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-12-12T12:06:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 19,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05dc80d42... |
46c0f2ea-7ae0-4050-88ea-3191cdfeb4a2 | tbharathchandra/LawnBot | build/cgal_catkin/cgal-prefix/src/cgal/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_face_base_2.h | // Copyright (c) 2016-2018 INRIA Nancy (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : <NAME> <<EMAIL>>
// <NAME>
#ifndef CGAL_HYPERBOLIC_TRIANGULATION_FACE... | ALGO | 0.961599 | 7.006373 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-05-07T16:00:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b026143e6... |
bfd8e601-fbb7-4e8f-bf66-62593dd7e536 | Kuroko201/Tic-Tac-Toe-7x7-cpp | Tic Tac Toe 7x7.cpp | //Tic Tac Toe game made by Kuro201.
//For practice use, if you found any bugs, feel free to tell me!
// default is 7x7 grid, 5 same letters to win
// This should work no matter the size of the grid and the same letters to win
#include <iostream>
#include <string>
#include <Windows.h>
const int boardWidth = 7;
const i... | ALGO | 0.97462 | 5.142789 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-12-22T03:56:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "228fcf3fa5... |
f636349d-f0bc-4694-90c3-e2f44b7e1bf9 | ArnabbiswasAB/Leetcode-Solved-Questions | Number of Longest Increasing Subsequence - GFG/number-of-longest-increasing-subsequence.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int NumberofLIS(int n, vector<int>&arr) {
// Code here
vector<int>dp(n,1);
vector<int>cnt(n,1);
int maxi = 0;
for(int i=0; i<n; i... | ALGO | 0.999883 | 6.037457 | {
"github_metadata": {
"branch": "main",
"commit_count": 1814,
"repo_created_at": "2022-08-27T18:08: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": "b11b774e4... |
211563f6-f9b5-4a0c-8503-e8f66045ee09 | ishandutta2007/codeforces-s | sunset/normal/883/D.cpp | #include<bits/stdc++.h>
#define inf 1000000000
#define N 1000009
using namespace std;
int n,cnt,sum[N],f[N],a[N]; char s[N];
int calc(int l,int r){
if (l<1) l=1;
// cout<<" "<<l<<' '<<r<<endl;
if (l>r) return 0; return sum[r]-sum[l-1];
}
int getnxt(int i){
if (i<1) i=1;
return i>n?n+1:f[i];
}
bool check(int t){
... | ALGO | 0.999269 | 3.195811 | {
"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": "41cea067b53f... |
4a39df86-5c86-4677-b53b-a448c4e108e4 | chanyoung990704/Baekjoon_Practice | 백준/Silver/10815. 숫자 카드/숫자 카드.cc | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N; cin >> N;
vector<int> has_card(N);
for(int i = 0 ; i < N ; i++)
cin >> has_card[i];
int M; cin >> M;
vector<in... | ALGO | 0.999986 | 4.22141 | {
"github_metadata": {
"branch": "main",
"commit_count": 1466,
"repo_created_at": "2023-08-02T14:22: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": "e30d4d454... |
b73c78fa-5d18-4a83-8480-fe2a15fa6f32 | LakshithaAnand/Assembler | siscas.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>
#include <algorithm>
#include <iterator>
#include <string>
#include <cmath>
#include <cstring>
using namespace std;
std::vector<std::string> machine_prog_lines;
std::vector<int> line_nbr;
std::vector<std::string> output;
std::v... | TOOL | 0.955623 | 3.986209 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-10-15T21:25: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": "12b1c46d7c80... |
8f14f8f0-71ff-4bb1-8fed-da012fbf0331 | shawbicc/rover-stuff | arduino/navigation-flysky/navigation_flysky_v4/navigation_flysky_v4.ino |
double ch1=10; // previously A0
double ch2=11; // previously A1
int sp=0;
// left
#define ARPWM 6
#define ALPWM 9
#define A1ENRF 7
#define A2ENBL 12
// right
#define BRPWM 3
#define BLPWM 5
//#define B1ENLF 10
#define B1ENLF A3 // <---------- changed
#define B2ENBR 2
#define speed 200
void stop(){
// LF + ... | ALGO | 0.982552 | 3.895785 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2024-02-23T06:44:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5731831caae... |
d1306722-8e6d-4a97-bb7e-0d40d65e8a17 | sarahklock/estudo-dirigido-1 | sarah2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
vector<int> nums, compare;
int somatorio = 0, sim_ou_nao, somatorio2;
do{
int n;
cout << "Digite um numero inteiro: ";
cin >> n;
nums.push_back(n);
cout << "Voce deseja ... | TOOL | 0.997393 | 3.865575 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-09-16T19:46: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": "5fa398aa7e... |
61a7d9e1-b8f3-47f9-9e6e-f3a1a50d8563 | TemaBlag/Contests | contest4/task3.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n + 1);
for (int i = 1; i <= n; ++i) {
cin >> a[i];
}
int min_a = *min_element(a.begin() + 1, a.end());
int max_a = *max_element(a.... | ALGO | 0.999956 | 4.485068 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-01-29T15:57:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b482c322c94... |
d81ae333-b438-41a6-974b-028806c324ba | KevinP0102/COMP4411_Trace | RaySkelS20/src/RayTracer.cpp | // The main ray tracer.
#include <Fl/fl_ask.h>
#include "RayTracer.h"
#include "scene/light.h"
#include "scene/material.h"
#include "scene/ray.h"
#include "fileio/read.h"
#include "fileio/parse.h"
#include "ui/TraceUI.h"
extern TraceUI* traceUI;
extern std::vector<vec3f> distributedRays(vec3f ray, double radius, int... | ALGO | 0.969843 | 6.324029 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-11-04T10:21:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4c734c42c43... |
dba08920-883e-45d9-b888-5cd6ed13804f | insus100/FAL22-23 | FALProblems/Reservas_de_elefantes/Reservas_de_elefantes.cpp | // Nombre del alumno .....
// Usuario <NAME> ......
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
using namespace std;
typedef long long int llint;
// función que resuelve el problema
llint resolver(vector<llint> const & nacimientos, int const &index1, int const &index2) {
if (inde... | ALGO | 0.999922 | 4.449931 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2022-09-25T10:53:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "136d7de0d70... |
4f7f5e37-9951-4642-89ac-46af79cfafea | mangophant/PAT | AdvancedLevel/1014WaitingInLine.cpp | #include<iostream>
#include<iomanip>
#include<queue>
using namespace std;
int main()
{
queue<int> * window;
int N, M, K, Q, customer, index, *processingTime, *finishTime;
cin >> N >> M >> K >> Q;
processingTime = new int [K]; //Processing time for customers: minutes
finishTime = new int [K]; ... | ALGO | 0.999849 | 3.322079 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2019-07-06T16:26:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d10c5e4a1... |
7e83d071-84e7-42f4-b892-1db29642e587 | google-ai-edge/mediapipe | mediapipe/examples/desktop/autoflip/quality/polynomial_regression_path_solver.cc | // Copyright 2019 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or a... | ALGO | 0.999682 | 7.060198 | {
"github_metadata": {
"branch": "master",
"commit_count": 4767,
"repo_created_at": "2019-06-13T19:16:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30689,
"forks": 5453,
"issues": 443,
"pull_requests": 149
},
"file_meta": {
"content_id"... |
ab1e7d0a-f132-4a4c-bc3f-7b7c38b058cd | drewdzzz/Differentiator | operators.hpp | #ifndef CALC_TREE_OPERATORS_INCLUDED
#define CALC_TREE_OPERATORS_INCLUDED
#include <math.h>
namespace OPE //Operator errors
{
enum ERR
{
OK,
NOT_EXIST,
HAS_VARIABLE,
DIVIDE_TO_ZERO
} LAST_ERR;
};
static char operators[] = {'-', 1, '+', 1, '*', 2, '/', 2, '^', 3};
bool is_... | ALGO | 0.931881 | 3.958555 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2019-11-16T22:07: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": "b991e0fd3... |
ba1a1c74-39f7-4d59-9fd7-51976a6d2e77 | ani555/SPOJ | DICT.cpp | //be careful of the input output format
#include<bits/stdc++.h>
using namespace std;
#define CHAR_TO_INDEX(c) ((int)c-(int)'a')
struct Trie_node
{
int value;
Trie_node *children[26];
};
class Trie
{
private:Trie_node* root;int count;
public:
Trie()
{
root= getnode();
count=0;
}
Trie_node *getnode()
{
Trie... | ALGO | 0.999731 | 3.921914 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-04-22T20:48: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": "48574dd7a4... |
1dd06f95-62fb-4f39-a4a5-73df4872b9ac | skyqinsc/ACM | HDU-5296-hdu5296-Annoying problem.cpp | /*
* Algorithm: 在线LCA
* Date: 2015-08-26
* Contest: 2015 多校(1)
*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#define INF 1<<29
#define mod 1000000... | ALGO | 0.99998 | 4.208362 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2015-08-19T02:51:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "69ab405ce... |
58f471ec-03d6-41c5-b221-58ad1e2fb332 | ruchit1131/Data_Structures | Heap/Heap_sort.cpp | #include<bits/stdc++.h>
using namespace std;
int parent_less_than_child(int arr[], int pos, int n)
{
int lc = pos * 2 + 1;
int rc = pos * 2 + 2;
if(rc < n)
{
if(arr[rc] >= arr[lc])
{
if(arr[rc] > arr[pos])
return rc;
else
return 0;
}
else
{
if(arr[lc] > arr[pos])
return lc;
else
... | ALGO | 0.999973 | 4.432166 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-03-22T11:49: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": "3196add99... |
3b3ed883-d777-4a18-b61b-1927c1761636 | dhruv-yadav-nitj/striver-a2z-dsa-cpp | Step 16 ~ Dynamic Programming/05. DP ON STRINGS (VVV. IMP)/34-LONGEST-COMMON-SUBSTRING.CPP | #include <bits/stdc++.h>
#define ll long long
using namespace std;
// https://practice.geeksforgeeks.org/problems/longest-common-substring1452/1
// https://takeuforward.org/data-structure/longest-common-substring-dp-27/
// APPROACH: can be considered a follow up ques to DP-32
// dp[n][m] will not give us the answer;... | ALGO | 0.999974 | 5.790103 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2023-06-07T19:26:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5110f2f8... |
23143aba-c7e6-4430-84d7-e95202def971 | sdheke/4883-Programming_Techniques | Assignments/P07/10107.cpp | // <NAME>
// CMPS 4883
// Top in CS: Prog. Tech
// Fall 29020
// Professor <NAME>
// Due date: 10/21/2020
// Problem 10107
#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std ;
void insertionSort( int *num, int i )
{
while( i > 1 && num[ i ] < num[ i - 1 ] )
{
swap( num[ i ] , num[ i ... | ALGO | 0.999864 | 4.057139 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2020-08-31T16:53: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": "fbc0a14ea... |
7e3d58ce-b98e-4401-a8ce-d9381222ec62 | Gitspike/Bebop | basic2_2.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
class Matrix
{
public:
int** matrix = NULL;
int row, col;
Matrix(int row, int col);
~Matrix();
Matrix(Matrix& matrix);
void inputMatrix();
void outputMatrix();
void addMatrix(Matrix A1, Matrix A2);
void subMatrix(Matrix A1, Matrix A2);
Matrix& operat... | ALGO | 0.996548 | 3.960562 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-11-18T04:15: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": "95414a4cb0... |
fd23bd8c-0eaa-4d40-9dff-4cc5b0a6c6b2 | mority/motis-0.x.y | modules/nigiri/src/guesser.cc | #include "motis/nigiri/guesser.h"
#include "utl/enumerate.h"
#include "utl/to_vec.h"
#include "guess/guesser.h"
#include "nigiri/timetable.h"
#include "motis/core/common/logging.h"
#include "motis/nigiri/location.h"
namespace mm = motis::module;
namespace n = nigiri;
namespace {
constexpr auto const kClaszMax =
... | ALGO | 0.974947 | 7.078463 | {
"github_metadata": {
"branch": "master",
"commit_count": 495,
"repo_created_at": "2024-10-16T13:11: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": "c6eb3e3e... |
532de765-9ca5-4f55-881a-2d0efd5affd7 | Ananditha-phindla/LeetCode-DSA | 34-find-first-and-last-position-of-element-in-sorted-array/find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
int findFirstOcc(vector<int> &nums, int target){
int lo = 0;
int hi = nums.size() - 1;
int first = -1;
while(lo <= hi){
int mid = lo + (hi-lo)/2;
if(nums[mid] == target){
first = mid;
hi = mid - 1;
... | ALGO | 0.999946 | 6.213782 | {
"github_metadata": {
"branch": "main",
"commit_count": 235,
"repo_created_at": "2025-02-15T08:02:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0536ec641b... |
756cf617-4786-44f4-9420-e9c813512db4 | ishandutta2007/codeforces-x | xellos/normal/1338/A.cpp | // iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <chrono>
#include <random>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include ... | ALGO | 0.999582 | 4.457691 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38: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": "69edd03f45f0... |
82d50620-f930-470a-9e90-06eeeca3d1a0 | tahiri-lab/source-code | code_source/muscle/dividetree.cpp | #include "muscle.h"
#include "tree.h"
void MakeSubsetNodes(const Tree &InputTree,
const vector<uint> &SubsetNodes,
const vector<string> &SubsetLabels,
Tree &SubsetTree);
void DivideTree(const Tree &InputTree, uint Node,
Tree &Subtree, Tree &Supertree)
{
asserta(InputTree.IsRooted());
const uint InputNodeC... | ALGO | 0.901353 | 4.645868 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-08-05T14:59:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9218d9c01b6b... |
ff4a6843-7542-44e7-be95-2455a4846f85 | a62625536/ACM | Codeforces/797_D.cpp | #include<bits/stdc++.h>
using namespace std;
int n,a[100005],l[100005],r[100005],vis[100005] = {0};
map<int,int> mp;
struct xx
{
int x;
xx():l(NULL),r(NULL){};
xx *l,*r;
}*root;
void insertt(int now,xx *&p)
{
p = new xx;
p->x = a[now];
if(l[now] > 0) insertt(l[now],p->l);
if(r[now] > 0) ... | ALGO | 0.999867 | 3.438076 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-02-04T09:56: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": "e02c6ae508... |
50c53217-fcda-4fca-b861-9f6a966ce9b1 | ishandutta2007/codeforces-y | yashchandnani/normal/906/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int i = a; i <= (n); ++i)
#define repD(i, a, n) for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a) ... | ALGO | 0.999198 | 3.310123 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "640be386a806... |
58fc7324-3b40-422f-893a-7cf5322d8aba | ishandutta2007/codeforces-p | physics0523/normal/1394/C.cpp | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define d 12
using namespace std;
int dx9[16]={0,-1,-1,-1,0,0,1,1,1};
int dy9[16]={0,-1,0,1,-1,1,-1,0,1};
int n;
int f1(int x,int y){return x;}
int f2(int x,int y){return y;}
int f3(int x,int y){return... | ALGO | 0.999934 | 3.395119 | {
"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": "dd5a57db2035... |
ae8a6759-2102-46cb-accf-0fbf82b58449 | alu0101333588/CyA_P08_2023 | practica/Simbolo.h | // Universidad de La Laguna
// Escuela Superior de Ingenier ́ıa y Tecnolog ́ıa
// Grado en Ingenier ́ıa Inform ́atica
// Asignatura: Computabilidad y Algoritmia
// Curso: 2º
// Práctica 1: Símbolos, alfabetos y cadenas
// Autor: <NAME>
// Correo: <EMAIL>
// Fecha: 30/09/22
// Archivo Simbolo.h: clase Simbolo.
// Contie... | TOOL | 0.916221 | 4.335099 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-11-19T17:13: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": "e7b48b47f9bf... |
fc4daf44-b4a8-4dbf-bb74-4a255defdb2c | tymefighter/CompetitiveProg | codeforces/1420D.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
const int N = 300005;
const long long MOD = 998244353;
int n, k;
pair<int, int> seg[N];
map<int, int> begin_, cont;
void readInput() {
scanf("%d %d ", &n, &k);
begin_.clear();
cont.clear();
for(int i = 0;i <... | ALGO | 0.999989 | 4.53467 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2019-05-11T04:22:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcf4ad064... |
fcd8adbd-854f-4810-9a0e-a206cebe9028 | narosan/Algoritmo-UVA | C++/14042018/ex1.cpp | /*
1. Fazer um programa para calculo de dabuada.
O usuario devera informar um valor inicial
e um valor final, os valores não podem ser zero, negativos
e nem o segundo valor menor que o primeiro caso aconteça,
mensagem de erro para retorno da digitação
o usuario tambem ira inforamr ate qual valor o calculo sera
feito e... | ALGO | 0.995481 | 3.646186 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-04-13T18:14: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": "f9c9b5490... |
6fb7df7b-3bcb-498c-a9b5-e653825a09eb | Jaredandres/C-exercises | vectorScore.cpp | #include <iostream>
#include <vector>
/*
💡 Problem: "Clean and Organize Scores"
Write a C++ program that:
Asks the user to enter any number of test scores (integers).
Stops when the user enters -1.
Stores the scores in a vector<int>.
Removes any score lower than 50.
Sorts the remaining scores in descending ord... | ALGO | 0.998964 | 5.049035 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-06-17T22:36: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": "62b6b1bae41c... |
d0d62e2e-6a29-493d-922f-2e7a970ef5e3 | correaa/iterator-zipper | zipper_test.cpp | #ifdef compile_instructions
clang++ -std=c++14 -O3 -Wfatal-errors -lboost_system -lboost_timer $0 -o $0.x -lstdc++fs && $0.x $@ && rm -rf $0.x; exit
#endif
#include "./zipper.hpp"
#include <vector>
#include <iostream>
#include <random>
#include <boost/timer/timer.hpp>
#include <algorithm> // std::sort
#include <list>
... | ALGO | 0.997706 | 5.551572 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-02-09T23:20: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": "0a4ae04ccc... |
8ed99833-ca04-46dd-82ae-56f4784e6ecb | ali-hasrat/DSA-Cpp | Reverse-of-Linked-List.cpp | #include<bits/stdc++.h>
using namespace std;
struct node {
int data;
struct node *next;
};
// We construct a linked list and use this function to push elements to the list
void push(struct node **head, int data)
{
struct node *node;
node = (struct node*)malloc(sizeof(struct node));
node->data =... | ALGO | 0.999964 | 5.109671 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-01-24T19:31:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d74e1022a9... |
deec4bb0-97b9-4e0c-a258-518ae47be4c4 | pgrones/advent-of-code-2024 | day10/main.cpp | #include <unordered_set>
#include "../lib/lib.h"
using namespace std;
struct coordinate {
int x;
int y;
string to_string() {
return std::to_string(x) + "," + std::to_string(y);
}
};
int traverse(coordinate currPos, const vector<vector<int>> &map, unordered_set<string> &seen, const bool all =... | ALGO | 0.999819 | 6.619145 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2024-12-01T16:41:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c1cf754a71... |
5ca508b7-cd71-462d-8590-12c966096ac4 | justanotheruser/Diplom | Код/EllipseDetection_FornaciariPrati/EllipseDetection_FornaciariPrati/FornaciariPratiDetector.h | #include "EllipseDetector.h"
#include <list>
#include <iostream>
#pragma once
using cv::Mat;
using cv::Point;
typedef std::vector<Point> Arc;
typedef std::vector<Arc> Arcs;
typedef std::vector<Ellipse> Ellipses;
// TODO: replace this class with tuples after switching to C++14
class Triplet
{
public:
Triplet(int fir... | ALGO | 0.975143 | 6.115484 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2015-03-15T11:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad775cb29... |
619de971-bc76-4b95-8d1a-e069d483f871 | billy-cg/billy-cg | decicion c++/guia2ejer14.cpp | #include <iostream>
using namespace std;
/**
Hacer un programa para ingresar por teclado la fecha de nacimiento de una persona,
ingresando día, mes y año como 3 datos individuales. Luego ingresar la fecha actual ingresando día,
mes y año como 3 datos individuales. Calcular luego la edad en años de esa persona y list... | ALGO | 0.908124 | 3.636004 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-05-17T17:57:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "352ff79a0a1... |
f0897c88-eca0-444d-8081-9941e1037a5a | ADITYADEVANSH/C-plus-plus-Questions-Solution | recursion/N Queen (using 2D Vector).cpp | /******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
******************************************... | ALGO | 0.999815 | 5.211557 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-01-24T23:05: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": "6fc2d351684... |
22e34bca-0fad-4c9e-a9ce-7958e1d215c3 | omsingh10/dsa_with_c_-_java | Pattern29.cpp | #include <iostream>
using namespace std;
int main() {
int n = 5;
// Upper half of the diamond
for (int i = 1; i <= n; i++) {
for (int j = i; j < n; j++) {
cout << " ";
}
for (int j = 1; j <= i; j++) {
cout << j;
}
for (int j = i - 1; j ... | ALGO | 0.999922 | 5.250638 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2025-02-02T12:40:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4016e8aa9... |
f43a64aa-377d-4f2f-9697-2da3f424b3d0 | bak3839/baekjoon_cpp | 백준/Gold/1477. 휴게소 세우기/휴게소 세우기.cc | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N, M, Len;
vector<int> rest;
void Solution() {
int L = 1, R = Len, mid, cnt, ans = 0;
while(L <= R) {
cnt = 0;
mid = (L + R) / 2;
for(int i = 1; i < rest.size(); i++) {
int diff = rest[i]... | ALGO | 0.999996 | 3.97204 | {
"github_metadata": {
"branch": "master",
"commit_count": 1166,
"repo_created_at": "2022-08-20T05:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b6438a... |
6446fc48-6d82-4a36-9fc3-74948dec1d17 | Mr-Magnificent/ds-algo | class14_recursion/floodFill.cpp | // import java.util.*;
#include <bits/stdc++.h>
using namespace std;
void floodFill(vector<vector <int>>& arr, int i, int j, string ans)
{
if (i == arr.size() - 1 && j == arr[0].size() - 1)
{
cout << (ans) << endl;
return;
}
if (i < 0 || i >= arr.size())
return;
if (j < 0 || j >= arr[0].size())
return;
i... | ALGO | 0.999756 | 3.877871 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-07-24T14:35: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": "d205d9ec2... |
fd74cccd-1194-4552-881f-dbfd79fccf28 | dongd908/Flex-deployer | scheme_lhq.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <memory>
#include <string.h>
#include "graph.h"
#include "types.h"
#include "tensor.h"
#include "attr_value.h"
#include "ge_error_codes.h"
#include "ge_api_types.h"
#include "ge_ir_build.h"
#include "all_ops.h"
#include <vector>
#include <unordered_s... | ALGO | 0.929779 | 3.748526 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-13T03:25:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52ae891a2a11... |
bfdb60d7-d6a9-4616-a7c5-13cd24941246 | nvcc1701/dsa | PTIT/code tham khao/CTDL_GT_CPP/contest10/bai19bangSo.cpp | #include<bits/stdc++.h>
using namespace std;
// contest10/bai19bangSo
#define INF 1e9
int n,m;
int arr[501][501];
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
int cost[501][501];
struct Point{
int x,y,w;
Point(int X,int Y,int W){
x = X;
y = Y;
w = W;
}
};
void init(){
cin>>n>>m;
for(int i=0;i<n;i++){
... | ALGO | 0.999973 | 3.916803 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2020-10-06T05:07:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3afc4438... |
064f1f87-1f28-4e1e-9c8f-ad8be2701530 | Igorok/algorithms-js | algorithm_issues/5/6/main.cpp | /*
Last Digit of the Partial Sum of Fibonacci Numbers
Sample 1.
Input:
3 7
Output:
1
Sample 2.
Input:
10 10
Output:
5
*/
#include<iostream>
#include<vector>
using std::vector;
// I already know period is 60
vector<int> fibonacci_remainders = { 0, 1 };
void generate_fibonacci_remainders () {
int a = 0;
in... | ALGO | 0.999942 | 4.260161 | {
"github_metadata": {
"branch": "main",
"commit_count": 269,
"repo_created_at": "2023-12-01T18:21:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "196d544ac8... |
3076898c-f829-460b-ad95-c86d6851232b | wenqf11/LeetCode | C++/409. Longest Palindrome/solution.h | #pragma once
#include <vector>
#include <queue>
#include <string>
#include <climits>
#include <algorithm>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
using namespace std;
class Solution {
public:
int longestPalindrome(string s) {
int n = s.size();
int a[52] = {0};
for... | ALGO | 0.999973 | 5.435236 | {
"github_metadata": {
"branch": "master",
"commit_count": 374,
"repo_created_at": "2016-09-08T14:55: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": "710dab1e... |
1b977de7-07ce-4218-911e-6a8f14261f38 | jossergio/LeetCode | d2021_07_19/modelo1.h | class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if (root->val == p->val || root->val == q->val) // Se é um dos nós, então, é ele
return root;
if (p->val < q->val) // Os caras podem mandar dessa forma ou não
if (root->val > p->val && root->val < q... | ALGO | 0.999979 | 6.166128 | {
"github_metadata": {
"branch": "main",
"commit_count": 992,
"repo_created_at": "2021-07-17T20:20: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": "8001e96b5a... |
3d8ce83d-1bc0-45ed-8f93-ba65a665ae0d | Jiheyy/study | new_13460.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;
struct TURN {
int by, bx, ry, rx; // 위치
int sec;
int game_end = 0; // 0 continue 1 win 2 lose
};
// y, x
int n, m, answer;
int blank_y, blank_x;
vector <string> arr;
// 왼쪽으로 기울이기
TURN up(TURN turn) {
int cur_by = t... | ALGO | 0.999994 | 3.654196 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2021-12-20T16:07:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f00f9aaecfa... |
c5fdc4f6-c80e-4d79-ac57-42c232201d39 | shakespete/CP-PS | Implementation/HR_algo_implem_chocolate-feast/HR_algo_implem_chocolate-feast/main.cpp | //
// main.cpp
// HR_algo_implem_chocolate-feast
//
// Created by <NAME> on 4/2/21.
//
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int chocolateFeast(int n, int c, int m) {
int bars = 0;
int eatIdx = 0;
int wrappers = 0;
int* eaten = new int[n];
bars = n / c;
eaten[eatIdx++] = bars;... | ALGO | 0.999951 | 4.730783 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2020-02-02T14:33:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "001fdaf9... |
1d9152c1-e520-48cd-916f-9e6d7f78e18c | maxudd/ode-sev-2022 | 4-symbolic-image.cpp | #include <math.h>
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <time.h>
#include "types.h"
using namespace std;
int main(){
setlocale(LC_ALL, "Russian");
double x_left=-1, y_top=1.5, x_right=1, y_down=-1.5, h=0.0325, a=0.2,b=-0.2;
Area area(x_left, y_top, x_right, y_down);
int n... | ALGO | 0.999181 | 4.185686 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-08-16T08:38:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a04e308b4bb... |
a11333f8-ea9e-4781-b6a1-6f4128530135 | YhgzXxfz/leetcode | continuous_subarray_sum.cpp | // hashmap
class Solution {
public:
bool checkSubarraySum(vector<int>& nums, int k) {
unordered_map<int, int> mp;
mp[0] = -1;
int sum = 0;
for (int i = 0; i < nums.size(); ++i) {
sum += nums[i];
int mod = k == 0 ? sum : sum%k;
if (mp.f... | ALGO | 0.999946 | 6.256228 | {
"github_metadata": {
"branch": "master",
"commit_count": 824,
"repo_created_at": "2015-05-01T15:51:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ee6e9ca... |
f0d61239-da13-41b2-8f63-544db72814cc | fajiivanainen/AdventOfCode24 | AdventOfCode24/CPP/Day4.cpp | #include "Day4.hpp"
int Day4::findWordCount(std::string str, std::string key1, std::string key2){
int count = 0;
size_t pos1 = str.find(key1);
size_t pos2 = str.find(key2);
while(pos1 != std::string::npos) {
count++;
pos1 = str.find(key1, pos1 + key1.length());
}
// find rever... | ALGO | 0.998492 | 4.576141 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-02T18:38: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": "a38a2c97ebb6... |
7ecc4f0b-a37a-4766-8d0e-4f7d5154cc9d | tianliyu/DSMGA-II-TwoEdge | myrand.cpp | /***************************************************************************
myrand.cc - description
-------------------
begin : Sep 24 2001
copyright : (C) 2001 by <NAME>
email : <EMAIL>
***************************************************************************/
/****... | ALGO | 0.995846 | 4.63349 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-08-22T05:23:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1701c0762... |
f7c229ab-e72c-42ad-84c3-4b5dbc63c102 | joearrigo/Walker | walker-arduino/walker.ino | #include <Servo.h>
const int trigPin = 9;
const int echoPin = 10;
const int servoPin = 6;
const float Kp = 1;
const float Ki = 1;
const float iteration_time = 66;
float desired_value = 20;
float error = 0;
float error_prior = 0;
float integral = 0;
float output = 0;
float duration = 0;
float distance = 0;
Servo ... | TOOL | 0.966363 | 5.262628 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-09-15T14:31: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": "4940624954... |
7d2cb706-2603-4153-93db-f866055816a3 | google/monster-mash | third_party/libigl/include/igl/bfs_orient.h | // This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2013 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.... | ALGO | 0.992868 | 6.305123 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-01-28T21:04:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1312,
"forks": 182,
"issues": 24,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe0389... |
27e3d408-a43b-423e-8bfb-252f1db9b8ca | thepluck/CP-Training | APIO/APIO2021/Day4/swap.cpp | #include "swap.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
struct node {
int endP[2], par, size, val;
} comp[MAXN];
int wpar[MAXN], depth[MAXN];
vector <int> adj[MAXN];
int root(int u) {
while (comp[u].par >= 0) u = comp[u].par;
return u;
}
bool join(int u, int v, i... | ALGO | 0.999921 | 4.69697 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-12-11T09:33:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fbaff22ea52... |
6d5ce304-19b4-4013-a1e5-9bb274bfb3c7 | muhammadhasan01/cp | Online Judge/Codeforces/Contests/DIV1/DIV1-664/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, d, m;
vector<int> v[2];
int len[2];
vector<long long> pre[2];
int ceil(int a, int b) {
return (a + b - 1) / b;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n >> d >> m;
for (int i =... | ALGO | 0.999935 | 3.804477 | {
"github_metadata": {
"branch": "master",
"commit_count": 1187,
"repo_created_at": "2019-07-13T15:49:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf3253f... |
03284f76-ddbf-4443-8c6f-32d0c30d51f1 | NVIDIA/DALI | dali/operators/generic/reduce/reduce.cc | // Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
/... | TOOL | 0.979508 | 7.590347 | {
"github_metadata": {
"branch": "main",
"commit_count": 3924,
"repo_created_at": "2018-06-01T22:18:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5465,
"forks": 643,
"issues": 218,
"pull_requests": 39
},
"file_meta": {
"content_id": "1d... |
685b88f1-1677-4931-b02d-b81fc8d1cb08 | amitprat/NewPracticeCode | C++/bits/DivideWithoutDivisionOperator.h | #include "../header.h"
class DivideWithoutDivisionOperator {
public:
static void test() {
DivideWithoutDivisionOperator obj;
vector<pair<int, int>> tests = {{-2147483648, -1}};
for (auto test : tests) {
cout << obj.divide(test.first, test.second) << endl;
}
}
... | ALGO | 0.974001 | 5.652206 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-08-05T06:01: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": "2868f41109fe... |
10ec202c-3e8d-4149-9445-de1aba8db526 | yanglr/leetcode-ac | cpp-leetcode/leetcode370-range-addition(locked)_difference_array.cpp | #include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
class Solution {
public:
vector<int> getModifiedArray(int length, vector<vector<int>> &updates) {
// 技巧: 差分数组
vector<int> diff(length + 1, 0);
for (int i = 1; i <= updates.size(); i++)
{
vector<... | ALGO | 0.999938 | 5.865231 | {
"github_metadata": {
"branch": "master",
"commit_count": 644,
"repo_created_at": "2016-04-23T08:14:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 135,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbe2... |
69d02111-a9f2-4a5e-99bb-31f3669543a7 | salehbarkaibrahim/projetphp.POO | C++.cpp | #include <iostream>
#include <string>
using namespace std;
// Fonction pour déterminer si une année est bissextile ou non
bool estBissextile(int annee) {
if (annee % 4 != 0) {
return false;
} else if (annee % 100 != 0) {
return true;
} else if (annee % 400 != 0) {
return false;
... | TOOL | 0.995885 | 4.856893 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-04-19T21:43: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": "aec4791fb13a... |
2e397abd-14fa-4495-a22a-dc6c9cc9023b | B1ackBeltDev/SzkolaIT | Na24.03/wydawanie_reszty.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void solve(int n, vector<int> v, int k, bool limited){
int kbegin = k;
sort(v.begin(), v.end());
vector<int> ans;
for(int i = n-1; i >= 0; i--){
if(limited){
if(k-v[i] >= 0){
ans.pu... | ALGO | 0.999921 | 4.072819 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-02-15T10:22: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": "b85d56094f2a... |
197845b3-4473-467b-ace5-083ad78ab18a | iamfahim/Codeforces | Offline Solve/588B.cpp | //<NAME>
#include<bits/stdc++.h>
#define PI acos(-1.0)
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ms(a,b) memset(a, b, sizeof(a))
#define filein freopen("input.txt", "r", stdin)
#define fileout freopen("output.txt", "w", stdout)
#define debug cout<<... | ALGO | 0.999956 | 4.084475 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2019-07-04T16:33: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": "1b3537c4d... |
581f92c0-83d5-4830-8955-640633d98ce6 | WOLFIEEEE/LeetCode_Solutions | 1448-count-good-nodes-in-binary-tree/1448-count-good-nodes-in-binary-tree.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.999788 | 5.823556 | {
"github_metadata": {
"branch": "main",
"commit_count": 508,
"repo_created_at": "2021-12-24T07:28: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": "3179017cc2... |
0f263df7-435f-436a-89bb-ce6e01b02eae | autowarefoundation/autoware_universe | localization/yabloc/yabloc_common/include/yabloc_common/ground_server/util.hpp | // Copyright 2023 TIER IV, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... | TOOL | 0.952853 | 6.837646 | {
"github_metadata": {
"branch": "main",
"commit_count": 8531,
"repo_created_at": "2021-11-19T02:59:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1208,
"forks": 763,
"issues": 216,
"pull_requests": 161
},
"file_meta": {
"content_id": "9... |
dd5ceba2-2b7d-4f28-b299-7988d0b43874 | SliverOverlord/Threading-MPI | Threading/projects/joshua.denioAssig3.2 copy.cpp | /*
Author: <NAME>
Date: 04/01/2020
Program: Assignment02
Description:
To compile: g++ -O3 -w joshua.denioAssig3.cpp -lpthread -o joshua.denioAssig3
To run: ./joshua.denioAssig3 filename n
example:
./joshua.denioAssig3 toyGraph1.txt 4
note: n is the number of threads.
*/
#include <stdio.h>
#include <stdlib.h>
#in... | ALGO | 0.999587 | 5.059026 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-03-19T15:05: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": "8067b594e5... |
afa7ceb0-141b-4bcc-acda-8de48fc2b754 | ParthTimbadiya/DSAusingCPP | queueUsingArray.cpp | #include<iostream>
using namespace std;
#define n 5
int queue[n];
int front = -1;
int rear = -1;
void enQueue(int x){
if(rear == (n - 1)){
cout<<"Queue is overflow :"<<endl;
}else if(front == -1 && rear == -1){
front = rear = 0;
queue[rear] = x;
}else{
rear++;
queue[rear] = x;
}
}
void deQueue()... | ALGO | 0.998897 | 3.671597 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-05-07T06:43:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4369e81cb... |
f15e3bd0-5b39-4ed6-bc3a-2d61b5b91041 | arnabsahawrk/DSA | Introduction to Algorithms/Graph Traversal Algorithms/2-Breadth First Search (BFS)/checking_if_node_can_be_visited_or_not.cpp | #include <bits/stdc++.h>
using namespace std;
bool visited_or_not(vector<vector<int>> adj_list, vector<bool> visited, int src, int des)
{
queue<int> q;
q.push(src);
visited[src] = true;
while (!q.empty())
{
int parent = q.front();
q.pop();
for (int x : adj_list[parent])
... | ALGO | 0.999984 | 5.467568 | {
"github_metadata": {
"branch": "main",
"commit_count": 158,
"repo_created_at": "2024-12-07T13:55: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": "712e6e8199... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.