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 |
|---|---|---|---|---|---|---|---|
6d986f23-7b9f-45cb-95e4-e2dc87f36af9 | sqrtqiezi/xuetang_algorithm | 19_exchange.cpp | #include <vector>
#include <cstdio>
using namespace std;
// ================= 代码实现开始 =================
//seq:原序列,为了方便处理,将其设为全局变量
//seqTemp:用以辅助计算的临时数组
//cnt:统计逆序对个数
vector<int> seq,seqTemp;
long long cnt;
//归并排序
//l,r分别为归并排序排序区间的左右端点
void mergeSort(int l, int r) {
if(l==r)
return;
int mid = (l + r)>>1;
merg... | ALGO | 0.999995 | 4.148472 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-10-21T11:28:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e2006070... |
59156a28-55c3-4eb4-ab67-dca6af2d743a | LeKSuS-04/Competitive-Programming | UVa-problems/10507.cpp | /* UVa 10507 - Waking up brain */
// https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1448
// Date: 2021-08-17 15:30:48
// Run time: 0.000
// Verdict: AC
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> vi;
t... | ALGO | 0.999534 | 3.378611 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2021-10-13T17:29: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": "9a7e5ca7b... |
6ed3a159-9ca1-4ec4-8314-60971f1970e5 | pawankumar088/Data_structure | linked list/Deletion.cpp | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
class node
{
public:
int data;
node *next;
node(int val)
{
data = val;
next = NULL;
}
};
void Insert_At_Tail(node *&head, int key)
{
node *n = new node(key);
node *temp = head;
if (head == NULL... | ALGO | 0.999888 | 4.164191 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-05-05T19:31:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0767a33356d... |
0cc80621-6a58-4035-a9c9-a5e99074200b | nguyentuss/Competitive-Programming | CP/OnlineJudge/LQDOJ/primecount.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
int t ;
int main(){
ios::sync_with_stdio(0); cin.tie(NULL);
cin >> t;
for (int test = 0 ; test < t ; test ++) {
int l , r; cin >> l >> r;
vector <bool> sieve(r - l + 1 );
for (int i = 2 ; i * i <= r ; i++)
f... | ALGO | 0.999928 | 4.210111 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-20T04:18: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": "f30ac0e87d3c... |
54ea693b-3432-4fab-bb1b-0e9687b0fdd7 | goongg/SamSung | arrray.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
typedef pair<int, int> pii;
vector<vector<int> > v;
vector<vector<int> > n_v;
int R, C, K;
void print( vector<vector<int> > v)
{
cout<<endl;
for(int i =0 ; i< v.size(); i++)
{
for(int ... | ALGO | 0.999846 | 3.567182 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2021-09-23T17:37:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e38d086ea0f... |
89898543-fc3d-4c0d-b47f-41cb59884e52 | dya4kov/average-atom-toolkit | average-atom-toolkit/thomas-fermi/atom/potential.cxx | #include <algorithm>
#include <cmath>
#include <numeric>
#include <iostream>
#include <numeric-toolkit/ODE/types.h>
#include <numeric-toolkit/ODE/solver.h>
#include <numeric-toolkit/ODE/stepper/PD853.h>
#include <average-atom-toolkit/thomas-fermi/atom/potential.h>
#include <average-atom-toolkit/thomas-fermi/atom/ODE/... | ALGO | 0.978397 | 5.811862 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-03-02T14:35: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": "f68a440b5... |
72bea427-a587-4455-a49b-6077f5184b54 | moccbc/MonteCarloMosquito | main2.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
#include <random>
#include <vector>
#include <string>
using namespace std;
double sqr(double x) {
return x*x;
}
int main() {
// Generator that will generate random direction
// Referenced en.cppreference.com/w/cpp/numeric/random
random_device rd;... | ALGO | 0.999755 | 4.733671 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-05-09T21:28: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": "1dac25b5e980... |
3217da26-58a7-48a3-8a60-05ae01145b81 | ZabrinaRulif21/MODUL-PRAKTIKUM-1 | Modul 1 No 3.cpp | #include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main() {
int data[] = {5, 2, 4, 4, 5};
int total = 0;
cout << "Nilai ke-1: " << data[0] << endl;
cout << "Nilai ke-2: " << data[1] << endl;
cout << "Nila... | ALGO | 0.999735 | 3.853093 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-03-01T14:43: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": "4fc89373be4f... |
e594c7cf-ab56-47ba-8e43-c1a810f990d8 | PatricioSaldivar/ProgrammingOrientedToObjects | Tarea 1/Tarea 1/Tarea1.cpp | //
// main.cpp
// Tarea 1
//
// Created by <NAME> on 10/01/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
// se define el tablero
int matriz[4][4]=
{{0,2,3,4}
,{1,7,5,6}
,{8,9,15,14}
,{10,11,12,13}};
int mueve,cero, c... | ALGO | 0.990105 | 3.860994 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-09-20T20: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": "a7089176de... |
22770e96-6ffc-4533-aa7d-e8a27f5f71c3 | qgyc98/ssf | SIFEL/TRFEL/SRC/millymat.h | #ifndef MILLYMAT_H
#define MILLYMAT_H
#include <stdio.h>
#include "genfile.h"
class millymat
{
public:
millymat (void); //constructor
~millymat (void); //destructor
void matcond (matrix &d,long ri,long ci,long ipp);
void matcap (double &c,long ri,long ci,long ipp);
void matcond1d (matrix &d,long r... | TOOL | 0.915579 | 3.266281 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-02-27T17:52: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": "a4faf9921a2... |
a01091d5-125a-46e0-9ea0-a48e0abf05fc | diego1401/ComputerGraphics | Raytracer_Assignement1/classes/vector.cpp | #pragma once
#include <stdio.h> /* printf */
#include <iostream>
#include <math.h> /* pow */
#include <stdlib.h> /* srand, rand */
#include <vector>
#include <random>
#include <string>
#include <list>
// #include <iostream>
// #include <stdio.h>
#include <string.h>
#include <algorithm>
// #include <vecto... | ALGO | 0.974602 | 3.745181 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2021-03-31T14:54: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": "134a5e9f6f... |
181fa601-758a-4510-a396-674fec762d88 | mysql/mysql-server | plugin/x/tests/driver/mysqlxtest.cc | /*
* Copyright (c) 2015, 2025, Oracle and/or its affiliates.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2.0,
* as published by the Free Software Foundation.
*
* This program is designed to work with certain software (in... | TOOL | 0.911824 | 6.721747 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 186679,
"repo_created_at": "2014-09-26T09:31:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11540,
"forks": 4072,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "... |
4f1c95dd-b25f-417e-8635-9a920c5d6851 | zorchp/dsa | c_cpp/Graph_Theory/single_source_minimal_path/Dijkstra_algo.cpp | #include <iostream>
#include <vector>
#include <cstdlib> //rand
#include <ctime> //time
#include <queue> // priority_queue
#include <chrono>
using namespace std;
using namespace std::chrono_literals;
constexpr auto X = 0x3f3f3f3f;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
fo... | ALGO | 0.999713 | 4.922122 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-04-19T08:31: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": "2f9aed28c... |
0c271b97-0b2f-4e31-bc34-0443323d4b69 | siudangiuu/Cplus | OOP C++/Final/test4.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
class Employee{
protected:
string name; //<NAME>
int Year; //namsinh
long long c_salry; //he so luong
public:
Employee(string n = "", int y = 0, long long c = 0 )
{
this->name = n;
this-... | TOOL | 0.956711 | 3.246663 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-05-04T06:50:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b82ca994dd1... |
cd85f4aa-f359-4bb1-a30d-8b2f9c25dfee | trinhminhtriet/leetcode | solutions/3000-3099/3086.minimum-moves-to-pick-k-ones/Solution.cpp | class Solution {
public:
long long minimumMoves(vector<int>& nums, int k, int maxChanges) {
int n = nums.size();
vector<int> cnt(n + 1, 0);
vector<long long> s(n + 1, 0);
for (int i = 1; i <= n; ++i) {
cnt[i] = cnt[i - 1] + nums[i - 1];
s[i] = s[i - 1] + 1LL ... | ALGO | 0.999928 | 4.975447 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2024-12-09T17:55:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "914973... |
288efea2-5442-4612-b5cd-6c9e6b7f413e | PunitTak2005/CPP-GFG | 269.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
vector<vector<int>> adjList;
vector<int> parent, visited;
bool DFS(int node) {
visited[node] = 1;
for(int neighbor : adjList[node]) {
if(!visited[neighbor... | ALGO | 0.999869 | 6.269899 | {
"github_metadata": {
"branch": "main",
"commit_count": 397,
"repo_created_at": "2024-10-16T13:12: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": "8f3ada96ac... |
74d01986-6562-42c8-8e36-55b98d04c183 | RosettaCommons/rosetta | source/src/apps/pilot/dgront/saxs/RescorePDDF.cc | #include <protocols/jobdist/not_universal_main.hh>
#include <protocols/moves/Mover.hh>
#include <basic/options/option.hh>
#include <basic/options/keys/OptionKeys.hh>
#include <basic/options/keys/in.OptionKeys.gen.hh>
#include <basic/options/keys/out.OptionKeys.gen.hh>
#include <basic/options/keys/score.OptionKeys.gen.... | TOOL | 0.909713 | 5.590402 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "b404... |
cecd99fc-4d11-44fe-a35d-4722a39ef0d0 | xuqianmamba/Harmony | src/query.cpp | #include <faiss/IndexFlat.h>
#include <faiss/IndexIVFFlat.h>
#include <faiss/index_io.h>
#include <mpi.h>
#include <argparse/argparse.hpp>
#include <filesystem>
#include <format>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include "tribase.h"
#inclu... | ALGO | 0.997323 | 5.728398 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2024-10-29T17:12: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": "575e29992a0... |
7411a001-2b8f-42fb-b96a-d35ab609c63d | alexandraback/datacollection | solutions_5766201229705216_0/C++/darrenhp/B.cpp | //Clibrary:
#include<cassert>
#include<cctype>
#include<cerrno>
//#include<cfenv>
#include<cfloat>
//#include<cinttypes>
#include<ciso646>
#include<climits>
#include<clocale>
#include<cmath>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
//#include<cstdbool>
#include<cstddef>
//#include<cstdint>
#include<cstdio>... | ALGO | 0.999672 | 4.440425 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "753bbedfa... |
692dfa3d-fa1c-4697-b42e-f35182e9baf3 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc116/C/4188747.cpp | #include <iostream>
#include <bitset>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cc... | ALGO | 0.99997 | 3.788943 | {
"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": "c8ef4f66... |
a98f2332-e1e7-40b6-b0e8-a0b24cf4bdd1 | ZhxCKaMPVfef/hoccppcunghlamm | tìm số nguyên tố.cpp | #include <iostream>
using namespace std;
int main() {
int m, n, k;
cin >> m;
cin >> n;
k = 1;
while (k < m) { //lặp lại khi th k < m
int a = n, b = k, temp;
while (b != 0) { // tìm ước chung lớn nhất
temp = a % b;
a = b;
b = temp;
}
... | ALGO | 0.999991 | 3.84424 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2023-05-20T05:40:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "7642d7572... |
1808282a-16b3-40e2-b923-74afe82a56e6 | dbetm/cp-history | OmegaUp/19_AritmeticaElemental.cxx | #include <bits/stdc++.h>
// https://omegaup.com/arena/problem/2016-Aritmetica-Elemental#problems
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string a, b;
cin >> a;
cin >> b;
int cont = 0, carry = 0;
int i = a.size()-1, j = b.size()-1;
int sum;
do {
... | ALGO | 0.999619 | 4.030255 | {
"github_metadata": {
"branch": "main",
"commit_count": 384,
"repo_created_at": "2019-01-09T04:13:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c976e2d006... |
1e7a84a4-3ca8-4f1b-99e5-56751fba15d3 | TianChenjiang/LeetCode | C++/1818.cpp | class Solution {
public:
int minAbsoluteSumDiff(vector<int>& nums1, vector<int>& nums2) {
int n = nums1.size(); int res = 0;
int MOD = pow(10, 9) + 7;
vector<int> vec(nums1);
sort(vec.begin(), vec.end());
int maxExange = 0; //比起某个位置的diff,在交换后能额外小多少
for (int i = 0; i <... | ALGO | 0.999994 | 6.058483 | {
"github_metadata": {
"branch": "master",
"commit_count": 271,
"repo_created_at": "2019-05-28T16:05:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3e103fe... |
09b19279-de78-455d-a662-85ed477005c3 | kaldi-asr/kaldi | src/gmmbin/gmm-est-fmllr-gpost.cc | // gmmbin/gmm-est-fmllr-gpost.cc
// Copyright 2009-2011 Microsoft Corporation; Saarland University
// 2013 Johns Hopkins University (author: <NAME>)
// 2014 <NAME>
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (t... | DATA | 0.906495 | 6.387678 | {
"github_metadata": {
"branch": "master",
"commit_count": 9405,
"repo_created_at": "2015-04-20T17:23:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14986,
"forks": 5368,
"issues": 189,
"pull_requests": 63
},
"file_meta": {
"content_id":... |
7eb5ff4d-6fd2-4ed4-be1f-ccf5d29e6924 | xiaozhuyfk/DeepDriving | torcs-1.3.6/src/drivers/olethros/opponent.h | // -*- Mode: c++ -*-
/***************************************************************************
file : opponent.h
created : Thu Apr 22 01:20:19 CET 2003
copyright : (C) 2003-2005 <NAME>, <NAME>
email : <EMAIL>
version : $Id: oppo... | TOOL | 0.952259 | 4.964134 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-10-05T20:43:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2618516ec0... |
bd50f370-f1eb-42d0-bc31-22427350f150 | dgyf/ProjectXYSketch | Heavy_Change_Queries/src/ASketch.h | #ifndef _ASKETCH_H
#define _ASKETCH_H
#include "params.h"
#include "BOBHash32.h"
#include "SPA.h"
#include <cstring>
#include <x86intrin.h>
#include <bmiintrin.h>
using namespace std;
class ASketch
{
private:
int w = 0;
int bucket_num = 0;
int *new_count;
int *old_count;
uint32_t *items;
int... | ALGO | 0.944337 | 4.078132 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-02-19T09:49:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ca8fd0c864... |
0d155a24-b718-4dd6-a9ae-a3515d11798e | DiegoEmilio01/IIC3413 | src/storage/isam/isam_nonclustered_iter.cc | #include "isam_nonclustered_iter.h"
#include "storage/isam/isam_nonclustered.h"
#include "storage/isam/isam_nonclustered_leaf.h"
IsamNonClusteredIter::IsamNonClusteredIter(
const IsamNonClustered& isam,
const Value& min,
const Value& max,
uint_fast32_t key_pos,
uint_fast32_t start_page_number,
... | TOOL | 0.913469 | 5.496145 | {
"github_metadata": {
"branch": "T5",
"commit_count": 40,
"repo_created_at": "2024-03-21T14:30:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 1,
"issues": 38,
"pull_requests": 0
},
"file_meta": {
"content_id": "a23ba8c3faf... |
30b67d75-96a2-46a7-bbfb-93130628a521 | SaatoruGojo/Sudoku_Solver | sudoku.cpp | // C++ Program to Solve Sudoku Problem
// Concept Use Recursion and Backtracking
// By - <NAME>
#include <iostream>
#include <fstream>
using namespace std;
#define N 9 // N is the size of the matrix
void print(int arr[N][N]) // Print the matrix
{ cout << "++======================++\n";
for (int i = 0; i < N;... | ALGO | 0.999161 | 5.50701 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-08-10T07:26: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": "ad41d3ce5c... |
bc91f4a3-b5e8-4931-9e03-2e8d7b94c77c | Hiroki9759/Atcoder | AtCoder/Atcoder007/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define REP(i,n) for(ll i=0; i<(n); i++)
#define REP2(i,x,n) for(ll i=x; i<(n); i++)
#define REP3(i,x,n) for(ll i=x; i>(n); i--)
#define zero_pad(num) setfill('0') << std::right << setw(num)
#define space_pad(num) setfill(' ') << std::right << setw... | ALGO | 0.999584 | 4.210258 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2019-06-19T02:26: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": "1dfc12bfb... |
9e2cfaeb-0732-4b54-97a1-0483a228a422 | priyalbhatewara123/July-LeetCoding-Challenge-2021 | Day 19 - Lowest Common Ancestor of a Binary Search Tree.cpp | /*
Solution 1 : Recursive approach
Time Complexity - O(n)
Space Complexity - O(n) //recursion call stack
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
int rootVal = root -> val;
int pVal = p -> val;
int qVal = q -> val;
if (p... | ALGO | 0.999998 | 6.715815 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-07-21T06:57:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58f4565aaaab... |
6806be3b-4f31-452a-990a-7266ff3c1cae | yashjain128/competitive_programming | usaco/other/Silver/2016/S3Moocast.cpp |
#include <bits/stdc++.h>
using namespace std;
bool testcases=false;
bool filein=true;
void solve(){
int n;
cin >> n;
int x[n];
int y[n];
int p[n];
for (int i=0; i<n; i++){
cin >> x[i] >> y[i] >> p[i];
}
vector<int> adj[n];
for (int i=0; i<n; i++){
for (int j... | ALGO | 0.999626 | 4.625008 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-08-19T07:28: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": "5ae237d5d3b... |
b7ae248a-f55e-4280-9047-a65678f8ac59 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0813/personal_submission/cf822d_zrnstnsr.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int mod = 1000000007;
constexpr int inf = 0x3f3f3f3f;
void solve() {
int t, l, r;
cin >> t >> l >> r;
vector<ll> d(r + 1, -1), pr;
for (ll i = 2; i <= r; ++i) if (d[i] < 0) {
d[i] = i * (i - 1) / 2 % mod;
pr.... | ALGO | 0.999858 | 5.214526 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "8e7f... |
d79aac05-f237-419e-ac92-15b083e77582 | YizheWill/learn-cpp | coursera/week_4/even_odd_sort/source.cpp | #include <iostream>
using namespace std;
void swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
return;
}
void bubble_sort(int start, int end, int *arr) {
int i = start, j = end;
bool sorted = false;
while (!sorted) {
sorted = true;
i = start;
while (i < j - 1) {
if (arr[i] > arr... | ALGO | 0.999936 | 4.123581 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-01-30T18:44: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": "58aaea46408... |
d8019004-88d3-42c1-b666-943ac61c63f4 | Ankitverma3507/StriverSheetChanllenge2k23 | Day24/q1.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution
{
private:
void dfs(int start, vector<vector<int>>& adj, vector<int>&vis, stack<int>&st,int v){
vis[start]=1;
for(auto it: adj[start]){
if(!vis[it])
dfs(it,adj,vis,st,v);
}
... | ALGO | 0.999867 | 5.690659 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-06-05T19:57: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": "7eba63a78cb... |
ee7ad49d-452a-483d-be81-700ad860ceb9 | akashiitj/dsaprogram | dp/codechefdp/naincodesubsetdivide.cpp | #include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cassert>
#include <string>
#include <cstring>
#include <complex>
using namespace std;
#define rep(i,a,b) for(int i = a; i < b; i++)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\... | ALGO | 0.999641 | 3.511413 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-05-08T18:29: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": "0f6ecd7b7... |
a29fd1a1-7f6d-4d76-8e76-e584b5f49bbf | mgrailoo/HLS4ML_CPP_HDL_MNIST_ | syn/systemc/softmax.h | // ==============================================================
// RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and OpenCL
// Version: 2020.1.1
// Copyright (C) 1986-2020 Xilinx, Inc. All Rights Reserved.
//
// ===========================================================
#ifndef _softmax_HH_
#d... | ALGO | 0.976556 | 3.713904 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-12-15T23:16: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": "164ae3ba1dba... |
f892fdfc-8843-4079-8906-104683aabecf | Acytoo/leetcode | c++/1081smallestSubsequenceOfDistinctChars.cc | #include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <queue>
#include <climits>
#include <stack>
#include <algorithm>
#include <cmath>
#include <set>
#include <unordered_map>
#include <list>
#include <unordered_set>
#include <map>
#include <functional>
#include <bitset>
#include <numeric>... | ALGO | 0.999906 | 5.018396 | {
"github_metadata": {
"branch": "master",
"commit_count": 417,
"repo_created_at": "2018-11-01T11:52:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a30cc99d... |
29fd1d99-b7a8-4c29-9137-1b86e8263ef1 | artmills/Mesh-Processing-Research-Station | polyhedron.cpp | #include "polyhedron.hpp"
Polyhedron::Polyhedron()
{
vlist.reserve(40000);
elist.reserve(100000);
tlist.reserve(40000);
Corner c;
clist = std::vector<Corner>(3 * tlist.size(), c);
center = glm::dvec3(0.0, 0.0, 0.0);
}
Polyhedron::Polyhedron(int vertices, int edges, int triangles)
{
vlist.reserve(vertices);
... | TOOL | 0.924507 | 3.090068 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2021-11-28T19:56:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fa9f0b2c... |
84fb9770-a1f2-4ea2-9204-5498739cb061 | danirod12/cpp_lab_11 | main.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <fstream>
#include <iterator>
template <typename Iterator>
void print(Iterator begin, Iterator end) {
while (begin != end) {
std::cout << *begin++ << " ";
}
}
int main() {
// read numbers (task 1)
std::vector<int> vector;
int ... | TOOL | 0.991374 | 4.198757 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-02-18T16:00: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": "d870dc2063... |
db7c7b82-3ea5-4a17-9dda-9c181de7899e | jczarnowski/DeepFactors | sources/core/features/matching.cpp | /*
* This file is part of DeepFactors.
*
* Copyright (C) 2020 Imperial College London
*
* The use of the code within this file and all code within files that make up
* the software that is DeepFactors is permitted for non-commercial purposes
* only. The full terms and conditions that apply to the code within t... | ALGO | 0.998414 | 5.93692 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-01-16T15:35:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 637,
"forks": 85,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccd2e1... |
e923897b-186d-42c7-8b43-4d252e3f30fa | Divishax/DSA | arrays/arraysBasic.cpp | #include <iostream>
using namespace std;
int main(){
// Printing an array
// int arr[50] = {5,9,8,7,6};
// int n=5;
// for(int i=0;i<n;i++){
// cout<<arr[i]<<" ";
// }
// Taking input in an array
// int arr[5];
// int n=5;
// for(int i=0;i<n;i++){
// cin>>arr[i]>>... | ALGO | 0.995512 | 3.543197 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-01-24T11:53: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": "54d2ae75fd2... |
27ad3b37-5767-441b-bab2-3b90279f055c | magdyhasan/competitive-programming | SPOJ/SPOJ HISTOGRA - Largest Rectangle in a Histogram.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 800500;
int h[maxn];
int l[maxn], r[maxn];
int main(){
freopen("uva.txt","rt",stdin);
int n;
while (scanf("%d", &n)){
if (!n)break;
for (int i = 1; i <= n; i++) scanf("%d", h + i);
h[0] = -1;
stack<int> st; st.pus... | ALGO | 0.999754 | 3.532502 | {
"github_metadata": {
"branch": "master",
"commit_count": 222,
"repo_created_at": "2017-01-29T00:35:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2a93bf4... |
e1259803-f056-4b7f-85e2-dd05e6488c6e | ManaswitaDatta/MySpace | Research_Craft.ino | bool m1a=LOW; //Initializing values for motor pins:- m1a=a pin of motor 1,m1b=b pin of motor 1
bool m1b=LOW; // m2a=a pin of motor 2,m2b=b pin of motor 2
bool m2a=LOW;
bool m2b=LOW;
int val,ch1,ch4,ch3,valu,va;
void Stop(){ //function to stop motors from turning
m1a=LOW;
m1b=LOW;
m2a=LOW;
m2b=LOW;
dig... | ALGO | 0.910509 | 4.520595 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-08-17T09:48: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": "42f421495c... |
f214f7ee-193e-41a6-85b5-f962fba43cd9 | karencl/SistemasEmbebidosAvanzados | Intro-cpp-exercises/exercise02.cpp | // =================================================================
//
// File: exercise02.cpp
// Author(s): <NAME> - A01704254
// <NAME> - A01351820
// Description: This file contains the code that performs the sum of
// all prime numbers less than or equal to MAXIMUM. The
// time this implementation take... | ALGO | 0.999956 | 4.308516 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2022-09-28T15: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": "8af57ec7b... |
be8e5dc4-7069-4467-9ec3-91fbd083263f | achyuts/VitaminCRoboCar | Challenge2.ino | // BOE Bot Dead Reckoning using wheel encoders
// with IR beacon and HC-SR04 distance sensing
#include <Servo.h>
#include <math.h>
// Hacked version of the NewPing library is BotPing
#include <BotPing.h>
// Debug Pins
#define ZERO_SERVOS 6
#define HALT_TURRET 7
// Pinger
#define TRIGGER_PIN 9 // Arduino pin tied ... | TOOL | 0.997026 | 4.55724 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-07-15T17:53: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": "4a10713cb1... |
07405842-2570-46c2-9572-88253a18ba47 | FangGet/BundleFusion_Ubuntu_Pangolin | include/FreeImage/include/CGAL/predicates/in_smallest_orthogonalcircle_ftC2.h | // Copyright (c) 1997 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your o... | ALGO | 0.999823 | 6.379307 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-06-29T03:53:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 34,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "06c5951... |
465b7111-0616-448e-bd57-502bef18bb3d | TuZhengzhou/cp_ilc | cp_ilc/src/utils.cpp | #include <iostream>
#include <cmath>
#include <limits>
#include <assert.h>
// Objective function
double objectiveFunction(int n1_, int n2_, int m_) {
return 3 * (n1_ + n2_) * log(3 * (n1_ + n2_)) + (m_ + m_) * 3 * (n1_ + n2_);
}
unsigned int nextPowerOf2(unsigned int n) {
// 如果 n 已经是2的幂次方,则直接返回
if ((n & ... | ALGO | 0.999756 | 4.919887 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-11-02T00:45: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": "1713a52db2e... |
b4c5df7a-e29b-4dea-99dc-a1d36c3ff692 | ericniebler/range-v3 | example/count_if.cpp |
// Range v3 library
//
// Copyright <NAME> 2017
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range-v3
//
///[count... | TOOL | 0.960816 | 6.818006 | {
"github_metadata": {
"branch": "master",
"commit_count": 2541,
"repo_created_at": "2013-11-11T16:05:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4273,
"forks": 457,
"issues": 262,
"pull_requests": 24
},
"file_meta": {
"content_id": ... |
15bf6b10-db92-4c44-8950-b977547d69af | btracey/myjoe | src/common/mixing_combustion/pdf_functions.cpp | #include "pdf_functions.h"
double betai(double a, double b, double x) {
double bt,betai;
if ((x<0.0)||(x>1.0)) {cout << "bad argument X in BETAI. X = " << x << endl;
throw(-1);}
if ((x == 0.0)||(x == 1.0)) { bt=0.0; }
else { bt=exp(lgamma(a+b)-lgamma(a)-lgamma(b)+a*log(x)+b*log(1.0-x))... | ALGO | 0.996582 | 4.177117 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2013-06-14T00:53:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "174df39ba... |
41c66a2a-7811-475e-957b-d98e55183a7b | ishandutta2007/codeforces-b | benq/normal/1254/B2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef ... | ALGO | 0.999897 | 3.619279 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2cfe0379bdf0... |
204ba8cd-2f96-422c-a8cc-e34df0338529 | GuillermoFrancoAbellan/ExoCLASS | cosmorec_lite/Development/Hydrogenic/Atom.cpp | //====================================================================================================================
// Author: <NAME>
//
// first implementation: June 2005
// last change : Aug 2014
//============================================================================================================... | ALGO | 0.938466 | 4.223933 | {
"github_metadata": {
"branch": "main",
"commit_count": 1785,
"repo_created_at": "2022-04-08T14:00:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a54b9c89... |
bcfd0076-2498-4e26-8490-92383d82fcc9 | navneetk2001/CPP_Programs | Topic Wise Coding Questions/4_Searching/22_Efficiently merging two sorted arrays with O(1) extra space.cpp | https://practice.geeksforgeeks.org/problems/merge-two-sorted-arrays-1587115620/1
//Solution Approach :-
class Solution{
public:
//Function to merge the arrays.
void merge(long long arr1[], long long arr2[], int n, int m)
{
int i = 0, j = n - 1;
while(j >= 0 and i < m)
{
if(... | ALGO | 0.999996 | 5.397886 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-02-14T06:01:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9c6799c67... |
ef982602-5eb2-41f1-9c23-d7407f9f5fb4 | shivansh196/Data-Structure-and-Algorithms | 0543-diameter-of-binary-tree/0543-diameter-of-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.999773 | 5.869232 | {
"github_metadata": {
"branch": "master",
"commit_count": 807,
"repo_created_at": "2024-02-03T12:01: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": "24db862b... |
b759666d-bd4b-452d-a5be-ce09c4583561 | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/compute/algorithm/detail/reduce_on_cpu.hpp | //---------------------------------------------------------------------------//
// Copyright (c) 2016 <NAME> <<EMAIL>>
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://boostorg.github.com/compute ... | ALGO | 0.999517 | 7.705901 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
6fdc02ee-b144-4115-a120-ed92dacd74a2 | Veljko28/cpp-data-algrtms | codeforces/NotAssigning.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <string>
#include <cstring>
#include <ctime>
#include <set>
#include <unordered_set>
#include <list>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <unordered_map>
... | ALGO | 0.999903 | 4.566563 | {
"github_metadata": {
"branch": "master",
"commit_count": 2176,
"repo_created_at": "2021-06-11T09:14: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": "8114646... |
e50bd651-cf7c-4768-859a-e2dc13134270 | ArturRegadas/Competitive_Programming | Beecrowd/7-Grafos/1799-Rato_no_Labirinto-4/1799.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
#include <vector>
#include <unordered_map>
#include <string>
bool in(std::vector<std::string> arr, std::string pro){
for(std::string i : arr){
if (i == pro){
return true;
}
}
return false;
}
int bfs(std:... | ALGO | 0.999258 | 4.336438 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2024-06-26T20:08: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": "e8d8b2c3e0... |
f7bfbe6a-fbec-45fd-b2f0-11469beb18d9 | meraioth/EA2 | Boyer-Moore.cpp | /* Program for Bad Character Heuristic of Boyer Moore String Matching Algorithm */
//# include <limits.h>
# include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stdio.h>
# define ASCII 256
using namespace std;
class BM {
protected :
string txt;
vector <int> bc;
public:
BM( ... | ALGO | 0.999868 | 5.109237 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2016-09-25T04:20:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "daeb7047c... |
ff366984-c629-4ad3-afa9-a143e2c490f1 | wnsvy7203/Algo | 백준/Gold/17396. 백도어/백도어.cc | #include <iostream>
#include <vector>
#include <queue>
#define MAX 100'000
#define INF 10'000'000'000
using namespace std;
int N, M;
bool pos[MAX];
vector<pair<int, int>> graph[MAX];
long long visited[MAX];
priority_queue<pair<long long, int>, vector<pair<long long, int>>, greater<pair<long long, int>>> pque;
void ... | ALGO | 0.999971 | 4.309201 | {
"github_metadata": {
"branch": "main",
"commit_count": 1087,
"repo_created_at": "2022-08-16T12:22: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": "66a1b0031... |
3e236b07-919d-4f00-8320-032ab95cfb03 | genc-ahmeti/personal-projects | C++ Projects/Visual C++ Projects/kik programm/kik programm/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <ctime>
#include <cmath>
/*
*Write a program for finding an equation of form
*N ? N ? N ? N ? N = x
* where:
* N - int from 0...9
* ? - operator (+-x/)
* x - int from 0...90
* The x value will be passed to function.
* Each operator m... | ALGO | 0.999517 | 3.885417 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-09-18T20:22: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": "79029a60e... |
d75cf8d6-4a47-433d-a8c1-2f8194227760 | Victorahf2004/TrabalhosUFMG | EstruturaDeDados/Trabalho2/TP/include/fechoconvexo.hpp | #ifndef FECHOCONVEXO_H
#define FECHOCONVEXO_H
#include "ponto2d.hpp"
#include <string>
#include "vector4.hpp"
using namespace std;
class FechoConvexo
{
public:
// atributos
Ponto2d p0;
vector<Ponto2d> _pontos;
vector<Ponto2d> copia;
vector<Ponto2d> S;
// métodos
FechoConvexo(vector<Ponto2... | ALGO | 0.99907 | 4.510525 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2024-04-06T21:26: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": "b0d319cc5... |
c519363a-a88a-4d8e-9e26-15cd27c419c5 | PolyArch/gem-forge-gapbs | src/spmm_pull.cc | // Copyright (c) 2015, The Regents of the University of California (Regents)
// See LICENSE.txt for license details
#include <algorithm>
#include <iostream>
#include <vector>
#include <omp.h>
#include "benchmark.h"
#include "builder.h"
#include "command_line.h"
#include "graph.h"
#include "pvector.h"
#ifdef GEM_FOR... | ALGO | 0.998679 | 6.386493 | {
"github_metadata": {
"branch": "stream",
"commit_count": 221,
"repo_created_at": "2023-10-05T22:22:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "becdefa4e... |
a9060d0d-e2bd-4f4f-add9-5e03de553040 | cwrowley/ibpm | src/ProjectionSolver.cc | // ProjectionSolver.cc
//
// Description:
// Implementation of the ProjectionSolver class
//
// Author(s):
// <NAME>
//
// Date: 3 Jul 2008
//
// $Revision$
// $LastChangedDate$
// $LastChangedBy$
// $HeadURL$
#include "Scalar.h"
#include "BoundaryVector.h"
#include "NavierStokesModel.h"
#include "ProjectionSolver.h"
... | ALGO | 0.998628 | 5.046062 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2012-10-26T15:31:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 111,
"forks": 49,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "bbcc6... |
1edd0067-fe1c-4168-a63e-f9e3953d5449 | Vaibhav0810/leethub | gfg/cycle detection in undirected graph/cycle detection in undirected graph(using dfs).cpp | class Solution{
public:
// Function to detect cycle in an undirected graph.
// TIME-O(N+E) SPACE-O(N+E)+O(N)+O(N)
bool isCycle(int V, vector<int> adj[]) {
// Code here
vector<int> visi(V,0);
for(int i=0;i<V;i++){
if(!visi[i]){
... | ALGO | 0.999892 | 5.783583 | {
"github_metadata": {
"branch": "main",
"commit_count": 1241,
"repo_created_at": "2022-08-03T19:22: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": "89092b29d... |
0788891e-437d-401e-89b6-073f09b66836 | amana2525/proiecte-informatica | tema 1-info/tema 1-pr 4.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.999876 | 3.553979 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-01-25T14:34: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": "663c2df5599a... |
49acf5e9-a49d-4b0f-a7dd-307e82c0487c | TasiChicken/LeetCode | cpps/1000/100/80/75.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
void sortColors(vector<int>& nums) {
short size = nums.size(), left = 0, right = size - 1;
for(int i = 0; i < size; i++){
while(!nums[left]) left++;
while(nums[right] == 2) right--;
... | ALGO | 0.99973 | 5.465098 | {
"github_metadata": {
"branch": "main",
"commit_count": 265,
"repo_created_at": "2023-08-02T15:42:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8af72af60... |
d9040438-be7d-4559-be8d-784176f631ba | Hui-Xie/OptimizedKNNSegmentation | main.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
#include "ImageAnalyzer.h"
void printUsage()
{
std::cout << "==============Projection Similarity Segmentation============\n"
"Version: April 30th, 2016\n"
"Description: Automatically segment an RGB image with its projection similarity.\n"
... | ALGO | 0.977124 | 4.892437 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-09-20T05:23:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c041feb52... |
137abc48-5ca5-4786-8718-170f2e783b04 | nikaaboda/ads | Sortes/InsertionSort.cpp | #include <bits/stdc++.h>
using namespace std;
/* Function to sort an array using insertion sort*/
void insertionSort(int arr[], int n)
{
int i, j, key;
for(i = 1; i < n; i++)
{
j = i - 1;
key = arr[i];
while(j >= 0 && key < arr[j])
{
arr[j+1] = arr[j];
... | ALGO | 0.999958 | 5.846924 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-19T01:09: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": "e35404a57754... |
9e2eb893-f3f7-44d4-9742-31dcbe49e069 | ludamad/lanarts | dependencies/lua-box2d/vendor/Box2D/Box2D/Dynamics/Joints/b2BiFrictionJoint.h | /*
* Copyright (c) 2006-2007 <NAME> http://www.box2d.org
*
* 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,
* inclu... | ALGO | 0.942772 | 7.329305 | {
"github_metadata": {
"branch": "master",
"commit_count": 2228,
"repo_created_at": "2012-07-01T21:53:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 6,
"issues": 10,
"pull_requests": 2
},
"file_meta": {
"content_id": "547c1... |
c5cf507a-830f-47c2-b459-b0553fc81243 | innovatelogic/junk | course/red/w5/matrix_sum.cpp | //#include "test_runner.h"
#include <vector>
#include <future>
#include <numeric>
#include <cmath>
using namespace std;
template <class Iterator>
class IteratorRange
{
public:
IteratorRange(Iterator begin, Iterator end)
: _begin(begin)
, _end(end)
{}
//Iterator begin() { return _begin; }
//... | ALGO | 0.999222 | 5.277565 | {
"github_metadata": {
"branch": "master",
"commit_count": 297,
"repo_created_at": "2016-07-15T21: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": "25587ae5... |
bdb484a7-7d43-4d92-ae4f-41d10bf57dd8 | abzsd/CPP-Codes | Array_queue_implement.cpp | #include <bits/stdc++.h>
using namespace std;
class Queue {
private:
int head, tail;
int capacity;
int* array;
public:
//Initialisation
Queue(int capacity) {
this->capacity = capacity;
head = 0;
tail = 0;
array = new int[(capacity * sizeof(int))];
}
//Check if Queue is Full
int isFull()
{
retur... | TOOL | 0.964609 | 4.313635 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-03T07:49:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "876796ef025c... |
d1187d2b-0fa7-4033-ad53-b453b941cc60 | Kan19990810/Cpp | HOT100/树/sortedArrayToBST.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.999996 | 6.866818 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2023-07-03T14:53: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": "7f82582f6... |
8c98462c-9d70-4cb4-8c51-f4a4fd18ef64 | danielbinschmid/distributed-query-execution-azure | tools.h | #include <vector>
#include <string>
#include <map>
#include "HashRanging.h"
#pragma once
struct CountPartitionTask {
int partitionIdx;
std::string url;
};
class CountKey {
private:
public:
int count;
std::string domain;
CountKey();
CountKey(int count, std::string doma... | DATA | 0.972078 | 5.594811 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2024-03-15T19:27: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": "b7b068dc7e0... |
9ecb0b59-f839-4406-936c-cddb380ada51 | sxyugao/Codes | Luogu/P2150/P2150.cpp | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int pri[] = {0, 2, 3, 5, 7, 11, 13, 17, 19};
const int N = 505;
const int S = 1 << 8;
struct Data {
int s, p;
void init(int x) {
for (int i = 1; i < 9; i++) {
if (x % pri[i]) continue;
s |= 1 << ... | ALGO | 0.9999 | 4.437201 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2018-09-16T12:55:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aef8254f... |
954b1816-fdf9-4761-987c-2b766debd0fc | u2x1/algorithm | luogu/2672.cpp | #include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#define orep(i,a,b) for(auto i=(a); i< (b); ++i)
#define crep(i,a,b) for(auto i=(a); i<=(b); ++i)
#define NL putchar(10);
inline int read() {
int x=0; char c=0;
while(c<'0' || c>'9') {c=getchar();}
while(c>='0' && c<='9'){x=x... | ALGO | 0.999933 | 3.501555 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2022-07-14T04:43:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75755f56b01... |
86b10883-3044-4a17-afe8-6f82a76901be | taufiqhusada/competitive-programming | codeforces/1118D.cpp | #include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for ( int i = 0, _n = (n); i < _n; i++ )
#define FOR(i,a,b) for ( int i = (a), _n = (b); i <= _n; i++ )
#define FORD(i,a,b) for ( int i = (a), _n = (b); i >= _n; i-- )
#define RESET(a,val) memset(a,val,sizeof(a));
#define pb push_back
#define mp ... | ALGO | 0.999999 | 3.351418 | {
"github_metadata": {
"branch": "master",
"commit_count": 168,
"repo_created_at": "2018-12-10T03:14: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": "664c6769... |
64463056-2486-47d3-8806-e9bc69149917 | o-fugi/gerrymandering_sim | create_maps.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <random>
#include <ctime>
#define MIN(a, b) ((a<b) ? a : b)
#define COERCE(a, min, max) ((a<min) ? min : ((a>max) ? max : a))
int num_cities = 8;
float prec_dim_x = 16.0; //dimension n
float prec_dim_y = 20.0; //dimen... | ALGO | 0.998866 | 4.091057 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2018-05-06T19:54: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": "ee13bd716... |
45bf8bc0-300e-4510-ba6b-bc1875dd3465 | hasipon/icfpc2023 | solver/shiota1/main.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <complex>
#include <algorithm>
#include <set>
#include <queue>
using namespace std;
struct Attendee {
double x;
double y;
vector<double> tastes;
};
struct Problem {
double roomWidth;
double roomHeight;
double stageWidth;
doub... | ALGO | 0.999528 | 4.489656 | {
"github_metadata": {
"branch": "main",
"commit_count": 1410,
"repo_created_at": "2023-07-07T07:42: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": "5d8d5c68d... |
ce9bb4ec-8ccc-442c-92a7-8353962f2707 | joker-eph/llvm-project-repacked | clang/lib/Frontend/CompilerInvocation.cpp | //===- CompilerInvocation.cpp ---------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.943026 | 6.296193 | {
"github_metadata": {
"branch": "master",
"commit_count": 330373,
"repo_created_at": "2019-10-26T05:54:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "d82d3... |
1ffec4db-6025-427d-84b6-43d04a9bba58 | Linolium25/AandP | Кр/1.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main() {
const int SIZE = 10;
int arr[SIZE];
srand(time(0));
for (int i = 0; i < SIZE; i++) {
*(arr + i) = rand() % 100;
}
cout << "Pochatcoviy masiv:\n";
for (int i = 0; i < SIZE; i++) {
cout... | ALGO | 0.998884 | 4.576397 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2025-03-27T17:19: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": "360234080... |
e3f0c59e-7f37-4fec-be34-7d7eaceb40ac | xiaozheng2013/USACO | section 1.4/ariprog_hash.cpp | /*
ID: fzhpand1
PROG: ariprog
LANG: C++
*/
#include<iostream>
#include<map>
#include<fstream>
#include<algorithm>
#include<vector>
using namespace std;
class Pair{
public:
int a;
int b;
Pair(int x,int y)
{ a = x; b = y; }
};
int compare(Pair m, Pair n)
{
return (m.b<n.b)||(m.b==n.b && m.a<n.a);
}
int contain... | ALGO | 0.999935 | 3.519628 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2013-04-21T01:00: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": "f18423e90... |
4269d6a8-4b94-44cf-907a-0cc9372bbadb | MangriMen/SAOD_SFML | HeapSort.cpp | #include <iostream>
#include <vector>
#include <ctime>
#include <cmath>
#include <iterator>
#include <algorithm>
#include <sstream>
#include <SFML/Graphics.hpp>
#include "menu.hpp"
#include "ArrOperations.hpp"
#include "Constants.hpp"
using namespace std;
void swap(int* x, int* y) {
int z = *x;
*x = *y;
*... | ALGO | 0.997925 | 3.449926 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-03-03T09:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9f20febd... |
068fae5d-72b9-4653-b85c-c50f679d029e | LakshyaDuhoonISU/Lakshya46_23-27_Sem-II_DSA | 12graphtraversal.cpp | // Graph Traversal techniques: a) Depth First Search b) Breadth First Search
#include <iostream>
#include <queue>
using namespace std;
const int MAXN = 100;
// Depth First Search (DFS)
void dfs(int graph[][MAXN], bool visited[], int n, int node)
{
visited[node] = true;
cout << node << " ";
for (int i = ... | ALGO | 0.999992 | 6.121962 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-03-27T13:54:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4c82f46c1f9... |
37aadc1e-2eb4-4633-8396-18354c67eb00 | yuhyao/Contest-Library | misc/mo-algorithm.cpp | /**
* Author: <NAME>
* Date: 23-05-06
* Description: Mo's algorithm which answers $M$ range queries on $\{a_0, a_1, \ldots, a_{N - 1}\}$ offline. You need to implement three functions $pointAdd$, $pointErase$ and $pointAsk$. $pointAdd(i)$ and $pointErase(i)$ corresponds to taking $a_i$ into / out of consideration. $... | ALGO | 0.999493 | 5.294895 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2021-07-06T12:01:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8fbde1b7a0... |
f4ea4c0b-5ceb-41d6-a091-3d835d4e8a58 | EshaThakur88/_STL_practice | iterators.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
// iterators for vectors
vector<int> v = {2, 3, 5, 7, 11};
cout << "elements of vector:" << endl;
// using indices
for (int i = 0; i < v.size(); i++)
{
cout << v[i] << " ";
}
cout << endl;
// using itera... | TOOL | 0.939135 | 4.072907 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-08-23T00:18:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84fc326b9cb4... |
99b7ea68-60ae-4025-903d-343abd0feaad | 0kitasan/Cpp-hw | func/func5/main.cpp | #include <iostream>
using namespace std;
// 你的代码
template <typename T> void maxmin(T arr[], int size) {
T maxVal = arr[0];
T minVal = arr[0];
for (int i = 1; i < size; ++i) {
if (arr[i] > maxVal) {
maxVal = arr[i];
}
if (arr[i] < minVal) {
minVal = arr[i];
}
}
cout << maxVal << ... | ALGO | 0.999931 | 4.389825 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2024-04-19T10:08: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": "c276dada3b... |
a730fa45-4984-4a42-8db1-1bc8a3c3f1ef | NgTuanLoc/OOP | Week 9/Array1D/Array1D/Array1D.cpp | //
// Array1D.cpp
// Array1D
//
// Created by <NAME> on 27/11/2021.
//
#include "Array1D.hpp"
Mang1C::Mang1C()
{
n = 0;
a = NULL;
}
Mang1C::Mang1C(int n)
{
this->n = n;
a = new int[n];
}
Mang1C::~Mang1C()
{
delete[] a;
}
Mang1C::Mang1C(const Mang1C &m)
{
n = m.n;
a = new int[n];
for (int i = 0; i <... | TOOL | 0.989055 | 3.287137 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2021-09-19T02:13: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": "bfae984a7... |
4b317ffb-6c73-49fe-b2c1-4f36d99cca87 | wuyuhang05/My-OI-Code | CF/266E.cpp | #include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <bitset>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <map>
#include <set>
#define fi first
#define se second
#define U unsigned
#define P std::... | ALGO | 0.999983 | 4.062652 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2018-06-03T12:18:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35d26596... |
f34d7448-fc19-4470-a960-e5755a1892d4 | ishandutta2007/codeforces-k | kort0n/normal/1409/E.cpp | #include <bits/stdc++.h>
//#include <atcoder/all>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
if(a < b) {
a = b;
return true;
}
return false;
}
template<class T>
inline bo... | ALGO | 0.999745 | 4.016448 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "c4464fe3e5ba... |
9c13083f-72d7-4882-9ae0-f0d4114cbafc | LMingzhe/BA_PnP | src/BundleAdjustment.cpp | #include <Eigen/Core>
#include <sophus/se3.hpp>
#include <opencv2/opencv.hpp>
#include "BundleAdjustment.h"
#include "TypeDef.h"
void BundleAdjustment(
const VecVector3d &point_3d,
const VecVector2d &point_2d,
const cv::Mat &K,
Sophus::SE3d &pose
)
{
std::cout << "====================start BundleAd... | ALGO | 0.970448 | 5.849691 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-05-01T10:18:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de242b3e53... |
e3f75c06-5a46-48a7-98c0-7f5e02cef4a7 | dwdjjj/BOJ | SM_2nd_test/BAEKJOON_19953/BAEKJOON_19953/main.cpp |
#include <iostream>
using namespace std;
int iv, m, t;
int v[4];
int cnt[4]; // 0 : 동쪽, 1: 아래, 2: 서쪽, 3: 북쪽
int main(int argc, const char * argv[]) {
cin >> iv >> m >> t;
// 1초꺼 이동
int x = 0, y = iv;
t--;
int tmp = (iv * m) % 10; // 초기속도인 iv에 m곱해주고 10으로 나눈 나머지 저장.
for (int i=0; i<4; i++) {... | ALGO | 0.999922 | 3.150539 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-04-15T01:47: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": "b2668eb94a2... |
5d3c2380-473d-4f17-916d-369384052a4b | andrewstalin/contest | 0945-minimum-increment-to-make-array-unique/0945-minimum-increment-to-make-array-unique.cpp | class Solution {
public:
int minIncrementForUnique(vector<int>& nums) {
std::sort(nums.begin(), nums.end());
int res = 0;
int count = 1;
int prev = nums[0];
for (size_t i = 1; i < nums.size(); ++i) {
if (nums[i] == prev) {
++count... | ALGO | 0.999919 | 6.451249 | {
"github_metadata": {
"branch": "main",
"commit_count": 1195,
"repo_created_at": "2024-01-19T02:43: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": "39f145487... |
b7ac6621-b442-4d3b-beec-58f1cfe1119d | hongjianMa/cpp | Algorithm/Acwing/搜索和图论/Dijkstra/849-Dijkstra求最短路I.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 5e2 + 10; // 最大节点数+10的缓冲区
int n, m; // n: 节点数, m: 边数
int g[N][N]; // 邻接矩阵存储图结构(处理稠密图)
int dist[N]; // 存储起点到各点的最短距离
bool st[N]; // 标记节点是否已确定最短路径
int Dijkstra()
{
memset(dis... | ALGO | 0.999949 | 4.241101 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2025-01-24T15:32:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3dea5ff136... |
6526a26f-98c4-48b8-82ec-e6935d5b33bd | curaposterior/aisd_2 | intro_graphs/task_1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
class Node {
public:
int a;
Node* next;
};
class LinkedList {
private:
int roz = 1; //rozmiar jest odpowiednio zwiekszany przy dod. elem.
public:
Node* head; // niezbedne zeby miec dostep do wartosci w node
LinkedList... | ALGO | 0.998865 | 4.641347 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2022-10-06T06:07: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": "b2960fde608... |
95b62c25-2ce3-4641-8f27-fe7942a7c26c | rjrks/Spoj | MFISH (god, feel).cpp | ///
// Created by Rohan on 30/08/14.
// Copyright (c) 2014 Rohan. All rights reserved.
//
#include <math.h>
#include <iostream>
#include <vector>
#include <string.h>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <list>
#include <stack>
#include <algorithm>
using namespace... | ALGO | 0.999928 | 3.213069 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2015-05-10T15:17: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": "5d88259ca... |
b721e504-5ce6-42ca-8377-3144317141e2 | olejik-web/UniversityLabWorks | Tree_seg_Node/main.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <cmath>
#include <string>
using namespace std;
struct Node {
long long info;
int treel;
int treer;
Node* left = NULL;
Node* right = NULL;
Node* pred = NULL;
};
void init(Node* Elem, int treel, int treer) {
Elem->treel = tree... | ALGO | 0.999737 | 3.561093 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-28T15:48: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": "975b9f6ccc8a... |
1b9e3fc4-23ba-477c-b806-48d12dcb2aa1 | Kumarbhaskar24/LeetCode | 0103-binary-tree-zigzag-level-order-traversal/0103-binary-tree-zigzag-level-order-traversal.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.999997 | 6.143424 | {
"github_metadata": {
"branch": "main",
"commit_count": 1375,
"repo_created_at": "2022-10-04T04:26: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": "d53242c37... |
3143f002-7b89-4999-bf09-d0a900a6e230 | Mabsas/Code_Forces | BeautifulYear.cpp | #include<bits/stdc++.h>
using namespace std;
bool occurence(int x){
string s = to_string(x);
sort(s.begin(),s.end());
for(int i = 0; i <s.length()-1;i++){ //this loop check korbe kono same element ase kina thakle false retun korbe and year ek kore barbe
// i =3 ho... | ALGO | 0.999429 | 3.749533 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-06T08:07: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": "1ae4a8b696f1... |
7e9b8fc4-274c-4611-99c1-5ce8895fd204 | Avanish-Gupta-CSE/Data-Structures | Queue.cpp | #include <climits>
#include <iostream>
using namespace std;
class Node
{
public:
int value;
Node *next;
Node(int value)
{
this->value = value;
next = nullptr;
}
};
class Queue
{
private:
Node *first;
Node *last;
int length;
public:
Queue(int value)
{
N... | TOOL | 0.982369 | 4.02908 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-05-10T10: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": "47c4cbdbbf72... |
386220b6-e7b7-4114-8cf4-794cad138cb3 | xuzx1210/LeetCode | 2024. Maximize the Confusion of an Exam.cpp | class Solution
{
private:
void add(const char c, int &fCount, int &tCount)
{
if (c == 'F')
++fCount;
else
++tCount;
}
void minus(const char c, int &fCount, int &tCount)
{
if (c == 'F')
--fCount;
else
--tCount;
}
pub... | ALGO | 0.999942 | 5.379164 | {
"github_metadata": {
"branch": "main",
"commit_count": 1072,
"repo_created_at": "2022-02-16T09:23: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": "8b27f254a... |
5050d269-6fa2-4ef5-b9ad-ab5a541dfb9e | kronicler/cs2040_DSnA | Misc/pyramid.cpp | #include <iostream>
#define MAX 100
using namespace std;
int main(int argc, char const *argv[])
{
char arr[MAX][MAX];
int num;
cin >> num;
for (int i = 0; i < num; ++i)
{
for (int d = 0; d < (2 * num) - 1; ++d)
{
arr[i][d] = ' ';
}
}
for (int i = num-1; i >= 0 ; --i)
{
for (int d = (2* num) - ... | ALGO | 0.999973 | 3.237459 | {
"github_metadata": {
"branch": "master",
"commit_count": 346,
"repo_created_at": "2018-01-12T10:39:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81f4551b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.