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 |
|---|---|---|---|---|---|---|---|
a92a1c91-51bd-4f79-8c64-f3e9d2d3a0c6 | Gaurav-create948/graph | cycleInDirectedAcyclic.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
/*
This is the bfs based cycle detection solution implemented by the logical use of kahns algo.
Why this algo is working?
because kahns algorithm only works for DAG (direct acyclic graph) and if there's a cycle
it will detect e... | ALGO | 0.999961 | 5.803817 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-07-15T06:49: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": "a026ea764e... |
547f3272-ccdb-4596-9755-f15f56b8da9f | Tadanoningen96/atcoder_archive | atcoder/abc210/d/main.cpp | #include<bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i) < (n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i) < (n);(i)++)
using namespace std;
using ll = long long;
using ld = long double;
template<typename T>
bool chmax(T &a,const T &b) {if(a < b) {a = b;return true;}return false;}
template<typename T>
bool chmi... | ALGO | 0.999969 | 3.886272 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-11-06T06:11: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": "64692cc8ee... |
a9eba40f-1025-457e-acd2-7ae77aa6662b | mzahana/multi_target_kf | src/kf_tracker.cpp | /*
BSD 3-Clause License
Copyright (c) 2020, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions a... | TOOL | 0.916042 | 6.499168 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2021-12-15T05:42:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8b826098... |
36fc5982-cc9d-4ddd-8268-88342e50abe8 | MingkaiMa/Programming-Pearls | Heaps/PriorityQueue.cc | #include <iostream>
using namespace std;
template<class T>
class prequeue
{
private:
int n, maxsize;
T *x;
void swap(int i, int j)
{
T t = x[i];
x[i] = x[j];
x[j] = t;
}
public:
prequeue(int m)
{
maxsize = m;
x = new T[maxsize + 1];
n = 0;
... | ALGO | 0.999953 | 4.707469 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-03-27T15:20: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": "cf29d1079... |
d93cf8e3-dd6f-447a-83e3-7ab60d248035 | Byte717/USACO_TRAINING | Silver/Binary_Search/Handshakes/handshakes.cpp | #include <bits/stdc++.h>
#define INF 1e18
#define MOD 1e9+7
#define all(x) begin(x),end(x)
#define rall(x) x.rbegin(), x.rend()
typedef long long ll;
using namespace std;
int dirX[] = {-1, 0, 1, 0};
int dirY[] = {0, 1, 0, -1};
int LOG2(int n){
int ret = 0;
while((1<<(ret+1)) <= n){ret++;}
return ret;
... | ALGO | 0.999972 | 3.456328 | {
"github_metadata": {
"branch": "main",
"commit_count": 324,
"repo_created_at": "2022-12-05T00:24: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": "c9d36191b8... |
471be056-73bb-45a6-b8b6-a4e8efb3875a | deepanshuoct12/cpp-practise-codes | ncr.cpp | // C++ implementation to find nCr
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int ncr(int n, int k)
{
int res = 1;
// Since C(n, k) = C(n, n-k)
if (k > n - k)
k = n - k;
// Calculate value of
// [n * (n-1) --- (n-k+1)] / [k * (k-1) ---- 1]
for (int i = 0; i < k; ... | ALGO | 0.999963 | 5.769502 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-01-30T12:17: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": "48b0a5993d8... |
702ae3a9-888f-433d-aa59-7282729b4312 | stp/stp | lib/Simplifier/UseITEContext.cpp | /********************************************************************
* AUTHORS: <NAME>
*
* BEGIN DATE: Feb, 2011
*
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, includin... | ALGO | 0.99256 | 6.935143 | {
"github_metadata": {
"branch": "master",
"commit_count": 3188,
"repo_created_at": "2013-08-27T00:53:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 547,
"forks": 142,
"issues": 51,
"pull_requests": 5
},
"file_meta": {
"content_id": "63d... |
1580aa41-10b7-4b93-9952-9557389fcc0f | madhulagg/Optimal-University-Course-Assignment-System-Design | final.cpp | #include <bits/stdc++.h>
using namespace std;
// assuming total course = 12, can be set any variable no in the code but minimum no is 12-->
const int NUM_COURSES = 12;
const int MAX_ITERATIONS = 3; // as in each iteration we are alloting only 0.5 of a course to each professor
// 4 FD CDC, 4 FD Ele, 2 HD CDC, 2 HD ... | ALGO | 0.999581 | 5.243261 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-11-30T12:28:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ec381c7311... |
65bbeed5-2737-40c1-8427-8ca9b9dc8228 | liuyubobobo/Play-Advent-of-Code | 2020/Day-12-Rain-Risk/cpp-2020-12/main_part_1.cpp | /// Source : https://adventofcode.com/2020/day/12
/// Author : liuyubobobo
/// Time : 2020-12-12
#include <iostream>
#include <fstream>
#include <vector>
#include <cassert>
#include <unordered_set>
using namespace std;
class Solution{
private:
const int dirs[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
publi... | ALGO | 0.999669 | 5.252266 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2018-02-16T23:28:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "888e39a3f... |
e0784cf1-bc39-431b-90f7-03bbb21aeff7 | Saif-000001/Introduction-to-Algorithms-Problem-Solving-Part---III | AlgorithmGraph/Modul_6LabBFSDFS/DFS.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int visited[N];
vector<int> adj_list[N];
void DFS(int node)
{
cout << node << " ";
visited[node] = 1;
for (int adj_node : adj_list[node])
{
if (visited[adj_node] == 0)
DFS(adj_node);
}
}
int main()
{
int n... | ALGO | 0.999957 | 4.919072 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2023-03-07T17:46: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": "a794c23dc1... |
ac0d896c-b087-4fc6-87f8-5533154d69f1 | mosta7il/Competitive-programming | uva/10147 - Highways.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<set>
#include<map>
#include<list>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<complex>
#include<sstream>
#include<iostream>
#include<fstream>
#include<algorithm>
#include<numeric>
#include<utility>
#include<functio... | ALGO | 0.999963 | 3.929827 | {
"github_metadata": {
"branch": "master",
"commit_count": 519,
"repo_created_at": "2017-08-15T22:37:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37efce68... |
1c7822ea-8419-4a26-981a-cb1c88ad4723 | tanjummotin/Competitive-Programming | CODE BOOK/Segment Tree/5.Find elements in the range L o R which are greater than K(Spoj-Kquery).cpp | ///<NAME>
///Given an array size N and Q queries of form L R K,find elements int the range L o R which are greater than K
#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
typedef long long ll;
const ll mx=30005;
vector<ll> tree[4*mx];
ll arr[mx];
void init(ll ... | ALGO | 0.999993 | 5.147316 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2020-06-27T07:13:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d45fc1cd... |
e235b172-5ed9-40e1-8fb6-693cbbcf4e35 | abhinav2603/CS252 | lab7/bridgesim.cpp | #include<bits/stdc++.h>
using namespace std;
#include"bridge.cpp"
class event{
public:
Bridge* bridge;
mssg msg;
Lan* lan;
};
class flow_event{
public:
Bridge* bridge;
Lan* lan;
pair<string,string> msg;
};
class bridgesim{
//map<string,vector<string> > topo, host;
public:
map<string,Lan*> host;
vector<Bridg... | ALGO | 0.994548 | 3.466756 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-03-18T17:31: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": "14dd978f5e... |
ae56172c-ae5e-4e79-8211-e0c1d081fb1f | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/MixtralExpert/top0-100/sorted-gcd-pair-queries-Solution.gcdValues/177865_DoS.cpp | PatternMatch(char *pat, int patdashes, char *string, int stringdashes)
{
char c,
t;
if (stringdashes < patdashes)
return 0;
for (;;) {
switch (c = *pat++) {
case '*':
if (!(c = *pat++))
return 1;
if (c == XK_minus) {
patdashes--;
for (;;) {
while ((t = *strin... | ALGO | 0.999466 | 4.202942 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-22T14:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "756c862d96be... |
2213f9c4-3800-43ea-8fad-e3f64361be74 | vagifaliyev/Matrix-Solver | Matrix.cpp | #include <iostream>
#include <typeinfo>
#include <cmath>
#include "Matrix.h"
using namespace std;
// Constructor - using an initialisation list here
template<class T>
Matrix<T>::Matrix(int rows, int cols, bool preallocate):\
rows(rows), cols(cols), size_of_values(rows * cols), preallocate(preallocate)
{
// If we w... | ALGO | 0.989133 | 4.248494 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-02-05T13:25:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "198be87b3... |
bf89ad5b-7c8a-4ba8-9af1-c37b944ec582 | hackwa/pynqfire | src/ref/cpp_FIR.h | /*
(c) Copyright 2013 - 2016 Xilinx, Inc. All rights reserved.
This file contains confidential and proprietary information of Xilinx, Inc. and
is protected under U.S. and international copyright and other intellectual
property laws.
DISCLAIMER
This disclaimer is not a license and does not grant any rights to the ma... | ALGO | 0.986147 | 6.106257 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2016-05-23T21:01:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 11,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc0709b... |
1de124fe-f73c-414f-9c04-5b4f9e5cc862 | nemanjarotman/AADSP2 | model0/ProcessWavFile/main.cpp |
#include <stdlib.h>
#include <string.h>
#include "WAVheader.h"
#define BLOCK_SIZE 16
#define MAX_NUM_CHANNEL 8
#define BUFFER_MAX_LENGTH 4000
#define NEG_VALUE -1
#define LEFT_CH 0
#define RIGHT_CH 1
#define LEFT_S_CH 3
#define RIGHT_S_CH 4
#define LEFT_FE_CH 5
#define MAX_SAMPLE 0.9999999994
double sampleBuffer[... | ALGO | 0.935505 | 4.582944 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-03-04T23:11: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": "f8d2417b55... |
d639c541-eeaf-43f8-aec1-20d71337b6c0 | hyxinchou/VOI2023 | VNOI/YugiHacker/Segment_Tree/qmax2.cpp | #include <bits/stdc++.h>
template<typename T>
struct SegmentTreeLazy {
const int n;
std::vector<T> info, lazy;
SegmentTreeLazy(int n) : n(n), info(4 << std::__lg(n)), lazy(4 << std::__lg(n)) {}
void pull(int p) {
info[p] = std::max(info[2 * p], info[2 * p + 1]);
}
void pull_lazy(int p, int l, int r) {
if (la... | ALGO | 0.999919 | 4.679141 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-07-03T02:16: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": "118ce1f6b087... |
736a63c1-fae8-4100-be69-1269d98d44e9 | a-farooq/ProblemsAndSolutions | DataStructuresAndAlgorithms/hashing/distinct-elements-in-window.cpp | /****
Given an array of integers and a number K. Find the count of distinct elements in every window of size K in the array.
Example 1:
Input:
N = 7, K = 4
A[] = {1,2,1,3,4,2,3}
Output: 3 4 4 3
Explanation: Window 1 of size k = 4 is
1 2 1 3. Number of distinct elements in
this window are 3.
Window 2 of size k = 4 is... | ALGO | 0.999538 | 5.859143 | {
"github_metadata": {
"branch": "master",
"commit_count": 420,
"repo_created_at": "2020-07-09T18:48: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": "f6df5f6c... |
1776085c-7181-4316-9412-79c26b11f9b5 | n0ming/algorithm-solutions | Programmers/게임맵최단거리.cpp | #include <vector>
#include <queue>
using namespace std;
//
int x_size, y_size;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
struct Node {
int x, y, cost;
Node(int _x, int _y, int _cost) : x(_x), y(_y), cost(_cost) {}
bool operator<(const Node& other) const {
return this->cost > oth... | ALGO | 0.999945 | 5.338675 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2024-04-11T02:31: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": "b90d4a48a2... |
120dbf0a-2329-46bb-b3fc-c143fe4dd21c | mannal2/Algorithm-Ex | Lecture12/16987.cpp | /*
1. 깨지지 않은 계란 선택후 부딪치게 한다.
2. 손에 집은 계란이 마지막 계란이 되면 깨진계란수를 구한다.
be는 전역변수로 두고 brokenEgg대신 내구<=0으로 체크하면 변수를 줄일수있음
*/
#include <bits/stdc++.h>
using namespace std;
int maxEgg = 0;
bool brokenEgg[10];
int board[10][2];
int n;
void ffff(int k, int be) {
if (k == n || be == n) {
maxEgg = max(maxEgg, be);
return;
}... | ALGO | 0.999943 | 3.933216 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-08-08T13:37: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": "0a383cada39... |
00af5a86-727d-4881-86b0-7862cd6487f5 | Phantom16361/MTRN3100_Micromouse_25T2 | Code/src/test_position_pid/main/main.ino | /**************************************************************
* File : main.ino
* Author : <NAME>
* Description : Runs a precomputed cubic trajectory over time
* and feeds it into a velocity PID loop. Intended
* to test trajectory smoothness and closed-loop
* ... | ALGO | 0.915465 | 6.204803 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2025-06-22T12:28: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": "c9fa5b1385c... |
bf150a9e-d932-4456-b6d4-3020e6da6b08 | AditiGawande4/DSA | 7. Subarrays - Challenges/faster_pair_sum.cpp | //Check if there exists two elements in an array such that their sum is equal to given k
// This solution is applicable only when the array is sorted. Time complexity is O(n)
// In the case of unsorted array, first we have to sort the array. Here we the sorting functions time complexity is higher then that will be time... | ALGO | 0.999788 | 5.773538 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-06-27T18:52:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a95c3af3e9e... |
64a014b1-ba96-4e9f-8cad-49703f80c084 | mihircjain/Algorithmic-Toolbox | Divide_and_Conquer/binarysearch.cpp | #include <iostream>
using namespace std;
int main(void)
{
int n, i, k;
//cout<<"Enter length of array: ";
cin>>n;
//cout<<"Enter value to be searched: ";
//cin>>key;
int ar[n];
//cout<<"Enter values of array: ";
for(i=0;i<n;i++)
cin>>ar[i];
cin>>k;
int keys[k];
for(i=0;i<... | ALGO | 0.999891 | 4.513156 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-08-31T15:09: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": "eb69cd7bd... |
c2155355-35ea-402f-8ea6-1517acce3299 | SyedT1/Cpp | Data Structures/Linked List/Doubly Linked List/L002.cpp | #include <iostream>
using namespace std;
class dl
{
public:
int value;
dl *prev = nullptr, *next = nullptr;
};
void ins(dl *&k, int m)
{
if (k == nullptr)
{
k = new dl{m, nullptr};
return;
}
else if (k->next == nullptr)
{
k->next = new dl{m, k, nullptr};
retur... | ALGO | 0.999771 | 4.346698 | {
"github_metadata": {
"branch": "master",
"commit_count": 542,
"repo_created_at": "2020-07-30T20:38:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16523812... |
3fbe986f-3380-4add-89ac-785b9de1e9d0 | ashwera/competitive-coding | increasingsequencewithfixedor.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void solve() {
int n;
cin >> n;
int dupe=n;
// the idea is simple
// just take the original number
// subtract powers of 2 for each set bit RTL
// then reverse the array
set<int>answer;
answer.insert(n);
int i=0... | ALGO | 0.999434 | 5.305309 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2025-03-15T09:08: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": "b407efe118d... |
f0ac51a3-7ed7-4bdf-942d-cd341463bb22 | Rajanala2003/Data-Structures-Lab | pg-25.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAX_VERTICES 1000
struct Edge {
int src, dest, weight;
};
struct Graph {
int V, E;
struct Edge* edge;
};
struct subset {
int parent;
int rank;
};
struct Graph* createGraph(int V, int E);
void addEdge(struct Graph* graph, int src, int dest, int ... | ALGO | 0.999992 | 5.512754 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-27T06:44: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": "1df19d7938b7... |
aee7063e-e82e-4e9c-b934-76bd372203cf | seungdo1234/CodingTestPractice | CodeUp/2차원 배열/진격 후 결과.cpp | #include <iostream>
// https://codeup.kr/problem.php?id=1509&rid=0
using namespace std;
int map[12][11] = { 0, };
int main() {
for (int i = 1; i <= 11; i++) { // 맵 입력
for (int j = 1; j <= 10; j++) {
cin >> map[i][j];
}
}
for (int i = 1; i <= 10; i++) {
if (map[11][i] == 1) { // 말 찾기
for (int j = 10... | ALGO | 0.99992 | 3.499226 | {
"github_metadata": {
"branch": "main",
"commit_count": 249,
"repo_created_at": "2023-10-20T06:43:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7cde201bfe... |
892befe6-f11f-4ae1-b3ca-caa28c33ac4d | Jeonin/Algorithm-study | 22-08-31/14499.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int answer;
int dx[4] = { 1, -1, 0, 0 };
int dy[4] = { 0, 0, 1, -1 };
void check_bfs(vector<vector<int>>& v)
{
queue<pair<int, int>> q;
for (int i = 0; i < v.size(); ++i)
{
for (int j = 0; j < v[i].size(); ++j)
... | ALGO | 0.999591 | 4.079007 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2022-08-14T05:39: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": "6aae19d6c... |
37813a0a-34ac-4ba9-865d-8a4d236a8d72 | aquacustom/the_lift | govstar_coding_assignment/lift.cpp | #include <vector>
std::vector<int> the_lift(
std::vector<std::vector<int>> &queues, int capacity) {
/* Note, I have slightly altered this function header to remove the const declaration for queues as I wanted to make changes to the struct without
deep copying for memory efficiency. It didn't seem as though I ... | ALGO | 0.996994 | 4.825314 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-02T23:58: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": "d2a5fa3fe16a... |
8cb518dd-f98d-4700-a511-590f0da9e534 | abraxaslee/ACM-ICPC | q10611.cpp | //q10611.cpp - 2011/11/13
//accepted at
//run time = 0.032
#include <stdio.h>
int ladies[50005];
int top;
int binarySearch(int search, int data[]){
int low = 0, high = top -1;
int mid;
while(low <= high){
mid = (low + high)/2;
if(data[mid] == search)
return mid;
else if(search > data[mid])
low = mi... | ALGO | 0.999966 | 3.440655 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-03-15T07:37:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5674c73709... |
2fc1cd0b-0643-44d7-9e57-d14fc90f31fd | theNded/Open3D | src/Cuda/Registration/FastGlobalRegistrationCudaHost.hpp | //
// Created by wei on 1/21/19.
//
#include <Cuda/Common/JacobianCuda.h>
#include <Cuda/Geometry/NNCuda.h>
#include "FastGlobalRegistrationCuda.h"
namespace open3d {
namespace cuda {
void FastGlobalRegistrationCuda::Create() {
if (device_ == nullptr) {
device_ = std::make_shared<FastGlobalRegistrationCud... | DATA | 0.952985 | 6.741154 | {
"github_metadata": {
"branch": "cuda",
"commit_count": 2859,
"repo_created_at": "2018-02-11T05:18:04.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "isl-org/Open3D",
"stars": 129,
"forks": 20,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_i... |
d67935b4-ce91-49a0-82f7-9effe25550b2 | kennyledet/Algorithm-Implementations | Hamming_Code/c++/lakshmanaram/HammingCode.cpp | #include<bits/stdc++.h>
using namespace std;
char XOR(char a,char b){
return (char)((int)'0'+(((int)a-(int)'0')^((int)b-(int)'0')));
}
string ComputeHamming(string a){
reverse(a.begin(),a.end());
string ans = "";
// ai represents the index of string, pow2 -> current power of 2
for(int i=1, ai=0, pow... | ALGO | 0.999998 | 4.817892 | {
"github_metadata": {
"branch": "master",
"commit_count": 1645,
"repo_created_at": "2013-12-24T00:39:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2195,
"forks": 530,
"issues": 9,
"pull_requests": 2
},
"file_meta": {
"content_id": "c5... |
bdae386a-7c47-476f-a24b-b5a03a5a81c9 | MuhammadAmitHasan/Algorithm | M20_Assignment3/Shortest_Distance.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 105;
long long d[N][N];
int n, m;
const long long INF = 1e18 + 5;
void dist_initialise()
{
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
if (i != j)
d[i][j] = INF;
}
}
}
int mai... | ALGO | 0.999987 | 4.34899 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-08-11T10:35: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": "962a9ea5be4b... |
611b0fcf-98b1-4299-af8e-cd4002e82c9a | blender/blender | source/blender/blenlib/intern/polyfill_2d_beautify.cc | /* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup bli
*
* This function is to improve the tessellation resulting from polyfill2d,
* creating optimal topology.
*
* The functionality here matches #BM_mesh_beautify_fill,
* but its far simpler to... | ALGO | 0.999573 | 6.710209 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0... |
71482ba6-5499-49ec-ac53-0ffadf11ec82 | Tunixer/DS_ZJU_MOOC | week4/is_same_BST.cpp | #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
typedef struct TreeNode *Tree;
struct TreeNode{
int v;
Tree Left,Right;
int flag;
};
Tree MakeTree(int N);
Tree Insert(Tree T,int V);
Tree NewNode(int V);
int check(Tree T,int V);
int Judge(Tree T,int N);
void ResetT(Tree T);
void FreeT... | ALGO | 0.999976 | 3.343958 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-05-16T02:35: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": "9a6f9d3e65... |
6fa965cc-29f3-48eb-b1ac-3a9598f02b91 | QbitQuantum/Basics | Исходники/physics_aware.cpp | void PushObject::updateModel(const Eigen::MatrixXd& traj, GRBQuadExpr& objective) {
VectorXd& times = m_problem->m_times;
MatrixXd perts_tk = getSinBasis(times/times.maxCoeff(), fmin(6, times.size()/2));
MatrixXd pinvperts_tk = perts_tk * (perts_tk.transpose() * perts_tk).inverse();
m_exactObjective = simulate... | ALGO | 0.981172 | 5.789069 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-03-06T07:05:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee6b5dbd6e8... |
cec0025b-c22b-429b-9d66-26a31df07fc5 | Akasakar/0O0O0o0 | codeforces.com/Educational Codeforces Round 74 (Rated for Div. 2)/1238F.cpp | /* *
* Author: Akasaka
* FileName: 1238F.cpp
* Created: 2019.11.06(UTC+0800) 19.28.12(星期三)
* */
#ifdef AKASAKA
#define DebugIN(x) freopen(x, "r", stdin)
#define DebugOUT(x) freopen(x, "w", stdout)
#define IN "./in.in"
#define OUT "./out.out"
#define CLOSE "CON" ///close in/out
#define STOP print... | ALGO | 0.99987 | 3.791517 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2019-09-09T02:17: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": "e20ee992... |
5398d2ca-ac74-4ae4-9b02-a7c81553b867 | tlsghwns3366/baekjoon | C++/1956/1956.cpp | #include <iostream>
using namespace std;
int ve[401][401];
int main()
{
int v, e;
cin >> v >> e;
fill(&ve[0][0], &ve[v][v + 1], 987654321);
for (int i = 0; i < e; i++)
{
int a, b, c;
cin >> a >> b >> c;
ve[a][b] = ve[a][b] > c ? c : ve[a][b];
}
for (int i = 1; i <= v;... | ALGO | 0.999957 | 3.860937 | {
"github_metadata": {
"branch": "master",
"commit_count": 602,
"repo_created_at": "2021-05-18T16:36:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa64e5cc... |
d79a93fc-aff3-4e22-a83e-b478bce713e9 | mpatt3970/Robotics | Sketches/line/line.ino | //pin definitions
int AnL = A0;
int AnR = A1;
int EnL = 3; //ENA
int ForL = 2; //IN1
int RevL = 4; //IN2
int EnR = 6; //ENB
int ForR = 7; //IN3
int RevR = 8; //IN4
int LedR = 5; //right light
int LedL = 12; //left light
//motor speed
int spd = 150;
//threshold for light
int THRES = 750;
//time for movning
int TIME = ... | ALGO | 0.998347 | 4.16371 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-07-25T03:07: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": "940ccc20ba... |
196fa8bd-c607-495b-8d10-3aa420df88de | algorithm-haneun-42/algorithm | 7th/jeakim/9465_sticker.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
void set_score(int sticker[2][100000], int board[2][100000], int n)
{
long score = 0;
board[0][0] = sticker[0][0];
board[1][0] = sticker[1][0];
board[0][1] = sticker[0][1] + board[1][0];
board[1][1] = sticker[1][1] + board[0][0];
fo... | ALGO | 0.999977 | 3.865465 | {
"github_metadata": {
"branch": "main",
"commit_count": 1067,
"repo_created_at": "2024-01-15T08:30:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "234392770d... |
18fbabb2-56e4-4b4e-87db-c245e20fe10b | MrMagoffin/AdventOfCode2022 | Day 11/monkey.cpp | #include <iostream>
#include <fstream>
#include <cstdlib>
#include <queue>
#include <vector>
#include <string>
unsigned long ipow(unsigned long base, unsigned long exp) {
unsigned long result = 1;
for (;;) {
if (exp & 1)
result *= base;
exp >>= 1;
if (!exp)
break;
base *= base;
}
re... | ALGO | 0.999344 | 5.759847 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-12-22T22:30: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": "0fc78da2a58... |
e7e00cbd-a089-40bd-a6cd-f145ed304bac | Yee172/Code_Library | HDU/HDU/Problem_1698.cpp | #include <bits/stdc++.h>
#pragma optimize("Ofast")
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; (i) < (n); (i)++)
#define _rep(i, n) for (int i = 1; (i) <= (n); (i)++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define square(x) ((x) * (x))
#ifdef Vince... | ALGO | 0.998773 | 3.614987 | {
"github_metadata": {
"branch": "master",
"commit_count": 574,
"repo_created_at": "2018-01-05T14:26: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": "1c2e44eb... |
744ad98e-8e01-40de-838f-32b92f70e9c1 | foorhad/Basic_Algorithm | week 2 Graph Algorithm/MOD 7 Bellmanford and Floyd Warshall algorithm/floyed_warshall.cpp | #include <bits/stdc++.h>
#define ll long long int
#define fast() ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
int main()
{
fast();
ll nodes, edge;
cin >> nodes >> edge;
ll adj_matrix[nodes][nodes];
for (int i = 0; i < nodes; i++)
{
for (int j = 0; j < n... | ALGO | 0.999987 | 3.996161 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-09-28T19:21: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": "e9d7281dc6b... |
7d90163d-408c-42b5-a8eb-8dc2183ae111 | ishandutta2007/codeforces-k | krk/normal/733/E.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
using namespace std;
typedef long long ll;
const int Maxn = 1000005;
int n;
char str[Maxn];
int acc[Maxn];
int tkl[Maxn], tkr[Maxn];
ll res[Maxn];
int main()
{
scanf("%d", &n);
scanf("%s", str + 1);
for (in... | ALGO | 0.999793 | 3.260538 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fedb13c9b58... |
6ef5e13a-4609-4922-bc94-cfa410c6c5a6 | kuldeepsingh2002/Project | project.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <unordered_set>
#include <algorithm>
using namespace std;
class SentimentAnalyzer {
public:
void loadPositiveWords(const string& filename) {
loadWords(filename, positiveWords_);
}
void loadNegativeWords(const str... | TOOL | 0.976084 | 6.303636 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-03T19:39: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": "9d5f20b60028... |
f540b31c-1809-4fe8-8807-0e6a428ea10c | LunaQu4kez/CodeRepo | CppEdition/23TreeChainPartiton/chain-partition.cpp | /*
题目描述
一棵包含 N 个结点的树(连通且无环),每个节点上包含一个数值,需要支持以下操作:
1 x y z,表示将树从 x 到 y 结点最短路径上所有节点的值都加上 z。
2 x y,表示求树从 x 到 y 结点最短路径上所有节点的值之和。
3 x z,表示将以 x 为根节点的子树内所有节点值都加上 z。
4 x 表示求以 x 为根节点的子树内所有节点值之和
输入格式
第一行包含 4 个正整数 N,M,R,P,分别表示树的结点个数、操作个数、根节点序号和取模数(即所有的输出结果均对此取模)。
接下来一行包含 N 个非负整数,分别依次表示各个节点上初始的数值。
接下来 N−1 行每行包含两个整数 x,y,表示点 x 和点 y... | ALGO | 0.999961 | 4.254989 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2023-06-03T01:56:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e2382038... |
a7df3805-3a2a-4cd2-ac9f-cc9a0706fd7d | adnanaziz/EPIJudge | epi_judge_cpp/matrix_connected_regions.cc | #include <deque>
#include <vector>
#include "test_framework/generic_test.h"
#include "test_framework/timed_executor.h"
using std::deque;
using std::vector;
void FlipColor(int x, int y, vector<deque<bool>>* image_ptr) {
// TODO - you fill in here.
return;
}
vector<vector<int>> FlipColorWrapper(TimedExecutor& execu... | TEST | 0.963219 | 6.412158 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2017-12-21T06:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2874,
"forks": 1899,
"issues": 47,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
352ae871-4c4b-408d-b7cd-57d80fc964db | sooyonee/CppStudy | Phase1/Week2/09_ArrayPassing.cpp | // Array is passed by reference!
// either int[] or int * (following are equiv.)
// int max(int numbers[], int size);
// int max(int *numbers, int size);
// int max(int number[50], int size); // 50 is actually ignored.
// unless declare as const variable, modifiable inside the function
// To write a function that op... | TOOL | 0.981372 | 4.618383 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-08-22T05:48: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": "8d124c028c4c... |
b5708b9a-2134-467b-9afd-29e5a5daf55d | JayH2018/learingforac | 第6章/例题6_1.cpp | /**
*/
#include<stdio.h>
#include<iostream>
#include<deque>
#include<string.h>
#include<stdlib.h>
#include<map>
using namespace std;
int tmp[201];
string s[21][21];
int time[21][21];
void init(){
memset(time,0,sizeof(time));
for(int i = 0;i < 21;i ++){
for(int j = 0;j < 21;j ++){
s[i][... | ALGO | 0.996006 | 3.149572 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2019-06-29T07:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8e3cbada... |
eae49b03-952a-4ce6-b7dc-f078c3f040cf | Keshav1707/Submissions | B_Farmer_John_s_Card_Game.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define di(x) \
ll x; \
cin >> x
#define vecll vector<ll>
#define sz(x) ((int)(x).size())
#define pb push_back
#define po pop_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define endl "\n"... | ALGO | 0.99935 | 3.922944 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-04-06T11:54: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": "53c39d3eec... |
f956f965-71d4-4892-9591-c548343d7c7a | sharc-lab/Edge-MoE | src/attention.cpp | #include "../include/attention.hpp"
#include "../include/linear.hpp"
#include <hls_math.h>
#include <hls_stream.h>
static constexpr unsigned int DIM_PER_HEAD = FEATURE_DIM / NUM_HEADS;
fm_t attn_scale;
void read_x(hls::stream<fm_block_t>& x_stream, patch_blocks_t x)
{
#pragma HLS inline off
FOR_EACH(patch, ... | TOOL | 0.993258 | 5.038024 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-05-30T01:53:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 124,
"forks": 16,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "52f99466f7... |
7f28f264-53d8-43ac-98d0-da98efe1d1bf | Himangi-Malik/Main-Quest | array.cpp | #include<iostream>
using namespace std;
int getmax(int arr[], int size)
{
int max = arr[0];
for(int i=0; i<size; i++)
{
if (arr[i]>max)
max = arr[i];
}
return max;
}
int getmin(int arr[], int size)
{
int min = arr[0];
for(int i=0; i<size; i++)
{
if (arr[i]<min)
min = arr[i];... | ALGO | 0.999927 | 3.527292 | {
"github_metadata": {
"branch": "main",
"commit_count": 174,
"repo_created_at": "2023-07-11T07:28: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": "c42dac74e7... |
b6c2597d-91b4-4993-9279-0876b88112f1 | yancouto/competitive-programming | ojs/cc/prgcup04.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }
const int N = 21... | ALGO | 0.999937 | 3.963509 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2016-08-26T11:17:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b4cd670... |
33c0b6cd-e9e4-4ba3-8828-5792fbe3499a | sulav063/4th-Sem-23081003 | Lab Reports TOC/Lab4567/lab4nfa.cpp | #include <iostream>
#include <string>
using namespace std;
// Function to simulate the NFA
bool isAccepted(string str) {
int state = 0; // Start at q0
// Traverse the string
for (int i = 0; i < str.length(); i++) {
char input = str[i];
switch (state) {
case 0: // State q0
... | ALGO | 0.999963 | 6.585869 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-04T11:49:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "394fd3e4fa01... |
7a3d04cc-2a2b-4280-81a2-2a32e3959f39 | milkisZero/algorithm_PS | 백준/Gold/13398. 연속합 2/연속합 2.cc | #include <bits/stdc++.h>
#define INF INT_MAX
#define LLINF LLONG_MAX
#define fastio ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL)
#define endl '\n'
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned long long;
ll dp[100005][2];
int main() {
... | ALGO | 0.999997 | 3.990426 | {
"github_metadata": {
"branch": "main",
"commit_count": 489,
"repo_created_at": "2023-07-17T01:36: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": "8e834ff631... |
87169d60-dbf1-4ca8-91c0-edca15762276 | os-fpga/Backend | include/packer_fix/nl_Par.cpp | #include "nl_Par.h"
#include "globals.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include <fstream>
#include <thread>
namespace nlp {
using namespace pinc;
using std::string;
using std::vector;
using std::cout;
using std::cerr;
using std::endl;
uint Par::countMolecules(t... | ALGO | 0.988312 | 4.089316 | {
"github_metadata": {
"branch": "main",
"commit_count": 1507,
"repo_created_at": "2022-05-27T16:07:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "bf6e2dcbad... |
4e3e9a43-2e9c-45a1-a6e1-d713241e3d7d | Congee/leetcode | src/41.first-missing-positive.cpp | #ifdef __LOCAL__
#include <leetcode.h>
#endif
class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
// [0,2,4,6,-1]
// [2,4,6,0,-1]
// [3,1,5,0,-1]
return cycle_sort(nums);
return index_as_key(nums);
}
int index_as_key(vector<int>& nums) {
int n = nums.size(), min = INT... | ALGO | 0.999941 | 5.133546 | {
"github_metadata": {
"branch": "master",
"commit_count": 275,
"repo_created_at": "2020-02-13T18:05:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85aa25d0... |
bdc6d865-4f8c-47a7-a5d4-df0e2d7e90ea | abdallamaher/competitive_programming | Adhoc_Problems/A2OJ/A2OJ_C_Ladder/C. Ladder.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1e5 + 5;
int n, m, r, l, down, cnt;
int ar[N], b[N], a[N];
int main() {
cin.sync_with_stdio(false);
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> ar[i];
}
for (int i = 0; i < n; i++) {
if (down && ar[i] < ar[i + 1]) {
a... | ALGO | 0.999999 | 4.675937 | {
"github_metadata": {
"branch": "master",
"commit_count": 1094,
"repo_created_at": "2020-01-09T17:46:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6eb6072... |
238928ba-20d5-428e-bc25-324928b46008 | pankhuri-52/Data-Structures-Codes | BST/countNodes_inRange.cpp |
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node* right;
Node* left;
Node(int x){
data = x;
right = NULL;
left = NULL;
}
};
Node *insert(Node *root,int data)
{
if(root==NULL)
root=new Node(data);
else if(data<root->data)
root... | ALGO | 0.999939 | 4.975018 | {
"github_metadata": {
"branch": "master",
"commit_count": 434,
"repo_created_at": "2019-10-22T08:29: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": "9dac21c3... |
7f0caa5e-22a1-42c1-a437-8e180bd054b2 | peter-iakovlev/Telegram | submodules/libtgvoip/webrtc_dsp/webrtc/common_audio/sparse_fir_filter.cc | /*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | TOOL | 0.926904 | 7.381546 | {
"github_metadata": {
"branch": "public",
"commit_count": 11,
"repo_created_at": "2014-02-26T11:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3291,
"forks": 863,
"issues": 278,
"pull_requests": 12
},
"file_meta": {
"content_id": "a... |
5ef013b8-34f7-453e-92b1-e1c5583f14db | sofiamonty/Lab-2 | task7.cpp | #include <iostream> //Header inclusion
using namespace std;
int main(){
//Establishing variables and pointer variables
int num;
int* p1 = #
int* p2 = p1;
//Asking for user input
cout<<"Please, choose a number: ";
cin>>num;
//Explaining what is happening
cout<<"The first pointer p1... | ALGO | 0.980606 | 4.34552 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-04-10T10:07: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": "9c0e15766208... |
61d53bd1-c919-4e90-acff-68262ae022e0 | Hyeonjun0527/codeSoloPractice2024 | graphTheory/4.cpp | #include <iostream>
#include <vector>
#include <tuple>
#include <queue>
#include <algorithm> // for max function
using namespace std;
int main() {
int v;
cin >> v;
// 그래프를 담을 구조: 인접 리스트, 진입 차수, 작업 시간을 하나의 튜플로 묶음
vector<tuple<vector<int>, int, int>> graph(v + 1);
// 그래프 정보 입력
for (int i = 1; ... | ALGO | 0.999962 | 5.635375 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-09-14T12:59: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": "18366cd0eb3... |
fb99e7cc-a5b0-475d-bff8-450b7d11fea1 | 1rre/CircuitSim | src/Matrix.hpp | #include <iostream>
#include <armadillo>
#include <cassert>
#include <cmath>
#include "component.hpp"
using namespace std;
using namespace arma;
/*
This function will construct the I and E matrices simultaneously (spelling? haha) by updating a single matrix in the form:
|I1| |Z0|
|I2| |Z1|
|I3| |Z2|
===
|E0... | ALGO | 0.978956 | 5.122428 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2020-07-01T19:14:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb5f9fbb... |
a19beb90-dd37-46f1-ac2e-bae0e29ad264 | pravin435916/Cpp-DSA | Trees/LargestBinaryTree.cpp | class Solution{
private:
vector<int> largestBST(Node* root) {
if(!root) {
// size true/false minval , maxval
return {0,1,INT_MAX,INT_MIN};
}
vector<int> leftRes =largestBST(root->left);
vector<int> RightRes =largestBST(root->right);
if(lef... | ALGO | 0.999913 | 5.954784 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2024-01-06T15:18:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d72e374a91... |
e9ecd507-eacf-4915-91eb-2b195a8eb41d | Masttf/XCPC | group/2025-2-17/c.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
#define dbg(x...) \
do { \
cout << #x << " -> "; \
err(x); \
} while (0)
void err() {
cout << endl << endl;
}
template<class T, class... Ts>
void err(T arg, Ts ... args) {
cout << fixed << setprecision(10) << arg << ' ';
err(args.... | ALGO | 0.999971 | 3.883049 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2025-02-09T13:42:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "224676373... |
66ab90a4-c438-4c5f-9ebe-11174f95c0c4 | BNAplatform-organization/PAGANI-toolkit | src/BNAPlatform-win64-cuda7.0-20151118/src/BC/BC_CPU/BC_CPU/BC_CPU_main.cpp | #include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <fstream>
#include <iostream>
#include <ctime>
#include "BC_CPU.h"
using namespace std;
void read_csr(char * fileCSR, int &numVertices, int &numEdges, int *&row, int *&col)
{
string csrfilename = string(fileCSR);
ifstream fCSR(csrf... | ALGO | 0.998212 | 3.570517 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2015-12-29T05:44:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "84e1d25439... |
393f25a7-a7b7-4f43-a527-1e3fd193a131 | NakulChauhan1/Data-Structure | Other_Platform_Problems/Checking_Brackets_in_Code.cpp | #include<iostream>
#include<stack>
class xyz
{
public:
int ii;
bool j;
};
using namespace std;
int check(char , char);
xyz isBalanced(string a, stack <char> &s)
{
xyz X;
int i=0;
while(a[i]!=NULL)
{
if(a[i]=='{' or a[i]=='(' or a[i]=='[')
{
s.push(a[i]);
}
... | ALGO | 0.999109 | 3.607158 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-03-25T06:07:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1dc9bb30b... |
58a4556d-ec15-48e8-a4b7-283567dd9f6b | Martins3/ACM | leetcode/1/127.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <stack>
#include <sstream>
#include <climits>
#include <deque>
#include <set>
#include <utility>
#include <queue>
#include <map>
#include <cstring>
#include <algorithm>
#include <iterator>
#include <string>
#include <cassert>
using name... | ALGO | 0.999988 | 4.433914 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2018-03-05T11:57:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "300158cbb... |
6c6ed5df-6ae3-471e-8ca5-1b028630877d | mamadaliev/high-performance-computing | 07/cramer3_openmp.cpp | #include <iostream>
#include <vector>
#include "omp.h"
using namespace std;
#define N 4
struct Params {
vector<vector<int>> matrix;
int index;
double result;
};
double determinant_3x3(vector<vector<int>> m) {
return m[0][0] * m[1][1] * m[2][2] - m[0][0] * m[2][1] * m[1][2] - m[0][1] * m[1][0] * m[2]... | ALGO | 0.999996 | 4.844817 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2021-09-04T17:01:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7740f3a561c... |
6eaece13-95bd-48ef-9a18-0c395e2c3a72 | megargayu/USACO-Solutions | codeforces/problems/littlegirlmaxsum/littlegirlmaxsum.cpp | // https://codeforces.com/contest/276/problem/C
#include <bits/stdc++.h>
using namespace std;
#define MAX_N 2e5
#define ll long long
vector<int> a(MAX_N);
vector<int> mult(MAX_N + 1);
int main()
{
int n, q;
cin >> n >> q;
for (int i = 0; i < n; ++i)
cin >> a[i];
int l, r;
for (int i = 0; i < q; ++i)... | ALGO | 0.999897 | 4.408502 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2022-04-14T06:22:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbf394d7a1... |
bbdf457b-0cfa-4133-9808-d4f138bcad4c | Rahul-r-a/Training_Project | Container_array/main.cpp | #include <iostream>
#include<array>
using namespace std;
int main()
{
// std::array<int,5>arr; // array declaration (array=classname, int = datatype, 5= number of elements, arr=array name)
std::array<int,5>arr = {1,2,3}; //array initialisation
std::array<int,5>a = {9,8,7,6,5};
cout <<... | TOOL | 0.974772 | 4.186096 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-10-03T11:14: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": "07546068178... |
a2128a20-bc89-4ea8-a302-cdf514eb047e | nicro31/CG-Backmapping-Mobility | LOE-CTP-FRAG/src/Graph.h | #ifndef GRAPH_H_INCLUDED
#define GRAPH_H_INCLUDED
#include "System.h"
#include "Johnson.h"
#include "QC_Tools/src/calculateTI.hpp"
#ifdef _WIN32 || _WIN64
#include <direct.h>
#else
#include <sys/stat.h>
#endif // linux
enum HopType { intra , inter, dopantIntra, dopantInter, level };
enum RateType { maPheno, maTransfe... | ALGO | 0.992646 | 4.310397 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-02-14T10:03: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": "1310b07221... |
e70fe225-a4eb-41ea-bdd2-13571309cf28 | Ronnoc/Training | Poj/3960.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <sstream>
#inc... | ALGO | 0.999948 | 3.623684 | {
"github_metadata": {
"branch": "master",
"commit_count": 445,
"repo_created_at": "2013-10-11T04:01:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f69b034... |
7e291fa9-776d-4efd-a780-78067a43b1a3 | keshav-goswami/DSA | GRAPHS/Articulation_points.cpp | // Pre-requisites BRIDGES IN GRAPH
#include<bits/stdc++.h>
using namespace std;
map<int,bool> mp;
void dfs(int node,int parent,vector<int> adj[],vector<int> &vis,vector<int> &tin,vector<int> &lw,int &timer){
vis[node] = 1;
lw[node] = tin[node] = timer++;
int child = 0;
for(auto a:adj[node]){
//... | ALGO | 0.999812 | 4.311845 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2022-01-11T17:55: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": "707d242b7... |
a7511e8d-66f3-4099-bf58-56bb84220d29 | olethrosdc/beliefbox | src/statistics/SparseGaussianProcess.cc | /* -*- Mode: C++; -*- */
// copyright (c) 2013 by <NAME> <<EMAIL>>
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the term... | ALGO | 0.90977 | 6.484672 | {
"github_metadata": {
"branch": "master",
"commit_count": 1611,
"repo_created_at": "2015-03-20T15:15:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b85af7... |
27147c56-35e4-47da-8ea9-cf0c7665c98e | Dacian22/UBB-CS | Year 1/Semester 2/DSA/Lab2/SortedBag/SortedBag.cpp | #include "SortedBag.h"
#include "SortedBagIterator.h"
#include <iostream>
using namespace std;
//Best case: Θ(1)
//Worst case: Θ(1)
//Average case: Θ(1)
//Total: Θ(1)
SortedBag::SortedBag(Relation r) {
// Constructor that initializes the SortedBag with the given relation, sets the element number to 0, and sets the... | ALGO | 0.999823 | 5.11361 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-08-20T12:09:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89143b78282... |
8afd56fd-5a93-47a3-b1d2-1d2a2b08d044 | VidishaYagnick/Data-Structure | DSA Questions/Binary Tree Questions/LevelOrderBinaryTree.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
class Node
{
public:
int data;
Node* left;
Node* right;
Node(int data)
{
this->data = data;
this->right = nullptr;
this->left = nullptr;
}
};
vector <vector... | ALGO | 0.999993 | 6.043449 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-09-07T15:56: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": "1f8baababf... |
c482b8e2-ecae-4b28-8e4c-8dce3200946b | elemental/Elemental | examples/lapack_like/BusingerGolub.cpp | /*
Copyright (c) 2009-2016, <NAME>
All rights reserved.
This file is part of Elemental and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
*/
#include <El.hpp>
int
main( int argc, char* argv[] )
{
El:... | ALGO | 0.914739 | 5.694034 | {
"github_metadata": {
"branch": "master",
"commit_count": 3773,
"repo_created_at": "2012-05-06T08:37:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 513,
"forks": 110,
"issues": 38,
"pull_requests": 7
},
"file_meta": {
"content_id": "800... |
f6c5cf30-a384-4802-a394-ebd0fa701ccb | NakonechnyiMykhail/cs50 | 2_cs50_groups/cs2/lesson9/bin.cpp | #include <iostream>
using namespace std;
void binarySearch(int arr[], int left, int right, int x);
int main(void)
{
int list[] = {1, 2, 5, 7, 9, 13, 14, 17, 19, 21, 25, 29, 36, 45, 53, 55, 78};
int n = sizeof(list)/sizeof(list[0]);
int x = 0;
cin >> x;
cout << "We have " << n << " elements. We a... | ALGO | 0.999063 | 4.683993 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2018-10-28T09:54: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": "b57ba9342... |
5d6c1a87-e161-4c92-9674-592c0338b3c8 | furu0529/reconpolarcpp | simulationfit/func.hpp | #ifndef _FUNC_HPP_
#define _FUNC_HPP_
#include<complex>
#include<iostream>
#include<fstream>
#include<string>
#include<math.h>
#include <random>
#include<fstream>
#include "fftw3.h"
#include "global.hpp"
#include "linearinterp.hpp"
#include <boost/math/special_functions/spherical_harmonic.hpp>
#include "praxis.hpp"
us... | ALGO | 0.941094 | 3.211152 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-10-27T11:16: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": "32bb232b81d3... |
6394f35f-7ef7-44e3-a050-dc312a358471 | pich12/TP_MODL_TP2 | tp/src/nuage.hpp | // Gardien //---------------------------------------------------------------------------------------
#ifndef _NUAGE_HPP_
#define _NUAGE_HPP_
// Entetes //---------------------------------------------------------------------------------------
#include <vector>
#include <cartesien.hpp>
#include <polaire.hpp>
// Declara... | ALGO | 0.966466 | 5.255353 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-10-12T12:06: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": "4869884489... |
c062eeeb-4698-4559-bfc3-16c2522f8787 | ale-cci/Neural-Evolution | extmath.cpp | #include "extmath.h"
#include <cmath>
#include <algorithm>
#include <cassert>
double delta(double A, double B, double C) {
double solution = B*B - 4*A*C;
if (solution < 0)
return -1;
return sqrt(solution);
}
double* deg2equation(double A, double B, double C, double * solutions, uint8_t* solution_... | ALGO | 0.999296 | 4.840446 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-06-30T23:34: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": "884490085... |
2a976f03-047a-40eb-9efc-33df67fee005 | indrani23/Leetcode | Given a linked list of 0s, 1s and 2s, sort it. - GFG/given-a-linked-list-of-0s-1s-and-2s-sort-it..cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
/* Link list Node */
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
struct Node *start = NULL;
// } Driver Code Ends
/*
Node is defined as
struct Node {
int data;
... | ALGO | 0.999953 | 5.49122 | {
"github_metadata": {
"branch": "main",
"commit_count": 516,
"repo_created_at": "2022-03-27T17:48:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "389112f2e6... |
dac6edb0-2b70-44fe-8340-e4e227fd6782 | Swarnav-Kumar/Design-and-Analysis-of-Algorithms-Lab-5th-Sem | LAB-1/Question-2.cpp | /*Write a program to store random numbers into an array of n integers, where the
array must contains some duplicates. Do the following:
a) Find out the total number of duplicate elements.
b) Find out the most repeating element in the array.*/
#include <iostream>
#include<time.h>
#include <cstdlib>
using namespace st... | ALGO | 0.999387 | 3.573546 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-09-08T13:45:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac1c1044ed6... |
af7cf4d9-fac1-4fea-b45f-a708107be4bc | vsriv9394/Mesh_Conversion_Tool | SU2toCASv3.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
struct f3{
int node3;
int cell_l;
int cell_r;
f3* next;
};
struct f2{
int node2;
int size;
f3* ptr;
f2* next;
};
struct f1{
int size;
f2* ptr;
};
void sort4 (int* array){
int dummy;
if(array[0]... | ALGO | 0.995908 | 3.312392 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-09-08T07:06:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d7d4cc13... |
d34f4a0e-f1da-4a9d-ae95-cbf6c2ec9e95 | MAZHARMIK/Interview_DS_Algo | Arrays/Product of the Last K Numbers.cpp | /* Scroll below to see JAVA code also */
/*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=Jvu3hd8A2rg
Company Tags : Will update soon
Leetcode Link : https://leetcode.com/problems/product-of-the-last-k-numbers
*/
/****************************************... | ALGO | 0.999635 | 5.464566 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
5649d12c-ad02-4d83-be89-89a2fcb55a2d | Tarunagg1/competitive_programing | gfg-problemsoftheday/Special Palindrome Substrings.cpp | // Special Palindrome Substrings
// MediumAccuracy: 78.74%Submissions: 2K+Points: 4
// Participate in Monthly Hiring Challenge conducted by GeeksforGeeks !!
// Given two strings s1 and s2, The task is to convert s1 into a palindrome such that s1 contain s2 as a substring in a minimum number of operation.
// In a singl... | ALGO | 0.999966 | 5.696067 | {
"github_metadata": {
"branch": "master",
"commit_count": 1108,
"repo_created_at": "2021-02-09T15:02:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "188a451... |
ba63ee62-e581-44bc-a6ee-4e06a63e5766 | cdh-hub/leetcode | 15.三数之和.cpp | /*
* @lc app=leetcode.cn id=15 lang=cpp
*
* [15] 三数之和
*/
// @lc code=start
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> ans;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size()-2; i++) {
int j = i+1, k = nums.size... | ALGO | 0.999932 | 6.512253 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2023-01-08T02:17: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": "02fd1e6cd... |
494f82c7-5957-474e-a7ee-9643d81a43f0 | ArtysticSoul/Advanced-Search-Engine | dict.cpp | // Do NOT add any other includes
#include "dict.h"
Dict::Dict(){
// Implement your function here
root=new DictNode('@');
}
DictNode* Burn(DictNode* node){
for(int i=0 ; i<54 ; i++){
if((node->bacha[i])){
node->bacha[i]=Burn(node->bacha[i]);
}
}
delete node;
return N... | ALGO | 0.901061 | 3.449014 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-11-03T18:02: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": "33a05a6114b4... |
1b46ae8a-ebda-4405-93aa-9ac36f8f8b75 | kalashnikov/algoPrac | misc/compare.cpp |
//
// Cracking Coding Interview
// Problem 17.4
//
#include <cstdio>
#include <climits>
using namespace std;
//
// Use XOR for Flip
//
int flip(int bit){
return (1^bit);
}
//
// a>>31 => Get Flag for Minus
// Flip to get 1 for Positive
//
int sign(int a){
return flip((a>>31) & 0x1);
}
//
// Will overfl... | ALGO | 0.999927 | 4.101308 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2013-06-11T13:47: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": "080f1a8d... |
25e80afe-088f-480b-be1c-2d023638bc81 | CrossLuna/hackerrank | Flipping_the_Matrix/main.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
LL maxsub(vector<vector<int>>& mat, int row, int col, int len) {
if(len == 1)
return mat[row][col];
else if(len == 2) {
//return mat[row][col] + mat[row+1][c... | ALGO | 0.99997 | 3.692971 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-12-20T05:44: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": "4d7aed17f5... |
1c4b0f9f-e494-4b87-9658-ea49107421be | Mumbaikar007/Code | HackerRank/ClimbingLeaderboard.cpp | # include <iostream>
# include <vector>
using namespace std;
struct RankScore
{
long int score;
long int rank;
};
int main(int argc, char const *argv[])
{
int n;
cin >> n;
int rankNow = 0, previous = -1;
vector <RankScore> vec(n + 1);
for ( int i = 0 ; i < n ; i ++){
cin >> vec[i].score;
if (previous ... | ALGO | 0.999988 | 3.729306 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2017-09-24T06:10:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37d79e126... |
da632e3e-fb15-45ec-8292-1de7ec442775 | Omega1001/HTW | Prog4_2/src/Prog4_2.cpp | /*
* Prog4_2.cpp
*
* Created on: 03.06.2019
* Author: jannik
*/
#include <strlib.hpp>
#include <iostream>
#include <iomanip>
#include <ios>
#include <stdlib.h>
#include <fstream>
#define OPTION_WC 1
#define OPTION_EQW 2
using namespace std;
void launchWC() {
char * buffer = (char *) malloc(sizeof (char) ... | ALGO | 0.954967 | 4.040443 | {
"github_metadata": {
"branch": "pi17w",
"commit_count": 212,
"repo_created_at": "2017-11-30T09:23:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 18
},
"file_meta": {
"content_id": "65ce068c... |
fb08a057-3993-4e09-9b51-1e7c7e70f887 | 99hgz/Algorithms | Problems/Vjudge/contest201672D.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
int tot, Head[5010], Next[100010], From[100010], To[100010], Val[100010];
int FLOW, Q[50100], pre[5010], n, m, S, T;
bool inq[5010];
double Cost[100010], dis[100010];
double sqr(doub... | ALGO | 0.999894 | 3.744084 | {
"github_metadata": {
"branch": "master",
"commit_count": 190,
"repo_created_at": "2017-04-21T11:47:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ed3174b... |
1eab4827-ad0d-4f90-b681-0842359c94ec | krystianpetek/LearningCpp | Pasja informatyki - Mirosław Zelent/12_search_max_number.cpp | #include <iostream>
#include <cmath>
void searching_max_number()
{
std::cout << "Searching for the maximum number in the array" << std::endl;
int *array = new int[3];
array[0] = 5;
array[1] = 15;
array[2] = 10;
int max = 0;
for (int i = 0; i < 3; i++)
{
if (array[i] > max)
... | ALGO | 0.999573 | 3.746518 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-03-30T18:54: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": "bf68358621b... |
6f4d82bc-5e5a-45fd-bcfd-2ba4bf116d59 | ishandutta2007/codeforces-u | um_nik/normal/1090/L.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
... | ALGO | 0.999538 | 3.13651 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "04f0de19459f... |
c80c8c7b-3118-48d9-8311-2e8b59c34392 | kalpitborkar/LeetCode | 199-binary-tree-right-side-view/199-binary-tree-right-side-view.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999593 | 6.153912 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2022-06-27T03:49: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": "0f03793dce9... |
291c0946-28da-402f-8ab1-34660eb77d47 | itachi1101/Leetcode-_Solutions | TreeQuestion/Medium/maxium_level_sum.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 5.236727 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2020-09-27T12:31: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": "f74549819... |
21ca05be-76fe-4fbf-b264-53a327a9349a | rubak/spatstat.revdep | ttbary/src/multimatching.h | #ifndef MATCHING_H
#define MATCHING_H
#include <Rcpp.h>
using namespace Rcpp;
class MultiMatching {
int n, k; // no. of points (in all patterns the same, including virtual points), no. of patterns
NumericVector zetax, zetay;
LogicalVector isvirtual;
int nvirtual; // order!
const NumericMatrix ppmatx, ppm... | ALGO | 0.996936 | 4.1683 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2020-12-21T01:27:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ac41aa4e0f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.