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 |
|---|---|---|---|---|---|---|---|
2bb2d85a-a37c-4dfd-bc4f-775d15334f48 | Crush12999/Algorithm-log | 2022_Spring Camp/src/com/ataraxia/每日一题/div2/day80_最喜欢数学了.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5 + 50;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t;
cin >> t;
while (t--) {
int x, y;
cin >> x >> y;
if (x == y) {
cout << 0 << "\n"... | ALGO | 0.999939 | 4.055375 | {
"github_metadata": {
"branch": "main",
"commit_count": 232,
"repo_created_at": "2021-11-28T15:32: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": "a4ee4cf218... |
b5195c17-28b0-484f-afc7-0abe161ba72d | bryanSME/hipparchus-_cpp | ode/nonstiff/DormandPrince54FieldIntegrator.h | #pragma once
/*
* 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 "Licens... | ALGO | 0.997731 | 6.460423 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-08-15T23:45:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf27485bccc... |
43a2cf67-5f68-49b5-b887-4c0c9768237a | Prateek-1920/DSA | LeetCode/2257_Count_Unguarded_Cells_in_the_Grid.cpp | class Solution {
public:
int countUnguarded(int m, int n, vector<vector<int>>& guards, vector<vector<int>>& walls) {
vector<vector<int>> grid(m,vector<int>(n,0)); //0=unguarded 1=marked 2=guard 3=wall
for(int i=0;i<guards.size();i++){
int x = guards[i][0];
int y = guards[i][1... | ALGO | 0.999895 | 5.586432 | {
"github_metadata": {
"branch": "master",
"commit_count": 395,
"repo_created_at": "2025-05-20T10:56:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d2f2fc9... |
695f3dc4-381e-4ae4-90fc-51b91007da60 | iampkuhz/OnlineJudge_cpp | leetcode/cpp/281-zigzag-iterator.cpp | /*
*
*Given two 1d vectors, implement an iterator to return their elements alternately.
For example, given two 1d vectors:
v1 = [1, 2]
v2 = [3, 4, 5, 6]
By calling next repeatedly until hasNext returns false, the order of elements returned by next should be: [1, 3, 2, 4, 5, 6].
Follow up: What if you are given k 1... | ALGO | 0.999915 | 6.050904 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2014-10-07T13:36: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": "0f68f830f... |
4eaa9f1c-c4a1-4444-8f3a-501e0edf6a4a | PJK/comm-avoiding-cuts-cc | lib/galois/apps/surveypropagation/SurveyPropagation.cpp | /** Survey propagation -*- C++ -*-
* @file
* @section License
*
* Galois, a framework to exploit amorphous data-parallelism in irregular
* programs.
*
* Copyright (C) 2011, The University of Texas at Austin. All rights reserved.
* UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING THIS
* SOFTWARE... | ALGO | 0.999874 | 5.323543 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-12-12T23:43:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8941872f0... |
5bb2cdaa-f3c5-4802-8a60-d0d4218616b6 | erwincoumans/tiny-differentiable-simulator | third_party/rbdl/include/rbdl/rbdl_mathutils.h | /*
* RBDL - Rigid Body Dynamics Library
* Copyright (c) 2011-2018 <NAME> <<EMAIL>>
*
* Licensed under the zlib license. See LICENSE for more details.
*/
#ifndef RBDL_MATHUTILS_H
#define RBDL_MATHUTILS_H
#include <assert.h>
#include <cmath>
#include "rbdl/rbdl_math.h"
namespace RigidBodyDynamics {
struct Model;... | TOOL | 0.990458 | 7.119666 | {
"github_metadata": {
"branch": "master",
"commit_count": 718,
"repo_created_at": "2020-05-14T18:04:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1305,
"forks": 134,
"issues": 8,
"pull_requests": 5
},
"file_meta": {
"content_id": "5cd... |
fcdf0c03-500c-47c3-8e3b-486aecb6af83 | sxweetlollipop2912/MaCode | .LHP/.Lop11/.HSG/.T.Minh/Week 4/DBRAC1/DBRAC1/DBRAC1.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#define maxN 72
#define maxK 37
#define dp 0
#define su 1
typedef int maxn;
typedef long long maxa;
maxn n, KK;
maxa f[maxN][maxK], sum[maxN][maxK], curK[maxN];
maxa DP(const maxn L, const maxn R, const maxn K, const bool opt) {
if (L > R) return opt == d... | ALGO | 0.99936 | 3.504809 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2020-09-20T11:15:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "478d5eb98... |
2b841166-17a7-4e11-8cac-23f6cae22aa3 | XSiling/lajolla_public | src/materials/thinfilm1.inl | #include "../microfacet.h"
// reference source: https://github.com/knightcrawler25/GLSL-PathTracer/blob/master/src/shaders/common/disney.glsl
// line 90
Spectrum eval_op::operator()(const ThinFilm& bsdf) const {
if (dot(vertex.geometric_normal, dir_in) < 0 ||
dot(vertex.geometric_normal, dir_out) < 0) {
... | ALGO | 0.977555 | 6.162383 | {
"github_metadata": {
"branch": "main",
"commit_count": 371,
"repo_created_at": "2024-02-27T23:36: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": "851e46aa75... |
f41d20a8-dfdd-4eaf-9ffc-c888e7c6e2e7 | rupav/cp | competitive_coding/contests/AtCoder/abc165/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define watch(x) cout << (#x) << " is " << (x) << endl
#define fr(i,n) for(int i=0; i<n; i++)
#define rep(i, st, en) for(int i=st; i<=en; i++)
#define repn(i, st, en) for(int i=st; i>=en; i--)
#define sq(a) (a*a)
typedef long long ll;
#define int ll
typedef pair<int, int> p... | ALGO | 0.999869 | 4.443252 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-01-30T05:56: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": "2b47aa05a3a0... |
298a5123-dd8b-4fbe-965b-a58d09532ec3 | LimeMun/BaekJoon | priorityQueue/maxHeap.cpp | #include <iostream>
#include <vector>
using namespace std;
int arr [100000];
int heapIndex = 0;
void swap(int * a, int * b){
int temp;
temp = * a;
* a = * b;
* b = temp;
}
void heap_Push(int data){
int index = ++heapIndex;
arr[index] = data;
while((index != 1) && (data > arr[index / 2])){... | ALGO | 0.99998 | 4.424324 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2021-07-09T09:45: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": "f6423454f... |
72d2b829-882a-4fff-9179-dda31c0164dc | mdj982/competition-library | class_SuccinctBitVector.cpp | #include "auto_util_header.hpp"
// not strictly a succinct data structure
class SuccinctBitVector {
private:
int n, m;
vector<int> L0;
vector<int> L1;
vector<bitset<64>> B; // divided blocks
public:
// s should be composed of '0' or '1'
SuccinctBitVector(const string &s) {
this->n = int(s.length());
this->m ... | ALGO | 0.99946 | 4.767277 | {
"github_metadata": {
"branch": "master",
"commit_count": 158,
"repo_created_at": "2017-09-27T09:46:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d468fd4... |
f14fbc14-f456-495e-9b4d-f4949e1ae9e8 | facebook/mysql-5.6 | router/src/metadata_cache/src/plugin_config.cc | /*
Copyright (c) 2016, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
... | CONFIG | 0.904439 | 7.195034 | {
"github_metadata": {
"branch": "fb-mysql-8.0.32",
"commit_count": 178894,
"repo_created_at": "2013-04-15T17:54:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2557,
"forks": 715,
"issues": 198,
"pull_requests": 40
},
"file_meta": {
"con... |
e7184191-4635-4bcb-beb7-f3bc32444ef3 | face4/yukicoder | Level2/0164.cpp | #include <iostream>
#include <climits>
using namespace std;
typedef long long ll;
ll getnum(int digit, string s)
{
ll res = 0;
ll base = 1;
for (int i = s.size() - 1; i >= 0; i--)
{
char x = s[i];
if (x <= '9')
res += ll(x - '0') * base;
else
res += ll(x ... | ALGO | 0.999475 | 4.05787 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2018-04-19T11:55: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": "9d27a15a... |
2d91bfca-08dc-4997-b1d7-9f4446dda073 | cugbbaiyun/undergraduateCourses | OpenGL/baiyun/Cohen-sutherland.cpp | #include <GL/gl.h>
#include <GL/glut.h>
#include <windows.h>
// #include <iostream>
class wcPt2D
{
public:
GLfloat x, y;
wcPt2D() { x = y = 0.0; }
wcPt2D(float a, float b)
{
x = a;
y = b;
}
void setCoords(GLfloat xCoord, GLfloat yCoord)
{
x = xCoord;
y = yC... | ALGO | 0.9896 | 5.353353 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-03-21T07:18:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c58a3cb73... |
ed2c1fdb-bc44-40b8-9f7a-871f151e7ac8 | sashajones/Data-Structures | Lab3SP.cp | /*
* Lab3SP.cpp
*
* Created on: Mar 1, 2018
* Due Date: Sunday, March 4th, 2018
* Author: sashajones
* TA: Name: <NAME>
* Email address: <EMAIL>
* Office Hours: Thursday 4:30-6:30
*/
//
// TA: Name: <NAME>
// Email address: <EMAIL>
// Office Hours: Thursday 4:30-6:30
#include <iostream>
#inclu... | ALGO | 0.954636 | 3.409024 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-12-09T21:54: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": "426d2861ec... |
068d1ceb-d1ff-44ca-9945-c8453da75a26 | hchen799/ForgeBench | conv/adaptive_avgpool_template.cpp | void adaptive_avgpool(
data_t input[{C}][{H_IN}][{W_IN}],
data_t output[{C}][{H_OUT}][{W_OUT}]
)
{{
for (int c = 0; c < {C}; c++) {{
for (int oh = 0; oh < {H_OUT}; oh++) {{
int h_start = (int)floor(( (float)oh * {H_IN} ) / {H_OUT});
int h_end = (int)ceil(( (float)(oh + 1) *... | ALGO | 0.996134 | 5.285738 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2025-03-07T03:21:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "63588e6d76... |
b3e7cfb1-499f-4225-9e0a-f8f42b4ed1bf | TheBuzzSaw/MegaMatrix | main.cpp | #include "Matrix.hpp"
#include <iostream>
#include <fstream>
#include <random>
#include <chrono>
#include <thread>
#include <sstream>
using namespace std;
using namespace Kelly;
#define LDB cerr << "yarr -- " << __LINE__ << '\n'
void TestBasicMultiplication()
{
auto a = Matrix<int>::RowMajor(2, 3);
auto b = M... | TEST | 0.985601 | 5.297972 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-01-30T00:39: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": "07e01e85de... |
5db2b408-ba4f-4ef8-89d0-6079c9a50048 | cs108/projects | cpp/leetcode/Medium/notSolved_StringToInteger.cpp | /*
Message from leetcode:
'''
Runtime Error Message:
Line 61: Char 7: runtime error: signed integer overflow: 2147483640 + 8 cannot be represented in type 'int' (solution.c)
Last executed input:
"-2147483648"
'''
*/
#include<stdio.h>
#include<iostream>
int myAtoi(char * str) {
void prepare(int* prepared, char bi... | ALGO | 0.998984 | 3.925782 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2019-04-02T03:31:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9894d4661... |
784b99ce-d765-4862-b400-e6d95e892c12 | JustinButler700/SchedulingAlgorithms | sjf.cpp | //=========================================================
//Assignment 3
//Your name: <NAME> & <NAME>
//Complier: G++
//File type: Client program for implementing a sjf algorithm
//==========================================================
#include <algorithm>
#include <iostream>
#include <fstream>
#include <string>... | ALGO | 0.996799 | 4.336488 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-08T22:16: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": "3f44d8643304... |
61c83bd8-963b-4559-bbc7-b3aa9191434e | amanmehara/programming | C++/sort/Sorting (Top Down Merge Sort)/merge_sort.cpp | /*
* Copyright 2018 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... | ALGO | 0.999791 | 5.914951 | {
"github_metadata": {
"branch": "master",
"commit_count": 404,
"repo_created_at": "2017-02-25T07:48:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 94,
"issues": 10,
"pull_requests": 34
},
"file_meta": {
"content_id": "5241... |
1d9e2c11-c5f9-42cc-b6b8-73639c23bd3b | TanishSingla/Dsa-Codes | Linked List/deletion.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
// constructor :-
Node(int d)
{
this->data = d;
this->next = NULL;
}
// Destructor :-if the object is created by using new or the constructor uses new to allocate
// memory which re... | ALGO | 0.999506 | 3.896255 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-07-28T07:39: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": "3ad27b3486... |
6299a10b-fa13-4c19-ab1d-15a48afe896a | ririya/HairSwapping | HairSwapping/ColorEstimate.cpp | #include "ColorEstimate.h"
// OpenCV
#include <opencv2//core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include "HairExtraction.h"
#include "faceRecognition.h"
#include "skinSynthesis.h"
//void plotHistogram(Mat src)
//{
// vector<Mat> planes;
// split(src, planes);
//
// /// Establish the n... | ALGO | 0.979411 | 4.343269 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-02-21T04:04:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45768ca9f... |
abe2fd35-993c-4a6d-a095-3cca2064f1de | cegm/PM_Practica_1 | PM_01/Practica2/Prac2_r/Prac2_r.ino | // r) SEMAFORO con Timers
// V_1 - digital pin 53
// A_1 - digital pin 52
// R_1 - digital pin 51
// V_2 - digital pin 10
// A_2 - digital pin 11
// R_2 - digital pin 12
void setup()
{
DDRB = DDRB | B11111111; // Data Direction Register B: Inputs 0-6, Output 7
cli();
TCCR1B = 0;
TCCR1A = 0; //Output compa... | TOOL | 0.966188 | 4.782574 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-08-30T15:42:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34fa87c38... |
4a256b9c-bd8c-45d5-a2af-59865d6e6164 | micmacIGN/micmac | src/uti_image/Sift/Gauss34.h | #ifndef __GAUSS34__
#define __GAUSS34__
// this is from <NAME>'s siftpp (now VLFeat)
inline bool siftpp__gauss33_invert_b( Real_ *i_m, Real_ *i_b )
{
#define at(i,j) (i_m[(i)+(j)*4])
// Gauss elimination
for(int j = 0 ; j < 3 ; ++j)
{
// look for leading pivot
Real_ maxa = 0;
... | ALGO | 0.999287 | 4.695095 | {
"github_metadata": {
"branch": "master",
"commit_count": 10879,
"repo_created_at": "2016-11-24T22:09:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 163,
"issues": 83,
"pull_requests": 30
},
"file_meta": {
"content_id": "5... |
6e4bd605-b7db-4cdc-ae45-67877b78704e | girish-48/electronic-club-stuff | elec_club_task_1.cpp | #include<iostream>
#include<math.h>
using namespace std;
class Vec3
{
public:
float X,Y,Z;
Vec3()
{
X=0;
Y=0;
Z=0;
}
void normalize()
{
float S = X*X + Y*Y + Z*Z;
X = X/S;
Y = Y/S;
Z = Z/S;
return;
}
Vec3 add(Vec3 b)
{
Vec3 c;
c.X = X +... | ALGO | 0.996352 | 4.056622 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-06-07T19:43:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59976eb6426d... |
504f43f5-8dfa-4ed7-9b22-af415d3617b0 | xmk0987/Ohjelmointi2 | student/02/encryption/main.cpp | #include <iostream>
using namespace std;
int main()
{
std::string key;
std::string message;
std::cout << "Enter the encryption key: ";
std::cin >> key;
if ( key.length() != 26){
std::cout << "Error! The encryption key must contain 26 characters." << endl;
return EXIT_FAILURE;
... | TOOL | 0.998593 | 4.848834 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2023-01-05T18:37:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59571eb6eec... |
baca03e5-1d8f-437c-b72d-23d959258ba9 | pranav1698/Competitive-Programming | Datastructures/Trees/construct_string_binary_tree.cpp | // Construct srting from binary tree using preorder traversal with following pattern
// SlothyCoder16
// July 26, 2020
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNo... | ALGO | 0.999922 | 6.13916 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2020-05-18T19:23:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72e06495d... |
f7dba6e5-f5c2-44e1-8c98-a6c0efa154a9 | kiwibrowser/src.next | components/history/core/browser/visitsegment_database.cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/history/core/browser/visitsegment_database.h"
#include <math.h>
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#i... | TOOL | 0.907194 | 7.686657 | {
"github_metadata": {
"branch": "kiwi",
"commit_count": 701,
"repo_created_at": "2020-06-05T14:40:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3051,
"forks": 444,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "7278c... |
2da21e56-71c9-48c9-8a86-9073c50086c2 | amagalifv/CODE | VSCODE/Ejercicios_C++/2021_1erC_FRBA-UTN/VyM/VyM_17.cpp | #include <iostream>
using namespace std;
#define MAX_FILAS 29
#define MAX_COLUMNAS 24
void cargarMatriz(int matriz[MAX_FILAS][MAX_COLUMNAS], int filas, int columnas){
for (int i = 0; i < filas; i++){
for (int j = 0; j < columnas; j++){
cout<<"Ingrese un valor: ";
cin>> matriz[i][j]... | ALGO | 0.988384 | 4.216955 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-08-03T13:46:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a9249d9e0... |
bd07d6ff-bdd6-402d-9380-24ddb942ee83 | Sundae2608/QuantNetAdvancedCpp | son_pham Level 4 HW submission/son_pham Level 4 HW submission/HW2/HW2_Exercise2.cpp | /*
* Advanced C++ and Modern Design
* Level 4
* Author: <NAME>
* Homework 2, Exercise 2: Predicates for Ranges
*/
#include <algorithm>
#include <chrono>
#include <iostream>
#include <numeric>
#include <ranges> // Required for C++20 range algorithms
#include <vector>
#include <random>
namespace {
void part_a() {
... | TEST | 0.95603 | 6.687385 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-25T23:51:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd1022cff97c... |
bf4b96e9-4e3c-47c6-b555-28f85f7bcf40 | lraszkiewicz/jnp1-horror | smalltown.h | // <NAME>, <NAME>
#ifndef SMALLTOWN_H
#define SMALLTOWN_H
#include <algorithm>
#include <cassert>
#include <iostream>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include "monster.h"
namespace SmallTownH {
template <typename U, size_t N>
struct Fib {
constexpr Fib() ... | ALGO | 0.985574 | 6.423846 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2016-11-21T12:30: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": "f5eda7858... |
c40391ff-5c66-4685-9358-422dc7569f26 | Scurrra/leetcode | src/cpp/7.reverse-integer.cpp | #include <vector>
/*
* @lc app=leetcode id=7 lang=cpp
*
* [7] Reverse Integer
*
* Time complexity: O(log n)
* Space complexity: O(log n)
*/
// @lc code=start
class Solution
{
public:
std::vector<char> split(int n)
{
std::vector<char> digits;
while (n)
{
digits.push_b... | ALGO | 0.9994 | 5.933141 | {
"github_metadata": {
"branch": "master",
"commit_count": 233,
"repo_created_at": "2023-06-12T18:23: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": "a4c2162a... |
7c2766f8-ed32-4da5-bfb8-7f36223d029f | madddx/Leet-Code | 801-900/827. Making A Large Island.cpp | #pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,abm,bmi2")
static const auto io_sync_off = []() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
return nullptr;
}();
// class Solution {
// public:
// int largestIsland(std::vector<std::vector<int>> &grid) {
// int g... | ALGO | 0.999826 | 6.025746 | {
"github_metadata": {
"branch": "main",
"commit_count": 218,
"repo_created_at": "2025-01-01T15:10:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a97061b76f... |
a5b30350-6bc1-42f1-8641-dd25fca458b4 | TEL20A/Informatik-2 | Vorlesungsmaterial/21-06-07/baeume3.cpp | /*** Beispielimplementierung eines binären Suchbaumes.
*
* Verbesserung: Hilfsfunktionen sind jetzt Memberfunktionen der Element-Struktur.
* Vorteile:
* - Die Implementierung der Member wird übersichtlicher, man ist "in" einem Element.
* - Vorbereitung für weitere objektorientierte Verbesserungen (z.B. privat... | ALGO | 0.997501 | 5.12232 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2021-04-25T16:46:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2cff77daf4c7... |
f989ac41-321b-42d4-9281-9a20c79d1d09 | ANKerD/competitive-programming-constests | training/pomba-2/c/code.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ll long long
#define ii pair<int, int>
#define vi vector<int>
#define ld long double
#define vii vector<ii>
#define vll vector<ll>
#define MAX 100007
#define INF 1e9 + 7
template<typename ... | ALGO | 0.999783 | 3.43551 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2018-05-14T01:24:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d787d8b3... |
877e4b20-35b0-45bc-bc18-6deb4dd48992 | javier-adrian/sorting-algorithms | util.cpp | #include <iostream>
#include <chrono>
#include "include/raylib-cpp.hpp"
#define SIZE 256
#define WIDTH 1280
#define HEIGHT 720
enum MODE {
SELECTION,
BUBBLE,
INSERTION
};
void switchMode(
int (&array)[SIZE],
int &n,
int ¤t,
int &lowest,
int &verified,
MODE &mode,
bool &p... | ALGO | 0.984621 | 4.32029 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-06-13T02:06:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fab62163af69... |
728af240-416b-46a4-833b-96066cd1bc34 | Keerthana-P-G/40_Days_Coding_Challenge | LeetCode/Day18_LT.cpp | /*Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Every close bracket has a corresponding open bracket of ... | ALGO | 0.99941 | 6.193719 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2023-11-21T16:05: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": "845ae895e4... |
e824a3cb-fca9-4cda-8f5c-2edf03eb87e5 | Borhan2003/algorithm | Quick_sort.cpp | #include <bits/stdc++.h>
using namespace std;
int Partition(vector<int> &x, int a, int b)
{
int p = x[b], y = a - 1;
for (int z = a; z < b; z++)
{
if (x[z] <= p)
swap(x[++y], x[z]);
}
swap(x[y + 1], x[b]);
return y + 1;
}
void QuickSort(vector<int> &x, int a, int b)
{
i... | ALGO | 0.999543 | 4.984968 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-03-03T02:59:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "181b535b832f... |
fefe554d-257d-41a3-b61b-6f0aef4e8d83 | ishandutta2007/codeforces-e | e869120/normal/815/C.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int n, b, p[5700], q[5700], x[5700], dp[5700][5700][2], dp2[5700][5700], dd[5700]; vector<int>X[5700], D;
int dfs(int pos) {
for (int i = 0; i < X[pos].size(); i++)dd[pos] += dfs(X[pos][i]);
D.push_back(pos);
dd[pos] += 1;
return dd[pos];
... | ALGO | 0.999956 | 3.763 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "eda9ab79fe7f... |
d5016e22-ed14-48a4-8310-ef4a1fb87445 | yooniversal/PS | BOJ/dfs, bfs/1189.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
typedef long long ll;
const int INF = 987654321;
const int MOD = 1000000007;
int dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, 1, -1};
int R, C,... | ALGO | 0.999548 | 4.518276 | {
"github_metadata": {
"branch": "master",
"commit_count": 664,
"repo_created_at": "2020-04-24T15:46:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de54625b... |
b27e9076-cfe1-48ac-a670-69232f076952 | SupremeWarrior108/Competitive-Programming | CSES/1IntroductoryProblems19GridPath.cpp | #include <bits/stdc++.h>
using namespace std;
// Macros
#define pb push_back
#define pf push_front
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
// Read and Print
#define read(a, n) for (ll i = 0; i < n; ++i) cin >> a[i];
#define print(a, n) for (ll i = ... | ALGO | 0.999962 | 3.714217 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-24T14:16: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": "961187487838... |
237f7592-f177-4324-b978-4f473907801a | ishandutta2007/codeforces-r | rama_pang/normal/1364/B.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int T;
cin >> T;
while (T--) {
int n;
cin >> n;
vector<int> a(n);
for (auto &i : a) {
cin >> i;
i--;
}
vector<int> ans;
for (int i = 0;... | ALGO | 0.999944 | 4.129402 | {
"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": "17ce22ebc9e1... |
d6eb129e-eb07-443b-84ab-474f7df57ade | MusicScience37/numerical-collection-cpp | include/num_collect/ode/implicit_problem_wrapper.h | /*
* Copyright 2023 MusicScience37 (<NAME>)
*
* 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 o... | ALGO | 0.993899 | 7.370187 | {
"github_metadata": {
"branch": "main",
"commit_count": 1919,
"repo_created_at": "2021-04-26T13:19:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ea890c2e... |
af73842b-cfd5-4fc6-8fc2-39d444918c41 | zhangru-ng/SPOJ | src/Classical/nhay.cc | // http://www.spoj.com/problems/NHAY/
#include <iostream>
#include <vector>
using namespace std;
vector<int> buildTable(string& P) {
int m = P.size();
vector<int> prefunc(m, 0);
for (int i = 1; i < m; i++) {
int j = prefunc[i-1];
while (j > 0 && P[i] != P[j]) {
j = prefunc[j-1]... | ALGO | 0.999843 | 5.093894 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2016-05-03T15:09:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ab1f11d6... |
7b120c63-2c2d-4199-8433-8055c3446787 | bbuchsbaum/neurocluster | src/find_best.cpp | // [[Rcpp::plugins(cpp11)]]
#include <Rcpp.h>
#include <unordered_set>
using namespace Rcpp;
// This is a simple example of exporting a C++ function to R. You can
// source this function into an R session using the Rcpp::sourceCpp
// function (or via the Source button on the editor toolbar). Learn
// more about Rcpp a... | ALGO | 0.99939 | 6.984402 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-01-16T21:40: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": "ec3b5835c... |
59e5145a-5f3f-4384-aed3-1e86f24519ef | okp369/AtCoder | AtCoder/ソース39.cpp | //#include <iostream>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <map>
//using namespace std;
//typedef long long ll;
//#define rep(i,n) for (int i = 0; i < (n); ++i)
//
//std::string replaceOtherStr(std::string & replacedStr, std::string from, std::string to) {
// const unsigned int p... | ALGO | 0.999855 | 3.908136 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2021-12-30T02:20: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": "3133032bc... |
08d8aca5-b586-4483-be7e-8579161ad965 | R-fzx/code | problem/luogu/P4000-P4999/P4313.cpp | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <vector>
#ifndef ONLINE_JUDGE
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define d... | ALGO | 0.999952 | 3.660463 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2021-11-07T12:57:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a005cc4... |
c852a273-2598-49d4-970b-f912cc18ebbe | kassonlab/gmxapi | src/gromacs/linearalgebra/gmx_lapack/dlarrfx.cpp | #include <cmath>
#include "gromacs/utility/real.h"
#include "../gmx_blas.h"
#include "../gmx_lapack.h"
#include "lapack_limits.h"
void
F77_FUNC(dlarrfx,DLARRFX)(int *n,
double *d__,
double *l,
double *ld,
double *lld,
int *ifirst,
int *ilast,
double *w,
double *sigma,
double *dplus,
double *lplu... | ALGO | 0.999837 | 4.910982 | {
"github_metadata": {
"branch": "master",
"commit_count": 19315,
"repo_created_at": "2017-05-25T14:05:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 53,
"forks": 13,
"issues": 93,
"pull_requests": 2
},
"file_meta": {
"content_id": "6bac... |
a41c00cb-f23c-4488-8639-80a0062d2e0e | TA-rathnayaka/DSA-project | DoublyLinkList.h | //
// Created by Dhananjaya on 2023-10-20.
//
#include <iostream>
#ifndef FILEMANAGEMENTSYSTEM_DOUBLYLINKLIST_H
#define FILEMANAGEMENTSYSTEM_DOUBLYLINKLIST_H
namespace dll {
template<typename T>
class Node {
public:
Node *next;
Node *previous;
T value;
Node(T value);
... | ALGO | 0.973768 | 5.443796 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-21T05:26: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": "890c305fbd04... |
7740d4eb-96e4-4261-9cf0-23392d91cb5a | jiridanek/piskvorky | strategie/alphabeta/main.cc | #include <iostream>
#include <csignal>
#include <ctime>
#include <cerrno>
#include <cstdio>
#include "board/cboard.h"
#include "load.h"
#include "minimax.h"
#include "func.h"
#include "minimax.cpp"
#include "alphabeta/calfabeta.h"
using std::cout;
using std::cerr;
using std::endl;
void print_results();
CBoard *star... | ALGO | 0.994712 | 4.715252 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2011-11-09T22:05:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f41f468da... |
4f9f1aad-d337-44c8-8f52-c5dbe0ab1940 | SyedaShafi/C_programming | CPP/bfs.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int N = 1e7 + 1;
vector<int> g[N];
bool vis[N];
int dis[N], parent[N];
int main()
{
int node, edge;
cin >> node >> edge;
while (edge--)
{
int u, v;
cin >> u >> v;
g[u].push_back(v);
g[v].push_ba... | ALGO | 0.999982 | 4.01713 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-03-31T18:28:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "889804175f5d... |
910085f2-5c9b-4a19-9e3a-7d4a28ceeabf | 11akanksha/SPOJ-practice | candy.cpp | #include <iostream>
// #include <algorithm>
#include <numeric>
using namespace std;
int TheCount(int a[], int n)
{
int sum = 0;
sum = accumulate(a, a + n, sum);
int avg = sum / n;
if (sum % n != 0)
{
return -1;
}
int count = 0;
for (int i = 0; i < n; i++)
{
if (a[i] ... | ALGO | 0.998644 | 3.55106 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2021-07-08T17:07: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": "9274b437caa... |
8fdf37e1-921d-41ef-82ea-43dd35807828 | dcseal/finess | lib/3d/UpdateSoln.cpp | #include "tensors.h"
#include "StateVars.h"
// Update the solution using the constructed Lstar
//
// The Low-Storage RK methods use a combination of two different values of q,
// together with a right hand side, L. This routine computes the following:
//
// qnew = alpha1*qstar + alpha2*qnew + beta*dt*Lstar.
//
//... | ALGO | 0.999878 | 4.7676 | {
"github_metadata": {
"branch": "master",
"commit_count": 478,
"repo_created_at": "2022-02-23T19:41:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0a8cc7c... |
8cf590dc-32e1-487c-acd2-9f01642c0611 | amanzano05/Data_structures-Algorithms | classes_operador_overloading.cpp | #include<bits/stdc++.h>
using namespace std;
//Implement the class Box
class Box{
//l,b,h are integers representing the dimensions of the box
private:
int l, b, h ;
public:
// The class should have the following functions :
// Constructors:
// Box();
Box(){
l=0;
b=0;
h=0... | ALGO | 0.998838 | 3.653767 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-02-04T20:34:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab6700af74... |
5f2cda5a-7675-48b9-ab07-37f88633bbd6 | mono-1729/AtCoder_cpp | ABC/228/f.cpp | #include <bits/stdc++.h>
#include <unordered_map>
#include <stdlib.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <atcoder/all>
using namespace atcoder;
using namespace boost::multiprecision;
using namespace std;
#define rep(i, a, n) for(ll i = a; i < n; i++)
#define rrep(i, a, n) for(ll i = a; i >= n; i--)
#d... | ALGO | 0.998445 | 4.186849 | {
"github_metadata": {
"branch": "main",
"commit_count": 296,
"repo_created_at": "2023-07-13T08:05: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": "351357a6e0... |
1dc84589-68ea-4670-a503-808d7c5e6d31 | jessica9685/Algorithm | BOJ/DFS/2573_빙산.cpp | // 2573_빙산.cpp
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <queue>
#include <utility>
#include <cstring>
using namespace std;
#define MAX 300
int n, m;
int ice[MAX][MAX];
bool visited[MAX][MAX];
int dy[4] = { 1, -1, 0, 0 };
int dx[4] = { 0, 0, 1, -1 };
// 얼음 녹이기
void melt() {
int copied[MAX][MAX];
... | ALGO | 0.999987 | 4.28396 | {
"github_metadata": {
"branch": "main",
"commit_count": 504,
"repo_created_at": "2021-01-19T14:32: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": "ab96730779... |
5b9d1388-ff04-4be3-a50f-4158f0936858 | unifem/overtureframework | Overture/oges/EquationSolver.h | #ifndef EQUATION_SOLVER_H
#define EQUATION_SOLVER_H
#include "Oges.h"
// base class for equations solvers such as yale, harwell, slap, petsc etc.
class EquationSolver
{
public:
EquationSolver(Oges & oges_);
virtual ~EquationSolver();
virtual int allocateMatrix(int,int,int,int);
virtual int displayMatrix();... | ALGO | 0.967058 | 4.137966 | {
"github_metadata": {
"branch": "master",
"commit_count": 323,
"repo_created_at": "2017-12-19T03:56:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8947fdb6... |
941d9dde-7b76-40ca-b9ad-9c2e2588272e | mayankamencherla/cracking-the-coding-interview-solutions | stacks-and-queues/three-in-one.cpp | #include "stack.cpp"
#include <limits>
using namespace std;
/**
* This is an implementation of an array being used for 3 stacks
*/
class ThreeInOne
{
private:
vector<int> memory;
int size;
vector<int> sizes;
public:
/**
* Creates an array that contains 3x size
... | ALGO | 0.988946 | 5.837069 | {
"github_metadata": {
"branch": "master",
"commit_count": 209,
"repo_created_at": "2018-10-11T10:37:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44a7f7c7... |
03d34440-66cd-49f2-99a6-f83ead74d78f | earnestzhao/LeetCode | LeetCode_306.cpp | class Solution
{
public:
bool isAdditiveNumber(string num)
{
if (num.length() < 3)
{
return false;
}
for (int iFirstLength = 1; iFirstLength <= num.length() / 2; iFirstLength ++)
{
for (int iSecondLength = 1; max(iFirstLength, iSecondLeng... | ALGO | 0.999794 | 5.222871 | {
"github_metadata": {
"branch": "master",
"commit_count": 288,
"repo_created_at": "2016-05-03T03:14: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": "cf5b3398... |
61c7d866-8676-4a19-ba35-9e593e0fb841 | DrSwad/CP | Submissions/Codeforces/1697/F_Too_Many_Constraints.cpp | #include <bits/stdc++.h>
using namespace std;
struct TwoSat {
int N;
vector<vector<int>> gr;
vector<int> values; // 0 = false, 1 = true
TwoSat(int n = 0) : N(n), gr(2 * n) {}
void either(int f, int j) {
f = max(2 * f, -1 - 2 * f);
j = max(2 * j, -1 - 2 * j);
gr[f].push_back(j ^ 1);
gr[j].pu... | ALGO | 0.999794 | 4.729094 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2019-10-12T13:53:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "d13e7fe9... |
6b2c25e5-c0b7-4be5-a546-5257438ed974 | haohaoguo-666/Algorithm_Code | 算法作业/二叉树/236. 二叉树的最近公共祖先.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
//思路一 DFS + 栈
class Solution {
public:
bool getPath(TreeNode* root, TreeNode* x, stack<TreeNode*>& path)
{
... | ALGO | 0.999996 | 6.372875 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-07-04T02:12:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfd4163982d... |
4146da47-93ef-4042-895a-6e12f9d5081c | macksgur0303/Arduino | 2024.09.03/mode_drive/mode_drive.ino | #include <avr/wdt.h>
#define Current_Pin A0 // 전류측정 센서 핀
#define Acid_Pin A1 // 연축전지 센서 핀
#define Scap_Pin A2 // 슈퍼캐패시터 센서 핀
#define Process_Btn 0
#define TimeMax_Swtich 1
int LedPin[] = {2, 3, 4}; // Led 핀
#define Process_Switch 6
#define Relay_Pin 7 // ... | TOOL | 0.931812 | 5.421057 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2023-01-04T04:33:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61331bd5e32... |
9943c9f1-4cd8-499b-aa09-0acfeb624784 | leostd/Competitive-Programming | SPOJ/PQUEUE/pqueue.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int counters[10];
bool can (int n)
{
n++;
while ( n < 10)
{
if (counters[n])
return false;
n++;
}
return true;
}
int main()
{
//freopen("pqueue.txt", ... | ALGO | 0.999951 | 3.258229 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2017-04-09T05:24:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab4a3b15... |
5a9efca0-c74a-45de-80fa-d601f2478da0 | Jinchenyuan/LeetCode | src/322.coin-change.cpp | /*
* @lc app=leetcode id=322 lang=cpp
*
* [322] Coin Change
*/
// @lc code=start
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
const int Max = amount + 1;
vector<int> dp(amount + 1, Max);
dp[0] = 0;
... | ALGO | 0.999842 | 5.787362 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2019-05-12T06:06:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ea5935f... |
e1fccd85-e804-4504-bd1a-18eaa94d9300 | mahmoud-5555/xo_with_difference_variance | src/Tic_Tac_Toe_Board.cpp | // Class definition for Tic_Tac_Toe_Board
// Author: <NAME>
// Date: 2/12/2023
// Version: 1
#include <iostream>
#include <random>
#include <iomanip>
#include <algorithm>
#include "BoardGame_Classes.hpp"
using namespace std;
// set Board
Tic_Tac_Toe_Board::Tic_Tac_Toe_Board()
{
n_rows = n_cols = 5;
board ... | TOOL | 0.964309 | 5.245229 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-12-16T14:32: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": "52acf8e13cc... |
43593604-400e-40e3-a24c-585e31f001c9 | DiegoNolan/Radiotherapy | src/distribution.cpp | #include "distribution.h"
UniformDist::UniformDist(IloNum l, IloNum u)
{
if(!(u>l)){
cout << "Error: upperbound is lower than lower bound " << l << " " << u << endl;
}
b = u;
a = l;
}
void UniformDist::operator= (UniformDist & arg)
{
a = arg.a;
b = arg.b;
}
IloNum UniformDist::cdf(IloNum t)
{
if(t <= a... | TOOL | 0.984577 | 3.84278 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2012-12-31T13:18:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01e8903c5... |
143b92bb-7c02-42c4-be82-7f1e0492dc96 | mposypkin/BNB-solver | util/common/vec.hpp | #ifndef _VEC_HPP_
#define _VEC_HPP_
/**
* Subroutines for frequently used vector operations
*
* @author <NAME>, ISA RAS, <EMAIL>
*
* @warning Using the code below requires an explicit permition from the author
* @warning Any other use is prohibited
*
* @date Copyright by <NAME> 2005-2015
* @file vec.hpp
*/
#... | TOOL | 0.96018 | 6.342946 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2015-03-22T08:12:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "890420d49... |
e0195918-b6ba-49bd-ab1d-b6167d496e84 | EyciaZhou/acm-fake | Regionals 2011/Latin America/Uvalive5793.E-Elecrical Pollution/Uvalive5793.E-Elecrical Pollution/main.cpp | //
// main.cpp
// Uvalive5793.E-Elecrical Pollution
//
// Created by eycia on 24/8/15.
// Copyright (c) 2015年 eycia. All rights reserved.
//
#include <set>
#include <map>
#include <list>
#include <tuple>
#include <ratio>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <cstdio>
#include... | ALGO | 0.999952 | 3.997529 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-02-29T10:04: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": "42ae967f11... |
47be08f2-1263-4864-a24e-4e89c36214dc | wenxu2/IntrotoCPlusPlus | Project/Project 4/Wenwen_Xu_Programming_Project4.cpp | /* File Name: Wenwen_xu_ProgramProject4.cpp
* Author: <NAME>
* Email Address: <EMAIL>
* Assignment Number: 4
* Description: This program read file and display the average, lowest, and highest salary
* Last Changed: 3 July 2018
*/
#include <iostream>
#include <cmath>
#include <fstream>
#include <string>
#include <... | TOOL | 0.980633 | 4.088995 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-07-30T17:59:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec9437c7a7... |
34bec1ae-f314-4932-8342-80d9fabed984 | Suryansh555/CPP | SwapListNodesInPair.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
#include<bits/stdc++.h>
using namespace std ;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListN... | ALGO | 0.999986 | 5.148887 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2020-12-10T04:21: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": "1a8906b8c10... |
d13d325d-7811-429f-9e86-6976e1073485 | GerasimovIV/Yandex_techical_interview | Online_tests/zadacha.cpp | #include <iostream>
using namespace std;
#include <string>
bool check(string mas, int n)
{
int couter = 0;
for (int i = 0; i < 2 * n; i++)
{
if (mas[i] == '(')
{
couter += 1;
}
if (mas[i] == ')')
{
couter -= 1;
}
if (couter < 0)
... | ALGO | 0.999398 | 4.556398 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-24T16:26: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": "ece3b70e76... |
9e12c56b-1db4-4bfd-bf77-4b37f75cd5da | IamLph/Study_C | C++提高编程/19_谓词.cpp | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
// 仿函数 返回类型是bool
class Five {
public:
// 重载()
bool operator()(int val){
return val > 5;
}
};
void test01() {
vector<int>v;
for (int i = 0; i < 10; i++) {
v.push_back(i * 2);
}
// 查找大于5的数字 返回迭代器
vector<int>::iterat... | ALGO | 0.9991 | 4.890074 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-05-25T12:44: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": "f97ae312e90f... |
b9365477-36e1-4a9e-8aa4-bfa9caa046b0 | madhukundena/DSA | Sorting/BubbleSort.cpp | // Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.
// Example:
// First Pass:
// ( 5 1 4 2 8 ) –> ( 1 5 4 2 8 ), Here, algorithm compares the first two elements, and swaps since 5 > 1.
// ( 1 5 4 2 8 ) –> ( 1 4 5 2 8 ), Swap since 5 >... | ALGO | 0.999963 | 5.50147 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2022-02-19T03:25:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "415840e3c... |
6c6540ad-6c24-47b0-85dc-f2690ce48744 | Bhu03sun/DSA0152-Object-oriented-programming-c- | quadratic eq.cpp | #include <iostream>
#include <cmath>
int main() {
double a, b, c;
std::cout << "Enter coefficients a, b, and c: ";
std::cin >> a >> b >> c;
double discriminant = b * b - 4 * a * c;
double root1, root2;
if (discriminant > 0) {
root1 = (-b + std::sqrt(discriminant)) / (2 * a);
r... | ALGO | 0.978817 | 5.428164 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-06-06T04:02: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": "ac9e3bc193e7... |
b8aedc29-6954-4f4e-83dd-f6820fc2dfee | shuvokhalid173/uva-online-judge-solution- | 320_div_2.cpp | /****ALLAH IS ALMIGHTY****/
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#inclu... | ALGO | 0.999938 | 3.172561 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-11-27T11:32: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": "1926e6f45b... |
e36762d3-5208-412c-82bc-7d3416570c28 | alexandraback/datacollection | solutions_5706278382862336_1/C++/AndyJiang/A-large.cc | #include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<cstdlib>
#include<cmath>
#include<string>
#include<sstream>
#include<queue>
#include<stack>
#include<list>
using namespace std;
bool check(long long p){
while(p%2 == 0)
... | ALGO | 0.999729 | 3.973345 | {
"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": "6bace4d12... |
be2444e2-0862-494b-9b1c-e2e2c61ce3a9 | ocpalo/Graph-Search-Shortest-Paths-and-Data-Structures | Week1/connectedComponentsBFS.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <list>
// This algorithms finds every connected components
// No way to miss a node, for loops walk through every node
// Usage:
// Check if network disconnected
// Graph visualisation
// Clustering
// Space complexity Linear Time O(N)
void addEdge(s... | ALGO | 0.999214 | 5.262431 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-08-21T21:53:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa417f12d... |
9d71ae66-4f09-4791-abb8-7c4e465427fe | devraj2018/Programming_Pathshala | Amazon_Most_Frequently_Asked/3)-Merge_K_Sorted_LinkedList.cpp | /**
* Definition for singly-linked list.
* 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) {}
* };
*/
// --- [Brute_force] Merge first with second,then... | ALGO | 0.999818 | 6.454333 | {
"github_metadata": {
"branch": "main",
"commit_count": 199,
"repo_created_at": "2021-12-02T18:36:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d63cf5501f... |
35361de9-e64e-4c33-b7b1-96dd4759eaac | DBGroup-SUSTech/multi-vector-retrieval | src/impl/BruteForce.hpp | //
// Created by username1 on 2023/2/16.
//
#ifndef VECTORSETSEARCH_BRUTEFORCE_HPP
#define VECTORSETSEARCH_BRUTEFORCE_HPP
#include <stdexcept>
#include <cstdint>
#include <Eigen/Eigen>
#include <limits>
#include <queue>
#include <iostream>
#include <mutex>
#include "include/struct/MethodBase.hpp"
#include "include/a... | ALGO | 0.986099 | 6.645385 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-01-23T05:11:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37b3c8d83ee... |
61d2407f-3292-464c-aef4-acaff32a2994 | HassanSheikh1033/C-Plus-Plus-Full-Course | Programming Fundamentals/Nested Loops/Triangle.cpp | #include<iostream>
using namespace std;
int main(){
int rows;
cout<<"Enter the rows "<<endl;
cin>>rows;
// Pattern 1:
for(int i = 1; i<=rows; i++){
for(int j = 1; j <= rows - i; j++ ){
cout<<" ";
}
for(int j = 1; j <= i; j++ ){
cout<<"* ";... | ALGO | 0.999488 | 4.095104 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-13T16:11: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": "291ef498bba8... |
690f11e2-7da8-415a-812e-4611a7dda240 | halterman/CppBook-SourceCode | Chap10/referencevar.cpp | #include <iostream>
int main() {
int x = 5;
int y = x;
int& r = x;
std::cout << "x = " << x << '\n';
std::cout << "y = " << y << '\n';
std::cout << "r = " << r << '\n';
std::cout << "Assign 7 to x\n";
x = 7;
std::cout << "x = " << x << '\n';
std::cout << "y = " << y... | ALGO | 0.991475 | 3.910788 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-11-30T04:14:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 46,
"forks": 31,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f963bd6... |
44bf66b3-b30c-4245-a130-8273a66990b6 | Ngochanako/DSA_SS8 | SS8-Tree/B7.cpp | #include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* left;
struct Node* right;
};
typedef struct Node Node;
Node* newNode(int data) {
Node* node = (Node*)malloc(sizeof(Node));
node->data = data;
node->left = node->right = NULL;
return node;
}
int isCompleteBinaryTr... | ALGO | 0.999486 | 5.182373 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-15T14:41: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": "aa5f15a89219... |
9f1d17fd-c47d-4003-ba47-94a12a0bcae7 | shvom667/CompetitiveProgramming | ARC174/C2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll mod=998244353;
long long binpow_remainder(long long a, long long b, long long m=mod) {
a %= m;
long long res = 1;
while (b > 0) {
if (b & 1)
res = res * a % m;
a = a * a % m;
b >>= 1;
}
re... | ALGO | 0.999964 | 4.532188 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2024-07-25T15:51:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28dae002... |
339512be-e477-408f-b694-c40671fed923 | Durgeshmundada/DSA | 234-palindrome-linked-list/palindrome-linked-list.cpp | /**
* Definition for singly-linked list.
* 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:
bool isPalindrome(Lis... | ALGO | 0.999559 | 6.0346 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2025-07-10T17:21: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": "f4b080994a4... |
414632ce-04a9-4349-96aa-0afdeb09719c | miras999/ADS-2022-Fall | G1/lesson14/lab2_k.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node {
char value;
Node *next;
Node(char x) {
value = x;
next = nullptr;
}
};
struct LinkedList {
Node* head;
int size;
LinkedList() {
head = nullptr;
size = 0;
}
Node* get_tail() {
No... | ALGO | 0.999971 | 3.939304 | {
"github_metadata": {
"branch": "main",
"commit_count": 228,
"repo_created_at": "2022-11-12T15:55: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": "339e1a3af3... |
611a57ec-b049-49d2-8edb-6f46eb90ad7a | yjl9903/XCPC | HDu-Multi/2019/2/d.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <utility>
#ifdef XLor
#define dbg(args...) do { cout << #args << " -> "; err(args); } while (0)
void err() { std::cout << std::endl; }
template<typename T, typename...Args>
void err(T a, Arg... | ALGO | 0.999537 | 4.133629 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-25T19:33:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5042d3365197... |
48612d71-0a10-4fb0-a5ae-b6302cea3887 | NavedAFZ/CP1_CHIPHERSCHOOLS | LINKED LIST_day6/practice.cpp | #include <iostream>
#include <cstdio>
# include<bits/stdc++.h>
using namespace std;
/* a node of the singly linked list */
struct node
{
int data;
struct node *next;
node(int x){
data = x;
next = NULL;
}
};
/* A utility function to insert a node at the beginning of linked list */
void ... | ALGO | 0.999954 | 3.623422 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-08-15T09:05: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": "ce645eb65... |
d0dc7ab5-c53e-4f28-baaa-16bc480f1782 | amanjoshi668/Progrmming | codechef/snackdown/elimination/ahacker.cpp | #include <bits/stdc++.h>
#include <unistd.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including seg_tree_order_statistics_Node_update
#include <stdio.h>
#include <cassert>
using namespace std;
//using namespace __gnu_pbds;
typedef long long lo;
typedef long dou... | ALGO | 0.999915 | 3.949503 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-09-26T11:16:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c3c65a81... |
c994ac62-bb80-4b4f-97a2-4b00d7b2ef7f | emei18/Wordle | wordle.cpp | #include <iostream>
#include <string>
#include <cctype>
using namespace std;
string correctChar(string guess, string answer)
{
string result = "";
for (int i = 0; i < 5; i++)
{
if (guess[i] == answer[i])
result = toupper(guess[i]);
}
return result;
}
int main()
{
s... | TOOL | 0.941321 | 4.424435 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-06-24T03:45: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": "17028e1bae82... |
6a87a127-6834-40fe-9bcc-55500cbbc5b5 | aroslhy/acm | Code/UVALive/UVALive_3939.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN = 1000+5, MAXM = 2000000+5, MAXP = 1000000+5;
const int INF = 0x7fffffff;
int N, M, R, X, Y, Z, A, B, C, fa[MAXN];
vector<int> u, v, w, a, b, c, re, rq;
vector<bool> ans;
bool cmp_e(const int a, const int b)
{
... | ALGO | 0.999836 | 3.801445 | {
"github_metadata": {
"branch": "master",
"commit_count": 196,
"repo_created_at": "2012-07-28T11:54: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": "f0c3f30b... |
307c60a3-ed31-425b-b6fb-a088bc627171 | Nitin1130/Data-Structures-ProblemsCplusplus | VerticalOrderBinaryTree.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node *left, *right;
Node(int d) {
data = d;
left = right = NULL;
}
};
Node* buildTreeLevelWise() {
int d;
cin >> d;
Node* root = new Node(d);
qu... | ALGO | 0.99998 | 4.637999 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2021-05-02T18:10: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": "5b282aac9... |
a82a789b-8a04-4096-9d12-3596ff899c54 | gauriiiiiiiiiiii/practise_DSA | 6. LINKED LIST/3. Problems of LL/11. Linked List Cycle.cpp | /*
You're given the head of a singly linked list
You want to detect if there's a cycle — i.e., if any node points back to a previous node instead of ending with nullptr
Floyd’s Cycle Detection Algorithm (also called the Tortoise and Hare algorithm)
You use two pointers: Tortoise (slow): moves one step at a time & Hare... | ALGO | 0.999888 | 6.900112 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-06-03T06:27: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": "4feefb8f2ec4... |
a63aa91c-916a-47ff-8266-33fa96bd3643 | Tarun0312/DSA-Supreme | Week3/Live/12September2023/03rotateArrayByKsteps.cpp | #include<iostream>
#include<vector>
using namespace std;
void printVector(vector<int> a){
for(auto it : a){
cout<<it<<" ";
}
cout<<endl;
}
void rotate(vector<int>& nums, int k) {
// algo step1-> store n-k element in temp array
// step2-> arr[i]=arr[i-k]
// s... | ALGO | 0.999407 | 5.75985 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-09-10T18:46: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": "c18afad4042... |
30241bf8-96e4-49cc-b0ae-9578a3f2db17 | FHead/fheadhelpercode | Program/CalendarSolver/SolvePuzzle.cpp | #include <iostream>
#include <vector>
#include <ctime>
using namespace std;
#include "Board.h"
int main(int argc, char *argv[]);
void DoShapeTest(vector<Shape> &Shapes);
int main(int argc, char *argv[])
{
string DateString = "20241124";
if(argc > 1)
DateString = argv[1];
int Year = 2024, Month = 11, ... | ALGO | 0.943207 | 4.674006 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2015-11-10T02:30: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": "d13a3cb0... |
4e89fb0d-8d37-4e50-a547-68c88bb357b5 | wangcy6/weekly_read | code_reading/oceanbase-master/src/sql/engine/sort/ob_in_memory_sort.h | /**
* Copyright (c) 2021 OceanBase
* OceanBase CE is licensed under Mulan PubL v2.
* You can use this software according to the terms and conditions of the Mulan PubL v2.
* You may obtain a copy of Mulan PubL v2 at:
* http://license.coscl.org.cn/MulanPubL-2.0
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BAS... | TOOL | 0.926799 | 6.879457 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2020-09-07T07:42:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eebd0f6993... |
b2596011-1800-4553-84da-3ad54b26ed3b | Ayush2980/Data-Structures | Tree/Heap/MaxHeap.h | #include <bits/stdc++.h>
using namespace std;
namespace H
{
class MaxHeap
{
private:
vector<int> arr;
int size;
public:
MaxHeap()
{
arr.push_back(-1);
size = 0;
}
void insert(int val)
{
arr.push_back(val);
... | ALGO | 0.996493 | 3.880724 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2023-08-20T21:07: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": "db9b0a67a... |
efce5d13-92d7-4a5e-a675-db23cad2327a | Myung-Hyun/SW-Lab-Cpp | 6. LSM/LSM.cpp | // matrix_LSM.cpp: 콘솔 응용 프로그램의 진입점을 정의합니다.
///
#include <iostream> // for getchar( )
#include <cstdlib> // for rand( )
#include "myMatrix.h"
using namespace std;
int main()
{
// data generation
float datax[100], datay[100];
int N = 100, i;
for (i = 0; i < N; i++) {
datax[i] = 300. + i + (rand() / (float)RAND_MA... | ALGO | 0.985817 | 4.35038 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-09-30T05:13: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": "c6e5351f9... |
ba9b1754-6754-4494-80ec-5116fc96b718 | vitusbalazs/cagd | oldshit/Vegl/QtFramework_Lab45_vegleges/Projekt/BicubicBSplinePatch3.cpp | #include "BicubicBSplinePatch3.h"
using namespace cagd;
BicubicBSplinePatch3::BicubicBSplinePatch3(): TensorProductSurface3(0.0, 1.0, 0.0, 1.0, 4, 4)
{
}
GLboolean BicubicBSplinePatch3::UBlendingFunctionValues(GLdouble u_knot, RowMatrix<GLdouble>& blending_values) const
{
if (u_knot < 0.0 || u_knot > 1.0)
... | ALGO | 0.923464 | 6.913945 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-06-11T18:32:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2eeec57e1e36... |
99e9f0f3-7177-4a36-831c-1a1869121c90 | bhagyeshagresar/ESP32_FreeRTOS_Projects | 11_mutex_challenge/11_mutex_challenge.ino | /**
* FreeRTOS Mutex Challenge
*
* Pass a parameter to a task using a mutex.
*/
// Use only core 1 for demo purposes
#if CONFIG_FREERTOS_UNICORE
static const BaseType_t app_cpu = 0;
#else
static const BaseType_t app_cpu = 1;
#endif
// Define the LED Pin
static const int led_pin = LED_BUILTIN;
static Semapho... | TOOL | 0.954708 | 5.646741 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2024-08-25T18:46: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": "2631baf3540... |
042a7422-c634-4c06-81c3-0e325fae266d | neko7055/Leg_Detection_Using_Adaboost | include/weaklearner.hpp | #ifndef WEAKLEARNER_HPP
#define WEAKLEARNER_HPP
#include <Eigen/Eigen>
#include <algorithm>
#include <limits>
#include <tuple>
#include <vector>
/**
* @brief The weak learner in Adaboost.
*/
class WeakLearner {
private:
friend class boost::serialization::access;
template <class Archive>
void serializ... | ALGO | 0.998897 | 6.908907 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-30T04:18:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94bf628b695a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.