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 |
|---|---|---|---|---|---|---|---|
3977a102-6e35-49b7-8522-9396c633bf51 | vatsalyachauhan/codes | spoj/CANDY.cpp | //Template
//Includes
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <utility> //Pair
#include <algorithm>
#include <sstream> // istringstream>> ostring stream<<
#include <iostream>
#include <iomanip>
//setbase - cout << setbase (16); cout << 100 << endl;... | ALGO | 0.999976 | 4.015797 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-06-17T12:59: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": "5606df9823... |
3b0aa412-e155-4d28-8cfd-3e2a0a6cefff | JameMoriarty/Hello-World | 程序/沈阳k/main.cpp |
//k
//#include <iostream>
//#include <cstdio>
//#include <math.h>
//#include <cstdlib>
//#include <algorithm>
//using namespace std;
//int main()
//{
// int t;
// cin>>t;
// for(int i=0;i<t;i++)
// {
// int s;
// cin>>s;
// int a[10050]={0};
// for (int j=0;j<s;j++)
// {... | ALGO | 0.999442 | 3.490273 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2019-03-14T09:29:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11ebcfec0... |
e5ab2d93-3812-4b38-a75a-7ba06d6c6aa2 | my-hoang-huu/My-hh | 1. Nhap mon lap trinh_chuong05_kieu cau truc/bai189-197 mang diem.cpp | #include<iostream>
#include<iomanip>
#include<ctime>
#include<cstdlib>
using namespace std;
struct DIEM
{
float x;
float y;
};
struct TAMGIAC
{
DIEM A;
DIEM B;
DIEM C;
};
void Nhap(DIEM&);
void Xuat(DIEM);
void Nhap(DIEM[], int&);
void Xuat(DIEM[], int);
int DemHoanhDuong(DIEM[], int);
DIEM MaxTungDo(DIEM[], int);... | ALGO | 0.99909 | 3.400939 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2021-02-27T02:18: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": "ac0b5045b3c... |
2e4c8e25-4f70-41f2-8f97-51a32a2fce3d | jinbooooom/coding-for-algorithms | LeetCode/62-不同路径/leetcode62.cpp | /*
https://leetcode-cn.com/problems/unique-paths
一个机器人位于一个 m x n 网格的左上角,机器人每次只能向下或者向右移动一步。
机器人试图达到网格的右下角,问总共有多少条不同的路径?
示例 1:
输入: m = 3, n = 2
输出: 3
解释:
从左上角开始,总共有 3 条路径可以到达右下角。
1. 向右 -> 向下 -> 向下
2. 向下 -> 向右 -> 向下
3. 向下 -> 向下 -> 向右
示例 2:
输入: m = 7, n = 3
输出: 28
*/
class Solution {
public:
int uniquePaths(int m,... | ALGO | 0.999812 | 5.858198 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2019-08-06T08:43:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb6293b... |
a68e21aa-e723-4810-a46c-aab2c4d6bd26 | diohabara/competitive_programming | ac/prev/abc054_d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
static const int dx[4] = { 0, 1, 0, -1 };
static const int dy[4] = { 1, 0, -1, 0 };
static const char dir[4] = { 'u', 'r', 'd', 'l' };
static const ll INF = 1ll << 60;
static const ll MOD = 1e9 + 7;
ll ... | ALGO | 0.999934 | 3.870242 | {
"github_metadata": {
"branch": "master",
"commit_count": 407,
"repo_created_at": "2019-01-21T06:09: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": "964b56bd... |
d8e5852a-ea5d-4176-97f3-2b63876938f0 | kbaedal/vzray | src/onb.h | #ifndef __ONB_H__
#define __ONB_H__ 1
#include <iostream>
#include <math.h>
#include "vec3.h"
/**
* \class Base Orto Normal
*
* Implementa las operaciones necesarias para manejar una
* base ortonormal de vectores (tres vectores perpendiculares
* entre si)
*/
class ONB
{
public:
ONB() {};
ONB(const Vec3 &v... | TOOL | 0.978885 | 3.703341 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2013-12-18T14:23: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": "b7722d202... |
e7395b3a-09cf-4a51-bbc4-605493c64799 | lukaszdumanski/Laboratorium4_InformatykaII | LAB4_LD.cpp |
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "winbgi2.h"
#include "rk4.h"
//szukamy rozwiązania równania różniczkowego (*) dy/dt= f(t,y), gdzie y= y(t) oraz znamy warunek początkowy y(t0)=y_0
double lambda = -0.5; // zmienna do pierwszego przykładu
double funkcja(double y, double t);//funkcja p... | ALGO | 0.999771 | 4.39225 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-05-06T15:47:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b8dc7d35c... |
036e1477-648c-41d9-b4e5-0d5cfae24bff | ishandutta2007/codeforces-m | mango_lassi/normal/1578/B.cpp | #include "bits/stdc++.h"
#define rep(i,a,n) for(auto i=a;i<=n;i++)
#define per(i,a,n) for(auto i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define FI first
#define SE second
#define all(A) A.begin(),A.end()
#define sz(A) (int)A.size()
template<class T> bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} ... | ALGO | 0.999875 | 3.821818 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c13870b21d6c... |
1bad4d02-65a7-4084-9230-2e1b093a1c9d | mrsp/nao_walk | nao_walk_naoqi/StepAdjustment.cpp | #include "StepAdjustment.h"
StepAdjustment::StepAdjustment(RobotParameters &robot_):robot(robot_)
{
dt = (double) robot.getWalkParameter(Ts);
w = (double) robot.getWalkParameter(omega);
T_max = (double) robot.getWalkParameter(Tss_max);
T_min = (double) robot.getWalkParameter(Tss_min);
T_nom = (doubl... | ALGO | 0.999954 | 4.810539 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-10-09T16:28:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6821c1ded... |
e7fe05c5-9329-4805-bc59-dae9a80d33b5 | FcAYH/CodeForVSC | niuke2c.cpp | #include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
const int Maxn=200010;
int n,num=0,cnt=0;
int in[Maxn];
int head[Maxn];
int Depth[Maxn];
struct EDGE{int next,to;}E[Maxn<<1];
struct SORT{int id,depth;}Sor[Maxn];
inline void add_edge(int x,int y)
{
... | ALGO | 0.999789 | 3.063207 | {
"github_metadata": {
"branch": "master",
"commit_count": 187,
"repo_created_at": "2021-04-03T07:56:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6722fd92... |
c748642e-ec9e-4c58-ac11-ee1f910ffa6a | Laceprndpm/ACM | src/cf/edu/edu148d2/B.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using PII = pair<int, int>;
constexpr int INF = 1e9;
void solve()
{
int n, k;
cin >> n >> k;
vector<int> arr(n + 1);
vector<i64> prefix(n + 1);
for (int i = 1; i <= n; i++) {
cin >> arr[i];
}
sort(a... | ALGO | 0.999962 | 4.983696 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2025-01-27T06:41: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": "c88383ebebd... |
ab1d5cee-1a9e-4473-9f00-ff375a16ca0b | ishandutta2007/codeforces-a | andrew/normal/1106/A.cpp | #include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define fi first
#define se second
#define p_b push_back
#define pll pair<ll,ll>
#define m_p make_pair
#define all(x) x.begin(),x.end()
#define ld long double
#define sset ordered_set
#define sqr(x) (x)*(x)
using name... | ALGO | 0.999753 | 4.230097 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f608a14cfcb... |
d9dd0c80-d4dc-44dd-86ba-d09f75c0f05a | monkeyonagazeboo/embree | pathtraceintegrator_MIS.cpp | // ======================================================================== //
// Copyright 2009-2011 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// y... | ALGO | 0.982851 | 5.502507 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2011-12-07T11:02:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6ceb62f13... |
66102964-1533-4d68-a7ba-76c8be5981cf | ghost461/Misc | algorithm/2.AddTwoNumbers/Solution.cpp | /*
*
* You are given two non-emtry linked lists representing two non-negative integers.
* The digits are stored in reverse order and each of their nodes contain a single digit.
* Add the two numbers and return it as a linked list.
*
* You may assume the two numbers do not contain any leading zero, except the ... | ALGO | 0.999925 | 5.848183 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-07-21T01:43:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "855595463... |
b99f7059-36cf-43ae-88b9-a5aeec3ef53d | 81-28/AtCoder | archive/24_10_21/t_b29_Power.cpp | // https://atcoder.jp/contests/tessoku-book/tasks/tessoku_book_db
#include <bits/stdc++.h>
using namespace std;
#define rep1(i,n) for (int i=1; i<(int)(n+1); i++)
using ll = long long;
template<typename T>
using v = vector<T>;
using vll = v<ll>;
#define fastio() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
void ... | ALGO | 0.999988 | 4.815979 | {
"github_metadata": {
"branch": "main",
"commit_count": 362,
"repo_created_at": "2024-06-29T11:33: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": "123dfa2d6b... |
e1876c39-919e-496e-b9dc-4294d246781c | microsoft/STL | stl/src/xfdnorm.cpp | // Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// _FDnorm function -- IEEE 754 version
#include "xmath.hpp"
_EXTERN_C_UNLESS_PURE
short _FDnorm(_Fval* ps) noexcept { // normalize float fraction
short xchar = 1;
unsigned short sign = static_cast<uns... | ALGO | 0.979946 | 6.246479 | {
"github_metadata": {
"branch": "main",
"commit_count": 2476,
"repo_created_at": "2019-08-27T01:31:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10715,
"forks": 1559,
"issues": 520,
"pull_requests": 23
},
"file_meta": {
"content_id": "... |
5be7c927-b994-4389-8df6-c762ce596ed9 | MonkeyPsw/CodeTree_Psw | 250318/작은 구슬의 이동/small-marble-movement.cpp | #include <iostream>
using namespace std;
int n, t;
int r, c;
char d;
int dx[4] = {0, 1, -1, 0}, dy[4] = {1, 0, 0, -1};
int x, y;
int GetDir(char a)
{
if(a == 'R')
return 0;
else if(a == 'D')
return 1;
else if(a == 'U')
return 2;
else
return 3;
}
bool InRange(int x, in... | ALGO | 0.999878 | 3.894448 | {
"github_metadata": {
"branch": "main",
"commit_count": 1941,
"repo_created_at": "2024-10-15T08:07:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef169b219... |
c8e0d0df-c993-4103-8335-b63d675607c9 | gvsi/collatz | UVaCollatz.c++ | // --------------------------
// projects/collatz/Collatz.h
// Copyright (C) 2016
// <NAME>
// --------------------------
#ifndef Collatz_h
#define Collatz_h
// --------
// includes
// --------
#include <iostream> // istream, ostream
#include <string> // string
using namespace std;
// ------------
// collatz_rea... | ALGO | 0.999358 | 5.132574 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2016-08-31T22:50: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": "a966b8ff8... |
1b453d11-2b2c-442c-97e4-a4e1465268a1 | SpasinaSpasova/Technical-University | OOP/KontrolnoOOP16052022/KontrolnoOOP16052022/2021/CiclicQueue/CyclicQueueMain.cpp | //---------------------------------------------------------------------------
#include <stdio.h>
#include <conio.h>
//---------------------------------------------------------------------------
class MyArray
{
public:
int Masiv[100];
int Broj;
double AverageValue;
MyArray(void) {Broj = AverageValue = ... | ALGO | 0.989795 | 3.767312 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2021-03-30T13:12: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": "af3e6c38615... |
69445137-b9a7-4c56-ae47-096eb029bd05 | truonghienminh/Full-House | code/10_15/10_15.cpp | #include <iostream>
using namespace std;
int main(){
int t;
cin >> t;
while (t--){
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++){
cin >> arr[i];
}
int ans = 1e9, temp;
for (int i = 0; i < n; i++){
for (int j = i + 1;... | ALGO | 0.999986 | 4.025016 | {
"github_metadata": {
"branch": "main",
"commit_count": 267,
"repo_created_at": "2022-06-12T10:07:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "262eab8dc9... |
4344e7a5-2478-4740-8f61-56b2557bbfd6 | qrlik/Learning | C++/Coursera/4 курс(коричневый)/week5/budget_mobile_prof_legacy/refactor/mentor_algorithm.h | #pragma once
#include <array>
#include "date.h"
static const Date START_DATE = Date::FromString("2000-01-01");
static const Date END_DATE = Date::FromString("2100-01-01");
static const size_t DAY_COUNT = ComputeDaysDiff(END_DATE, START_DATE);
static const size_t DAY_COUNT_P2 = 1 << 16;
static const size_t VERTEX_COUN... | ALGO | 0.994679 | 6.142023 | {
"github_metadata": {
"branch": "master",
"commit_count": 533,
"repo_created_at": "2019-09-05T08:28:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62899024... |
849bdfa9-c453-4663-b627-ec162aad9758 | zabir-nabil/Competitive-Programming | acm hust/LightOJ/1005/5683496_AC_212ms_9388kB.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull dp_table[33][33][905];
inline ull C(int m,int n,int k)
{
if(dp_table[m][n][k]!=-1) return dp_table[m][n][k] ;
else
{
//base cases
if(k>m || k>n)
{
dp_table[m][n][k] = 0;
ret... | ALGO | 0.999707 | 4.447958 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2017-03-03T19:04:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5cda47a79... |
c030ad91-0591-4f47-9228-ee2badaaeee5 | GS-GauravSingh/Data-Structures-and-Algorithms | 1.1. Arrays 1D and 2D (More Problems)/2. Medium/Spiral Matrix/SpiralMatrix.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
/* Spiral Order Traversal of Matrix. */
// Time Complexity:- O(n^2)
// Space Complexity:- O(1), excluding space used by answer vector.
vector<int> spiralOrder(vector<vector<int>> &matrix)
{
// vector to store answer.
... | ALGO | 0.999992 | 6.153876 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2023-02-10T05:26: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": "80ea13651... |
ed48a0a0-8366-4cb1-9845-c73694d23046 | rahulkumarguptaa/coding-ninjas-data-structure | Linked List 2/Even after Odd LinkedList.cpp | /*
For a given singly linked list of integers, arrange the elements such that all the even numbers are placed after the odd numbers. The relative order of the odd and even terms should remain unchanged.
Note :
No need to print the list, it has already been taken care. Only return the new head to the list.
Input format:... | ALGO | 0.999827 | 5.825139 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-12-19T18:11:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 64,
"forks": 49,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "66884c835... |
55dc99ac-d689-439a-9e4a-0611975612f9 | Beenish-Syed/Algorithms | Module6/ts.cpp | /* Title: ts.cpp
* Abstract: This program implements the topological
sorting algorithm based on the source-removal algorithm.
* Author: <NAME>
* ID: 1426
* Date: 06/01/2019
*/
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
using namespace std;
int Matrix[50][50];
int findSource(int ... | ALGO | 0.999966 | 5.110898 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-09-14T19:17: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": "ceb694a11f... |
f8d1a327-06df-4110-b605-990cb836a646 | Otober/Algorithm_problem | 백준/Silver/15663. N과 M (9)/N과 M (9).cc | #include <iostream>
#include <algorithm>
#define N 10
using namespace std;
int n, m;
int arr[N] = {};
int ans[N] = {};
void f_dfs(int cnt, int visit) {
if(cnt == m) {
for(int i = 0; i < m; i++) {
cout << ans[i] << " ";
}
cout << "\n";
return;
}
int before ... | ALGO | 0.999981 | 3.790002 | {
"github_metadata": {
"branch": "main",
"commit_count": 321,
"repo_created_at": "2022-09-08T10:15:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc73d41f46... |
e1b64e8e-c2ea-44ee-b66b-b1f7653b5156 | ayatullah2018/Mars-Exploration-Missions-Management | LinkedList.h | #pragma once
#ifndef _LINKEDLIST
#define _LINKEDLIST
#include "Node.h"
#include <iostream>
#include"MountanousMission.h"
using namespace std;
template <typename T>
class LinkedList
{
private:
Node<T>* Head; //Pointer to the head of the list
int count; //Number of nodes in the list
public:
bo... | TOOL | 0.969507 | 3.90736 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-02-14T00:14: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": "f5724f272555... |
8fc09ea2-4cb6-45cb-9485-f774335a9d4f | s1270146/algorithms-and-data-structures | chapter3/cpplang/bubble_sort.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
// Input
int n;
cin >> n;
vector<int> a(n, 0);
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
// Bubble Sort
int cnt = 0;
int flag = 1;
int i = 0;
while (flag) {
flag = 0;
for (... | ALGO | 0.999946 | 4.153121 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-07-12T09:25: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": "64a2a476b40... |
a69b936b-2e81-425b-bbb9-023fb5482b7c | tackOlab/HT-block-encoding-example | codingunits.h | #include <cstdio>
#include <cstring>
#include <functional>
#include "buf_chain.h"
typedef int32_t sprec_t;
class element_siz {
public:
uint32_t x;
uint32_t y;
element_siz() : x(0), y(0) {}
element_siz(uint32_t x0, uint32_t y0) {
x = x0;
y = y0;
}
};
#define CAUSAL 0x008
#define SHIFT_SIGMA 0 /... | ALGO | 0.999397 | 4.439191 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-01-11T06:33:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31587462b8de9... |
e99ca349-53cc-47c7-915b-e1b5d4e108ce | JieyangChen7/DVFS-MAGMA | magma-1.3.0/src/cpotrf3_mgpu.cpp | /*
-- MAGMA (version 1.3.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
November 2012
@generated c Wed Nov 14 22:53:01 2012
*/
#include "common_magma.h"
#include "trace.h"
/* === Define what BLAS to use ==============================... | ALGO | 0.999788 | 4.737443 | {
"github_metadata": {
"branch": "master",
"commit_count": 785,
"repo_created_at": "2016-04-02T23:09: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": "241ed7d0... |
920570b9-7f0d-4627-a136-11724efa2a7c | IunKhi/vector- | вектор.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
int main() {
std::ifstream infile("input.txt");
if (!infile) {
std::cerr << "Error opening file" << std::endl;
return 0;
}
std::vector<int> vec;
int num;
while (infile >> num) {
vec.push_back(num);
}
infile.close();
std::... | ALGO | 0.99993 | 4.227818 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-01T07:05: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": "010f78e14d58... |
1b864268-7fe1-4906-82d9-083fe4b81605 | LucasWhc/RU_ECE_573 | Assignment1/Q2/main.cpp | //
// Created by <NAME> on 2/2/20.
//
#include "Timer.h"
#include "quickFind.h"
#include "quickUnion.h"
#include "weightedQuickUnion.h"
#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <sstream>
int main() {
vector<vector<int> > dataList;
vector<int> dataP;
vector<int> d... | ALGO | 0.99786 | 4.585146 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-02-04T21:58: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": "5ba42d64c... |
d02a64f0-a0d5-4e3b-9f15-d0301a2af3fa | xczhang07/leetcode | topic/remove_duplicates_from_sorted_array.cpp | /*
According to leetcode question:
https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/description/
https://leetcode.com/problems/remove-duplicates-from-sorted-array/description/
which requires to remove the duplicates from sorted array, and the duplicates can keep in array at most how many times.
abo... | ALGO | 0.999958 | 6.531693 | {
"github_metadata": {
"branch": "master",
"commit_count": 1226,
"repo_created_at": "2017-05-20T20:34: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": "f5b4cf9... |
e8c042ba-c832-4ff4-aaf7-11be119d1a2d | kkoala0864/LeetCode | 0417_Pacific_Atlantic_Water_Flow/Solution.cpp | #include <Solution.h>
#include <iostream>
#include <queue>
#include <vector>
#include <utility>
using namespace std;
void dfs (int height, int x, int y , int m, int n, vector<vector<bool>>& record, vector<vector<int>>& matrix) {
if ((x < 0 || x >= m) || (y < 0 || y >= n)) {
return;
}
if (height <= matrix... | ALGO | 0.999966 | 6.102506 | {
"github_metadata": {
"branch": "master",
"commit_count": 353,
"repo_created_at": "2015-04-01T07:43:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a24d9ba8... |
a9c3f77c-a51e-4958-bb0a-fa8b309bd3a9 | ishandutta2007/codeforces-l | lucccff/normal/1592/C.cpp | #include <bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long LL;
int a[100010],b[100010],c[100010];
vector <int> e[100010];
int dfs(int k,int x) {
c[k]=1;
b[k]=a[k];
int j=0;
for(int i=0;i<e[k].size();i++) {
if (c[e[k][i]]==0) {
j+=dfs(e[k][i],x);
... | ALGO | 0.999943 | 4.851444 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c1eb9a04152... |
dc0f5914-c8b3-4ebf-a906-7cf7ca936712 | shashwat0105/CPP-Data-Structures-and-Algorithms | 09 (Graph Algorithms)/Theory/00) graphTheory.cpp | // http://www.i2symbol.com/symbols/arrows (copied arrow symbols from here)
// DFS is used more than BFS due to convenience of implementation.
// YT resources followed: 1) Striver's Graph
// 2) Codencode Graph Playlist
// Two types of graphs
// 1) Undirected 2) Directed
// Directed graphs ... | ALGO | 0.999961 | 5.61898 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2021-01-23T10:22:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "d7a77bae... |
f0153453-57d0-4bee-9321-2df44fa98798 | Gojou0/DSA_CB | L13-LinkedList/1_LLbasics.cpp | #include <iostream>
#include <vector>
using namespace std;
// Self Defining Datatype for node
class Node{
public:
int data;
Node* next;
// Calling Constructor
Node(int data1, Node* next1){
data = data1;
next = next1;
}
Node(int data1){
data = data1;
next = ... | ALGO | 0.999947 | 5.024508 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-02-27T06:16:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47eb1804305... |
baf51720-59f9-4ba4-9721-f0d5f7e0783c | rushs777/MySundance | ResidualBasedStabilization/ResidualBasedStabilization.cpp | #include "ResidualBasedStabilization.hpp"
ResidualBasedStabilization::ResidualBasedStabilization(velocityROM velROM, PMB pressROM, Expr forceTerm, Expr t, int K, int verbosity)
: velROM_(velROM),
pressROM_(pressROM),
forceTerm_(forceTerm),
t_(t),
deltat_(deltat),
K_(K),
verbosity_(verbosity)
... | ALGO | 0.996985 | 5.301585 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2016-11-03T16:15: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": "10ccef9e... |
5466075a-87aa-41c8-a166-d8c7e3e11d39 | since2016/leetcodemedium | 513.找树左下角的值.cpp | /*
* @lc app=leetcode.cn id=513 lang=cpp
*
* [513] 找树左下角的值
* 使用层序遍历, 每层最左边的第一个元素当作结果,遍历完就得到最终结果。
* 要注意每次队列要不为空的情况下
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
... | ALGO | 0.999996 | 5.931685 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-01-30T09:53: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": "cc4ced292e... |
cabd5f7a-0eb7-4e9f-8e4f-8013a5a6bcc3 | OpenXRay/xray | SDK/boost_1_30_0/libs/regex/src/primary_transform.hpp | /*
*
* Copyright (c) 1998-2002
* Dr <NAME>
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notic... | TOOL | 0.997548 | 6.069225 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-03-21T12:57:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 104,
"forks": 25,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "700032d5... |
97a284da-522f-4f93-aed5-c8c5caba306c | dixitt5/CP-Solutions | Leetcode/9_Merge_sorted_array.cpp | //Problem Question : https://leetcode.com/problems/merge-sorted-array/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
// Time complexity: O(logn)
// Space Complexity: O(1)
//Solution 1 :
class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {... | ALGO | 0.999991 | 5.384461 | {
"github_metadata": {
"branch": "main",
"commit_count": 656,
"repo_created_at": "2022-10-01T06:08:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 190,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "a588fb9... |
c8fbaa93-4ce9-4264-b288-7240f812855c | isbel8ai/university-cpp-projects | Sums in a Triangle I/Code.cpp | #include <iostream>
using namespace std;
int sumt(int **n , int c, int i , int j)
{
if(i == c - 1)
{
return n[i][j];
}
else
{
int s1 , s2;
s1 = sumt(n , c, i + 1 , j);
s2 = sumt(n , c, i + 1 , j + 1);
if(s1 > s2)
return s1 + n[i][j];
else
return s2 + n[i][j];
}
}
int m... | ALGO | 0.999886 | 3.460604 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-29T14:25: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": "7bda067f9be5... |
3f70703d-2f62-412f-abd3-29770ae83784 | dadboss/All-CodeForces-Submissions | codeforces/777/D.cpp | #include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n";
#defi... | ALGO | 0.999993 | 3.94433 | {
"github_metadata": {
"branch": "master",
"commit_count": 974,
"repo_created_at": "2022-01-24T11:11: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": "ec849e79... |
ade4c326-6ef6-47c2-9cce-2436d096ff0d | Aayushman-Gupta/Energy_Efficient-_WSN_Implemenation_using_CPP-ML | Algo4.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <limits>
class Node {
public:
int node_id;
double energy;
double distance_to_bs;
double dormancy_factor;
Node(int id, double e, double d)
: node_id(id), energy(e), distance_to_bs(d), dormancy_factor(0) {}... | ALGO | 0.999992 | 6.489012 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-10T12:31: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": "cd060345ee0f... |
66ddb575-6c63-43a1-a6b4-c574d740227e | Coolog/Nanodet-Robot-PathPlanning | path_planning.cpp | #include <path_planning.h>
/*********************** DEBUG函数宏定义***********************/
//#define DUBUG_LINE //输出画的线的位置信息
//#define DEBUG_PRE_MESSAGE //输出前一帧的信息
//#define DEBUG_NOW_MESSAGE //输出当前帧的信息
//#define DEBUG_EACH_LINE //画每一条线
float Path::judge_distance(){
if(line_max_y[la... | ALGO | 0.966882 | 3.464862 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-04-24T12:03: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": "d7048c60cba2... |
ade9e050-3735-49d0-a64a-0c0a82fc843b | gajalgarg09/Cpp-Problem-Solving-Journey | deque_implementationArray.cpp | // Design a data structure to implement deque of size ‘N’. It should support the following operations:
// pushFront(X): Inserts an element X in the front of the deque. Returns true if the element is inserted, otherwise false.
// pushRear(X): Inserts an element X in the back of the deque. Returns true if the element is ... | ALGO | 0.996795 | 5.021991 | {
"github_metadata": {
"branch": "main",
"commit_count": 288,
"repo_created_at": "2024-08-13T08:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff3324fe15... |
23cfcf71-e22d-4947-90dc-2f2afbee9228 | codewithdipesh/100DaysDSA | pattern/puzzle.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void printSquare(int n) {
// code here
for(int i = 0 ; i < 2*n - 1 ; i++){
for(int j = 0 ; j<2*n - 1 ; j++){
int top = j;
i... | ALGO | 0.999705 | 5.010637 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-07-31T19:27: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": "2e43c0c9c8... |
62092c81-7748-46ee-9f98-f99f29e1be88 | diogobabo/stuff | 7/Tests/funWithBSTs.cpp | // AED 2021/2022 - Aula Pratica 07
// <NAME> (DCC/FCUP) [06/12/2012]
#include <set>
#include <map>
#include "funWithBSTs.h"
#include "bst.h"
// ----------------------------------------------------------
// Exercicio 1: Colecao de Cromos
// ----------------------------------------------------------
// TODO
int FunWith... | ALGO | 0.992663 | 3.976791 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2021-11-02T15:56: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": "93432175f... |
c00ee2a9-d42d-49c9-b5bb-8e1c3923c901 | Jatin-Shihora/LeetCode-Solutions | 1305-all-elements-in-two-binary-search-trees/1305-all-elements-in-two-binary-search-trees.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 | 5.993964 | {
"github_metadata": {
"branch": "main",
"commit_count": 3066,
"repo_created_at": "2021-12-14T12:46:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 97,
"forks": 26,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e47d0f... |
36dc3281-880f-421f-b341-8918beb1d35d | WangJunqiao/Jobs | 2014-8-29-Alibaba-bishi/b.cpp | #include <iostream>
#include <cstring>
#include <vector>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define maxn 1100000
char data[maxn];
int SA[maxn],rnk[maxn],H[maxn],n;
#define getR(a)((a)>n?0:rnk[a])
inline bool cmp(int a,int b){ return data[a] < data[b]; }
int c[maxn],a[maxn],_SA[maxn],_rnk[ma... | ALGO | 0.99996 | 3.910399 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-09-01T02:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a204d9d86... |
1a26e785-3a9e-453d-b7c6-c6a524d804c2 | hieu-ln/IT82-11 | CodeC2/TheVinh_C2_Bai11.cpp | #include<iostream>
#include<stdio.h>
using namespace std;
// Khai bo cau truc QUEUE.
struct Node
{
int info;
Node *link;
};
Node * front, * rear; // Luu dia chi dau va cuoi cua QUEUE.
// Thuc tuc tao QUEUE rong.
void init()
{
front = NULL;
rear = NULL;
}
// Kiem tra xem QUEUE rong.
int isEmpty()
{
if(front == ... | ALGO | 0.98046 | 3.686285 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2019-06-26T10:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57ab772b... |
b6880f0d-bebb-4497-b9e6-e832bd14e430 | hjiang13/LLM4IR | results/Task2_IR_Decompilation/DecompiledResuts_Human_x_164_O2/GPT4o_Human_x_164_O2_decompiled/test/CPP_160.cpp | #include <vector>
#include <string>
#include <stdexcept>
#include <cmath>
int do_algebra(std::vector<std::string> v1, std::vector<int> v2) {
if (v1.empty() || v2.empty()) {
throw std::length_error("vector::_M_realloc_insert");
}
int result = 0;
for (size_t i = 0; i < v1.size(); ++i) {
... | ALGO | 0.99621 | 6.019607 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f2f1315c35... |
ebd6d2f5-ef24-4055-a149-290194bcfe71 | boky0102/simd_convolution | main.cpp | #include "iostream"
#include "vector"
#include "chrono"
struct size{
int width;
int height;
};
void Convolve(std::vector<float> &src, std::vector<float> &tmp, std::vector<float> &kernel, size imSize){
// horizontal
int overflow = kernel.size() / 2;
for(int y = 0; y < imSize.height; y++){
for(int x ... | ALGO | 0.997735 | 5.012119 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-19T21:12: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": "712cd551281d... |
df8a20b1-3472-43e7-9f54-a031285708d4 | ApsiV11/LEDProject | Koodi.ino | //Kirjastojen sisällyttäminen
#include <fix_fft.h>
#include <FastLED.h>
//Vakioiden määrittäminen
#define LED_PIN1 3
#define LED_PIN2 6
#define LED_PIN3 8
#define LED_PIN4 11
#define LED_PIN5 13
#define MIC_PIN A0
#define NUM_LEDS1 108
#define NUM_LEDS2 84
#define NUM_LEDS3 60
#defi... | TOOL | 0.972281 | 3.594839 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-12-29T19:41: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": "fac1bfae12b4... |
c4441be2-7104-448b-a015-152b6e83e7cb | simjaesung/Algorithm_PS | 프로그래머스/2/81302. 거리두기 확인하기/거리두기 확인하기.cpp | #include <string>
#include <vector>
#include <queue>
#include <tuple>
#include <algorithm>
using namespace std;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int arr[5][5];
int visit[5][5];
bool inrange(int x, int y){
return x>=0 && x<5 && y>=0 && y<5;
}
//P(응시자)는 1 / O(빈테이블)는 0 / X(파티션)는 2로
int check(vector<s... | ALGO | 0.99813 | 4.80224 | {
"github_metadata": {
"branch": "main",
"commit_count": 983,
"repo_created_at": "2024-03-13T05:02:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4db99f9935... |
2a70b2a8-a36a-4452-865c-fff584c964d1 | Arpit-2678/Competitive-Programs | MOST VALUABLE PLAYER.cpp | // LINK=https://www.codechef.com/CPCD2021/problems/MVP
#include<bits/stdc++.h>
#define ll long long int
#define test while(t--)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define xxx exit(0)
#define ain(arr) for (auto &it : arr) cin >> it;
#define fs first
#define se... | ALGO | 0.998838 | 3.738781 | {
"github_metadata": {
"branch": "main",
"commit_count": 900,
"repo_created_at": "2021-03-24T14:19:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "670dceebd0... |
5c095ae1-642d-4afa-b80b-3cfcec86f116 | wuer-x/leetcode | 66_plus_one/66_plus_one.cpp | //
// Created by 宋腾 on 16/2/29.
//
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
vector<int> plusOne(vector<int> &digits) {
vector<int>::iterator it;
bool is_9 = true;
// is like 999999
for (it = digits.begin(); it != digits.end(); it++) {
... | ALGO | 0.99943 | 5.28677 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2015-11-02T14:11: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": "8418510b1... |
3fe21222-7b0a-4adb-b64b-24eb35e444f3 | ki-opt/AtCoder-ABC | ABC001-ABC100/ABC065/C/src/src.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <cmath>
#include <climits>
#include <string>
#include <queue>
using ull=unsigned long long;
using ll=long long;
using namespace std;
#define rep(iter, limit) for (int iter = 0; iter < (int)(limit); iter++)
#def... | ALGO | 0.999986 | 4.375241 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2023-02-05T05:00: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": "d69529de7... |
def4c44c-6b53-41ac-a429-207c16324e2a | BismarckSVBP/DSA-Basic-Learning-in-cpp | 108 DnC/merge_practice.cpp | #include <iostream>
#include <vector>
using namespace std;
void merge(vector<int> &arr, int start, int end)
{
int mid = (start + end) / 2;
int lengthOffirst = mid - start + 1;
int lengthOfSecond = end - mid;
int *first = new int[lengthOffirst];
int *second = new int[lengthOfSecond];
int k = star... | ALGO | 0.999984 | 5.538818 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-03-11T09:12:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c245d999a49... |
7edaf8ff-ac01-44a0-af3d-24bdb2936f7c | masep01/FIB | courses/EDA/Exhaustive search and generation/P70756.cc | #include <iostream>
#include <vector>
using namespace std;
int s, p;
void escriu(const vector<string> &V, vector<int> &sol)
{
for(int k = 0; k < p; ++k)
{
string a = "";
cout << "subconjunt " << k+1 << ": {";
for (int i = 0; i < s; i++)
{
if(sol[i] == k)
... | ALGO | 0.995872 | 4.062097 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-06-15T11:57: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": "0d87a6b6998... |
0a6af738-0d92-46b5-8f7b-bb2820cd635e | atakangelecek/bomberman-game | bgame.cpp | #include <iostream>
#include <vector>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/select.h>
#include "message.h"
#include "logging.h"
#include "logging.c"
#include "message.c"
#include <errno.h>
#include <string.h>
using namespace std;
int main(){
int x;
st... | ALGO | 0.961908 | 3.284086 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-04-18T20:32:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cebdebfdc88... |
de30c4ac-801a-4200-8cdf-afcc09ff8bd1 | opencv/opencv_contrib | modules/xfeatures2d/samples/surf_matcher.cpp | #include <iostream>
#include <stdio.h>
#include "opencv2/core.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/ocl.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/calib3d.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/xfeatur... | ALGO | 0.952321 | 5.48647 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 4557,
"repo_created_at": "2013-09-11T13:28:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9757,
"forks": 5828,
"issues": 553,
"pull_requests": 88
},
"file_meta": {
"content_id": "1d... |
5b601585-075c-4ebc-942a-4507de3be4b8 | kamyu104/LeetCode-Solutions | C++/rank-transform-of-a-matrix.cpp | // Time: O(m * n * log(m * n) + m * n * α(m * n)) = O(m * n * log(m * n))
// Space: O(m * n)
class Solution {
public:
vector<vector<int>> matrixRankTransform(vector<vector<int>>& matrix) {
map<int, vector<pair<int, int>>> lookup;
for (int i = 0; i < size(matrix); ++i) {
for (int j = 0;... | ALGO | 0.999998 | 6.745806 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
12071b2b-3347-43c8-ad4f-9734a7307a81 | igorldep/Cplusplus | quick.cpp | #include<iostream>
using namespace std;
void Particao(int esq, int dir, int *v, int *i, int *j){
*i = esq;
*j = dir;
int p, x; // p = pivo , x = valor
p = v[(*i + *j) / 2];
do{
while(v[*i] < p){ (*i)++; }
while(v[*j] > p){ (*j)--; }
if(*i <= *j){
x = v[*i];
... | ALGO | 0.999909 | 5.517958 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-03-16T04:13: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": "15a891a20... |
15719d88-1bb6-4e4b-a6ad-85af290e098a | DerThorsten/inference_inferno | include/inferno/inference/icm.hxx | #ifndef INFERNO_INFERENCE_ICM_HXX
#define INFERNO_INFERENCE_ICM_HXX
#include "inferno/inferno.hxx"
#include "inferno/utilities/delegate.hxx"
#include "inferno/inference/discrete_inference_base.hxx"
#include "inferno/inference/utilities/movemaker.hxx"
#include "inferno/model/factors_of_variables.hxx"
namespace inferno{... | ALGO | 0.986847 | 6.205486 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2015-01-18T10:34:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "7867079f... |
45fabc17-b137-4a1b-8c94-3916ae951639 | senyuliu/StereoCalibration | main.cpp | #include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <Data... | TOOL | 0.982809 | 3.912035 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-11-22T09:43: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": "842afc3605... |
a2370aed-410b-4ebe-85f5-fd0ad67fd698 | junghyun21/coding-test | 백준/Silver/1149. RGB거리/RGB거리.cc | #include <iostream>
#include <vector>
using namespace std;
struct Color {
int R;
int G;
int B;
};
int main()
{
int N; // 집의 수
cin >> N;
vector<Color> price(N); // 집을 칠하는 비용
for(int i = 0; i < N; ++i) {
cin >> price[i].R >> price[i].G >> price[i].B;
}
vector<Color> su... | ALGO | 0.998931 | 4.490173 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2023-06-23T08:06:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3335e70f28... |
7c5d3b18-2aa6-40c9-9f9c-4ce3929bf290 | amanharitsh123/Algorithms-DataStructures | Codeforces/1393/D.cpp | #include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<set>
#include<cstring>
using namespace std;
typedef long long int lli;
#define all(arr) arr.begin(),arr.end()
#define f first
#define s second
#define debug1(x) cout<<x<<"\n"
#define debug2(x,y) cout<<x<<" "<<y<<"\n"
#define debug3(x,y,z) ... | ALGO | 0.999696 | 3.49362 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2019-06-14T06:30:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8283034d... |
95de2b52-b986-49ce-be40-973f9ec41792 | ishandutta2007/codeforces-a | alireza_kaviani/normal/812/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef pair<ld,ld> pld;
typedef pair<string , string>... | ALGO | 0.999975 | 3.663566 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d312bb73f2ee... |
0dc3fa8b-86f1-4088-9c01-016711e55d16 | ay2306/Competitive-Programming | codeforces/practice/mahmoud_and_a_dictionary.cpp | #include <bits/stdc++.h>
//For ordered_set
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define MOD 1000000007
#define test int t; cin>>t; while(t--)
#define init(arr,val) memset(arr,val,sizeof(arr))
#define loop(i,a,b) for(int i=a;i<b;i++)
#define loopr(i,a,b) for(int i=a;i>=b;i--)
#de... | ALGO | 0.999946 | 3.734989 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-08-29T14:45:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e21244465... |
72c279af-9481-430d-870c-3dc1053aafb6 | OsouzaTI/estrutura-de-dados-ii | exercicios/URI/ArvoreBinariaDeExpressao.cpp | #include <iostream>
#include <stack>
#include <vector>
#include "../../utils/tree.h"
int main(){
// std::cout << Helpers::expressionInfixToPosfix("4 * a - ( 6 + b ) + 8 / ( 9 - 7 )") << std::endl;
std::string expression;
std::stack<Tree<char>*> tree;
Tree<char>* node, *helpers[2];
bool isFir... | ALGO | 0.99934 | 4.525367 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-07-15T19:42: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": "9e8c485f18... |
1e7446b6-3a30-42cb-aef5-c745e6c2ccae | mrizaln/learn-opengl-old | 1. Getting Started/1.6. Camera/notes - camera.cpp | // glad
#include <glad/glad.h>
// GLFW
#include <GLFW/glfw3.h>
// GLM
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
/*---------------------------------------------------------------------------------------
============[ Camera ]============
... | TOOL | 0.938584 | 6.669625 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2022-02-21T07:55:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "909ab603634... |
8f576741-e958-4229-9cd5-14174c28edfa | VARUN-009/CP31-Varun-Punia | 1100/Eating-candies.cpp | #include <bits/stdc++.h>
using namespace std;
// Constants
const int MOD = 1e9 + 7;
#define ios \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
// Utils
#define int long long
#define vi vector<int>
#define vii vector<vector<int>>
#define vip... | ALGO | 0.999961 | 5.574641 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-07-22T11:06:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71c9d240d3e... |
06d3ec40-2ffc-4dda-b8da-78dac1c6c5b2 | Xagen37/Homework-and-compendiums | labs/AlgoLabs/No9/fast_substr.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
string p, t;
cin >> p >> t;
string s = p + "#" + t;
vector <int> z(s.length(), 0);
int left, right;
left = right = 0;
for (int i = 1; i < s.length(); i++)
{
z[i] = max(0, min(right - i, ... | ALGO | 0.999873 | 4.330782 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2019-12-02T17:00:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18c1ea83... |
b8409043-1485-4901-8ec3-531c7949f9e0 | ingmoiss/bubble-sort-with-C- | main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int a[10] = {2, 6, 4, 8, 10, 12, 89, 68, 45, 37};//Declaracion del arreglo
int aux = 0;
cout << "Datos en el orden original\n" << endl;
for(int i = 0; i < 10; i++){
cout << setw(4) << a[i];
}
//Ordernamiento bu... | ALGO | 0.999704 | 4.443039 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-05-06T23:38: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": "a313ee89c3... |
1ebfac98-3f9a-4a84-869e-59ff23717d02 | ExplorerFreda/OI | MathRelated/Test/source/std/point.cpp | #include<cstdio>
#include<iostream>
#include<vector>
using namespace std;
long long list[50], tot = 0;
long long calc(long long n, long long curr, long long num, long long sgn) {
if (curr == tot) {
return n / num * sgn;
}
return calc(n, curr + 1, num, sgn) + calc(n, curr + 1, num * list[curr], -sgn);
}
int main(... | ALGO | 0.999767 | 3.58448 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-01-18T07:53:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "308ec6a0da... |
18134679-758c-487f-821f-31bce078d390 | Apress/beginning-cpp23 | Exercises/Chapter 12/Soln12_07/Soln12_07.cpp | // Creating a nested iterator class
import box.random;
import truckload;
import std;
/*
Turns out moving the getFirstBox() and getLastBox() functions
to the nested iterator class is easy. We used the same names for
the member variables, so it is just a matter of changing "Truckload::"
into "Truckload::Iterator::... | ALGO | 0.999086 | 4.336506 | {
"github_metadata": {
"branch": "main",
"commit_count": 519,
"repo_created_at": "2022-08-28T23:51:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 66,
"forks": 23,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "0396fe377... |
c950e7bf-55ec-42a8-a22d-c69c294c3b2e | 0x0cqq/Codes | codeforces/problem/cf755f.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010000;
int n,k;
int p[MAXN],cn[MAXN];
int getmin(){
int sum = 0;
static int f[MAXN];
memset(f,0x3f,sizeof(f));
f[0] = 0;
for(int i = 1;i<=n;i++){
if(cn[i] == 0) continue;
sum += i * cn[i];
for(int k = 0;k+i<=sum;k++){
if(f[k... | ALGO | 0.999979 | 3.620241 | {
"github_metadata": {
"branch": "master",
"commit_count": 330,
"repo_created_at": "2018-01-26T02:51:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3e720bb... |
e61e23c3-377e-498d-a716-b903aec85cde | nakano0518/programming-contest | Atcoder/APG4b/EX18.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(M), B(M);
for (int i = 0; i < M; i++) {
cin >> A.at(i) >> B.at(i);
}
// ここにプログラムを追記
// (ここで"試合結果の表"の2次元配列を宣言)
vector<vector<char>> table(N, vector<char>(N, '-'));
for(int i = ... | ALGO | 0.99999 | 4.308971 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2023-02-03T08:51: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": "c9b71a82c2a... |
a9bdfa50-26f7-4a39-a923-45f9f1ec0cab | maurice-schuppe/my-sync | C_CPP_sync/cppds-4.1.5/source/bitvect.cpp | /****************************************************************************/
// FILE : PtrVect.cpp
// PURPOSE:
// Simple bit vector class for storage of bits
/****************************************************************************/
#ifndef BITVECTOR_CPP
#define BITVECTOR_CPP
#ifndef BITVECTOR_H
#include "bitve... | TOOL | 0.958177 | 6.800367 | {
"github_metadata": {
"branch": "master",
"commit_count": 859,
"repo_created_at": "2015-11-30T12:28:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2db7ffe... |
59ac1fde-4786-4255-96eb-769e5652166a | TobiasDuswald/angiogenesis | src/modules/tipcell_finder.h | // -----------------------------------------------------------------------------
//
// Copyright (C) 2022 CERN, TUM, and <NAME>. 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.
//
// See the LICENSE file distr... | ALGO | 0.986733 | 7.23276 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2022-03-15T11:54: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": "c55d927b... |
dffe8d25-2baf-4ea1-b7d8-d865bdb5897a | prestcote/algorithms-data-structures | aads 4 semester/1hw/1-5.cpp | #include <iostream>
#include <algorithm>
#include <cstdint>
/*
template <typename T>
class SegmentTree {
public:
SegmentTree(const T* arr, size_t size) {
arr_ = new T[size];
size_ = size;
for (size_t i = 0; i < size; i++) {
arr_[i] = arr[i];
}
//std::cout << "hello?? ";
tree_ = new std:... | ALGO | 0.999938 | 4.487842 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2024-04-21T15:19:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5c57a9f013... |
0a75e831-e243-44cf-b46a-9f40a0963798 | MorganHuntleyCS/Project131 | Code Files/deepseekrestricted.cpp | //#include <iostream>
//#include <vector>
//#include <array>
//#include <algorithm>
//#include <cstdlib>
//#include <ctime>
//#include <string>
//using namespace std;
//
//const int GRID_SIZE = 5;
//const int INITIAL_HEALTH = 5;
//
//struct Bot {
// int x, y;
// int health;
// char symbol;
// string name;
/... | ALGO | 0.997671 | 4.451931 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-05-27T06:50:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9090223eb090... |
68e688b2-5852-4fd1-81e7-7597867d0549 | secretflow/spu | src/libspu/kernel/hlo/rank.h | // Copyright 2024 Ant Group Co., Ltd.
//
// 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 ... | ALGO | 0.998408 | 7.201262 | {
"github_metadata": {
"branch": "main",
"commit_count": 706,
"repo_created_at": "2022-07-02T09:05:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 292,
"forks": 135,
"issues": 25,
"pull_requests": 15
},
"file_meta": {
"content_id": "8e311... |
be95440b-c561-4bd8-9080-a33e17f3eb04 | iamjanvijay/codeforces-jvj_iit-submissions | 837/C[ Two Seals ].cpp | #include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d",&x)
#define su(x) scanf("%u",&x)
#define slld(x) scanf("%lld",&x)
#define sc(x) scanf("%c",&x)
#define ss(x) scanf("%s",x)
#define sf(x) scanf("%f",&x)
#define slf(x) scanf("%lf",&x)
#define ll long long int
#define mod(x,n) (x+n)%n... | ALGO | 0.999466 | 3.360309 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-09-02T13:54:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e8ff1c62... |
23c12b97-ad2b-4745-9a31-d3159a44bed1 | AhmedRaof/CodeForce | div2A/81-90/[82] Feed the cat.cpp | #include<iostream>
#include<iomanip>
#include<string>
using namespace std;
int main() {
int hh, mm;
double h, d, c, n, costNoDiscount = 0, costWithDiscount = 0, minute = 0;
cin >> hh >> mm >> h >> d >> c >> n;
costNoDiscount = ceil((h / n)) * c;
while (true) {
if(hh == 24 && mm == 59)... | ALGO | 0.998185 | 3.16941 | {
"github_metadata": {
"branch": "main",
"commit_count": 224,
"repo_created_at": "2020-10-26T16:23: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": "a3864e38c7... |
3b834a71-da36-4ac8-88a2-7d7ea8cbc0ee | rossklin/machine-learning | arena-project/src/utility.cpp | #include "utility.hpp"
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <iterator>
#include <random>
#include <sstream>
#include "types.hpp"
using namespace std;
MutexType::MutexType() { omp_init_lock(&lock); }
MutexType::~MutexType() { omp_destroy_lock(&lock); }
void MutexType::L... | ALGO | 0.999095 | 5.369771 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2020-02-09T11:26: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": "cc36f0a5... |
4ed84163-7489-44aa-bfd0-ada3b041df2f | RoteKekse/qc_simulation | code/RunDmrg.cpp | #include <xerus.h>
#include <vector>
#include <fstream>
#include <ctime>
#include <queue>
#include <math.h>
#include "classes/loading_tensors.cpp"
#include "classes/helpers.cpp"
using namespace xerus;
using xerus::misc::operator<<;
class InternalSolver2;
double simpleMALS(const TTOperator& _A, TTTensor& _x, val... | ALGO | 0.999535 | 4.436164 | {
"github_metadata": {
"branch": "main",
"commit_count": 662,
"repo_created_at": "2021-04-26T12:58: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": "19604531f7... |
4c5947af-5bd0-4ea8-8930-ff684bb2ddab | DominicS99/Competitive-Programming | Kattis/floodit.cpp | /**
* @file floodit.cpp
* @author <NAME>
* @brief Very fun flood fill problem. Really straight-forward description
* @version 0.1
* @date 2023-10-25
*
* @copyright Copyright (c) 2023
*
*/
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> pii;
vector<int> di... | ALGO | 0.999486 | 5.515848 | {
"github_metadata": {
"branch": "main",
"commit_count": 451,
"repo_created_at": "2022-11-29T22:13: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": "566c289aca... |
d955bb1f-a3a0-4484-b8a7-0df303851426 | Adreno225/spider | steps.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include "steps.h"
#include <fstream>
using namespace std;
void Steps::Reset()
{
set_rating_step(0);
set_position_start(0,0);
card_start.reset();
set_position_end(0,0);
card_end.reset();
}
void Steps::New_Step(int rati... | TOOL | 0.90548 | 3.422574 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-03-23T08:06: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": "44ae7a1364... |
20e976ca-2782-41fd-94a3-d0750cbe0996 | naman99lalit/Data-Structures-and-Algorithms | Linked_Lists/Midpoint of the list.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node
{
int rollno;
char name[30];
struct Node* next;
};
struct Node* head;
struct Node* getnode(int roll,char name[])
{
struct Node* p=(struct Node*)malloc(sizeof(struct Node));
p->rollno=roll;
strcpy(p->name,name);
return p;
}
void insert_begin(struct Node** ... | ALGO | 0.998892 | 4.113055 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2019-01-17T14:19:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30cbc6e41... |
9d913ad5-55b9-4ba0-8a1f-cd33511e7332 | SuphalBochkar/Iam-Neo | DSA/Unit - 6/L36_4.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_CITIES = 100;
bool hasChainOfHighways(int n, int highways[][MAX_CITIES], int city1, int city2)
{
bool distance[MAX_CITIES][MAX_CITIES];
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < n; ++j)
{
distance[i][j] = highwa... | ALGO | 0.999926 | 5.153278 | {
"github_metadata": {
"branch": "main",
"commit_count": 183,
"repo_created_at": "2023-10-01T08:05: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": "81e3a26e6f... |
588bcd64-32fb-4af1-a89b-d898acd89ba4 | Sumit4589/sunbeam-ds | cpp/day12/DijkstraShortestPath.cpp | #include <iostream>
#include <vector>
using namespace std;
const int INF = 999;
class AdjMatrixWeightedGraph
{
private:
int **mat;
int vertCount, edgeCount;
public:
AdjMatrixWeightedGraph(int vCount)
{
vertCount = vCount;
edgeCount = 0;
mat = new int *[vertCount];
for (int i = 0; i < vertCount; i++)
{
... | ALGO | 0.999988 | 4.514295 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-04-20T17:45: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": "8e12166eb9... |
9139a188-e3e5-40f3-907d-8a22add8881d | syurskyi/Python_Topics | 125_algorithms/_exercises/templates/_algorithms_challenges/leetcode/leetCode/DepthFirstSearch/282_ExpressionAddOperators.cpp | /*
* @Author: <EMAIL>
* @Last Modified time: 2016-07-27 10:42:26
*/
c.. Solution {
public:
/*
Once you can understand the solution space tree, you just get it.
Refer to:
https://discuss.leetcode.com/topic/24523/java-standard-backtrace-ac-solutoin-short-and-clear
*/
vector<string> addOperato... | ALGO | 0.999963 | 6.281633 | {
"github_metadata": {
"branch": "master",
"commit_count": 4653,
"repo_created_at": "2019-11-09T02:58:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 33
},
"file_meta": {
"content_id": "07a404... |
c3934ae7-abda-4649-8549-7be350fdd912 | nousername-anonymous/cpp-snippets | sorting using STL.cpp | // ----- Sorting using STL -----
#include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = { 1, 5, 8, 9, 6, 7, 3, 4, 2, 0 };
int n = sizeof(arr) / sizeof(arr[0]);
// Ascending Sorting
sort(arr, arr + n);
cout << "\nArray after sorting using "
"default sort is : \n";
fo... | ALGO | 0.999726 | 5.146125 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-10-16T04:33:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "12b330a9635... |
2b2b51ca-440c-4034-8ee8-c5f7fa0f0d86 | NVIDIA/TensorRT-LLM | cpp/tensorrt_llm/layers/medusaDecodingLayer.cpp | /*
* Copyright (c) 2019-2024, NVIDIA CORPORATION. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | TOOL | 0.922319 | 6.943533 | {
"github_metadata": {
"branch": "main",
"commit_count": 1926,
"repo_created_at": "2023-08-16T17:14:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11075,
"forks": 1602,
"issues": 699,
"pull_requests": 315
},
"file_meta": {
"content_id": ... |
62b0c0d7-3b25-4a26-985d-12267919101a | JulianBirsan/Competitive-Programming-Solutions | DMOJ Solutions/DMOPC/dmopc19c2p3.cpp | #include <bits/stdc++.h>
using namespace std;
void scan(){}
template<typename F, typename... R> void scan(F &f,R&... r){cin>>f;scan(r...);}
#define rng(x) x.begin(),x.end()
#define FOR(i,j,n) for(int i=j;i<n;i++)
#define read(v,n) for(int i=0;i<n;i++) scan(v[i])
#define fill(x) memset(x,0,sizeof(x))
#define IOS ios_... | ALGO | 0.999918 | 3.866073 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-11-12T22:21:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8461878fc... |
89893b1c-dd23-4d02-b1fc-eb5aa4dad57e | hrmrakib/Basic-Data-Structures | mod-9_Doubly_Linked_List/6_Delete_at_head.cpp | #include <bits/stdc++.h>
using namespace std;
class Node {
public:
int val;
Node *next;
Node *prev;
Node(int val) {
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
void print_forward(Node* head) {
Node* temp = head;
while(temp != NULL)... | ALGO | 0.999818 | 4.343705 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2025-06-16T07:36: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": "c33f683974f... |
79703ac8-e047-466a-819b-226727766df8 | autul2017831021/Codeforces-Solved-Problem | C-category/166C.cpp | using namespace std;
#include<bits/stdc++.h>
typedef long long int ll;
typedef double dl;
#define pb push_back
#define bg begin()
#define en end()
#define rbg rbegin()
#define ren rend()
#define sz size()
#define r0 return 0
#define F first
#define S second
#define inf 9999999999
main()
{
ll n,x,ini,ans=inf,f=0;
... | ALGO | 0.999989 | 3.446262 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-08-05T10:43: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": "2453af518... |
eb2066ec-a4b9-4883-a1e4-f0b5e215c792 | peppapighs/submissions | Codeforces/1236D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define long long long
#define iii tuple<int, int, int>
#define pii pair<int, int>
#define x first
#define y second
const int INF = 1e9 + 1;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const long LINF = 1e18 + 1e10;
const double EPS = 1e-10... | ALGO | 0.999999 | 4.192171 | {
"github_metadata": {
"branch": "master",
"commit_count": 297,
"repo_created_at": "2019-03-26T03:29:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc64142... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.