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 |
|---|---|---|---|---|---|---|---|
8b79416c-89f6-4f69-9782-1b3570d11691 | ishandutta2007/codeforces-c | conan1412yang99/normal/1603/C.cpp | #include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef ... | ALGO | 0.999901 | 4.246764 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "dd6fb816ee46... |
df93c4f0-6c43-4c30-9ca8-2fd6c22b06ea | Lydxn/Competitive-Programming | DMOJ/Woburn/wc17fs2.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef pair<int, ll> pill;
typedef pair<pa... | ALGO | 0.999898 | 4.231248 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-04-25T03:16:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7825ca4d825... |
3d09e2b7-27ab-4d12-b4b2-3f4f6c623f2c | mohammedjasam/Technical-Interview-Guide | HackerRank/ctci-ice-cream-parlor.cpp | /*
*
* Tag: Data Structure (Hash)
* Time: O(n)
* Space: O(n)
*/
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstrin... | ALGO | 0.999862 | 3.909056 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-04-01T19:15:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 110,
"forks": 34,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "731b52... |
af124b95-f4fb-46fa-a2d7-cd5a016eb954 | KhoiBui16/HCMUS_TaiLieu_IT | Cơ sở trí tuệ nhân tạo/genetic_algorithm.cpp | #include<bits/stdc++.h>
#define DNA_LENGTH 8
#define MAX_N 255
#define MAX_LOOP 11
#define MIX_TIMES n * 2
using namespace std;
typedef pair<int, int> ii;
int n, a, b, c;
// math functions
int factor(int x){
// equation: ax^2 + bx + c = 0
return abs(a * x * x + b * x + c);
}
string intToBinary(int x){
s... | ALGO | 0.99978 | 3.538216 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-07-01T16:36:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3c00f8e4e1... |
b5e702b7-2d3c-492d-b041-1aee4bc5fcbd | Hefestos/cup2015 | control/control.h | #pragma once
#include <math.h>
#include "iostream"
#include <stdio.h>
#include <string>
#include"../serial/serial.h"
#include"../vision/vision.h"
#include"../robot/robot.h"
#include <time.h>
#include "Windows.h"
class controle_bili{
public:
void ajuste_theta(float,float,float); // ajusta theta para sempre cresce... | ALGO | 0.996747 | 4.035649 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-07-07T14:42:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bfd913d51a... |
6c43a093-e841-4467-9650-55ac6b45f3e8 | Xilinx/Vitis-Tutorials | AI_Engine_Development/AIE/Design_Tutorials/20-TDM-Mixer/aie/tdm_mixer.cpp | //
// Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.
// SPDX-License-Identifier: MIT
//
// Author: <NAME>
#include <adf.h>
#include <aie_api/aie.hpp>
#include "tdm_mixer.h"
// ------------------------------------------------------------
// Constructor
// --------------------------------------... | ALGO | 0.990233 | 5.858089 | {
"github_metadata": {
"branch": "2025.1",
"commit_count": 3080,
"repo_created_at": "2019-09-30T17:08:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1419,
"forks": 572,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "25... |
b9241ffc-aae6-40c4-8d34-06b87385bef3 | kaldi-asr/kaldi | src/transform/lda-estimate.h | // transform/lda-estimate.h
// Copyright 2009-2011 <NAME>
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http:... | ALGO | 0.948719 | 7.60958 | {
"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":... |
3a28f19a-59ca-4201-ab3c-3839d1c31ca4 | akadakia/hello-world | rsa.cpp | #include <fstream>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <vector>
using namespace std;
int main()
{
vector<long long int> enigma;
for(int i = 0; i < enigma.size(); i++)
{
enigma.at(i) = 0;
}
string input;
cout << "Enter name of input file: ";
c... | ALGO | 0.999885 | 3.552984 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2015-04-01T23:45:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f2333be5ff... |
ac69c93e-e755-48af-ae13-15bd1334f80e | Abdullah-Ghaith/advent_2021 | advent3/advent-3.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include<cmath>
using namespace std;
class submarine {
private:
uint64_t horizontal = 0;
uint64_t depth = 0;
uint64_t aim = 0;
public:
void move(string input)
{
switch (input[0])
{
... | ALGO | 0.996291 | 5.470839 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-04-29T21:57: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": "481a1df1b978... |
fa4af046-17f0-49ce-8649-9387f2385222 | WilliamPhilippe/Estrutura-de-Dados | Estruturas/Queue/Exercícios/863.cpp | #include <bits/stdc++.h>
using namespace std;
struct node
{
int value;
node *next;
};
struct SetStack
{
node *head;
int size;
};
void push_elemment(SetStack *stack, int x){
node *newPointer = (node *) malloc(sizeof(node));
newPointer->value = x;
stack->size ++;
if(stack->head == NULL){
stack->head = newP... | ALGO | 0.999201 | 3.848578 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2018-11-21T18:55: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": "923c0d107... |
bb6a8738-146f-412b-bcde-6163b0d1aa21 | Divyanshu-Mishra9620/Dv.18 | minCostforTickets.cpp | #include <bits/stdc++.h>
using namespace std;
/* QUESTION
You have planned some train traveling one year in advance. The days of the year in which you will travel
are given as an integer array days. Each day is an integer from 1 to 365.
Train tickets are sold in three different ways:
a 1-day pass is sold for costs[0]... | ALGO | 0.999236 | 4.730146 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2023-12-14T13:58: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": "1815940e00d... |
d0e59ccd-f6eb-4017-984e-0c9a53d8e065 | koboko34/Leetcode | C++/middleOfLinkedList.cpp | #include <iostream>
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
public:
ListNode* middleNode(ListNode* head) {
int length = 1;
... | ALGO | 0.999848 | 6.129413 | {
"github_metadata": {
"branch": "main",
"commit_count": 169,
"repo_created_at": "2023-07-22T21:44: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": "d5daf0e60e... |
1459119c-502c-4d4c-957f-3b583d1fd7c2 | dqu123/code-sample-2016 | obj_parser.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <Eigen/Dense>
#include "obj_parser.h"
using namespace Eigen;
double square_dist(Vertex a, Vertex b) {
double dx = a.x - b.x;
double dy = a.y - b.y;
double dz = a.z - b.z;
return dx * dx + dy * dy + dz * dz;
}
// Convert to Vector3d.... | TOOL | 0.9163 | 5.140836 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-11-07T01:34: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": "6cf0f2ca1c... |
a151a8b7-0a0b-48f4-ae0a-edb655b1cde1 | RichardHancock/Quaternion-Performance-Testing | GCP Assignment 1/misc/Mat4.h | #pragma once
#include <iostream>
#include "Vec4.h"
#include "Vec3.h"
/** @brief A matrix 4x4. */
struct Mat4
{
/** @brief Default constructor. */
Mat4()
{
}
/**
@brief Constructor.
@param id Set to 1.0f for identity matrix.
*/
Mat4(float id) :
x(id, 0, 0, 0),
y(0, id, 0, 0),
z(0, 0, id, 0),
w... | TOOL | 0.944389 | 6.501112 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2016-11-16T02:45: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": "25e26531e... |
f10a0a58-268e-443e-866e-4c8aa1a93816 | Collab4exaNBody/exaNBody | src/core/include/exanb/core/spline.h | /*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this f... | ALGO | 0.991121 | 6.762047 | {
"github_metadata": {
"branch": "main",
"commit_count": 782,
"repo_created_at": "2023-07-04T07:13:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 2,
"pull_requests": 2
},
"file_meta": {
"content_id": "24ab79cda47... |
faa3b0bf-7cf4-45de-a1e7-c20c3dc07b76 | 21Cash/DSAArchive | Archive/Main/Linked Lists/RemoveNthNodeFromLast.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pi;
typedef long long ll;
#define PI 3.141592653589793238462
#define rep(i,a,b) for (int i = a; i < b; i++)
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end... | ALGO | 0.999939 | 4.392246 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-11-04T06:37: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": "68cf3a66428... |
6f73be08-7e84-44ab-9bb0-550f67ba7bb0 | mena-aq/Plants-Vs-Zombies | Classes/Defenders.cpp | #include "Defenders.h"
Defenders::Defenders() : defenders(nullptr), numDefenders(5) {
defenders = new LaneDefender * [numDefenders];
for (int i = 0; i < 5; i++)
defenders[i] = new LaneDefender(16, i * 5.5 + 6);
}
int Defenders::getNumLawnmowers() {
return numDefenders;
}
void Defenders::action() {
for (int i = 0... | TOOL | 0.936834 | 4.39408 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-05-15T07:36: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": "b60f02c058... |
fdadb553-ee2d-4ed2-a43b-14fdf92d0f56 | qsnake/deal.II | include/deal.II/lac/matrix_lib.h | //---------------------------------------------------------------------------
// $Id: matrix_lib.h 23876 2011-06-28 18:21:51Z kanschat $
//
// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and ... | ALGO | 0.98367 | 5.880123 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2012-07-27T14:00:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5addd45f20... |
f5feb3e0-d0cd-407d-83f4-9bc7ba5cd62a | retocrooman/AtCoder | algorithm/Napzack1.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define REP(i, n) for (int i=1; i<=(int)(n); i++)
#define FOR(i, n, m) for (int i=(n); i<=(int)(m); i++)
#define ll long long
const ll INF=1LL<<60;
const ll mod = 1000000007;
const double pi=3.1415926535;
const int dx[4] = {1... | ALGO | 0.999985 | 3.877482 | {
"github_metadata": {
"branch": "main",
"commit_count": 347,
"repo_created_at": "2021-04-26T11:44: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": "8168a2829d... |
bca6347b-61ff-44dd-964a-e511377554a2 | muhammadhasan01/cp | Online Judge/Codeforces/Practice/1800/Magic_Ship.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long INF = 1e18;
long long x_1, y_1, x_2, y_2;
int n;
string s;
pair<long long, long long> pre[N];
bool can(long long k) {
long long x = x_1 + pre[n].first * (k / n) + pre[k % n].first;
long long y = y_1 + pre[n].second * (k / n) + p... | ALGO | 0.999961 | 4.091166 | {
"github_metadata": {
"branch": "master",
"commit_count": 1187,
"repo_created_at": "2019-07-13T15:49:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df4a6a8... |
8d53d760-f81f-4e66-8efa-26649c1cbe95 | ammardab3an/ACM | problems/done/others/ucup - F. Fast XORting.cpp | // ucup - F. Fast XORting
// By AmmarDab3an
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define ll int64_t
// typedef unsigned int uint;
// typedef long long int ll;
// typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<i... | ALGO | 0.999961 | 4.18704 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-10-06T07:54:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fafddf085b... |
14b11117-eef0-4356-b0a7-eddcb0aac13a | oilover/ACM-Template | Math/FFT.cpp | typedef complex<double> Complex;
const double PI = acos(-1.0);
const int MAXN = 100100 << 2;
int f(int n)
{
int tmp = 1;
while (tmp < n) tmp <<= 1;
return tmp;
}
// oper = 1 FFT oper = -1 逆FFT
void FFT(Complex A[], int n, int oper)
{
for (int i=1,j=0;i<n-1;i++) {
for (int s=n;j^=s>>=1,~j&s... | ALGO | 0.999783 | 3.497931 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2014-09-10T06:59:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "642500ce... |
f9c50d76-5664-4e69-9846-0fab00d1916b | Fourier-UCSD/rl_train_deploy | GR1-deploy/gr1-rl-deploy/controllers/GR1_lite_webots/example/include/broccoli/curve/curves/QuaternionBSplineCurve.hpp | /*
* This file is part of broccoli
* Copyright (C) 2021 Chair of Applied Mechanics, Technical University of Munich
* https://www.mw.tum.de/am
*/
#pragma once // Load this file only once
// This module requires Eigen library
#ifdef HAVE_EIGEN3
#include "../../core/math.hpp"
#include "../../geometry/rotations.hpp"... | ALGO | 0.988682 | 7.254936 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-06-20T12:22:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b9c5b9c365ff... |
805c43db-ca18-4f7b-84b9-747faf30cc85 | samarth-bhargav/Competitive_Programming | Codeforces/Problems/2055E.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int t; cin >> t;
while (t--){
int n; cin >> n;
vector<int> a(n), b(n);
int neg_sum = 0;
for (int i = 0; i < n; i++){
cin >> a[i] ... | ALGO | 0.999906 | 4.058649 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-04-07T15:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "952cdfeabf7... |
3b76eb4f-1ad2-422e-a462-564df0906b57 | ICraZZyBoY/Algorithms-Trainings | LYCEUM (contests, homework, etc.)/CPP TRAININGS/DPtrainings/C3.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
if (n == 0)
return 0;
vector < vector <long long> > v(n+1, vector <long long> (m+1));
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
cin >> v[i][j];
vector < ... | ALGO | 0.999959 | 3.088378 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-13T11:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d84a46c3ac72... |
cbe1cc27-4fc8-479c-b19b-9a88c24274a0 | kidlatmc29/cs2600 | hw5/Graph.h | // Graph.h
// <NAME>
#include <iostream>
#include <fstream>
#include <sstream>
#include <queue>
using namespace std;
class Graph {
private:
int** adjMatrix = nullptr; // 2-D array for adjacency matrix of the graph
int numOfVertices;
void addEdge(int x, int y);
// helper function for load. ad... | ALGO | 0.992198 | 4.088649 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2021-01-30T01:06:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9efe709ba... |
dd0dc3ad-562b-4921-a3bf-7c4ffbc27905 | SrUnicornio/Segundo-Ingenieria-Informatica | AyEDA/Práctica 7/Versiones/V1/AVL.h | #ifndef __AVL_H__
#define __AVL_H__
#include "ABB.h"
#include "NodoAVL.h"
#include <deque>
#include <iostream>
template <class Key>
class AVL : public ABB<Key>
{
private:
NodoAVL<Key> *raiz;
// Busqueda
bool searchNode(NodoAVL<Key> *node, Key data) const
{
if (node == nullptr)
return false;
if... | ALGO | 0.999113 | 5.287977 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-11-09T15:36: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": "1399450fece... |
ea3c44aa-6cac-4a88-b751-43889e0d4adc | Bharatgupta922/Coding-Practice | 450leetcode/maths/addBinary_67.cpp | #include <bits/stdc++.h>
using namespace std;
string addBinary(string a, string b) {
if(a.length()<b.length()){
string temp = a;
a = b;
b = temp;
}
int carry = 0 , i = a.length()-1 , j = b.length()-1;
string res = "";
while(i>=0 && j >= 0){
... | ALGO | 0.999995 | 4.785813 | {
"github_metadata": {
"branch": "master",
"commit_count": 292,
"repo_created_at": "2020-05-23T12:24:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5d26dcd... |
c07fed96-b34b-41d4-97d7-d5280309633e | encrypted-def/basic-algo-lecture | 0x0D/solutions/17141.cpp | // Authored by : yongjunleeme
// Co-authored by : -
// http://boj.kr/49ac4768e5164bb4a958058fab126d2b
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
const int MX = 0x7f7f7f7f;
int n, m;
int board[55][55];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
vector<pair<int, int>> v;
qu... | ALGO | 0.999916 | 3.399298 | {
"github_metadata": {
"branch": "master",
"commit_count": 1862,
"repo_created_at": "2020-02-19T10:47:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2560,
"forks": 601,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "bb... |
bc27c9d6-ef18-4a29-a885-4cb25a9066d9 | alexandraback/datacollection | solutions_2449486_1/C++/vaputa/Q2.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
pair<int, int> v[1 << 15];
int a[1 << 7][1 << 7];
int col[1 << 7];
int row[1 << 7];
string solve(){
int n , m;
cin >> n >> m;
memset(col, 0, sizeof(col));
memset(row, 0, sizeof(row));
... | ALGO | 0.999974 | 3.104559 | {
"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": "063574e7c... |
5ed520a7-5df3-46f9-9dbc-f593b4a5bd29 | LuckyN510/CODE_PTIT | DSA/Do thi/DSA09013_LIET KE CANH CAU.cpp | #include<bits/stdc++.h>
using namespace std;
int n, m;
vector<int> adj[10005];
vector<pair<int, int>> v;
int visited[10005];
void DFS(int u, int s, int t){
visited[u] = true;
for(int x : adj[u]){
if(u == s && x == t || u == t && x == s){
continue;
}
if(!visited[x]){
... | ALGO | 0.999981 | 3.928504 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-02-06T14:18:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e73dcb1e06... |
6303c00b-7c31-4229-a862-9bb607c7e819 | gauravbyte/cpp_codes | LeetCodes/leetcode/editor/en/en/[210]Course Schedule II.cpp |
/**
There are a total of numCourses courses you have to take, labeled from 0 to
numCourses - 1. You are given an array prerequisites where prerequisites[i] =
[ai, bi] indicates that you must take course bi first if you want to take course
ai.
For example, the pair [0, 1], indicates that to take course 0 you have to... | ALGO | 0.999999 | 6.446235 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-08-28T05:40: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": "0b455a0c642... |
da54be64-96fa-4910-a882-ed997b06aab0 | Divyalok123/Spoj_Solutions | _mul.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
int concat(string &a, string &b)
{
int len1 = a.length();
int len2 = b.length();
if (len1 < len2)
{
for (int i = 0; i < len2 - len1; i++)
a = "0" + a;
}
if (len2 < len1)
{
... | ALGO | 0.999983 | 5.136351 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-05-14T00:02: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": "e31a5865b... |
4927f959-3a64-4805-8988-fa20b0c9b4f6 | Berry-Gouda/Kernel-Study | MFQ.cpp | #include <iostream>
#include <unistd.h>
#include <string>
#include <random>
#include <queue>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
class Process
{
public:
string name;
int remaining_time;
int priority;
Process(string n, int t, int p) : name(n), remaining_time(t),... | ALGO | 0.999289 | 4.347266 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-15T17:42: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": "56d20edb7ad7... |
4baae993-60e8-4a89-8a44-cd8e467b481a | sidhanthapoddar99/Competetive-coding | Coding blocks c++/1 STL QuickStart/9 List STL - I.cpp | #include <iostream>
#include <list>
using namespace std;
// list reffers to doubely linked list
// it is better for insertion
// insertion works in O(1) every time
int main()
{
list<string> s{"apple","mango","banana"};
/* Functions availabe in linked list
push_back
push_front
pop... | ALGO | 0.942246 | 3.178588 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-06-01T13:25:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bfb9ad70... |
72566771-31e7-49d3-af8c-29de5f7a419e | Kosthi/DeepSearch | src/distance/computers.cpp | #include "computers.h"
#include <algorithm>
#include <cmath>
#include "simd/distance_functions.h"
namespace deepsearch {
namespace distance {
// L2距离计算器实现
// template <typename T, QuantizerType Quantizer = QuantizerType::FP32>
// float L2DistanceComputer<T, Quantizer>::compute(const T* a, const T* b) const
// {
// ... | ALGO | 0.992953 | 6.603047 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2025-05-09T17:23:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "77e274c93... |
389af378-f036-4582-b4ba-d42c42434840 | wox2/migrace_databaze | skola/Fel_Mgr/1.semestr/PAL/ulohy/uloha2/PJC_Tarjan/TarjanAlgorithm.cpp | /*
* TarjanAlgorithm.cpp
*
* Created on: 8.1.2012
* Author: woxie
*/
#include "TarjanAlgorithm.h"
#include <cstddef>
#include <climits>
TarjanAlgorithm::TarjanAlgorithm() {
}
TarjanAlgorithm::~TarjanAlgorithm() {
}
void TarjanAlgorithm::readData(){
cin >> nodesCount ;
while(readEdge()){
};
}
bool Tar... | ALGO | 0.999859 | 4.384551 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2010-10-13T17:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f810af9a... |
bae02777-c70e-44f2-a552-16061214e228 | fsq/leetcode | 964. Least Operators to Express Number .cpp | class Solution {
public:
unordered_map<string, int> ans;
inline int cost(int i) {
return i==0 ? 1 : i-1;
}
int dp(int i, int x, int n) {
string key = to_string(i) + "," + to_string(n);
if (ans.count(key)) return ans[key];
if (n==0) return 0;
if (i>=... | ALGO | 0.999967 | 5.027442 | {
"github_metadata": {
"branch": "master",
"commit_count": 1935,
"repo_created_at": "2018-01-18T01:31:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c766e79... |
1bbacfa2-8d46-481a-a78c-80028aefe7a8 | cs-dad/class-work | CS-210/Module-7/lab/lab.cpp | #include <iostream>
#include<string>
#include<limits>
using namespace std;
class ContactNode {
public:
// public member functions and data
// construct class
ContactNode(string name, string phoneNumber) {
this->contactName = name;
this->contactNumber = phoneNumber;
// set n... | ALGO | 0.988552 | 4.682335 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-03-10T00:53:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8513b0a834b... |
daf43055-8e71-4cc3-aedb-4cdfdebc0cb8 | Yash4119/Data_Structures_And_Algorithms_CPP | Partition_Equal_Subset_Sum.cpp | #include<bits/stdc++.h>
using namespace std;
bool tabulation(vector<int> arr, int n, int target)
{
vector<vector<bool>> dp(n, vector<bool>(target + 1, 0));
for (int i = 0; i < n; i++)
{
dp[i][0] = true;
}
dp[0][arr[0]] = true;
for (int i = 1; i < n; i++)
{
for (int k = 1... | ALGO | 0.999976 | 5.195029 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-07-24T08:18: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": "d0262256aac... |
f9d310c4-3a74-41c2-9f3a-5a2e4712b875 | rabelhmd/UVA-Solutions | UVA_352 - The Seasonal War.cpp | #include "bits/stdc++.h"
using namespace std;
#define LL long long int
#define mem(a,b) memset(a,b,sizeof(a))
LL visit[30][30], N;
char str[30][30];
void DFS(int x, int y)
{
if(x < 0 or x >= N or y < 0 or y >= N or visit[x][y] == true or str[x][y] == '0')
return;
visit[x][y] = true;
... | ALGO | 0.999845 | 3.6543 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-09-26T05:38: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": "4e8620158f... |
cbc0043b-f317-43b1-8127-31cc5d8e64fd | bikashkumaryadav/GFG-ProblemSets | Difficulty: Easy/Search in a Row-Column sorted matrix/search-in-a-row-column-sorted-matrix.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
bool matSearch(vector<vector<int>>& mat, int x) {
if (mat.empty() || mat[0].empty()) return false; // Check for empty matrix
int row = 0;
i... | ALGO | 0.999331 | 5.688026 | {
"github_metadata": {
"branch": "main",
"commit_count": 593,
"repo_created_at": "2024-08-27T07:51:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3eee2431f... |
17732e24-6605-48c3-9d54-b4c9286831d2 | Arpitmurailya18/AJfiles-CP | bazokaandmochasarray.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long double lld;
typedef unsigned long long ull;
typedef long long ll;
typedef int in;
typedef char ch;
typedef float fl;
typedef double dou;
typedef string ss;
#define ub upper_bound
#define lb lower_bound
#define AJ(i,a,b) for(int i=a;i<b;i++)
#define fastio ios_b... | ALGO | 0.999998 | 3.620452 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-06-13T10:58:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d53bc47788d... |
2b7981af-7f06-402e-a29b-2609655641fc | Youkwangchae/Algorithms | 프로그래머스/3/42627. 디스크 컨트롤러/디스크 컨트롤러.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define INF 987654321;
bool cmp(vector<int>& A, vector<int>& B)
{
return A[1] < B[1];
}
int solution(vector<vector<int>> jobs) {
sort(jobs.begin(), jobs.end(), cmp);
int answer = INF;
int start = 0;
int time = 0;
... | ALGO | 0.999917 | 5.095881 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2024-01-07T01:45: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": "535312f9fc... |
057d1ef5-0fa5-4c6e-beb5-bee2191914ee | Giangattt123/DSA_PTIT | Generation algo/Generation_Permutation.cpp | #include <bits/stdc++.h>
using namespace std;
#define ms(s,n) memset(s,n,sizeof(s))
#define all(a) a.begin(),a.end()
#define present(t, x) (t.find(x) != t.end())
#define sz(a) int((a).size())
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define pb push... | ALGO | 0.999862 | 3.899778 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-02-17T15:47: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": "eebac5c047... |
0a65f29d-58be-40b5-8321-e42f8c56700a | pourzand/AS-OCT | simplemind/simplemind/dependencies/include/PCL/include/pcl/filter/image/ImageConvolutionFilter.h | #ifndef PCL_IMAGE_CONVOLUTION_FILTER
#define PCL_IMAGE_CONVOLUTION_FILTER
#include <pcl/filter/image/ImageFilterBase.h>
#include <pcl/filter/boundary_handler/RepeatingBoundaryHandler.h>
#include <pcl/misc/SafeUnsafeRegionGenerator.h>
#include <pcl/iterator/ImageWindowIterator.h>
namespace pcl
{
namespace filter
{
... | ALGO | 0.912336 | 7.457669 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-08-21T18:18:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40dcbdfba91... |
3cfee71e-45c3-4e50-91d8-0091282ef1f3 | bowman85/prata- | glava12/ex06/main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include "queue.h"
#include "cstdio"
const int MIN_PER_HR = 60 ;
bool newcustomer (double x) ;
int main()
{
using std::cin;
using std::cout;
using std::endl;
using std::ios_base;
std::srand(std::time(0) );
cout << "Case Study: Bank of Heather Automatic ... | ALGO | 0.996907 | 3.485062 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-12-29T14:54: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": "8801818642... |
b6518ef4-1185-4283-ab94-e06b3211be29 | Viraj-Mathur/DSA-Basics | LINKED LIST/doubly_Linked_List.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* prev;
Node* next;
// constructor
Node(int d){
this -> data = d;
this ->prev = NULL;
this -> next = NULL;
}
~Node(){
int val = this -> data;
if(next!=NULL){
... | ALGO | 0.998636 | 4.808239 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2023-07-01T14:25:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c66540dcf... |
d0ef35ce-fd36-45d1-a612-7437922b39ab | Nagsenwaghmare/DSA-SHEET | Tree/Easy/Binary Tree Paths.cpp |
#include <bits/stdc++.h>
using namespace std;
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), left(... | ALGO | 0.999959 | 5.802881 | {
"github_metadata": {
"branch": "main",
"commit_count": 2069,
"repo_created_at": "2021-10-22T06:55:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "241f26dc8... |
4495004e-3ba5-49dc-8b2d-f6f877bbe356 | joery0x3b800001/LEETCODE-150-Days | 150/GraphGeneral/130.cpp | // Surrounded Regions
// https://leetcode.com/problems/surrounded-regions/?envType=study-plan-v2&envId=top-interview-150
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
void solve(vector<vector<char>> &board)
{
if (board.empty() || board[0].empty())
return;
... | ALGO | 0.999366 | 7.358747 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-06-15T13:18: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": "4335ee3acdd2... |
a5f3d6b1-e6c5-496d-9ce9-80011517451f | raincross7/code-similarity | codes/train_code/problem061/problem061_76.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x... | ALGO | 0.999959 | 3.61351 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fc7fbff46a1... |
186a8a7e-0cb3-4b10-b4ed-e38dfad5f51d | bige00/miniSAT | core/Dimacs.h | /****************************************************************************************[Dimacs.h]
**************************************************************************************************/
#ifndef Minisat_Dimacs_h
#define Minisat_Dimacs_h
#include <stdio.h>
#include "../utils/ParseUtils.h"
#include "../co... | ALGO | 0.941549 | 4.641747 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-04-26T13: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": "388e78c527... |
9f87f1bd-1372-4796-aae8-25f59ce67ec2 | ishandutta2007/codeforces-r | robezh/normal/1105/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1005;
int n;
int a[N];
int check(int t) {
int sum = 0;
for(int i = 0; i < n; i++) {
if(a[i] >= t + 1) sum += a[i] - (t + 1);
else if(a[i] <= t - 1) sum += (t - 1) - a[i];
}
return sum;
}
int main() {
... | ALGO | 0.99997 | 3.745166 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "1934756cd4d9... |
826529b0-c9a8-43b0-9a59-59ffdcb3c7fe | alisw/AliRoot | TEvtGen/EvtGen/EvtGenModels/EvtBtoXsgammaRootFinder.hh | //--------------------------------------------------------------------------
//
// Environment:
// This software is part of the EvtGen package developed jointly
// for the BaBar and CLEO collaborations. If you use all or part
// of it, please give an appropriate acknowledgement.
//
// Copyright Informat... | ALGO | 0.999537 | 4.95345 | {
"github_metadata": {
"branch": "master",
"commit_count": 74535,
"repo_created_at": "2016-03-07T09:20:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 57,
"forks": 256,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2116... |
e2d020d9-c0ef-4e32-a395-5b78e6920da8 | eme64/AlgoLab | w12/tourofgaul/code.cpp | #include <iostream>
#include <map>
#include <vector>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/cycle_canceling.hpp>
#include <boost/graph/push_relabel_max_flow.hpp>
#include <boost/graph/successive_shortest_path_nonnegative_weights.hpp>
#include <boost/graph/find_flow_cost.hpp>
// Graph Type wit... | ALGO | 0.999774 | 3.898046 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2019-09-19T13:53: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": "2c279b2c... |
0339a76a-bfa2-4d2a-b779-44ce218551e8 | ishandutta2007/codeforces-s | sexpert/normal/1327/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 10;
const ll MOD = 998244353;
ll p10[MAXN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
p10[0] = 1;
for(int i = 1; i < MAXN; i++)
p10[i] = (10LL * p10[i - 1]) % MOD;
int n;
cin >>... | ALGO | 0.999894 | 4.125363 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c2520756aee... |
170b588e-3a04-45cb-b571-2ae493b274c5 | nskowron/Uni | Sem4/AI/List2/puzzle15/solve.hpp | #ifndef SOLVE_HPP
#define SOLVE_HPP
#include <cstdint>
#include <queue>
#include <unordered_map>
#include <memory>
#include "node.hpp"
#include "state.hpp"
#include "heuristics.hpp"
extern const uint64_t TARGET_STATE;
Node* solve(uint64_t start, int& length, int& visited) {
visited = 0;
length = 0;
WD_... | ALGO | 0.999915 | 4.602225 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2025-03-12T16:43: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": "ffc8d985... |
0e908272-8d93-4c44-a734-7824ddc9a0b1 | T2hhbmEK/cp | P_2580_于是他错误的点名开始了.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 1000010
int n, nxt[N][26], cnt, m;
bool vis[N], ok[N];
int main() {
cin >> n;
while (n > 0) {
char s[100];
scanf("%s", s);
int p = 0;
for (int i = 0; i < strlen(s); ++i) {
int j = s[i] - 'a';
if (!nxt[p][j]) {
nxt[p][j] = ++... | ALGO | 0.999825 | 3.890751 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2024-11-15T14:58: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": "ae31d7d6e1... |
2db9dd31-d3d6-49fd-a3f4-ebfc1626fef6 | YinyuDream/Algorithm-Competition-Materials | 2024国庆/2/good.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 10;
mt19937 eng(time(0));
int n, m, p[MAXN], s[MAXN]; pair<int, int> w[MAXN];
char a[MAXN], b[MAXN]; int pos[MAXN], tp;
int main() {
freopen("data.in", "r", stdin);
freopen("good.out", "w", stdout);
scanf("%d%d",... | ALGO | 0.999998 | 3.319409 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-08-27T13:30: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": "be6dcf60dc40... |
e8e5e49d-d495-4b63-a371-b88b05889747 | todorkrastev/software-university | C++/M02_Fundamentals/L03_Arrays/Demo/07.C++11-Array.cpp | #include <iostream>
#include <array>
const int arraySize = 3;
void printByCopy(std::array<int, arraySize> numbers) {
for (int number : numbers) {
std::cout << number << ' ';
}
}
void printByReference(const std::array<int, arraySize>& numbers) {
for (int number : numbers) {
std::cout << number << ' ';
... | TOOL | 0.91445 | 5.199273 | {
"github_metadata": {
"branch": "main",
"commit_count": 5585,
"repo_created_at": "2021-04-06T12:43:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8c65f02e... |
bee7b586-1593-4d02-8fde-2bb4f61ebfd0 | jizhang-cmu/autonomy_stack_mecanum_wheel_platform | src/utilities/domain_bridge/include/domain_bridge/process_cmd_line_arguments.hpp | // Copyright 2021, Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by appl... | TOOL | 0.963094 | 7.640028 | {
"github_metadata": {
"branch": "jazzy",
"commit_count": 86,
"repo_created_at": "2024-08-16T13:03:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 135,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "68b280ec... |
220329d5-df52-40a3-aad3-6cbc971ea9fd | king-yyf/cpcode | google/msoa/4_tree_count.cpp | #include<bits/stdc++.h>
using namespace std;
template<typename T>
struct FenwickTree2D{
vector<vector<T>> tr;
int n, m;
FenwickTree2D(int N, int M){
n = N, m = M;
tr.assiingn(n + 1, vector<T>(m + 1 , 0));
}
void add(int x, int y, int val){
for(int i = x;i <= n; i += i & -i)... | ALGO | 0.999927 | 4.258901 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-11-26T03:35: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": "8db62243f1d0... |
e091e54f-ed96-44cb-b1c9-3f00ff51a835 | noodlez102/EC330 | LinkedList.h | //
// LinkedList.h
// Linked_List
//
// Copyright © <NAME>. All rights reserved.
//
// This is an implementation of an ordered Linked List class, which is made up of Nodes.
// All classes are templated, such that their types may be provided at creation.
// Nodes contain data (which doubles as key), and pointers t... | ALGO | 0.999569 | 5.084706 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-03T21:00: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": "6b6c8f7de695... |
fac6d3ce-8ae9-4834-a579-2a814f8ae958 | NafiHasan/HabiJabi | C++/Google Contests/Google 2022/h_index.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast_io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
//Don't forget to clear the global variables or just init
struct info {
int prop, sum, best;
} tree[100005 * 3];
// void init(int node, int lo, int hi){
// if(lo == hi) {
// tree[node... | ALGO | 0.99929 | 4.50568 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-03-17T09:29:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4acc9450696... |
dcff40bb-c4bb-4b25-a251-906eba3bb1e6 | theankushrai/Competitive-programming-Cpp | SDE Sheet 2024/Arrays/next_permutation.cpp |
SEARCH FOR DECREASING PATTERN -> SEARCH FOR IMMEDIATELY BIGGER ELEMENT THEN ACTIVE ELEMENT
SWAP AND REVERSE THE ARRAY.
// ----------------------------------------------------------------------------------------
// <!-- A permutation of an array of integers is an arrangement of its members into a sequence or lin... | ALGO | 0.999996 | 5.605762 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2021-02-08T09:13: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": "58f79abe3... |
96bce4db-7995-4e36-b82a-fde82f2685d8 | niguang431/graduate | LeetCode/LinkedList/206. Reverse Linked List.cpp | // https://leetcode.cn/problems/reverse-linked-list/
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
publ... | ALGO | 0.999713 | 5.823864 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-06-09T06:38: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": "322a0e50f38... |
4b428d60-f859-4dc1-9ef4-fae267157a5c | Kalen-Ssl/shilu | C3_11.cpp | //最小公倍数
/*
#include <stdio.h>
int max(int a,int b,int c){
if(a>b&&a>c){
return a;
}else if(b>c&&b>a){
return b;
}else{
return c;
}
}
int main(){
int a,b,c,i,j;
scanf("%d%d%d",&a,&b,&c);
i=max(a,b,c);
int d=1;
while(1){
j=d*i;
if((j%a==0)&&(j%b==0)&&(j%c==0)){
break;
}
d++;
}
printf("%d\n"... | ALGO | 0.999699 | 3.355975 | {
"github_metadata": {
"branch": "master",
"commit_count": 297,
"repo_created_at": "2019-11-04T15:51: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": "b29e2a10... |
f9c42c13-baaa-4b70-aed9-94279e3040cc | wes1498/Interview-Questions | Medium/maximum_number_of_occurrences_in_substring.cpp | #include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
//Fast IO
static auto magic = []() {std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); return false; }();
using namespace std;
class Solution {
private:
unordered_map<int,int> char_count;
map<string,int... | ALGO | 0.999666 | 5.592013 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2019-03-21T22:48: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": "cf14edc31... |
09c9f361-ea2e-4a1b-a02d-3dba5ea193b4 | ksaveljev/UVa-online-judge | 10978.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main(void)
{
int n, sz;
string input;
bool visited[52];
pair<char,char> tmp;
vector< pair<char,char> > v(52);
while (cin >> n) {
if (!n) {
break;
}
int pos = -1;
fill(visited, visit... | ALGO | 0.999617 | 3.282093 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2011-04-04T11:43:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 106,
"forks": 69,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "f4389... |
c84bf70d-c0ba-46ff-abeb-911686571fbd | wcysai/Calabash | 2018牛客网暑期ACM多校训练营(第二场)/J.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6+100;
int n,m,T;
typedef pair<int,int> pii;
struct BIT{
vector<vector<int> > val;
void init(){
val.resize(n+1);
for (int i=0;i<=n;i++){
val[i].resize(m+1);
}
for (int i=0;i<=n;i++){
for (int ... | ALGO | 0.999492 | 3.899273 | {
"github_metadata": {
"branch": "master",
"commit_count": 601,
"repo_created_at": "2018-09-13T09:53:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 63,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d9bf8... |
fdb7ac72-966b-4c57-beab-a514ae34cab9 | kercre123/victor | lib/util/source/anki/util/random/randomIndexSampler.cpp | /**
* File: randomIndexSampler.cpp
*
* Author: ross
* Created: 2018 Apr 3
*
* Description: Utility for sampling from the indices [0,N) without replacement.
* The results are NOT CONSECUTIVE (check out Vitter JS (1987) for consecutive).
* There are 3 related algorithms at work here, bas... | ALGO | 0.98822 | 7.139391 | {
"github_metadata": {
"branch": "snowboy",
"commit_count": 38827,
"repo_created_at": "2024-09-10T20:49:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 40,
"forks": 35,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1f0... |
a6b479f8-92f9-43d1-8ded-1165e96a0686 | godotengine/godot | core/math/bvh_split.inc | void _split_inform_references(uint32_t p_node_id) {
TNode &node = _nodes[p_node_id];
TLeaf &leaf = _node_get_leaf(node);
for (int n = 0; n < leaf.num_items; n++) {
uint32_t ref_id = leaf.get_item_ref_id(n);
ItemRef &ref = _refs[ref_id];
ref.tnode_id = p_node_id;
ref.item_id = n;
}
}
void _split_leaf_sort... | ALGO | 0.993807 | 6.299287 | {
"github_metadata": {
"branch": "master",
"commit_count": 76043,
"repo_created_at": "2014-01-04T16:05:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98972,
"forks": 22820,
"issues": 5000,
"pull_requests": 3866
},
"file_meta": {
"content... |
1b9dd6c6-fdb7-473a-9330-9b47e992e1e9 | Luckyblock233/OI-code | Luogu/P4231 三步必杀.cpp | //知识点:差分
/*
By:Luckyblock
题目要求:
给定一长度为n的 初始全0的数列, 给定m次修改操作
对于每次修改操作, 给定四个参数:l,r,s,e
表示 修改范围为[l,r], 对 l+=s, 对 r+=e
每次修改的 值为一个等差数列, 首项为s,尾项为e,长度为(r-l+1)
求数列中 所有修改完成后
所有元素的 异或和 与 最大值
n <= 1e7, m <= 3e5 ,时间限制 500ms
分析题意:
- 这么鬼畜的 数据范围与时间限制,
无外部优化情况下, 只可使用 O(n) 算法
则对于单次 修改, 必须是O(1) 的
- 如何 进行区间加一 等差数列操作?
由于 等差... | ALGO | 0.999889 | 4.91127 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-10-16T07: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": "47eebdcc4a... |
14ce3a0f-96b5-4074-bc3b-c4242948bca6 | jeffreyrainy/advent2020 | day17a.cpp | #include <iostream>
#include "data.h"
std::map<char, std::string> getReplacements()
{
std::map<char, std::string> ret{};
return ret;
}
void prop(std::vector<std::vector<std::string>> from, std::vector<std::vector<std::string>>& to)
{
for(auto z = 0; z < from.size(); z++)
for(auto y = 0; y < from[0].si... | ALGO | 0.999669 | 4.405963 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-12-28T17:25: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": "f0b90b7194... |
96444780-7f8a-410e-ab49-fcda7380cb90 | tepidry/PastWork | c223s11 (ADT Data Structures)/PROG6/cavltree.h | //@author <NAME> (draper)
//@date March 22 2011
//@file cavltree.h
//@Specification for ADT cavltree (Adelson, Velski, & Landis)
//@ data object: a derived class of cbintree and cbstree that is a binary tree that
//@ is either empty or in the form:
// mroot such that {... | ALGO | 0.990345 | 5.575854 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2013-06-13T22:10: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": "a3bf9858b6... |
dc60cf27-f70f-43a9-bbb3-709168e9a61b | Yukariko/acm | problem/1017/test.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 987654321;
class NetworkFlow
{
public:
struct Edge
{
int target, capacity, flow;
Edge *reverse;
int residualCapacity() const { return capacity - flow; }
void push(int amt)
{
flow += amt;
reverse->flow -= amt;
}
};
NetworkFlow(int... | ALGO | 0.999912 | 3.57486 | {
"github_metadata": {
"branch": "master",
"commit_count": 1588,
"repo_created_at": "2014-07-06T11:37:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "102ed9... |
f704ea44-bb1a-439a-abb7-a1b2ba8d5884 | akhikolla/testpackages | fuzzedpackages/BoltzMM/src/RcppExports.cpp | // Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 1<PASSWORD>
#include <RcppArmadillo.h>
#include <Rcpp.h>
using namespace Rcpp;
// pfvbm
double pfvbm(arma::vec xval, arma::vec bvec, arma::mat Mmat);
RcppExport SEXP _BoltzMM_pfvbm(SEXP xvalSEXP, SEXP bvecSEXP, SEXP MmatSEXP) ... | ALGO | 0.990776 | 5.378924 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6c32a3409... |
c543b41a-67bc-4d34-bf5e-061dbbf1843f | SlimNFR/MvsTcode | Code/CubicSpline.cpp | //---This is the CubicSpline.cpp file. It defines the CubicSpline.h functions.
//---Standard libraries
#include<iostream>
#include<vector>
#include<fstream>
#include<cmath>
#include<algorithm>
//---User-defined libraries
#include"CubicSpline.h"
//---Namespace CubicSpline
namespace CubicSpline{
//---Variables... | ALGO | 0.999546 | 5.41745 | {
"github_metadata": {
"branch": "LoopTemperatures",
"commit_count": 13,
"repo_created_at": "2021-07-16T06:23: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": ... |
964a3486-cbcf-4580-aa39-d7a4abca6652 | emacser0/Computer-Graphics-Lecture | Warmup/Warmingup6/Warmingup6.cpp | #include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <random>
int map[50][50];
void reset(int map[][50])
{
for (int i = 0; i < 50; ++i)
{
for (int j = 0; j < 50; ++j)
{
map[i][j] = 0;
}
}
}
int get_random_action()
{
static std::random_device device;
static std::mt19937 ... | TOOL | 0.905124 | 4.120198 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2021-09-13T14:00: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": "05dd037e5... |
dcbb4978-eb46-402f-98ee-95591542dd9d | xmc-aalto/dismecpp | src/solver/null.cpp | // Copyright (c) 2021, Aalto University, developed by <NAME>
// All rights reserved.
//
// SPDX-License-Identifier: MIT
#include "null.h"
#include "stats/collection.h"
using namespace dismec::solvers;
namespace {
/*
stats::stat_id_t STAT_OBJECTIVE_VALUE{1};
stats::stat_id_t STAT_GRADIENT_NORM{2};
st... | ALGO | 0.910176 | 6.048149 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2022-07-20T11:31:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1558b9a0b8... |
b791677f-7bda-471a-b371-7b3317c2fb36 | lavajuno/advent_2023 | dec08/2/main.cpp | /*
* December 8, 2023 - Puzzle 2
* <NAME>
*/
#include <iostream>
#include <string>
#include <iomanip>
#include <numeric>
#include <vector>
#include <map>
#include <filereader.hpp>
struct Node {
std::string left;
std::string right;
};
std::pair<std::string, Node> readNode(std::string& line) {
std::stri... | ALGO | 0.999807 | 5.163969 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-12-01T13:48: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": "66b08cd26a0... |
9503f8b5-1c9f-44ed-a4d9-fc84a50e78b6 | jungyuha/codingtest | c++/c5430.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int tot;
cin >> tot;
vector<string> result;
while(tot){
string func_str,inp;
vector<int> mp;
int num=0,mid=0;
cin >> func_str >> num >> inp;
for(char c : inp){
if(c=='[' || c==']') {continue;}
else if((int)(c-'0')>=0 && (int)(... | ALGO | 0.999069 | 4.291666 | {
"github_metadata": {
"branch": "main",
"commit_count": 580,
"repo_created_at": "2022-06-14T14:00: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": "b17a326148... |
38ec7171-77fc-4684-b536-698b3f3f0eab | ljb1905/For-CodingTest | basic/11653(2).cpp | #include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
bool notPrime[10000001];
vector <int> v;
int main()
{
for (int i = 2; i * i <= 10000001; i++) {
for (int j = i + i; j <= 10000001; j += i) {
notPrime[j] = true;
}
}
int ans = 0;
notPrime[1] = tru... | ALGO | 0.999986 | 4.10805 | {
"github_metadata": {
"branch": "master",
"commit_count": 361,
"repo_created_at": "2021-01-04T13:56: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": "ec5c4bed... |
b4d6178e-4d07-44c4-98d2-5cc246c8ab92 | apollopower/interview-prep | cpp/dynamic_programming/bottom_up.cpp | // For a bottom-up approach, we do not have to make recursive calls.
// The idea is that instead of making recursive calls until we hit a
// base case, we can "start from the beginning" of the problem instead
// of the reverse.
// For example, here is a recursive solution to multiplying all
// numbers from 1 to n:
i... | ALGO | 0.999978 | 6.965537 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2018-08-27T02:13:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "056923e8... |
df3b476b-dd0e-4c90-842f-286cb64bcdc3 | brpapa/algorithms | solutions/uva/166.cpp | /*
dynamic programming > coin change
difficulty: medium
date: 15/May/2020
problem: coin change with limited amount of coins + greedy coin change with unlimited amount of coins; I don't know why, but it works without memo
by: @brpapa
*/
#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30... | ALGO | 0.999415 | 4.122646 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2019-01-25T20:40:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 35,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bdf9f... |
49bdd3fd-8a47-4800-8782-bcda0b6cf93e | FelippeVelosoMarinho/ExerciciosC- | banco.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class Agencia
{
private:
string _nome;
string _numero;
public:
Agencia(string nome, string numero) {
_nome = nome;
_numero = numero;
}
string get_nome() {
return _nome;
}
string get_numero() {
return _... | TOOL | 0.908803 | 4.583912 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-04-05T02:54: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": "796183884dcc... |
97500661-4e10-4b20-ac56-0e1afaf79f8d | Rahman2782/Randomizer | randomizer.cpp | #include <iostream>
#include <cstdlib> //has rand function
#include <vector>
#include <string>
#include <cctype>
#include "randomizer.h"
using std::cout;
using std::endl;
void randomize(int min, int max, int rolls) { //int randomizer
int random_num;
int rollResults[rolls];
for(int i=0; i < rolls; i++)
... | TOOL | 0.924779 | 4.286192 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-06T21:01: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": "d5bfbbce795c... |
a72144f0-410c-4443-aa14-b85c8582b985 | side-projects-all/works | Leetcodes/backtracking/q_351.cpp | /*
Android devices have a special lock screen with a 3 x 3 grid of dots. Users can set an "unlock pattern" by connecting the dots in a specific sequence, forming a series of joined line segments where each segment's endpoints are two consecutive dots in the sequence. A sequence of k dots is a valid unlock pattern if bo... | ALGO | 0.999943 | 6.175677 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2025-01-03T05:24: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": "203e600031d... |
cb3b78a4-584d-4f6d-be03-58702c1706c4 | kireb1298/RepositorioLocal | C++/EstructuraSecuencial/8-Area del Triangulo(angulo).cpp | //Calcule el area de un triangulo cuando se conocen dos lados y el angulo que forman.
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float b, c, angulo, A; // b = lado1, c = lado2, A = area
const float PI = 3.14159265;
cout << "Ingrese un lado del triangulo: ";
cin >> b;
cout << "Ingrese ot... | ALGO | 0.995909 | 4.903193 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2019-10-07T20:06:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "481b08440... |
dcadb739-3ec5-4fbe-9fcd-fafc9903a7b3 | tynnic/LeetCodeAttemptsInCPP | LeetCodeAnswers/Solution61.h | #pragma once
#ifndef SOLUTION61_H
#define SOLUTION61_H
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
//-------------------------------------------------------this code requires optimizing !!!!!!!!!!!!! --------------------------------------------
class Solution... | ALGO | 0.999867 | 5.57319 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2019-03-10T02:51: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": "4b7531008... |
0a76152c-5a13-43a4-8465-48a329b8d539 | mel-1804/Algorithms-Data-Struct | 5.exercise.cpp | // Ejercicio 1: Ordenación Personalizada
// Título: Ordenar por frecuencia de aparición
// Enunciado:
// Dado un arreglo de enteros, ordénalo de forma que los elementos con mayor frecuencia aparezcan primero.
// Si dos elementos tienen la misma frecuencia, el que apareció primero en el array original debe ir antes.
/... | ALGO | 0.999987 | 5.75969 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2025-03-28T13:57:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9355e3b5c... |
e1c8306e-7ea7-4991-95ed-95a702395dad | vrMithun/first_git | c++/BucketSort.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void InsertionSort(vector<float>& bucket) {
for (int i = 1; i < bucket.size(); i++) {
float key = bucket[i];
int j = i - 1;
while (j >= 0 && bucket[j] > key) {
bucket[j + 1] = bucket[j];
j--;... | ALGO | 0.999963 | 5.136802 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2023-12-02T14:14:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cc246d86d2... |
42d476ad-b3ac-4b0b-81f8-d0769ea3606f | thalyson004/solutions | codeforces/1800_D_nastyaIsBuyingLunch.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ii pair<int,int>
#define iii pair<ii, int>
#define iiii pair<ii, ii>
#define viiii vector< iiii >
#define viii vector< iii >
#define vii vector< ii >
#define vi vector< int >
//#define int long long
#define sz(x) ((int)x.size())
#d... | ALGO | 0.999891 | 3.335678 | {
"github_metadata": {
"branch": "master",
"commit_count": 535,
"repo_created_at": "2018-04-21T02:21:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "41deb3d4... |
fd171efb-537f-4e75-b31d-d2ee5fe3dfd9 | niyaznigmatullin/nncontests | utils/IdeaProject/archive/unsorted/2014.11/2014.11.05 - SPb Team 2014/h.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
int const N = 123456;
string a[N], b[N], c[N], z[N];
int main() {
freopen("names.in", "r", stdin);
freopen("names.out", "w", stdout);
int n;
cin >> n;
map<string, int> names;
for (int i = 0; i... | ALGO | 0.999937 | 3.989229 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2015-06-05T12:48:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a743d2b3... |
ffa7ed32-7ac9-4410-b367-a80b4269e8ca | DionysiosB/CodeForces | 1100-1199/1102B-ArrayKColoring.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
struct elem{long r,x,c;};
bool compA(elem a, elem b){return a.r < b.r;}
bool compB(elem a, elem b){return a.x < b.x;}
int main(){
long n, k; scanf("%ld %ld", &n, &k);
std::vector<elem> a(n);
for(long p = 0; p < n; p++){
a[p].r = p;
... | ALGO | 0.999997 | 3.46438 | {
"github_metadata": {
"branch": "master",
"commit_count": 4487,
"repo_created_at": "2013-06-27T18:15:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 690,
"forks": 163,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2cd... |
33f17f3c-b774-4742-b7d0-01dac7fba96a | CrashedBboy/leetcode | algorithms/leetcode/easy/234. Palindrome Linked List/PalindromeLinkedList.cpp |
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
// [idea]
// Phase 1: Reverse the first half while finding the middle.
// Phase 2: Compare th... | ALGO | 0.999921 | 6.004628 | {
"github_metadata": {
"branch": "master",
"commit_count": 349,
"repo_created_at": "2020-03-08T07:27:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8547cfe... |
ce25f931-ebb7-414d-be21-4550ed74f5b3 | alexgunkel/eulerPlayGround | lib/include/modulo.hpp | #ifndef EULERPLAYGROUND_MODULO_HPP
#define EULERPLAYGROUND_MODULO_HPP
#include <cassert>
#include <cinttypes>
#include <cmath>
#include <memory>
#include <vector>
uint64_t findSmallestMultiple(uint64_t base, uint64_t modulo);
uint64_t findSmallestMultipleFast(uint64_t base, uint64_t modulo);
struct Factors {
uin... | ALGO | 0.977631 | 7.163341 | {
"github_metadata": {
"branch": "mainline",
"commit_count": 53,
"repo_created_at": "2020-09-05T14:57: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": "0807f05... |
48e65f19-551d-4007-8d7b-34851ad9ace3 | WantGoodex/Problem-Solving | baekjoon/noj.am1000-9999/baekjoon_3197.cpp | #include <iostream>
#include <queue>
using namespace std;
int r, c;
int dx[4]={1,-1,0,0},dy[4]={0,0,1,-1};
int visited[1500][1500];
char arr[1500][1500];
pair<int,int> pos;
queue<pair<int,int>> q, bq, wq;
int bfs(){
int days = 0; // 얼음이 다 녹을 때까지 녹는 시간
while(1){ // 백조가 만날때 까지 계속 반복됌.
queue<pair<int,int>> nxbq, nxw... | ALGO | 0.999153 | 3.470758 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-04-03T07:06: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": "9df0a1e8d6... |
1c4c8a73-859b-47c4-a1e1-9cddabcd5a2e | AlkaDas991/DSA | double_circular_linked_list.cpp | #include<iostream>
using namespace std;
typedef struct node{
struct node *prev;
int data;
struct node* next;
}Node;
Node* head,*curr,*ptr;
void create(){
int i=0;
char ch='y';
do{
curr=new Node;
if(curr==NULL){
cout<<"Out of Memory\n";
return;
}
... | ALGO | 0.998922 | 3.815474 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-01-19T05: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": "fecd50c8e122... |
4de68e6b-90ec-49d2-8855-165b75faf0b6 | OpenFOAM/OpenFOAM-2.1.x | src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------... | TOOL | 0.951523 | 6.922368 | {
"github_metadata": {
"branch": "master",
"commit_count": 627,
"repo_created_at": "2011-12-19T14:30:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 70,
"forks": 122,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e324... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.