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 |
|---|---|---|---|---|---|---|---|
944c6f17-bf62-42d7-b9e2-30de687a1e1f | saroshmorani/PF-LAB-TASKS | pf lab task 7/q3.cpp | #include <stdio.h>
int main() {
int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; // Predefined array
int size = sizeof(arr) / sizeof(arr[0]); // Calculate the size of the array
int pairSum[size / 2]; // Array to store the sums of pairs
// Loop through the array with a step of 2 to sum adjacent ele... | ALGO | 0.997416 | 5.381942 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-09-28T17:39: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": "a9011461363... |
d3d00835-c3b3-48ea-bb79-76217ab5990e | archembaud/GAGPU | cpu_main.cpp | /*
GPU Accelerated Genetic Algorithm
Data
*/
#include <stdio.h>
#include "config.h"
int main() {
// Allocate memory
Allocate_Memory();
// Setup the random number generator on the GPU
SetupRfGPUCall();
// Start our testing
for (int test = 0; test < NO_TESTS; test++) {
printf("*** Ensemble Average %d of ... | ALGO | 0.998914 | 5.277204 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-09-11T04:42:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c62f86b2c... |
26b2c1ad-91b6-4a13-8ee6-71c6514c34c9 | longjianjiang/LeetOJ | cpp/438_find_all_anagrams_in_a_string.cpp | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
using namespace std;
// s: "abab" p: "ab"
// s: "cbaebabacd" p: "abc"
// 1> 遍历s,两层循环,每次遍历p的长度;
// 2> 使用滑动窗口,l和r,cnt标记p的长度,当匹配到一个--cnt,当匹配完成后,尝试++cnt;... | ALGO | 0.999754 | 5.692224 | {
"github_metadata": {
"branch": "master",
"commit_count": 706,
"repo_created_at": "2018-04-12T14:07:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96732b36... |
bc2114c8-dd74-4611-8806-f1a1e8936457 | cunbidun/competitive_programming | archive/Codeforces - Codeforces Round #709 (Div. 2, based on Technocup 2021 Final Round)/D. Playlist/solution.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int cur = n;
if (__gcd(a[n - 1], a[0]) != 1) {
... | ALGO | 0.999992 | 3.658656 | {
"github_metadata": {
"branch": "master",
"commit_count": 189,
"repo_created_at": "2020-07-14T13:10: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": "2d5b8df2... |
14e4555c-d54b-4e6c-8a8b-26f417c85f85 | AmityWilder/Sandbox | ArtisticRenderer0/ArtisticRenderer0/Main.cpp | #include <Windows.h>
#include <iostream>
#include <cmath>
#include <thread>
#include <vector>
int Clamp(const int value, const int min, const int max)
{
if (value < min) return min;
else if (value > max) return max;
else return value;
}
struct Coord
{
double x, y;
operator POINT() const { return { (LONG)x, (LONG... | ALGO | 0.94443 | 5.079674 | {
"github_metadata": {
"branch": "main",
"commit_count": 425,
"repo_created_at": "2020-12-14T03:29:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "16e59d2496... |
dcbb5c1e-bef5-43e9-8527-617c22e2c168 | WebKit/WebKit-http | Source/ThirdParty/libwebrtc/Source/webrtc/modules/audio_processing/agc/loudness_histogram.cc | /*
* Copyright (c) 2012 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.950991 | 7.194905 | {
"github_metadata": {
"branch": "master",
"commit_count": 231005,
"repo_created_at": "2011-01-11T13:50:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4992,
"forks": 1983,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
785554a9-5986-4785-9b0e-567dd4ebfb44 | Jdinis8/Electric-Hyperboloidal | main/RNVacuumPhi.cpp | #include "TimeEvolution.h"
#include <matplotlibcpp.h>
//For Aconf
void Yaconf(quad* data, quad x, int sizex, quad& result, quad* aconf, BackgroundParameters<quad> BP){
#ifdef DEBUG
printf("[%s]\n", __PRETTY_FUNCTION__);
#endif
quad Y = data[0];
quad Ccmc = BP.Ccmc;
quad R0 = BP.R0;
... | ALGO | 0.988319 | 3.835334 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-09-03T22:55: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": "23e54cd0388... |
2928144a-cad8-4715-afa8-25104044e40f | EDkinGG/Object-Oriented-Programming | 2018-1c.cpp | #include<bits/stdc++.h>
using namespace std;
class DB;
class DM
{
double meter;
double cm;
public:
void setData( double a = 0 , double b = 0 )
{
meter = a;
cm = b;
}
void display()
{
cout<<"the distance is \n";
cout<<"meter = "<<meter<<" centimeter = "<<cm<<endl;
}
friend DB add( DM ,DB);
};
class D... | TOOL | 0.964085 | 3.542691 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-03-14T17:44: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": "44318e950e... |
85fa4cd7-e82b-4440-8f04-44da1eb0dcdf | chdb-io/chdb | src/Storages/MergeTree/Compaction/MergePredicates/DistributedMergePredicate.cpp | #include <Storages/MergeTree/Compaction/MergePredicates/DistributedMergePredicate.h>
#include <Common/ZooKeeper/ZooKeeper.h>
#include <IO/ReadHelpers.h>
#include <base/defines.h>
#include <filesystem>
namespace fs = std::filesystem;
namespace DB
{
CommittingBlocks getCommittingBlocks(zkutil::ZooKeeperPtr & zookeep... | ALGO | 0.993515 | 6.507557 | {
"github_metadata": {
"branch": "main",
"commit_count": 1532,
"repo_created_at": "2023-02-25T13:35:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2418,
"forks": 84,
"issues": 42,
"pull_requests": 1
},
"file_meta": {
"content_id": "5aeeb... |
719ffe86-dbe4-4ad6-93e2-c76df3b5e47b | vjumpkung/01204214-Problem-Solving | week05/mid59_jumpgame.cpp | #include <iostream>
#include <queue>
#include <utility>
using namespace std;
int coord[2][4] = {{1, -1, 0, 0}, {0, 0, 1, -1}};
int mat[21][21];
int visited[21][21];
int n, power;
int main()
{
cin >> n >> power;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
cin >>... | ALGO | 0.999968 | 4.626351 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-11-30T16:14: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": "751ebd25fa... |
0ac00813-db63-4f78-bbe8-aa62a7a23231 | oriolvelasco/Algorismia | 2. Backtracking-Consolidation/ReisPacifics.cc | #include <iostream>
#include <vector>
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
int n, r;
VVI tauler;
void f(int i, int j, int reis) {
if(i == n and reis == r) {
for (int k = 0; k < n; ++k) {
for (int l = 0; l < n; ++l) {
if(tauler[k][l] == 2) cout <... | ALGO | 0.998333 | 4.129532 | {
"github_metadata": {
"branch": "master",
"commit_count": 357,
"repo_created_at": "2015-09-23T23:27:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c03bff7f... |
48f77e9f-0da4-4e6a-b0ed-fffd500215a7 | gwkdgwkd/leetcode | c_c++/array/binarysearch/基础/2529.正整数和负整数的最大计数.cpp | /*
给一个按非递减顺序排列的数组nums,返回正整数数目和负整数数目中的最大值。
换句话讲,如果nums中正整数的数目是pos,而负整数的数目是neg,返回pos和neg二者中的最大值。
注意:0既不是正整数也不是负整数。
示例1:
输入:nums = [-2,-1,-1,1,2,3]
输出:3
解释:共有3个正整数和3个负整数。计数得到的最大值是3。
示例2:
输入:nums = [-3,-2,-1,0,0,1,2]
输出:3
解释:共有2个正整数和3个负整数。计数得到的最大值是3。
示例3:
输入:nums = [5,20,66,1314]
输出:4
解释:共有4个正整数和0个负整数。计数得到的最大值是4。
提示:
... | ALGO | 0.999966 | 5.12907 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2019-11-27T11:32: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": "f462a0a2... |
06140eb8-3a65-4c12-a313-734b915ab92e | MichiganTechRoboticsLab/SLAM-Scan-Matching | ICP/libicp/src/icp.h | /*
Copyright 2011. All rights reserved.
Institute of Measurement and Control Systems
Karlsruhe Institute of Technology, Germany
Authors: <NAME>
libicp is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either versi... | ALGO | 0.98199 | 6.179765 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2015-02-09T22:15:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 34,
"forks": 18,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe69b25... |
e392c034-db01-42ab-9f06-67556ea265ff | RIckyBan/competitive-programming | AtCoder/EducationalDP/Knapsack2.cpp | #include <iostream>
#include<cmath>
using namespace std;
int N, W, w[100+5], v[100+5], buffv = 0, vsum = 0;
long long DP[100+5][100000+5]; //DP[N][V]
void solve(){
//配列の初期化
for(int i = 0; i <= N; i++){
for(int j = 0; j <= vsum; j++ ){
if(j == 0) DP[i][j] = 0;//v=0はW=0で得る
else ... | ALGO | 0.999997 | 4.239511 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2020-02-29T06:12: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": "0f604e02... |
8ecff305-a085-47d5-ac46-d77a92882e50 | jaegon-kim/cpp_in_container | src/epi/ch24highlevel/p24_04_max_multiple_except_1.cpp | #include <iostream>
#include <vector>
#include <limits>
#include "utility/dump.hpp"
using namespace std;
namespace p24_04 {
int max_multiple_except_1(const vector<int> & v) {
size_t min_positive_idx = numeric_limits<size_t>::max();
size_t max_negative_idx = numeric_limits<size_t>::max();
s... | ALGO | 0.999845 | 4.950534 | {
"github_metadata": {
"branch": "main",
"commit_count": 179,
"repo_created_at": "2023-02-04T14:59:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c7d2d1ad5... |
3fe5ccf5-8db6-47ad-a3c9-8a6f042af7b2 | kamyu104/LeetCode-Solutions | C++/sum-of-consecutive-subsequences.cpp | // Time: O(n)
// Space: O(n)
// combinatorics, prefix sum, freq table, dp
class Solution {
public:
int getSum(vector<int>& nums) {
static const int MOD = 1e9 + 7;
const auto& count = [&](int d) {
int result = 0;
unordered_map<int, int> cnt, prefix;
for (const a... | ALGO | 0.999993 | 5.923949 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
775428b3-2a28-4eeb-b628-5c23989ce1bf | SevenHe/Linux | C_C++/Problems/cmp_adjacent.cpp | /*
狐进行了一次黑客马拉松大赛,全公司一共分为了N个组,每组一个房间排成一排开始比赛,比赛结束后没有公布成绩,但是每个组能够看到自己相邻的两个组里比自己成绩低的组的成绩,比赛结束之后要发奖金,以1w为单位,每个组都至少会发1w的奖金,另外,如果一个组发现自己的奖金没有高于比自己成绩低的组发的奖金,就会不满意,作为比赛的组织方,根据成绩计算出至少需要发多少奖金才能让所有的组满意
*/
/*
* 考虑状态,因为只有临近的两个组,因此每边有两种状态,总共4个状态放在判断中即可.
*/
/* DP问题,先为每个人分配1W,然后从右至左,保证左边的人的钱大于右边的
然后从左至右,保证右边的人的钱大于左边的即可
*/
#incl... | ALGO | 0.999626 | 3.245861 | {
"github_metadata": {
"branch": "master",
"commit_count": 203,
"repo_created_at": "2015-11-04T09:04:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51df67d8... |
4d8dbb55-e6ec-4513-9911-8cc183b9a486 | MultivacX/leetcode2020 | algorithms/hard/0710. Random Pick with Blacklist.h | // 710. Random Pick with Blacklist
// Runtime: 200 ms, faster than 95.53% of C++ online submissions for Random Pick with Blacklist.
// Memory Usage: 49.4 MB, less than 100.00% of C++ online submissions for Random Pick with Blacklist.
class Solution {
public:
Solution(int N, vector<int>& blacklist) {
srand... | ALGO | 0.999819 | 5.8562 | {
"github_metadata": {
"branch": "master",
"commit_count": 1856,
"repo_created_at": "2019-12-31T13:19: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": "7e5906b... |
92fb82b1-d066-462b-91b2-a9076087844a | sandraleeusc/csci104_fall2020_lecture | nqueens.cpp | /*************************
* N-Queens solution
* Author: <NAME> & <NAME>
*
* Notes: Modify to print ALL Solutions
*
*************************/
#include <iostream>
#include <cstdlib>
using namespace std;
//prototypes
void addToThreats(int row, int col, int change);
bool search(int row);
void printSolution();
... | ALGO | 0.999908 | 4.931182 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2020-08-25T04:39:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0837b5a... |
0b2b01f1-37a1-40c2-b15f-70e2f47b9370 | harshalsonone123/Data-Structure-cpp | Leetcodes/1314.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<vector<int>> matrixBlockSum(vector<vector<int>> &mat, int k)
{
int row = mat.size();
int col = mat[0].size();
vector<vector<int>> ans(row, vector<int>(col));
for (int i = 0; i < row; i++)
{
... | ALGO | 0.999907 | 5.727722 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-11-06T12:22: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": "c78349194943... |
299082a5-11dd-4d35-9fce-57d7e2837ef6 | soutog/MP-HBRKGA | graphcost_ts.cpp | #include "graphcost_ts.h"
GraphCostTS::GraphCostTS(Instance * _p, int l)
{
commodity = l;
p = _p;
x = NULL;
pi = NULL;
slack = NULL;
dj = NULL;
env = CPXopenCPLEX (&status);
if ( env == NULL ) {
char errmsg[CPXMESSAGEBUFSIZE];
fprintf (stderr, "Could not open CPLEX environment.\n"... | ALGO | 0.999669 | 3.144824 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-18T14:02: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": "6eea14126745... |
d8946be3-edca-4d8f-a695-603458db4a91 | adyajudha/Maze-Generator-Recursive-Backtracker | MazeGenRecursiveBackt.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
const int MAZE_SIZE = 10;
class MazeGenerator
{
private:
int maze[MAZE_SIZE][MAZE_SIZE];
int width, height;
public:
MazeGenerator(int w, int h) : width(w), height(h)
{
// Initialize maze with all w... | TOOL | 0.93172 | 5.604502 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-04-06T04:46: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": "231e904e51b3... |
90dd51af-8194-41c1-9ac7-b6fb306a5d96 | michaelyql/cp | cf/numtheory/2084b.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
ll gcd(ll a, ll b) {
if (b == 0) return a;
return gcd(b, a % b);
}
void solve() {
int n;
cin >> n;
vector<ll> a(n);
rep(i, 0, n) ... | ALGO | 0.999953 | 4.496838 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2025-03-07T07:20: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": "0487014306... |
13cd7c27-ff63-4396-a77c-e964c75c48ef | luisponce/Practica_cero | src/quickSort.cpp |
#include <iostream>
#include <string>
#include <vector>
#include <time.h>
using namespace std;
vector <string> arr;
void ChangeStr( int a, int b){ //cambia un par de strings en el arreglo dado
string tmp = arr[a];
arr[a] = arr[b];
arr[b] = tmp;
}
int Partition(int firstPos, int lastPos){ //divide el arreglo ... | ALGO | 0.999931 | 4.747066 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2013-08-14T19:51: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": "a0739283f... |
32b6c3c7-9aa6-4ae6-9cff-4f297754a46f | byAnh-dev/EECS348-Lab11 | cProgram/HW1_BubbleSort.cpp | #include <iostream>
void bubbleSort(int*array, size_t n){
bool noSwap;
for (size_t i = 0; i < n - 1; i++){//Loop n-1 time to make sure all the number are sorted (because you dont have to sort the last element)
noSwap = true;
for(size_t j = 0; j < n - i - 1; j++){//Run from the start to the end ... | ALGO | 0.999134 | 4.880078 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-16T23:52: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": "9ec262c114da... |
10cb27f0-961b-4a6c-98bf-cbe38fc2f178 | CrazysCodes/algorithm | old/Interview/Algorithms.cpp | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;
class Solution
{
public:
struct TreeNode
{
int val;
TreeNode *left;
TreeN... | ALGO | 0.999912 | 4.890717 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-04-19T06:19:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2bb21e16728... |
a85e4c0f-0789-47f4-aeee-ace1f83a349e | sabide/cpp-etu | 01-C++_sans_les_classes/03-array_and_co/sol/array 2.cpp | #include <iostream>
#include <array>
#include <cmath>
const int n = 100;
const double h = 1.0 / n;
int main() {
// Déclaration des tableaux avec std::array
std::array<double, n + 1> X;
std::array<double, n + 1> F;
std::array<double, n + 1> Fpp; // Fpp pour F'' (dérivée seconde)
// Initialisa... | ALGO | 0.999902 | 4.764822 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-08-28T05:19:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b2a64d2ff1... |
30d26d20-e004-495e-88eb-ac6b32a647ea | SoumaSingh/Leetcode-Submissions | 1381-maximum-score-words-formed-by-letters/maximum-score-words-formed-by-letters.cpp | class Solution {
public:
int maxScoreWords(vector<string>& words, vector<char>& letters, vector<int>& score) {
int W = words.size();
vector<int> freq(26, 0);
for (char c : letters) {
freq[c - 'a']++;
}
int maxScore = 0;
vector<int> subsetLetters(26, 0);
... | ALGO | 0.999502 | 6.088318 | {
"github_metadata": {
"branch": "main",
"commit_count": 676,
"repo_created_at": "2023-09-03T15:05: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": "86da30794c... |
411abf6e-73fd-4f7b-8271-dd8bd3619220 | keshav25201/data-structure-and-algo | generic tree/Iterative-Preorder-And-Postorder.cpp | #include <iostream>
#include <stack>
#include <vector>
#include <queue>
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
vector<Node *> children;
Node(int data)
{
this->data = data;
}
};
void display(Node *root)
{
string str = to_string(root->data) + " -> ";... | ALGO | 0.999979 | 4.769785 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-09-05T06:42: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": "b53e47ef26... |
71910aa9-32ae-4e80-aa85-9181a60cf64c | ao333/CPP | ICL Coursework/Missionaries & Cannibals/river2.cpp | #include <iostream>
#include <fstream>
#include <cstring>
#include <cassert>
using namespace std;
#include "river.h"
/* You are pre-supplied with the functions below. Add your own
function definitions to the end of this file. */
/* internal helper function which allocates a dynamic 2D array */
char **allocate_2... | TOOL | 0.990652 | 3.510957 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2017-11-01T08:40: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": "e758e8529... |
143a2e55-00dd-4f28-b388-807a105ec524 | enriquefynn/contests | UVA/10963-The-Swallowing/code.cpp | #include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#define EPS 0.0000000000000001
#define fori(N) for(i = 0; i < N; ++i)
#define forid(N) for(int i = 0; i < N; ++i)
#define forj(N) for(j = 0; j < N; ++j)
#define forjd(N) for(int... | ALGO | 0.999754 | 3.673868 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2013-10-01T16:56: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": "743eda2f6... |
3780911a-11c4-4265-af29-9a87ec891097 | NSchertler/OnlineSurfaceReconstruction | libOSR/src/field.cpp | /*
This file is part of the implementation for the technical paper
Field-Aligned Online Surface Reconstruction
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
ACM TOG 36, 4, July 2017 (Proceedings of SIGGRAPH 2017)
Use of this source code is granted via a BSD-style license, which can be found
in License.txt i... | ALGO | 0.995288 | 4.933143 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2017-04-09T15:13:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 164,
"forks": 36,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "27ad66... |
17f2d54d-b7c0-44c8-a72d-78c2f563f88d | deepwateroooMe/myAlgorithms | myalgorithms/LeetCode_c++_0325-0430_2014-100/nextPermutation.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <stack>
#include <queue>
using namespace std;
typedef vector<int> vi;
void nextPermutation(vector<int> &num) {
if (num.empty()) return;
int n = num.size();
int prev = n-2;
int curr = n-1;
int cnt... | ALGO | 0.999968 | 4.334679 | {
"github_metadata": {
"branch": "master",
"commit_count": 464,
"repo_created_at": "2022-08-22T22:53: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": "2dcc2ebd... |
8ee38af5-5c74-47ae-8450-5ccf3f411c05 | AW1100/SoftRenderer612021 | P02/P02/Math/Util.cpp | #include "Util.h"
const double Util::PI = 3.1415926535898;
//Vec4²εΦ΅
Vec4 Util::Lerp(const Vec4& v1, const Vec4& v2, double t)
{
return Vec4(
Lerp(v1.x, v2.x, t),
Lerp(v1.y, v2.y, t),
Lerp(v1.z, v2.z, t),
Lerp(v1.w, v2.w, t)
);
}
//Vec2²εΦ΅
Vec2 Util::Lerp(const Vec2& v1, const Vec2& v2, double t)
{
retu... | TOOL | 0.997135 | 6.031999 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-06-04T10:29: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": "a72962de1161... |
eace8b46-2473-4292-9d21-506d677e6f15 | abhinavg2002/LeetCode-and-GFG-Solutions | Return two prime numbers - GFG/return-two-prime-numbers.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
bool isPrime(int n)
{
// Corner cases
if (n <= 1)
return false;
if (n <= 3)
return t... | ALGO | 0.999795 | 5.393002 | {
"github_metadata": {
"branch": "main",
"commit_count": 1548,
"repo_created_at": "2022-04-12T08:25: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": "1c175fee7... |
7241ba8d-565a-4a89-97ef-581b41073de3 | RafiulIslamRafi/PriBET_ResearchWork | SEALExamples/privacy_preserving_plagiarism.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <chrono>
#include <random>
#include <thread>
#include <mutex>
#include <memory>
#include <limits>
#include <complex>
#include <iterator>
#include "seal/seal.h"
///My Header File:
#include "Document/Document.h"
using namespace std;
usi... | ALGO | 0.988153 | 5.00625 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-02-24T13:03: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": "ef625e107268... |
c95ede6a-424f-4a2d-bae5-e295fb645267 | manhduydl/BigO_Blue09-19 | BigO_110919_C++/BFS_L05/Slick.cpp | //
// Slick.cpp
// BFS_L05
//
// Created by manhduydl on 10/2/19.
// Copyright © 2019 manhduydl. All rights reserved.
//
#include <stdio.h>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define MAX 255
int graph[MAX][MAX];
bool visited[MAX][MAX];
int dr[4] = {-1, 0, 1, 0};
int dc[4]... | ALGO | 0.999369 | 4.019073 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-09-30T04:14: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": "22eaf705b... |
64169304-a2fa-414a-ad57-10faa0b963a8 | muhamadalfariziedytia105/Praktikum_SDAA | 2309106105_Muhamad Alfarizi Edytia_posstest2.cpp | #include <iostream>
#include <string>
using namespace std;
const int MAX_TIKET = 100;
//STRUK TIKET: menyimpan informasi tike, termasuk ID,nama event, dan jumlah tiket.
//ARRAY POINTER: menggunakan untuk menyimpan pointer ke struct tiket, dengan maksimum 100 tiket.
//FUNGSI DAN PROSEDURr:tambah_tiket() yaitu menambah... | TOOL | 0.990621 | 6.002937 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-17T02:44: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": "4da02a18d263... |
7c60b339-8f78-43e9-8bb2-b2593001dc98 | ArmanGrewal007/TowerOfHanoi | soln2.cpp | # include <iostream>
# include <vector>
# include <cmath>
using namespace std;
////////////////////////// CUBE CLASS ///////////////////////////////////////
class Cube {
private:
double length_;
public:
Cube(double length) {length_ = length;} // Ctor
void setLength(double length) {length_ = length;}
dou... | ALGO | 0.999286 | 5.271452 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-12-27T15:59:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d431a33d... |
5f8d3a8e-7f27-42ac-9a32-64cd94925187 | mcgema/Visualization-of-R4 | R4_FINAL.cpp | #include <gl\glut.h>
#include "funcao.h"
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
using namespace std;
float gamma[6] = { 0,0,0,0,0,0 };
int flag = 0;
float scale = 1.0;
int xb, xm, yb, ym;
funcao f;
//lista de funcoes para serem plotadas
Quartenion f1(float r, float theta) {
Quartenion q;
q... | ALGO | 0.93634 | 4.26225 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-06-12T17:18: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": "2e0ba61fa14... |
181db4d2-c80a-4d64-b0e6-7889aff942b7 | lum7na/ACM | CODEFORCES/666E.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int MAX = N * 2 + 5;
const int MAXSN = N * 19 + 5;
int n;
int m;
struct SuffixAutomaton {
int fa[MAX];
int nxt[MAX][26];
int len[MAX];
int root;
int last;
int tot;
void init() {
root = 1;
last = root;
tot = 2;
}
... | ALGO | 0.999976 | 3.975736 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-05-10T09: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": "eb1b37ffdf2... |
cd2e4a7d-d8ab-40e5-9a65-2fc0434fb52c | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/05/0527/personal_submission/cf1954d_LengNian7.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const int INF = 0x3f3f3f3f;
const i64 mod = 998244353;
const int N = 5005;
int a[N];
i64 f[N];
signed main()
{
int n;
scanf("%d", &n);
int m = 0;
for (int i = 1; i <= n; i ++ )
{
scanf("%d", &a[i]), m += a[i];
}
... | ALGO | 0.999859 | 4.125458 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "1b96... |
737051a5-ac02-4efd-9d3f-b96b7aabd915 | zwliew/competitive-programming | solutions/codeforces/contest/1176/a.cc | #include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
... | ALGO | 0.999975 | 4.259322 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2019-01-26T15:14:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "2a8336f4... |
09910368-c380-47fa-beb7-14cd418a4d07 | paritosh-34/dds-algo | daily-ds/2024/01 Jan/27-01-24.cpp | /*
URL: https://leetcode.com/problems/k-inverse-pairs-array/description/?envType=daily-question&envId=2024-01-27
629. K Inverse Pairs Array
For an integer array nums, an inverse pair is a pair of integers [i, j] where 0 <= i < j < nums.length and nums[i] > nums[j].
Given two integers n and k, return the number of d... | ALGO | 0.999981 | 5.904 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2023-12-29T18:25:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "896b692b6d9... |
6b2d7cdd-d4eb-4c73-8e81-0b38b33f007f | P-SUBHAM/LeetCode | 2107-find-unique-binary-string/2107-find-unique-binary-string.cpp | // Approach 1: 0 to 2^n-1 will have correct representation
// sorting nums and checking which number is missing in range
class Solution {
public:
string findDifferentBinaryString(vector<string>& nums) {
int n = nums.size();
vector<int> v;
for(auto it: nums) {
int no = 0;
... | ALGO | 0.999966 | 5.840614 | {
"github_metadata": {
"branch": "main",
"commit_count": 1834,
"repo_created_at": "2022-06-10T18:59:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34b6748c3... |
c944acdc-f400-4030-9b4b-e2fbb3464fae | ramidedantas/treinamento | OPEI2024-C - Senha/main.cpp | #include <iostream>
#include <vector>
using namespace std;
string match(const string &senha, const string &tentativa) {
string m;
vector<bool> b(senha.size(), false);
vector<bool> w(senha.size(), false);
for (int i = 0; i < tentativa.size(); i++) {
if (tentativa[i] == senha[i]) {
... | ALGO | 0.999964 | 4.000132 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2024-04-04T12:07:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f259559e15b... |
2f8fc5cd-8899-424b-ae2b-5c69413a5ca5 | MartinKaraivanov/CppAlgorithms | NOI3 2011/otsechki_AB1_NOI3_2011.cpp | #include<iostream>
using namespace std;
struct Tochka{
int x;
int y;
};
Tochka edinKrai[128];
Tochka drugKrai[128];
int broiOtsechki;
struct Prava{
int a;
int b;
int c;
};
Prava pravataNaDveteTochki(Tochka parva, Tochka vtora){
return {parva.y - vtora.y, vtora.x - parva.x, parva.x*vtora.y -... | ALGO | 0.999928 | 4.702679 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-07-24T13:37: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": "9e47f1667b1c... |
a27681f6-968c-4817-aed4-834479cef538 | TasmiaTasmin/Old-Time-Buddy-C-nd-CPP | check-palindrome.cpp | //Program to Check Palindrome Number in C
//
//What is Palindrome Number?
//
//Answer: Palindrome numbers are those numbers that remain the same even after reversing the order of their digits.
//In C, we can check if a given number is palindrome or not by using two different methods given below:
//
//1. By Reversing a... | ALGO | 0.998845 | 4.119998 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-02-12T15:17: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": "e090b9819efe... |
35931d4c-36f9-4e4b-993f-158dfdbfb4f8 | MathCancer/AMIGOS-hypoxia | Single-lung-metastasis-model/examples/tutorial3_BioFVM.cpp | /*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We ... | ALGO | 0.998804 | 5.487113 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2017-11-27T15:53:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c32f9126... |
044fcd50-c657-49ae-a5c9-4d89d4796964 | jiahao1001/OJ_Guide | 有OJ/刷题指南(包含leetcode, POJ, PAT等)/PAT/PAT甲级(Advanced Level)/1108. Finding Average (20).cpp | 1108. Finding Average (20)
The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might not be legal. A "legal" input is a real number in [-1000, 1000] and is accurate up to no more than 2 decimal places. When you calc... | ALGO | 0.998007 | 3.850841 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-12-25T06:24:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 82,
"forks": 29,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f41abc2... |
a7f46467-b719-4ec5-8d1e-12b76c6b433b | Samyakmedhe/Generic_LinkedList | SinglyGeneric/SinglyLinear.cpp | #include<iostream>
#include<string>
using namespace std;
template<class T>
struct node
{
T data;
struct node<T>* next;
};
template<class T>
class SinglyLGen
{
private:
struct node<T>* first;
int iCount;
public:
SinglyLGen();
void InsertFirst(T);
void Inser... | ALGO | 0.997863 | 3.876719 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-14T11: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": "5cede6db9c35... |
4942ebaf-3758-46e9-9ea6-8e2cd1cb507a | kulvir3342/DSA-Training-CipherSchools | dfs in graph.cpp | #include <bits/stdc++.h>
using namespace std;
int maxPath = INT_MAX;
vector<int> ssp;
void dfs(int src, int dest, vector<vector<int>> graph, vector<int> ans, vector<bool> visited){
if(src == dest){
if(ans.size() < maxPath){
maxPath = ans.size();
ssp = ans;
}
... | ALGO | 0.999973 | 4.605095 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-07-23T09:31: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": "b3bf5b855bde... |
f009d4e2-b3f2-4909-9e8b-f9bc5b338037 | ishandutta2007/codeforces-f | for_the_love/normal/337/E.cpp | #include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <vector>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
using namespace std;
const int INF = 1e9 + 7;
int n, ans, v[10];
long long a[10], b[10], c[10], d[10];
int e[10][10];
map <long long, int> S;
int Gao(long ... | ALGO | 0.999894 | 3.294569 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "0af09cbbf00c... |
f3a1d4ca-c71e-4504-8cc2-7061720aa77f | dev-om-saran/Chat_Application_Linux | rc4.h | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<int> S(256); //Fill with for loop
vector<int> T(256); // Fill with key
vector<int> permute(vector<int>, vector<int>);
vector<int> str_to_vector(string str);
string encrypt(vector<int>s , vector<int> t, string p);
string decrypt(ve... | ALGO | 0.999922 | 4.620095 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-13T05:53:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0aa6c77fb465... |
b1f150c5-fb12-491a-bd05-85ff47b93f5c | phenix-bnl/phenix-sw | offline/AnalysisTrain/Run16dAuPi0Photon/Combination.cc | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "TNtuple.h"
#include "Combination.h"
#include "Diagnostic.h"
#include "KTofCutter.h"
ClassImp(Combination)
template <class T> T sqr(const T& x) {
return x * x;
}
const double Combination::pi0_asymmetry_cut = 0.99;
const doubl... | DATA | 0.985699 | 3.290417 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-11-15T01:42:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "590d2b51a7cd... |
1ee8a286-1c99-4e6b-8987-be253f75c863 | Lucas-Henrique-Lopes-Costa/c | aulas/dreed/05-21 - Atividade Vetores/22 - avaliacao.cpp | #include <iostream>
using namespace std;
int main(){
int n;
cin>> n;
int vetor1[n];
for(int i = 0; i<n; i++)
{
cin>>vetor1[i];
}
int cont5 = 0;
for (int j = 0; j < n; j++)
{
if(vetor1[j] == 5)
{
cont5++;
}
}
cout << "5: " << cont5 / (float)n << endl;
int cont4 = 0;
for (int j = 0... | ALGO | 0.998024 | 3.295185 | {
"github_metadata": {
"branch": "main",
"commit_count": 218,
"repo_created_at": "2023-04-15T21:58:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8590909a3... |
9fa80a69-187a-414b-85fe-e2f0554de09f | alviano/wasp | src/Clause.h | /*
*
* Copyright 2013 <NAME>, <NAME>, and <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 appli... | ALGO | 0.991275 | 7.007648 | {
"github_metadata": {
"branch": "master",
"commit_count": 758,
"repo_created_at": "2013-07-31T13:15:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3f9ea3... |
db4780ba-540a-4467-b8b8-fda0dbf23196 | ishaan1091/ds_algo | arrays/minMaxInAnArray.cpp | #include <iostream>
using namespace std;
class Pair
{
public:
int max, min;
};
Pair minimumMaximum(int arr[], int n)
{
Pair minmax;
int i;
if (n % 2 == 0)
{
if (arr[0] > arr[1])
{
minmax.max = arr[0];
minmax.min = arr[1];
}
else
{
... | ALGO | 0.999902 | 5.099665 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2021-01-19T03:06: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": "f83a01c2... |
79d650ec-3e7e-4232-b210-784ae627483a | rootachieve/Algorithm-study | week12/@rootachieve/11438.cpp | #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <list>
#include <stack>
using namespace std;
vector <int> v[100020];
int parent[100020][20];
int depth[100020];
bool visit[100020];
int n, m;
void DFS(int node,int d) {
for (int i = 0; i < v[node].size(); i++) {
... | ALGO | 0.999984 | 3.998154 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2022-03-20T12:06:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5583c675a03... |
b6cb85dc-24d8-48d1-a36d-c8b63a3f1b48 | codechikbhoka/codes | Intern/rightBrother.cpp | #include <iostream>
using namespace std;
struct node
{
int index;
int data;
node* left;
node *right;
public:
node(){}
node(int index1, int data1, node* left1, node* right1)
{
this->index = index1;
this->data = data1;
this->left = left1;
this->right = right1;
}
};
node *queue = new node[100];
int top... | ALGO | 0.999371 | 3.509301 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-11-04T21:13: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": "d49d257e34... |
14305bc9-88ef-4206-9e37-242c4ca734f6 | jayhendren/csci2270-hw4 | bst.h | #include <cstddef>
#include <iostream>
#ifndef BST_H
#define BST_H
#include <vector>
template<class Item>
class bstNode
{
public:
//constructor
bstNode(const Item& init_data, bstNode* init_parent=NULL, bstNode* init_left=NULL, bstNode* init_right=NULL)
{
data_field = init_data;
... | ALGO | 0.996173 | 3.54822 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2013-08-04T06:08:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75ce035df7... |
2eedd931-13c1-48fb-bb61-5e1b3349df5c | 5tarlight/BOJ | boj/silver/1421.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N, C, W;
cin >> N >> C >> W;
vector<int> trees(N);
for (int i = 0; i < N; i++) {
cin >> trees[i];
}
long long maxProfit = 0;
for (int L = 1; L <= *max_element(trees.begin(), trees.en... | ALGO | 0.999933 | 4.599112 | {
"github_metadata": {
"branch": "master",
"commit_count": 1192,
"repo_created_at": "2023-02-01T06:45: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": "7111cb5... |
0fa4ba66-4e1e-4134-aefd-bb871c3b1250 | ishandutta2007/codeforces-p | pavement/normal/1364/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#ifdef TEST
#define getchar_unlocked _getchar_nolock
#endif
#define int long long
#define ins insert
#define mp make_pair
#define mt make_tuple
#define pb push_back
#de... | ALGO | 0.999948 | 3.22906 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49: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": "6fd5a013024a... |
9c66622f-4673-4159-a6b4-930a83edb365 | renat-abbyazov/cosmological_models | inc/rkck.hpp | #ifndef _RKCK_HPP_
#define _RKCK_HPP_
#include <vector>
#include <cmath>
#include <algorithm>
struct RKCK{
double m_x;
std::vector<double> m_y;
double m_yStop, m_h;
double m_tol;
std::vector<std::vector<double> > K_div_by_h_2darray;
std::vector<double> C, D;
std::vector<double> E;
doub... | ALGO | 0.999617 | 4.329613 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-03-08T18:07: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": "89e6f84461... |
223c46db-6869-4877-adc9-473fff74f2fc | ishandutta2007/codeforces-y | yhchang3/normal/1264/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define eb emplace_back
template<int SZ> struct MCMF{//SZ = N+1
typedef int F; typedef int C;typedef pair<C,int> pci;
priority_queue<pci,vector<pci>,greater<pci> > q;
const C INF = numeric_limits<C>::max();
struct EDGE{int to,rev;F cap;C cost;};int n,s,t;F mf;C mc;
bool... | ALGO | 0.999913 | 3.578752 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "d4c0e0fcb495... |
fd02050b-1d1f-4075-816c-8ad5c3db28eb | uwsampa/grappa | applications/demos/nqueens/nqueens.cpp | ////////////////////////////////////////////////////////////////////////
// Copyright (c) 2010-2015, University of Washington and Battelle
// Memorial Institute. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following cond... | ALGO | 0.998221 | 6.317246 | {
"github_metadata": {
"branch": "master",
"commit_count": 3825,
"repo_created_at": "2012-06-24T20:46:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 158,
"forks": 50,
"issues": 77,
"pull_requests": 18
},
"file_meta": {
"content_id": "258... |
32e9e26b-7837-4e3b-8725-056cf3c6f3ef | reviseUC73/grader_code | hw5/hw5_queue.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
typedef struct node
{
int value;
struct node *next;
} node;
typedef struct queue
{
node *front;
node *rear;
int size;
} queue;
void enqueue(queue *q, int v)
{
node *new_queue = new node;
new_queue->value = v;
new_queue->next ... | ALGO | 0.99816 | 3.717909 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2022-12-22T09:36: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": "b9d73702c... |
14baf57d-6221-4625-a5a5-1f761d57fc96 | sealw4ll/Car_Ball_Physics_Simulation | src/systems/car_movement_system.cpp | #include "car_movement_system.hpp"
#include "../components/transform.hpp"
#include "../components/velocity.hpp"
#include "../components/car_tag.hpp"
#include "../config.hpp"
#include "raymath.h"
namespace systems {
void CarMovementSystem(entt::registry& registry, float dt) {
auto view = registry.view<compo... | ALGO | 0.908996 | 6.180806 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2025-07-13T15:25: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": "55009b26e7... |
d667eaf3-2716-4f8f-8f79-5e4eb80d8b0b | Rik-Sarkar-07/Codes | Data Structure/RecurssionProblems.cpp | #include<iostream>
using namespace std;
/* #1. Sum of n Numbers --------
sum(n) = n + sum(n-1)
*/
int sum(int n)
{
if(n==0)
{
return 0;
}
else
{
return (n+sum(n-1));
}
}
/* #2. Factorial of n Number --------
fact(n) = n * fact(n-1)
... | ALGO | 0.993464 | 3.943948 | {
"github_metadata": {
"branch": "main",
"commit_count": 342,
"repo_created_at": "2021-05-23T15:07:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "80051f255c... |
4da97894-9abc-4306-ac21-4f5b9983327c | pavelsimo/ProgrammingContest | codeforces/PastContest/Codeforces Beta Round #31 (Div. 2, Codeforces format)/C.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <deque>
#include <numeric>
#include <iterator>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ccty... | ALGO | 0.999993 | 3.511904 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-10-16T15:16:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e33f7612e... |
43125c2e-4f1b-40d2-9f6b-38123f42b1bb | frblazquez/Acepta-el-reto | 276.cpp | /*
* Copyright © 2018
*
* <NAME> ~ <EMAIL>
*
* Double degree in Mathematics-Computer engineering.
* Complutense university, Madrid.
*
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int numFilms, horaIni, minIni, duracion, quedaLibre, numPosibles, nextFilm; ch... | ALGO | 0.999668 | 4.125076 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2018-09-30T22:16: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": "21ae3f90... |
583c370f-5754-4850-af8c-13dc5ca85ba9 | mmingluo/kspir | src/utils.cpp | #include <iostream>
#include <math.h>
#include <cassert>
#include "params.h"
#include "utils.h"
#include "crt.h"
#ifdef INTEL_HEXL
#include <hexl/hexl.hpp>
#endif
void copy_vector(int64_t* result, uint64_t* a)
{
for (size_t i = 0; i < N; i++)
{
result[i] = a[i];
}
}
void copy_vector(uint64_t* re... | ALGO | 0.999299 | 3.064549 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-09-03T15:26:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88d04f9acfe... |
91690c61-7540-4b03-88a5-cb39c696ed63 | shriramt124/competitiveProgramming | recursion/N_queens.cpp | #include<iostream>
using namespace std;
#include<vector>
bool isSafe(int row,int col,vector<vector<int>>&v,int n){
int x = row;
int y = col;
//check for the row
while(y>=0){
if(v[x][y] == 1){
return false;
}
y--;
}
... | ALGO | 0.999992 | 5.506078 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2024-08-18T19:27: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": "89e6b7dda29... |
39845c4e-7832-493a-96e3-747dd5431103 | devosoft/avida | avida-core/source/main/cLandscape.h | /*
* cLandscape.h
* Avida
*
* Called "landscape.hh" prior to 12/5/05.
* Copyright 1999-2011 Michigan State University. All rights reserved.
* Copyright 1993-2003 California Institute of Technology.
*
*
* This file is part of Avida.
*
* Avida is free software; you can redistribute it and/or modify it u... | ALGO | 0.959618 | 5.072237 | {
"github_metadata": {
"branch": "master",
"commit_count": 4555,
"repo_created_at": "2010-11-05T14:27:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 625,
"forks": 116,
"issues": 26,
"pull_requests": 3
},
"file_meta": {
"content_id": "7ed... |
cf8fcca8-d97c-4ccf-a790-58dd6f9962f3 | NeoNeuron/ifnet | include/vecmanip.hpp | #include <iostream>
using namespace std;
template <class T> bool Transpose(vector<vector<T> >& data, vector<vector<T> >& newdata) {
// Judge the transpose requirement;
size_t firstlen = data.begin()->size();
bool mat_set = true;
for (typename vector<vector<T> >::iterator it = data.begin() + 1; it != data.end()... | ALGO | 0.99144 | 4.848585 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2017-03-02T08:37:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f51a523... |
a30647df-d8a6-4480-99e9-88269bb6beea | botondszilniczky/advent_of_code | 2024/src/14.cpp | #include <algorithm>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <regex>
#include <set>
#include <vector>
using namespace std;
struct pos
{
int x, y;
};
bool operator==(const pos& a,const pos& b){ return tuple(a.x,a.y) == tuple(b.x,b.y); }
pos operator+(cons... | ALGO | 0.9997 | 4.988949 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2024-04-06T04:23: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": "ebae6653e... |
1d55d3b0-7bdb-4c81-bee4-d9e2e885a01c | yurys0/SandyHeap | main.cpp | #include <iostream>
#include <fstream>
struct Arguments {
std::ifstream file;
char* path_to_save;
long max_iterations;
long frequency;
int16_t table_lenght;
int16_t table_width;
int16_t quantity_to_zero_by_lenght;
int16_t quantity_to_zero_by_wight;
};
Arguments ParseArguments(const int... | TOOL | 0.995256 | 4.436355 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-15T13:41: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": "a23e1ba95eaf... |
05e4f865-f336-4c9d-adc2-fa3daf54b4b9 | JayantGoel001/LeetCode | 1631-number-of-sub-arrays-with-odd-sum/1631-number-of-sub-arrays-with-odd-sum.cpp | class Solution {
public:
int numOfSubarrays(vector<int>& arr) {
const int MOD = 1e9 + 7;
int count = 0, prefixSum = 0;
// evenCount starts as 1 since the initial sum (0) is even
int oddCount = 0, evenCount = 1;
for (int num : arr) {
prefixSum += num;
... | ALGO | 0.99998 | 6.085201 | {
"github_metadata": {
"branch": "master",
"commit_count": 7444,
"repo_created_at": "2021-10-01T11:35:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb30a0... |
a7816f89-32c4-437d-96df-80e4efec85cf | OmarAnKh/Data-structers | final_project/main.cpp | #include "circular-double-linked-list.h"
#include <fstream>
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
vector<string> splitString(const string &inputString, char delimiter)
{
vector<string> result;
stringstream ss(inputString);
string token;
while (ge... | TOOL | 0.997815 | 4.316833 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2023-11-17T11:52:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8865fb02a4... |
a6d3e541-8999-4dfc-b72c-b1be925350c5 | tzupengwang/PECaveros | contest/opencup/XV/Europe/l.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> Pt;
#define X first
#define Y second
Pt operator-( const Pt& p1 , const Pt& p2 ){
return {p1.X - p2.X , p1.Y - p2.Y};
}
LL operator^( const Pt& p1 , const Pt& p2 ){
return p1.X * p2.Y - p1.Y * p2.X;
}
... | ALGO | 0.999976 | 4.144738 | {
"github_metadata": {
"branch": "master",
"commit_count": 448,
"repo_created_at": "2014-08-20T16:02:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7613dea... |
5088889e-2e1b-4946-8faa-020a38ce3f70 | GRTLCollaboration/Chombo | lib/src/EBTools/EBStencil.H | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#ifndef _EBSTENCIL_H_
#define _EBSTENCIL_H_
#include "Stencils.H"
#include "... | ALGO | 0.939609 | 5.980565 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2018-01-30T14:07:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fc2be898f... |
a381985b-c282-4e2b-82ee-294ee256a5a3 | mummy-alive/algorithm-study | C++17/백준/Silver/20923. 숫자 할리갈리 게임/숫자 할리갈리 게임.cc | #include<iostream>
#include<queue>
using namespace std;
int n, m;
deque<int> dd, su;
deque<int> d_gr, s_gr;
int main() {
cin >> n >> m;
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
dd.push_front(a);
su.push_front(b);
}
for (int i = 0; i < m; i++) {
if (!(i % 2)) {
int p = dd.front();
dd.po... | ALGO | 0.999949 | 4.244978 | {
"github_metadata": {
"branch": "main",
"commit_count": 113,
"repo_created_at": "2024-08-02T18:39: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": "510f825626... |
8d34cf40-6662-4c58-83ec-bf9e1ece1316 | vishal8803/DSA-Practice | 2246-longest-path-with-different-adjacent-characters/2246-longest-path-with-different-adjacent-characters.cpp | class Solution {
public:
int res = 1;
pair<char,int> calc(vector<int> adj[], int node, string &s) {
char ch = s[node];
vector<pair<char,int>> possible;
int mx1 = INT_MIN, mx2 = INT_MIN;
for(int child : adj[node]) {
auto it = calc(adj, child, s);
i... | ALGO | 0.999976 | 4.591233 | {
"github_metadata": {
"branch": "main",
"commit_count": 3290,
"repo_created_at": "2022-05-19T14:47:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ad11ee9b... |
f7e474cc-cf10-4cc1-9e1c-875a0f887e4b | jperry82/CS-210-R1791_Progamming_Languages | main.cpp | /*
Developer's Name: <NAME>
Date: 10/14/2023
Purpose: Systematically track and analyze the purchase frequency of grocery items, providing insights to optimze store layout and enhance customer shopping experience
*/
#include "GroceryTracker.h"
#include <iostream>
#include <fstream>
#include <string>
#include <limits>
... | TOOL | 0.920076 | 6.038087 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-09T15:34: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": "6344836c4c0f... |
71375188-85d3-4509-8e51-5fce83ab288e | Aniket512/Dynamic_Programming | min_path_sum.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.
Input
[[1,3,1],[1,5,1],[4,2,1]]
Output
7
*/
int minPathSum(int m, int n, vector<vector<int>> &grid)
{
vector<ve... | ALGO | 0.999987 | 4.862473 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2023-06-18T06:05: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": "d4562d7ea8... |
21fa67c0-736c-4e53-b4a8-1b2c98ee7d8f | pqrs-org/BulletGBA | bulletgba/generator/data/code/__system/cross-homing.cpp | // XXX uniqID XXX 631bc3dd254f304a676bf5f02905dc70 XXX
#include <gba_types.h>
#include "bullet.hpp"
#include "fixed.hpp"
#include "__system/cross-homing.hpp"
extern const BulletStepFunc bullet_cfc2b3912618700c664b08a021359a68_631bc3dd254f304a676bf5f02905dc70[] = {
stepfunc_8137a6039dd8009123f63cf0d9479e43_631bc3... | ALGO | 0.971479 | 3.598204 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2020-03-22T05:47:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 19,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ecfde2d9d5e... |
61381d8d-0708-4bcc-8751-c24445e88875 | 1iyiwei/noise | BlueNoise/src/Polyomino/GHexominoSubdivisionTiler.cpp | /*
GHexominoSubdivisionTiler.cpp
<NAME>
11/12/2007
*/
#include <iostream>
using namespace std;
#include "GHexominoSubdivisionTiler.hpp"
#include "GHexomino.hpp"
#include "Random.hpp"
#include "Exception.hpp"
#include <math.h>
GHexominoSubdivisionTiler::GHexominoSubdivisionTiler(void) : _grid_height(27), _gr... | ALGO | 0.990375 | 4.853199 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2016-11-06T09:14:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb9c9cba... |
94a128fe-1e85-49e9-897e-72fbec592db5 | sskeshav/Project-on-Genetic-Algorithm-GA | ga_coding.cpp | #include<iostream>
#include<fstream>
#include<math.h>
using namespace std;
float obj(float x1,float x2)
{
return ((x1+x2)-(2*x1*x1)-(x2*x2)+(x1*x2));
}
int main()
{
fstream out("Output File1.txt",ios::in | ios::out | ios::app);
int x1[10][5],x2[10][5],n=10,l=5,i,j,k,val[10][2],m_pool_x1[10][5],m_pool_x2[10]... | ALGO | 0.999947 | 3.958278 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-09-17T07:07: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": "126853f483ee... |
25cac8c0-cd9c-4c96-ad3e-acf2f9e59275 | ishandutta2007/codeforces-x | xaohu/normal/1454/E.cpp | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 1 << 18;
int t, n, vis[N], dep[N], p[N];
vector<vector<int>> g;
vector<int> cycle;
void dfs(int v) {
vis[v] = 1;
for (auto u : g[v]) {
if (vis[u] && dep[u] < dep[v] - 1 && cycle.empty()) {
int a = v;
while (a != u) {
cyc... | ALGO | 0.999648 | 4.38878 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38: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": "78fb467539fc... |
740dfbe1-6c83-4571-a169-e69f17179a91 | Ritika1533/Coding-Challenges | L22-CharArray/parelidrone.cpp | #include<iostream>
using namespace std;
int getLength(char a[]){
int count=0;
for(int i=0;a[i]!='\0';i++){
count++;
}
return count;
}
char lowerCase(char ch){
if((ch>='a' && ch<='z') || (ch>='0' && ch<='9')){
return ch;
}
else{
char temp=ch-'A'+'a';
return temp;
}
}
bool checkPalindrone(char a[],int n){... | ALGO | 0.999638 | 3.68903 | {
"github_metadata": {
"branch": "main",
"commit_count": 145,
"repo_created_at": "2023-10-08T06:28: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": "086e4493ca... |
5bb7d68a-d012-4696-8d5f-ae3b1b9dbfeb | hehe520/Data-structure-and-algorithm | 动态规划/最长公共子序列.cpp | #include <stdio.h>
#include <string.h>
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define SIZE 200
// res 记录 str1, str2 匹配结果
int dp(char *str1, int len1, char *str2, int len2, int (*res)[SIZE])
{
int i, j;
int m = MAX(len1, len2);
// 0 号单元放 0
for (i=0; i<=m; i++) { res[0][i] = 0; res[i][0] = 0; }
for (i=0; i<le... | ALGO | 0.999816 | 3.387092 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-08-12T00:51:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 160,
"forks": 76,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1408726... |
8a27d301-6c16-47fa-b61d-09c3a7692ec5 | v2v3v4/BigWorld-Engine-14.4.1 | programming/bigworld/lib/server/bwconfig.cpp | #include "server/bwconfig.hpp"
#include "cstdmf/debug.hpp"
#include "cstdmf/debug_filter.hpp"
#include "cstdmf/watcher.hpp"
#include "network/network_interface.hpp"
#include "resmgr/bwresource.hpp"
#include <sys/types.h>
#include <pwd.h>
DECLARE_DEBUG_COMPONENT2( "Config", 0 )
BW_BEGIN_NAMESPACE
namespace BWCon... | TOOL | 0.926968 | 3.169717 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-01-09T19:54:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 225,
"forks": 106,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53161f5... |
006b3652-7879-495c-a32d-16676d88091d | mcl-csa/hir-dev | benchmarks/harris_df/src/hls/main.cpp | #define R 32
#define C 32
#include <assert.h>
#include <fstream>
#include <stdio.h>
#include <string>
#include <vector>
void harris_hls(float harris[R][C], float img[R][C]);
int main() {
// Open the File
std::ifstream in(
"/home/kingshuk/Git_Clones/hir-dev/benchmarks/harris/testbench/img.txt");
std::strin... | TEST | 0.926069 | 4.079575 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2021-04-19T06:44:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "561d5cfeb0... |
495e19b2-30e0-4612-a767-39a75000328d | halide/Halide | apps/hexagon_benchmarks/sobel_generator.cpp | #include "Halide.h"
using namespace Halide;
class Sobel : public Generator<Sobel> {
public:
Input<Buffer<uint8_t, 2>> input{"input"};
Output<Buffer<uint8_t, 2>> output{"output"};
GeneratorParam<bool> use_parallel_sched{"use_parallel_sched", true};
GeneratorParam<bool> use_prefetch_sched{"use_prefetch... | ALGO | 0.980637 | 6.274237 | {
"github_metadata": {
"branch": "main",
"commit_count": 23344,
"repo_created_at": "2012-07-31T04:05:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6126,
"forks": 1080,
"issues": 993,
"pull_requests": 78
},
"file_meta": {
"content_id": "... |
eaf46711-3b58-41f4-bbc0-5b7d59fd6c09 | georgianadruta/-IP-Impartirea-careului | square.cpp |
#include "square.h"
#include "solution.h"
square1 square[8][8];
bool help = false;
void initSquare1(square1& square, float posx, float posy, bool piece, int pieceNumber){
square.posx = posx;
square.posy=posy;
square.rec = sf::RectangleShape(sf::Vector2f(75.f, 75.f));
//square.rec.setOutlineColor(sf::... | TOOL | 0.986173 | 3.677283 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-12-06T09:54: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": "90460006c... |
aa7db4a0-9866-4349-989a-e10e917d9c6c | vedantbothikar/misc-codes | TE/LP-II Lab/assgn4_NQueens/practice/NQ-backtrack.cpp | #include<bits/stdc++.h>
#define N 5
using namespace std;
void printSolution(int board[N][N]){
for(int i=0; i<N; i++){
for(int j=0; j<N; j++){
cout<<" "<<board[i][j]<<" ";
}
cout<<endl;
}
}
bool isSafe(int board[N][N], int row, int col){
for(int i=col; i>=0; i--){
... | ALGO | 0.999877 | 4.957014 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2021-12-19T11:24:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2106bd899... |
0436a52a-f457-4910-af40-96f1c9e8f769 | astron98/DS-ALGO | dynamic_programming/coinChange/coinChange_minCount.cpp | // Created by astron98
//CoinChange min. count of coins to get a sum:
#include <bits/stdc++.h>
#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,n) for(int i=0;i< (int)(n);++i)
#defin... | ALGO | 0.999947 | 3.881004 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-07-13T06:15: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": "1da23d7a1... |
4621cba4-9ebe-4282-a12a-8fbf9a0f99d4 | HarryNguyen2662/codeKingToan | CSES/Dynamic Programming/1097.cpp | #include<bits/stdc++.h>
using namespace std;
#define NMOD 3
#define fi first
#define se second
#define pb push_back
#define log 17
#define mask(i) (1ll << (i))
#define setp(x) setprecision(x)
#define ALL(v) v.begin(), v.end()
#define ck(n, i) (((n) >> (i)) & 1)
#define getbit(x) __builtin_popcount(x)
const double P... | ALGO | 0.999973 | 4.103068 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-20T15:17: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": "13d1c0e00c89... |
bd5276b2-2400-481d-a89e-067841a1bb4c | svn2github/bullet | tags/bullet-2.0f/Bullet/NarrowPhaseCollision/VoronoiSimplexSolver.h | /*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 <NAME> http://continuousphysics.com/Bullet/
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is ... | ALGO | 0.999188 | 5.84768 | {
"github_metadata": {
"branch": "master",
"commit_count": 2728,
"repo_created_at": "2012-11-04T17:05:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e54840... |
dfd79cf6-7309-4580-9007-9ce82ca29146 | Saleh7127/CPP-solution-by-Fellow_junior | Light Oj/LO1142.cpp | /***
created: 2022-03-03-21.32.02
***/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define test int tt; cin>>tt; for(int cs=1;cs<=tt;cs++)
#define get_lost_idiot return 0
#define nl '\n'
#define row vector<ll>
#define matrix vector<vector<ll>>
matrix operator*(const matrix& a, const matrix& b)... | ALGO | 0.999885 | 4.056124 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-04-11T21:39: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": "9c155a9e6158... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.