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 |
|---|---|---|---|---|---|---|---|
5beec36c-27d9-4179-8ea8-73d686a288e7 | openvinotoolkit/openvino | src/core/reference/include/openvino/reference/equal.hpp | // Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <algorithm>
#include <functional>
#include "openvino/reference/autobroadcast_binop.hpp"
#include "openvino/reference/utils/type_util.hpp"
namespace ov::reference {
namespace func {
template <class T>
bool eq... | TOOL | 0.969189 | 7.65437 | {
"github_metadata": {
"branch": "master",
"commit_count": 19551,
"repo_created_at": "2018-10-15T10:54:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8597,
"forks": 2656,
"issues": 303,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
1b75f9b9-78b9-4fb7-a3db-59bee743f8a7 | usnistgov/psc-ns3 | src/wifi/model/interference-helper.cc | /*
* Copyright (c) 2005,2006 INRIA
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRA... | TOOL | 0.91342 | 5.840844 | {
"github_metadata": {
"branch": "psc-7.0",
"commit_count": 18640,
"repo_created_at": "2017-04-05T14:53:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 73,
"forks": 41,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "1325... |
715213d0-6522-4a38-9f7e-378c3898fa29 | NeuroBox3D/neuro_collection | membrane_transporters/ryr.h | /*
* Copyright (c) 2009-2019: G-CSC, Goethe University Frankfurt
*
* Author: <NAME>
* Creation date: 2011-12-20
*
* This file is part of NeuroBox, which is based on UG4.
*
* NeuroBox and UG4 are free software: You can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License v... | TOOL | 0.966909 | 7.588413 | {
"github_metadata": {
"branch": "master",
"commit_count": 784,
"repo_created_at": "2019-06-27T16:29:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df0631e10... |
cd7011c8-ad3a-4c88-9f00-0c127ee709c9 | ngoxuanhuy/Programming-problems | uva11624.cpp | // Use BFS to pre-calculate the matrix of fire
#include <stdio.h>
int T, R, C;
int start_x, start_y;
int result;
char map[1000+2][1000+2];
int fireMap[1000+2][1000+2];
bool visited[1000+2][1000+2];
void readInput();
void preCalculate();
struct Point
{
int x;
int y;
int step;
};
Point pQueue[1000002];
int first, las... | ALGO | 0.999945 | 4.034081 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-12-03T03:36: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": "c495370ed... |
36f955d9-186f-4320-83e1-9c6b56a4e01c | Hemanshudhaduk/DSA | TREE/New_Binary_Tree.c++ | #include <iostream>
#include <queue>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
node *BuildTree(node *root)
{
int data;
cout << "Enter the data : ";
cin... | ALGO | 0.999859 | 4.290918 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-02T05:27: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": "b05a18a69cdb... |
89c251e5-a373-4765-87b8-ccbde1ebff06 | olivia-brg/Algo-de-tri | Tri par selection/ChoixAlgo.cpp | #include <iostream>
#include <stdio.h>
#include "TriBulles.h"
#include "TriInsertion.h"
#include "TriRapide.h"
#include "TriSelection.h"
#include "ChoixAlgo.h"
int choixAlgo(int Tableau[], int taille) {
int choix;
printf("\n=== Choix du tri ===\n1. Tri a bulles\n2. Tri par insertion\n3. Tri par selection\n4.... | ALGO | 0.997479 | 3.9631 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-06-24T13:19: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": "ea7be92059... |
6039e6bd-f415-43e3-9f6a-2c368c3c33bd | JHYOOOOON/Collection | 알고리즘스터디/[1차]다트게임.cpp | #include <string>
#include <cmath>
#include <vector>
#include <iostream>
using namespace std;
int solution(string dartResult) {
int answer = 0, t, num, j;
vector<int> score;
for(int i=0; i<dartResult.length(); i++){
if(dartResult[i] >= '0' && dartResult[i] <= '9'){
if(dartResult[i... | ALGO | 0.99984 | 4.678915 | {
"github_metadata": {
"branch": "master",
"commit_count": 610,
"repo_created_at": "2019-05-16T13: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": "6bdf22d1... |
5116f0bc-a0d4-4a36-be52-cfe11c82406b | taitruong256/Competitive-programming | IUH_Olympic_ICPC/2024_Train_Team_Green_4/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define endl '\n'
#define sz(x) (ll)(x.size())
const ll mod = 1e9+7;
void solve()
{
ll n; cin>>n;
vector<ll> v;
for (ll i=0; i<n; i++)
{
char c; cin>>c;
v.push_back(c);
}
ll ans=0;
for ... | ALGO | 0.999885 | 3.935459 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-14T06:59:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdbaf00a44ff... |
7227e46a-0182-491d-adfe-95995fcb05b3 | razvanpetruta/UniversityProjects | Year_1/Semester_2/Data_Structures_And_Algorithms/Lab1_ADT_Bag/Bag.cpp | #include "Bag.h"
#include "BagIterator.h"
#include <exception>
#include <iostream>
using namespace std;
void Bag::resizeElementsArray()
{
this->elementsCapacity *= 2;
TElem* copy = new TElem[this->elementsCapacity];
for (int i = 0; i < this->elementsSize; i++)
{
copy[i] = this->elements[i];
}
delete[] this-... | ALGO | 0.979657 | 4.990148 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2022-07-02T15:35: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": "e202d17b6f2... |
5454bebe-0d38-4f00-af16-ae93e6e5d92b | jmqd/learning | self-study/c++/books/bjarne-stroustrup-programming-principles-and-practice/chapter-4/exercises/4.cpp | // Write a program to play a numbers guessing game.
// Program should be able to figure out the number I'm thinking of
// between 1 and 100 within 7 questions.
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
bool prompt_participation()
{
std::cout << "Would you like to pla... | ALGO | 0.998945 | 4.107981 | {
"github_metadata": {
"branch": "master",
"commit_count": 541,
"repo_created_at": "2016-05-13T17:36: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": "b15a41df... |
3ca70088-0a91-4e3e-90ce-640a7b297d62 | jayakrishna-g/Interviewbit | 3sum.cpp | /*
Question:
3 Sum
Asked in:
Facebook
Amazon
Microsoft
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target.
Return the sum of the three integers.
Assume that there will only be one solution
Example:
given array S = {-1 2 1 -4},
and target = 1.
The sum ... | ALGO | 0.999984 | 5.372949 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-05-13T05:49:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fee0b2ff7... |
cddea38f-bac4-4384-aeae-ca3b6ae32121 | PrateekRohilla/DSA-Fundamentals | linkedList/reverseLL1.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int d){
this -> data = d;
this -> next = NULL;
}
};
Node* reverseLL(Node* head){
Node* prev = NULL;
Node* curr = head;
Node* forward = NULL;
while(curr != NULL){
for... | ALGO | 0.999874 | 5.318138 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-04-08T09:16:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe4fe2ba78a... |
b3d9a246-9708-4faf-ad0b-d8830debf39a | PratikSaha198/CP-to-get-placed | Heap/CPU-task-schedulling.cpp | // You are given n tasks labeled from 0 to n - 1 represented by a 2D integer array tasks, where tasks[i] = [enqueueTimei, processingTimei] means that the ith task will be available to process at enqueueTimei and will take processingTimei to finish processing.
// You have a single-threaded CPU that can ... | ALGO | 0.999999 | 6.269187 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2021-02-20T21:06:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcbfe0895... |
f7723ce7-844d-4de3-ad00-b7c4183b84a1 | jamesEmerson112/Dijkstra-s-algorithm-for-the-single-source-minimum-path-problem | Vo_An_ast7_main.cpp | //************************************************************
//
// <NAME>
// CS 302, Dr. Larmore
// Assginment #7
//
//************************************************************
//************************************************************
//
// Write a program which implments Dijstra's algorithm for the
// si... | ALGO | 0.999799 | 3.808395 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-04-14T01:54:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ba72408e2... |
4f84787d-4a4e-46a1-b665-742c6504304a | ishandutta2007/codeforces-a | avinashkartik/normal/282/E.cpp | #pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>
using namespace std;
#define GODSPEED ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision... | ALGO | 0.999972 | 4.347071 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5dbaf6b2280... |
bbc3dbec-9f3b-45a1-9d75-07c6c8984f85 | buckydebugs/Leetcode | Binary Trees/Medium_Binary_Tree_Right_Side_View_Recursive_Optimal.cpp | /*
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
Example 1:
Input: root = [1,2,3,null,5,null,4]
Output: [1,3,4]
Explanation:
Example 2:
Input: root = [1,2,3,4,null,null,null,5]
Output: [1,3,4,5]
Exp... | ALGO | 0.999968 | 6.479098 | {
"github_metadata": {
"branch": "main",
"commit_count": 172,
"repo_created_at": "2024-09-25T07:42: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": "0faa26d33d... |
82db2259-a171-43d0-b6b0-22d3eecfd40c | shubhamnegi9/MyLeetCodeSolutions | 3276-minimum-number-of-pushes-to-type-word-ii/minimum-number-of-pushes-to-type-word-ii.cpp | class Solution {
public:
// make the "cmp" function as static, as sort() function takes static function pointer as an argument
static bool cmp(pair<char, int> &p1, pair<char, int> &p2) {
return p1.second > p2.second;
}
int minimumPushes(string word) {
map<char, int> mpp;
... | ALGO | 0.999982 | 5.038819 | {
"github_metadata": {
"branch": "main",
"commit_count": 1623,
"repo_created_at": "2023-09-01T02:46: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": "148849e21... |
28fa1146-e488-49e0-b8f9-05972ada4783 | itkingnb/cf-atc-and-so-on | codeforces/975.2/d.cpp | #include<iostream>
#include<cmath>
#include<string>
#include <algorithm>
#include<vector>
#include<queue>
#include<map>
#include<numeric>
#include<cstring>
#include<bits/stdc++.h>
#define pii pair<int,int>
#define mii map<int,int>
#define msi map<string,int>
#define ll long long
#define all(x) (x).begin(), (x).end()
us... | ALGO | 0.999904 | 4.012023 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-03-26T07:30:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a5701b8061f... |
9dba99f2-dd1a-4e6e-b64c-af6b477b8d82 | SwingOlive/kASA | stxxl/include/stxxl/bits/common/winner_tree.h | /***************************************************************************
* include/stxxl/bits/common/winner_tree.h
*
* Part of the STXXL. See http://stxxl.sourceforge.net
*
* Copyright (C) 2014 <NAME> <<EMAIL>>
* Copyright (C) 2014 <NAME> <<EMAIL>>
*
* Distributed under the Boost Software License, Vers... | ALGO | 0.996049 | 7.531061 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2019-03-26T15:26:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05197ba5... |
7a3a3509-2bd6-4555-a7f7-6a809e84f9a9 | xSeanliux/CompetitiveProgramming | AtCoder/ARC_078/pD.cpp | #include <iostream>
#include <vector>
#include <deque>
using namespace std;
const int maxN = 1e5 + 326;
deque<int> path;
vector<int> adj[maxN];
bool vis[maxN];
int N, u, v, sz[maxN];
bool found = false;
void findPath(int p = 1, int u = 1){
if(found) return;
path.push_back(u);
if(u == N){
found = true;
retur... | ALGO | 0.999941 | 3.868338 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-11-18T06:45: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": "f18fe4501... |
42eea08b-17b1-4594-946f-9ff2e363e872 | deckeym/RGR | files/affin.cpp | #include <iostream>
#include <string>
#include <fstream>
#include "function.h"
extern const char* SYSTEM_CLEAR;
using namespace std;
string code(const string& text, int addKey, int multKey)
{
string encoded;
for (int i = 0; i < text.length(); i++)
{
encoded += static_cast<char>(((static_cast<int>(t... | TOOL | 0.902279 | 3.29113 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-06-13T11:30: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": "73a78d432cf5... |
5f0549e9-f9f5-427c-9700-1a454a4db966 | sjtuyinjie/M3DGR | baseline_systems/HM_LIO_M3DGR/src/hm_lio/src/algo/IMU_Processing.cpp | #include "IMU_Processing.hpp"
namespace zjloc
{
ImuProcess::ImuProcess(/* args */)
: b_first_frame_(true), imu_need_init_(true), last_imu_(nullptr), start_timestamp_(-1)
{
cov_acc = Eigen::Vector3d(0.1, 0.1, 0.1);
cov_gyr = Eigen::Vector3d(0.1, 0.1, 0.1);
mean_acc = Ei... | ALGO | 0.975176 | 5.43828 | {
"github_metadata": {
"branch": "main",
"commit_count": 234,
"repo_created_at": "2025-01-27T13:38:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 131,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1d7c0ba... |
b8f76fff-570b-4a35-a4d8-29878d4254fe | copyrightpoiiiii/cf-record | GoodBye2021/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define maxn (300000+5)
#define mod 1000000007
int read(){
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=10*x+ch-'0';ch=getchar();}
return x*f;
}
ll readll(){
ll x=0,f=1;... | ALGO | 0.999828 | 3.752219 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2021-06-23T08:50:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c0de8cef... |
3b01879b-aaad-42a3-9800-775c535d2e14 | PaddlePaddle/Paddle | paddle/phi/kernels/funcs/jit/gen/matmul.cc | /* Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | TOOL | 0.97852 | 6.734243 | {
"github_metadata": {
"branch": "develop",
"commit_count": 54743,
"repo_created_at": "2016-08-15T06:59:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23037,
"forks": 5770,
"issues": 1009,
"pull_requests": 823
},
"file_meta": {
"content_... |
eb7d0cb8-dfbe-4340-ac66-1f5253f77e6d | Franco1010/ACM-ICPC | ICPC Live Archive/Dangerous Tunnels.cpp | #include <bits/stdc++.h>
#define For(i, a, b, c) for(int i = (a); i <= (b); i += (c))
#define Rof(i, a, b, c) for(int i = (a); i >= (b); i += (c))
#define Forn(i, n) For(i, 0, (n) - 1, +1)
#define For1(i, n) For(i, 1, (n), +1)
#define Forall(i, x) for(auto i = (x).begin(); i != (x).end(); i++)
#define size(x) (int) (x)... | ALGO | 0.999977 | 3.890634 | {
"github_metadata": {
"branch": "master",
"commit_count": 231,
"repo_created_at": "2018-03-05T21:59:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2b714af... |
e3f3bd88-055f-4878-8be7-6123d69b7d31 | ravens452/lab2_cc2 | lab_2_CC2/Ejercicio_3.cpp | //
// Ejercicio_3_Iterativa.cpp
// Lab_02__Andrade_Guzman_Carlos_UNSA__EPCC_II_GRUPO_B
//
// Created by <NAME> on 5/8/20.
// Copyright © 2020 <NAME>. All rights reserved.
//
//Implementar una función que ordene los elementos de un arreglo: ascendente.
#include <iostream>
using namespace std;
//resolvemos usando p... | ALGO | 0.999865 | 5.412347 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-05-09T05:09: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": "053a7fe49... |
bfb84c6f-b7f8-40e8-bf46-62ed82a18596 | Lucaslnobrega38/Programacao-competitiva | DIJKSTRA/flight_routes.cpp | #include <bits/stdc++.h>
using namespace std;
#define pairli pair<long long,int>
int k;
class grafo
{
public:
int size;
vector<pairli> *container;
vector<vector<long long>> dists;
grafo(int arg)
{
size = arg;
container = new vector<pairli>[size];
dists = vector<vector<lon... | ALGO | 0.999988 | 3.915645 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-18T03:04: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": "033c534c243... |
84b789cf-5923-4bdf-b830-cc6465be7d76 | ishandutta2007/codeforces-w | wiwiho/normal/1182/B.cpp | #include <bits/stdc++.h>
#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define printv(... | ALGO | 0.999991 | 3.811779 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34: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": "8015afd8b2a9... |
6cb664d1-3e26-4cd2-9d6a-94df92815ec6 | afourneaux/comp-371-Super-Hypercube | a1/Source/a1.cpp | // COMP 371 Assignment 1
// Spiral Staircase (Section DD Team 3)
//
// <NAME> (40129466)
// Fourneaux, Alexander (40022711)
// <NAME> (40155615)
// <NAME> (29783539)
//
// Based on Labs Framework created by <NAME>
/*
#include <iostream>
#include <list>
#include <fstream>
#include <string>
#include <vector>
#include <... | TOOL | 0.979513 | 3.583679 | {
"github_metadata": {
"branch": "main",
"commit_count": 267,
"repo_created_at": "2021-07-17T03:13: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": "5fc65cdb59... |
853b5418-6985-48a1-a103-1de6f411901c | GyuJin-Cho/Algorithm | 프로그래머스/OX퀴즈.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> solution(vector<string> quiz)
{
vector<string> answer;
int result;
int i, j;
for(i=0;i<quiz.size();i++)
{
string num1="", num2="";
char cacul = NULL;
bool check = false;
... | ALGO | 0.999927 | 4.348196 | {
"github_metadata": {
"branch": "main",
"commit_count": 1329,
"repo_created_at": "2021-07-07T11:10: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": "8c33fd963... |
17916da7-bc86-40c0-9c79-54435323bb9e | charonwang77/LeetCode100 | twopointers.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <string>
using namespace std;
//167. Two Sum II -Input array is sorted
vector<int> TwoSum1(vector<int> &Numbers, int Target)
{ //方法一:这种考虑不全面,只适用于两个正整数相加
//先将l指向第一个r指向最后一个 并相加,如果大于目标值则r向前移一位,反之l向后移
int size = Numbers.size();
int l = 0, ... | ALGO | 0.999975 | 4.541061 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-05-30T14:12: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": "c0178c44234e... |
08ecbfec-b41b-40cf-8979-bacf3901b36d | repusjh/BOJ | BFS_DFS/7576.cpp | #include <bits/stdc++.h>
using namespace std;
struct tomato{
int row, col;
};
int board[1001][1001];
int n, m;
int dr[] = {0, 1, 0, -1};
int dc[] = {1, 0, -1, 0};
queue<tomato> q;
int main(){
cin >> m >> n;
for (int i = 0; i < n; i++){
for (int j = 0; j < m; j++){
cin >> board[i][j];... | ALGO | 0.999986 | 3.945646 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-09-10T03:48: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": "43bab08ca... |
40e88a66-2cd1-499e-924f-08b97132ccb2 | tuilakhanh-s-Stuff/uit-assignment | IT001/11 MẢNG 1 CHIỀU/11.cpp |
/*###Begin banned keyword - each of the following line if appear in code will raise error. regex supported
define
include
using
###End banned keyword*/
#include <iostream>
#include <math.h>
using namespace std;
//###INSERT CODE HERE -
void inputArray(int a[], int &n)
{
std::cin >> n;
for (int i = 0; i < n; i++)... | ALGO | 0.999644 | 3.847955 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2021-11-16T04:38:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eea7224ad8... |
a9e6c692-854d-47b2-ad1e-adf350fd4ef5 | cs2b01/uniforminterface-macarenaoyague | Documents/Cursos de carrera/POO 2/Clases Rivas 2019-1/c6/main.cpp | #include <iostream>
using namespace std;
class vect{
int sz; //size
double* elem; //a pointer to the element
public:
vect(int s) //constructor
:sz{s}, //initialize sz
elem{new double[s]} {/*...*/}//initialize elem
//{
// for(int i=0;i<s;++... | ALGO | 0.95287 | 3.558296 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-05-20T16:39:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "40ec7de47f... |
3f435105-ee68-4f7d-b2a8-37c276d008ee | ishandutta2007/codeforces-s | s2speed/normal/53/E.cpp | #include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("Ofast")
#define all(x) x.begin() , x.end()
#define sze(x) (ll)(x.size())
#define mp(x , y) make_pair(x , y)
#define wall cout<<"--------------------------------------"<<endl
typedef long long int ll;
typedef pair<ll , ll> pll;
typedef pair<int , int... | ALGO | 0.99998 | 3.958734 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62b1d33eff95... |
c82409ad-b74b-4d6b-8be2-218f3f33c549 | townboy/acm-algorithm | HDOJcode/2389 2013-08-12 00 32 20.cpp | ******************************
Author : townboy
Submit time : 2013-08-12 00:32:20
Judge Status : Accepted
HDOJ Runid : 8910237
Problem id : 2389
Exe.time : 1390MS
Exe.memory : 141636K
https://github.com/townboy
******************************
#include<stdio.h>
#include<iostream>
#includ... | ALGO | 0.999826 | 3.80166 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2014-03-23T03:30: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": "222dcc15e... |
dfb1ce51-2e50-4d05-a161-83bf8538c8c9 | tobraver/TEA | cxx/TEA.cpp | #include "TEA.h"
#include <string.h>
// Encrypt two numbers at a time
void base_encrypt (uint32_t* v, uint32_t* k) {
uint32_t v0=v[0], v1=v[1], sum=0, i; /* set up */
uint32_t delta=0x9e3779b9; /* a key schedule constant */
uint32_t k0=k[0], k1=k[1], k2=k[2], k3=k[3]; ... | ALGO | 0.992277 | 5.499015 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-05-23T14:04: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": "6608694a40... |
f94dc124-53cd-45ee-b5c8-34cea5499258 | alexshi0000/competitive-programming | mockccc_4.cpp | #include <bits/stdc++.h>
using namespace std;
//document this pseudocode later
/*
long main()
{
long n, k;
cin >> n >> k;
long arr[k], cnt = 0;
for (long i = 0; i < k; i++) {
scanf("%d", &arr[i]);
arr[i]--;
}
for (long i = arr[2]; i < n; i++) {
long *ptr = upper_bound(arr, arr+k, i)-1;
long idx = (long)(... | ALGO | 0.999708 | 3.646333 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-05-23T22: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": "3f4d459281... |
36f2054b-04d2-4f82-853f-d4e7a2a4b9a5 | appu226/FactorGraph | oct_22/oct_22_lib.h | /*
Copyright 2023 <NAME>
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, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense,... | ALGO | 0.988057 | 5.158738 | {
"github_metadata": {
"branch": "master",
"commit_count": 298,
"repo_created_at": "2019-01-06T15:59:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78bff14b... |
9338b165-dac9-4f64-bdc6-926fe2045421 | youfeng243/hackerrank | Domains/Algorithms/Attending Workshops/Attending Workshops.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
bool cmp( const pair<int, int> a, const pair<int, int> b)
{
if( a.second == b.second )
{
return a.first < b.first;
}
return a.second < b.second;
}
class Available_Workshops
{... | ALGO | 0.999991 | 4.001284 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2016-01-13T13:27:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c3e2ad2e... |
1d578e1c-f94d-45b3-a601-76a99b22a825 | EmonSpeedy/Algorithms | cycle_detection_in_undirectedGraph.cpp | #include<bits/stdc++.h>
using namespace std;
int nodes, edges;
const int N = 1e5 + 10;
vector<int> adj_list[N];
int parent[N];
int visited[N];
bool detect_cycle(int node){
visited[node] = 1;
for(auto adj_node : adj_list[node]){
if(visited[adj_node] == 0){
parent[adj_node] = node;
... | ALGO | 0.999985 | 5.300221 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-05-24T06:55: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": "f92c0663c3df... |
d5d4d4cc-5167-4aab-a334-7c5b502ea31a | hfhongzy/CodeForOI | luogu-4121.cpp | #include <algorithm>
#include <cstdio>
#include <vector>
#include <map>
#define pb push_back
#define pii pair<int, int>
#define rep(i, j, k) for(int i = j; i <= k; ++ i)
#define per(i, j, k) for(int i = j; i >= k; -- i)
using namespace std;
const int N = 210, M = 1e4 + 10;
int n, q, c1[M], a[N][N];
int ID(int x, int y)... | ALGO | 0.999941 | 3.779318 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-10-12T02:46:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd076fb64274... |
d04945d2-99c1-4639-8397-a83dcda83537 | wanimaru47/AOJ | volume01/cpp/aoj0174.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (1) {
string s1, s2, s3;
cin >> s1;
if (s1 == "0") break;
cin >> s2 >> s3;
int a = 0, b = 0;
for (int i = 1; i < s1.size(); i++) {
if (s1[i] == 'A') a++;
else b++;
}
... | ALGO | 0.999275 | 3.517891 | {
"github_metadata": {
"branch": "master",
"commit_count": 444,
"repo_created_at": "2014-08-24T01:15:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "554fa4f7... |
a306f0b7-9bb1-47f5-8b2e-079a2b9fab3a | porjesuraj/Learning-Cplusplus | Workspace/Day8_1/main.cpp | /*
* main.cpp
*
* Created on: 10-Mar-2020
* Author: nilesh
*/
#include <iostream>
using namespace std;
class shape {
public:
virtual void accept()=0;
virtual void display()=0;
virtual float calc_area()=0;
virtual float calc_peri()=0;
};
class square : public shape {
private:
float side;
public:
squa... | ALGO | 0.957624 | 3.897946 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-04-14T15:57:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44cd5f123c... |
75eac7a2-fe48-42e1-9150-005eb9da341d | bdis-q/QSimLab | qsim/matrix.cpp | #include "matrix.h"
//
// Constructors of Matrix
//
// Default constructor
template<typename T>
Matrix<T>::Matrix() {
data = nullptr;
row = 0;
col = 0;
}
// Initialize a all-zero matrix
template<typename T>
Matrix<T>::Matrix(ll r, ll c) {
row = r;
col = c;
data = new T *[row];
for (ll i ... | TOOL | 0.909694 | 5.636649 | {
"github_metadata": {
"branch": "a1-omsim",
"commit_count": 17,
"repo_created_at": "2024-07-08T12:05:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d757bc... |
0d2eb7a0-2fc7-4e16-8d84-eb1d9660e723 | rapidsai/cudf | cpp/src/reductions/segmented/update_validity.hpp | /*
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | TOOL | 0.906196 | 7.737847 | {
"github_metadata": {
"branch": "branch-25.08",
"commit_count": 41228,
"repo_created_at": "2017-05-07T03:43:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9049,
"forks": 958,
"issues": 999,
"pull_requests": 95
},
"file_meta": {
"content... |
8c1eb5d5-085c-41cb-9a38-73a16da9cd3d | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/1_2741_0.cpp | #include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double Pi = acos(-1.0);
const int mod = 1000000007;
const int N = 210;
int main() {
int T;
while (~scanf("%d", &T)) {
while (T--) {
int n, k, b[205];
scanf("%d%d", &n, &k);
for (int i = 0; i < k; i++) scanf("%d", &... | ALGO | 0.999493 | 3.208997 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "7f1fbd7f96e... |
5c398c6a-02ee-4d13-bfe4-fe4f88bb4fde | geometer/FBReaderJ | jni/NativeFormats/util/AndroidUtil.cpp | /*
* Copyright (C) 2011-2015 FBReader.ORG Limited <<EMAIL>>
*
* This program 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 version 2 of the License, or
* (at your option) any later version.
*
... | TOOL | 0.92415 | 4.079998 | {
"github_metadata": {
"branch": "master",
"commit_count": 9034,
"repo_created_at": "2010-09-29T18:35:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1845,
"forks": 799,
"issues": 246,
"pull_requests": 13
},
"file_meta": {
"content_id": ... |
9848dd72-10fb-4b86-930e-a29374b2ded6 | leehwoo0119/Coding_practice | 백준9613.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int gcd(int a, int b)
{
int c = 0;
while (b != 0)
{
c = a % b;
a = b;
b = c;
}
return a;
}
long long cal(int* arr, int n)
{
long long tmp = 0;
//가능한 모든쌍 계산
for (int i = 0; i < n; i++)
{
for (int j = i + 1; j < n; j++)
tm... | ALGO | 0.999975 | 3.352135 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2021-01-24T07:58: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": "c829319e... |
f33e87b6-5f95-4a1c-8164-765215651644 | Githubiswhat/LeetCode | C++/src/Solution1601_1700/Solution1671.cpp | //
// Created by windows on 2023/3/2.
//
#include "Solution1671.h"
#include <functional>
#include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <stack>
using namespace std;
vector<int> getLISArray(const vector<int>& nums){
int n = nums... | ALGO | 0.999988 | 5.717128 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2021-02-02T12:56: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": "1ca83449393... |
1eaed3c0-4adf-49b3-8fc3-82c118cba1ac | hansol-y/leetcode-study | HansolYang/2022-07-19-Reverse-Linked-List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseList... | ALGO | 0.99986 | 5.921029 | {
"github_metadata": {
"branch": "main",
"commit_count": 1173,
"repo_created_at": "2022-06-15T18:56:15.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "Vancouver-KDD/leetcode-study",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
... |
b05172c5-4543-41e0-8594-2a61151db192 | HariAakash646/CompetitiveProgramming | CSES/string_reorder.cpp | #include <bits/stdc++.h>
using namespace std;
#define scd(t) scanf("%d", &t)
#define sclld(t) scanf("%lld", &t)
#define forr(i, j, k) for (int i = j; i < k; i++)
#define frange(i, j) forr(i, 0, j)
#define all(cont) cont.begin(), cont.end()
#define mp make_pair
#define pb push_back
#define f first
#define s second
typ... | ALGO | 0.999995 | 3.406244 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2022-09-08T07:58:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca71c31db9... |
97e5d918-daba-4258-aa6e-79ddd67bd220 | fcnoronha/competitive-programming | online-judge/traffic.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begin(),x.end()
#define p(x) cout << #x << endl
#define pv(x) for (auto u : x) cout << u << " \n"[u == *(x.en... | ALGO | 0.999877 | 3.692634 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2018-07-05T22:15: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": "2b189600... |
b89b42ca-ecba-40f0-85ae-dc7ef36a40f0 | vvmutee/laba-7 | main.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
long long matrix[100][100];
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
cin >> matrix[i][j];
}
}
bool all_diag_max = true;
long long diag_product = 1;
for (int i = 0; i... | ALGO | 0.999992 | 5.252419 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-17T16:39: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": "12ad6ee1dbfd... |
581f6617-3b95-42e1-b58c-95109fbeb195 | queuedq/ps | BOJ/3994/main.cc | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
using lld = long long;
using pii = pair<int, int>;
using pll = pair<lld, lld>;
////////////////////////////////////////////////////////////////
const int MAXN = 1e5+5;
lld x, n;
vector<pll> box[20];
lld pow(int e) {
lld res = 1;
while (e > 0) {
r... | ALGO | 0.999891 | 3.501379 | {
"github_metadata": {
"branch": "master",
"commit_count": 824,
"repo_created_at": "2018-05-26T14:07:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4edf5b4c... |
b52df047-d701-4558-a8de-962658a5d6aa | FlowKit/palabos-examples | showCases/vofMultiPhase/fallingDroplet.cpp | /* This file is part of the Palabos library.
*
* Copyright (C) 2011-2012 FlowKit Sarl
* Route d'Oron 2
* 1010 Lausanne, Switzerland
* E-mail contact: <EMAIL>
*
* The most recent release of Palabos can be downloaded at
* <http://www.palabos.org/>
*
* The library Palabos is free software: you can redistribute ... | ALGO | 0.998668 | 4.460641 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2013-06-05T11:24:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01721ace7... |
9be04b71-3ebf-432c-9d33-01c673f86805 | MrGxsheng/MyProblem | 洛谷P2563.cpp | #include <bits/stdc++.h>
#define debug puts("-----")
#define pi (acos(-1.0))
#define eps (1e-8)
#define inf (1<<30)
using namespace std;
typedef long long LL;
const int N = 1000010;
int n,m;
int primes[N];
int cnt;
bool st[N];
void get_primes(int n){
for(int i = 2 ; i <= n ; i++){
if(!st[i]) primes[cnt++] = i;
fo... | ALGO | 0.999904 | 3.823363 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-02-17T14:30: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": "3c686a80368... |
d455ed47-3001-4881-910e-629f76ce2dab | maltahat/coen243 | Tutorial12/LinkedListExample.cpp |
#include <iostream>
using namespace std;
class Node
{
public:
int value;
Node *next;
};
class LinkedList
{
private:
Node *header;
public:
LinkedList()
{
header = nullptr;
}
void Add(int value)
{
if (header == nullptr)
{
h... | ALGO | 0.996413 | 4.865367 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-23T18:57:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "975d2385dfce... |
f1a77389-6302-4b7d-84bc-b2e6d8bd7d65 | raincross7/code-similarity | codes/train_code/problem324/problem324_254.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stdio.h>
#include <list>
#include <numeric>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
#include <map>
#include <math.h>
//ceil(a/b) (a + (b - 1))/ b
using namespace std;
#de... | ALGO | 0.999941 | 3.99493 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53f0890e428e... |
479324e0-0d31-4084-875a-d410a06091e3 | ytsaurus/ytsaurus | contrib/python/scipy/py3/scipy/_lib/highs/src/mip/HighsImplications.h | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the HiGHS linear optimization suite */
/* */
/* Written an... | ALGO | 0.999072 | 6.42149 | {
"github_metadata": {
"branch": "main",
"commit_count": 83261,
"repo_created_at": "2022-12-05T16:32:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2063,
"forks": 164,
"issues": 335,
"pull_requests": 38
},
"file_meta": {
"content_id": "e... |
39b19945-5a7c-4d78-8303-199962dc3fc0 | mysh212/Coding | Labyrinth.cpp | // Author : ysh
// 08/09/2022 Tue 15:34:23
// https://cses.fi/problemset/task/1193
#include<bits/stdc++.h>
using namespace std;
int xx[] = {1,0,-1,0};
int yy[] = {0,-1,0,1};
char dd[] = {'D','L','U','R'};
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int a,b;cin>>a>>b;
int sx,sy,gx,gy;
bool... | ALGO | 0.999992 | 3.865924 | {
"github_metadata": {
"branch": "master",
"commit_count": 300,
"repo_created_at": "2022-02-05T12:21:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9aa8f913... |
d5eb0dfb-db11-4860-8854-003d11d7bdd5 | fonte-nele/Competitive-Programming | URI Online Judge/uri2827.cpp | #include <bits/stdc++.h>
using namespace std;
#define f(inicio, fim) for(int i = inicio; i < fim; i++)
#define fr(inicio, fim) for(int j = inicio; j < fim; j++)
#define all(x) x.begin (), x.end ()
#define sz(x) (int) x.size ()
#define pb push_back
#define mk make_pair
#define fi first
#define se second
#define eps 1e-... | ALGO | 0.99992 | 3.360965 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2019-06-22T18:49:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2579bed7c... |
01aa4d52-e4f5-4d48-8879-52350f760e5e | menerucha/Leetcode_DSA_Questions | Implement_queue_using_stacks.cpp | <<<<<<< HEAD
class MyQueue
{
stack<int> s1, s2;
public:
MyQueue() {}
void push(int x)
{
s1.push(x);
}
int pop()
{
while (!s1.empty())
s2.push(s1.top()), s1.pop();
int ans = s2.top();
s2.pop();
while (!s2.empty())
s1.push(s2.t... | ALGO | 0.995798 | 4.745331 | {
"github_metadata": {
"branch": "main",
"commit_count": 454,
"repo_created_at": "2024-02-08T05:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d8a5e9a23... |
67335f73-87e7-4c8e-b68c-59935e55acb1 | caleb-var/godot_voxel | flecs_extension/modules/world_module.cpp | #include <world_module.h>
#include <flecs.h>
#include <tiny_bvh.h>
#include <godot_cpp/variant/vector3.hpp>
#include <godot_cpp/variant/aabb.hpp>
namespace flecs_ext{
struct VoxAccessor {
const uint8_t *data;
int w;
int h;
int d;
uint8_t get(int x, int y, int z) const {
... | ALGO | 0.917683 | 6.84745 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2025-01-09T00:32:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "deb378fd2a4... |
0990be6d-f683-4714-8e80-c5c662339b51 | AveLexinton/test1 | LinearRegression/univariate_LR.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include <array>
#include <numeric>
#include <stdexcept>
using namespace std;
void extract_data(vector<double>& x, vector<int>& y) {
ifstream ifs("/home/lexinto/Workspace/MLalgorithms/datasets/Bike-Sharing-Dataset/day.csv");
if (!ifs.is_open()) {... | DATA | 0.967374 | 3.54787 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-10-16T12:09: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": "c9b432c27... |
a11a897a-bb18-406e-a302-d34a7f01bbcd | haotian-wu/Hackerrank_solutions | DynamicProgramming/longest-increasing-subsequent.cpp | /*******************************************************
* Copyright (C) 2015 <NAME>
*
* This file is the solution to the question:
* https://www.hackerrank.com/challenges/longest-increasing-subsequent
*
* Redistribution and use in source and binary forms are permitted.
******************************************... | ALGO | 0.999962 | 4.458436 | {
"github_metadata": {
"branch": "master",
"commit_count": 273,
"repo_created_at": "2015-05-29T20:33:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 121,
"forks": 64,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b80ae... |
bda2b3f5-5c15-41e9-be31-b4d04ce9d3f9 | thecrabsterchief/Federated-Learning-meets-Homomorphic-Encryption | openfhe_lib/bfv/client.cpp | #include <iomanip>
#include <tuple>
#include <unistd.h>
#include "openfhe.h"
// header files needed for serialization
#include "ciphertext-ser.h"
#include "cryptocontext-ser.h"
#include "key/key-ser.h"
#include "scheme/bfvrns/bfvrns-ser.h"
using namespace lbcrypto;
//////////////////////////////////////////////////... | TOOL | 0.947089 | 4.863191 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-06-13T09:38:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 71,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "55a973c439... |
c0bb5014-c38b-4833-a013-2bca232ca7f8 | alexandraback/datacollection | solutions_5648941810974720_1/C++/hogeover30/A.cc | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
int T; cin>>T;
for(int t=1; t<=T; ++t) {
string s; cin>>s;
vector<int> cnt(128);
for(c: s) cnt[c]++;
vector<int> res(10);
{ int x=cnt['Z']; res[0]+=x; for(c: "ZERO") cnt[c]-=x; ... | ALGO | 0.999722 | 3.991718 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3841c32a... |
c733c2dd-961f-4d77-b437-5db1ed2a6ea8 | AlexSorinDragomir/P.D.A | cuda/OddEvenSortThread.cpp | #include <iostream>
#include<time.h>
using namespace std;
void oddEvenSort(int arr[], int n)
{
bool isSorted = false;
while (!isSorted)
{
isSorted = true;
for (int i = 1; i <= n - 2; i = i + 2)
{
if (arr[i] > arr[i + 1])
{
swap(arr[i], arr[i + 1]);
isSorted = false;
}
}
for (int i = 0;... | ALGO | 0.999858 | 4.77471 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-03-23T07:48: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": "34d0d71eb... |
816acf1a-ca19-433c-ad4c-6e3524ce63f0 | elmau21/cpp-nn | src/RNN/GRU/GRU.cpp | #include "GRU.h"
#include <numeric> // Agregar esta línea
// Constructor de GRU
GRU::GRU(int input_size, int hidden_size)
: input_size(input_size), hidden_size(hidden_size) {
// Inicializar pesos y sesgos aleatorios
Wz.resize(hidden_size, std::vector<double>(input_size + hidden_size));
Wr.resize(hidden... | ALGO | 0.997621 | 6.321427 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-09-28T20:12:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e1bcbb6aeb5... |
f29032d5-1b06-4b5f-8690-5d6cb2982f34 | Iftekhar-Ahamed/Code | Finding_Periods.cpp | /***
** <NAME>
** ALLAHU AKBAR
**
** Author: <NAME>
** Bangladesh University of Business and Technology,
** Dept. of CSE.
***/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <itera... | ALGO | 0.999304 | 3.486728 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2022-08-30T05:33:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a9b1fd700f... |
bf0a4bde-73e5-4ba0-b4fe-7e5e48beae5f | vadymtolkachev/track-c | dz1/SolveSquare.hpp | #include <math.h>
/*! \mainpage Решение квадратного уравнения
* дз1
*/
/**
* \file
*
* \author <NAME>
*
* \date 30.09.2018
*
* Contact: <EMAIL>
*
*/
/*!
Решает линейное уравнение
\param b, c Коэффициенты первой и нулевой степени соответственно
\param x Решение будет записано сюда(если существует и един... | ALGO | 0.998464 | 3.603277 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2018-10-06T20:19:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd88c1d1... |
0dd2f202-5e2a-4c13-8504-9e8a1a8d2067 | coderistan/mix | algorithms/tic_tac_toe.cpp | // g++ -o program tic_tac_toe.cpp -std=c++11
#include <iostream>
#include <vector>
#include <map>
#include <math.h>
#define ROW 3
#define COL 3
#define PLAYER_X "x"
#define PLAYER_O "o"
#define E "-" // empty
#define N " " // nobody
#define MIN -100
#define MAX 100
using namespace std;
map<string,int> score;
bool fi... | ALGO | 0.999789 | 5.110148 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-12-29T19:44:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d2052193... |
280b5b88-5493-44ba-a696-ea27f01b62da | arangodb/arangodb | arangod/Graph/Enumerators/OneSidedEnumerator.h | ////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2024 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Business Source License 1.1 (the "License");
/// you may not use this file except... | TOOL | 0.954458 | 7.348879 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
d3cda854-6e58-40b5-912b-057cf5619fcf | dytsou/lc | cpp/2045.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<climits>
using namespace std;
class Solution {
public:
int secondMinimum(int n, vector<vector<int>>& edges, int time, int change) {
vector<int> adj[n];
for(auto& edge : edges){
int u = edge[0]-1, v = edge[1]-1;
ad... | ALGO | 0.999953 | 4.151186 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2024-07-04T08:56: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": "cae709bd... |
044978eb-4c32-4cc0-93d0-ed7240cd7aff | JinJin1503/BAITAPOOP | baitap2chuong3.cpp | #include <bits/stdc++.h>
using namespace std;
class SinhVien {
private:
string MSSV;
string HoTen;
int SoBuoiVang;
float DiemTH;
float DiemGK;
float DiemQT;
public:
SinhVien(string MSSV, string HoTen, int SoBuoiVang, float DiemTH, float DiemGK) {
this->MSSV = MSSV;
this->HoTen = HoTen;
this->SoBuoiVang... | TOOL | 0.984357 | 3.770298 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2024-03-28T14:39: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": "1ea885a45... |
f09ed3a2-2dd3-474b-a24f-adbc864fbd85 | discipline233/trash | Project13/Project13/入门测试.cpp | //#include<iostream>
//using namespace std;
//int x[100], c = 0;
//int main() {
// for (int i = 0;; i++) {
// cin >> x[i];
// if (x[i] == 0) break;
// c = i;
// }
// for (int j = c; j >= 0; j--)
// cout << x[j] << " ";
// return 0;
//}
//#include<iostream>
//#include<string>
//us... | ALGO | 0.999956 | 3.335098 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-09-02T09:34:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9b8d43bf453... |
68759aca-e87e-47c3-96b0-210ddcbdff80 | matyas13/Solutions | CCC/CCC_38/Classic/level4/main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <queue>
#include <fstream>
#include <iomanip>
using namespace std;
ifstream fin("level4_5.in");
ofstream fout("level4_5.out");
const int MAXN=250;
vector<vector<char>> mat(MAXN, vector<char>(MAXN));
v... | ALGO | 0.999935 | 3.32731 | {
"github_metadata": {
"branch": "main",
"commit_count": 163,
"repo_created_at": "2022-11-25T15:04: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": "918bfa724a... |
2b63d778-c70d-451d-8417-dedfafa166c8 | davidlunadeleon/leetcode | leetcode/cpp/98-ValidateBinarySearchTree/98-ValidateBinarySearchTree.cpp | // Source: https://leetcode.com/problems/validate-binary-search-tree/
// Date: 02.07.2020
// Solution by: <NAME>
// Runtime: 20ms
// Memory usage: 21.8 MB
#include <iostream>
#include <vector>
#include "../lib/treeUtils/treeUtils.h"
using namespace std;
// Leetcode solution starts
class Solution {
public:
bool ... | ALGO | 0.999617 | 6.152657 | {
"github_metadata": {
"branch": "master",
"commit_count": 187,
"repo_created_at": "2020-06-15T18:53:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfe50314... |
00f9e439-0a28-41b9-86fb-955fa91e3184 | Debasish-Dey/LabSem4 | TOC/20-02-24/moore_to_mealy.cpp | #include <iostream>
#include <vector>
using namespace std;
struct MooreState {
int output;
vector<pair<int, int>> transitions;
};
struct MealyState {
int output;
vector<pair<int, pair<int, int>>> transitions;
};
vector<MealyState> mooreToMealy(vector<MooreState>& moore) {
int num_states = moore... | ALGO | 0.999824 | 5.800534 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-01-08T13:46: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": "2c881ad54dbb... |
77b65166-9059-4142-8d72-ccdecb57ee5c | chane199/local-search | mmkp_source_code/MMKP.h |
/***************************************************************************
MMKP.h
-------------------
begin : Jun 1 2013
copyright : (C) 2013 by <NAME>
email : <EMAIL>
*********************************... | ALGO | 0.999333 | 3.79341 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-11-07T04:12:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8755858fe9... |
2986e1fa-a7aa-4186-9903-ec0ef7dbec43 | tusikalanse/acm-icpc | suda/0114/g.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <queue>
using namespace std;
const int MAXN = 102;
int vis[MAXN][MAXN];
char mat[MAXN][MAXN];
int dir[8][2] = {1, 1, 0, 1, 0, -1, 1, -1, 1, 0, -1, 1, -1, 0, -1, -1};
struct coor{int x, y;}a[MAXN*MAXN], t;
int main(){
int m, n, ans... | ALGO | 0.99966 | 3.571421 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2021-06-09T11:48: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": "18409cbf... |
4dd63236-ca29-4043-ab51-b5c0b63caaa2 | Bjergsen-dev/build-extract | includes/triangle.hpp | //
// Created by lightol on 3/16/18.
//
#ifndef DELAUNAY_TRIANGULATION_TRIANGLE_H
#define DELAUNAY_TRIANGULATION_TRIANGLE_H
#include <Eigen/Core>
#include "edge.hpp"
#include <assert.h>
#include <math.h>
class Triangle
{
public:
// constructor
Triangle() {}
Triangle(const A_Point2d &p1, const A_Point2d ... | ALGO | 0.901458 | 6.482077 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-19T07:23:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d4814001e... |
e21defbf-0e53-4409-92dc-4ea1bf578b83 | mcscoder/MyCodeForces | 1701B - Permutation.cpp | #include <iostream>
#include <vector>
#include <algorithm> // sort
#include <map>
#include <cmath>
#include <cctype>
// #define int long long
using namespace std;
void sol();
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
sol();
}
void sol() {
int t; cin >> t;
while(t--) {
int... | ALGO | 0.999511 | 4.409464 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2022-11-05T03:09:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eeaf5c6541a... |
c257d60b-2167-4039-b6dd-43598bd13862 | kursof/test | begin 40/begin40.cpp | /* Найти решение системы линейных уравнений вида
* A1·x + B1·y = C1,
* A2·x + B2·y = C2,
* заданной своими коэффициентами A1, B1, C1, A2, B2, C2,
* если известно, что данная система имеет единственное решение.
* Воспользоваться формулами
* x = (C1·B2 − C2·B1)/D, y = (A1·C2 − A2·C1)/D,
* где D = A1·B2 − A2... | ALGO | 0.999886 | 4.759412 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2015-01-31T18:07: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": "3032f4195... |
04ad289d-d6b1-4e0b-9eb3-f2d6ebdaf92e | longhai-mine/filemaynha | nhamtan/quaylui/l.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = (int)1e3 + 10;
int n, k;
int a[N];
bool check()
{
int sum = 0;
bool check = true;
for(int j = 1; j <= n; j++)
{
if(a[j] == 0)
sum++;
else
sum--;
if(sum < 0)
{
check = false;
break;
}
}
if(sum == 0 && check == true)
return true;... | ALGO | 0.999765 | 4.000073 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-11-04T12:51:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85329f3735... |
1c4e86aa-1cf0-4d0c-b598-b0db80e6ea39 | bukanyohandi/personal-website | static/archive/Competitive-Programming/UVA - 10034.cpp | #include <bits/stdc++.h>
using namespace std;
int tc, n, piv = 1;
double a, b;
bool visited[105];
pair<double, double> data[105];
double jarak(double x1, double y1, double x2, double y2) {
return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
void solve() {
double cost = 0, tmp;
int tmp2;
priority_queue... | ALGO | 0.999801 | 4.297701 | {
"github_metadata": {
"branch": "main",
"commit_count": 235,
"repo_created_at": "2023-07-23T03:48:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "425d67884e... |
2de87b1c-1bf7-48e8-9608-98bf3cf92825 | ROCm/OpenFOAM_HMM | src/meshTools/algorithms/PatchEdgeFaceWave/edgeTopoDistanceData.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-----------------------------------... | TOOL | 0.992132 | 7.121772 | {
"github_metadata": {
"branch": "suyash/hmm",
"commit_count": 25733,
"repo_created_at": "2022-10-27T12:31:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "7c... |
099b0012-3b75-4e30-b9db-61af38cb61de | EmanDeveloper/basic_practice_problems | loop/task_1.cpp | #include <iostream>
using namespace std;
int main()
{
int num_student, num_subject;
cout << "Enter the total number of students = ";
cin >> num_student;
cout << "Enter the total subject = ";
cin >> num_subject;
for (int i = 1; i <= num_student; i++)
{
float total_marks = 0;
f... | TOOL | 0.982562 | 4.014234 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-18T17:13: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": "4eccff7940d4... |
546a890e-0d61-475c-85ba-aeeed1fc13c8 | dalanlan/algo | sqrt.cpp |
/*
LintCode: sqrt x
http://www.lintcode.com/zh-cn/problem/sqrtx/
*/
// solution 2
// use divide instead of multiply
int sqrt(int x) {
if(x <= 0) {
return 0;
}
int lo = 1;
int hi = x;
while(lo <= hi) {
int mid = (lo+hi)/2;
if(mid<... | ALGO | 0.999992 | 4.934802 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2015-07-12T23:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ed307ff... |
a1ecc998-b0cf-416b-b02e-f49aa046c28c | ShashiShekharSuman/DSA | minimum_platforms.cpp | // Program to find minimum number of platforms
// required on a railway station
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// Function to find the minimum number of platforms required at the
// railway station such that no train waits.
int findPlatform(int ... | ALGO | 0.999976 | 5.448125 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-04-16T17:23:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7ffd3ccb2... |
4dd15844-8345-4647-ac2d-becd3592f2f4 | kuna2512/CPP-DSA_BY_PW_skills | _7_pattres 1st and 2nd assignment/_12_1Hollow_Rectangle.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout << "Enter no. of lines: ";
cin >> n;
int a = 6; // Width of the rectangle
int b = 2; // Height of the hollow part of the rectangle
// Print top border
for(int j = 1; j <= a; j++){
cout << "*";
}
cout << endl;
... | ALGO | 0.989394 | 3.17977 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-07-25T11:35:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70b43aba684... |
561e86b5-4c98-445c-9379-c7046d40f196 | shrey2005/DSA | Hashmap/longestSubarrayZeroSum.cpp | #include <iostream>
#include<unordered_map>
using namespace std;
int lengthOfLongestSubsetWithZeroSum(int* arr, int n) {
// Write your code here
unordered_map<int, int> frq;
int sum = 0;
int max = 0;
for(int i = 0; i < n; i++){
sum += arr[i];
if(sum == 0 ){
max = i + 1;
... | ALGO | 0.999814 | 4.947343 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-02-26T16:26: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": "8328c783df7... |
6ab45bc7-60db-49eb-a13e-c62a3f1d1b87 | marlonwc3/cp-codes | Uva/Uva785==Grid Colouring.cpp | #include <bits/stdc++.h>
#define _ printf("\n");
#define sc1(a) scanf("%d", &a)
#define sc2(a,b) scanf("%d %d", &a, &b)
#define sc3(a,b,c) scanf("%d %d %d", &a, &b, &c)
#define sc4(a,b,c,d) scanf("%d %d %d %d", &a, &b, &c, &d)
#define iz(b) if(b==0) { break; }
#define pb(a) push_back(a)
#define inf 0x3f3f3f3f
#define m... | ALGO | 0.99995 | 3.313355 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2015-01-02T17:57:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7b1785d3... |
b1b31507-5dae-4b8f-9273-ca223a589779 | alaminmiah4274/algorithm | assignment_2/Area_of_Component.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
int row, col;
char component[N][N];
bool visited_cell[N][N];
vector<pair<int, int>> cell_index = {{0, 1}, {0, -1}, {-1, 0}, {1, 0}};
bool valid(int i, int j)
{
if (i < 0 || i >= row || j < 0 || j >= col || component[i][j] == '#')
{
... | ALGO | 0.999767 | 5.156234 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-09-11T06:26: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": "9819b3a9c4b... |
8c7a6d7a-c5f9-468b-9207-c176daadc4c2 | cjyeon/CodingTest | BOJ/10828.cpp | #include <iostream>
#include <stack>
using namespace std;
int main()
{
int n;
cin >> n;
stack<int> st;
while (n--)
{
string s;
cin >> s;
if (s == "push")
{
int p;
cin >> p;
st.push(p);
}
else if (s == "pop")
... | ALGO | 0.998863 | 4.538457 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2021-02-04T13:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1547bd2150... |
b9d93263-fedd-47b6-8d17-24365e7ff9bc | dlalsrn/Baekjoon | 백준/Diamond/20132. Parity Constraint Minimum Spanning Tree/Parity Constraint Minimum Spanning Tree.cc | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
ll N, M, W, U, V, cnt, value = 0, ans_even = 1e18, ans_odd = 1e18;
vector <ll> UN_parent;
vector <pl> segtree;
vector <ll> lazy;
vector <ll> ... | ALGO | 0.999831 | 4.51694 | {
"github_metadata": {
"branch": "main",
"commit_count": 845,
"repo_created_at": "2022-10-18T11:21: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": "7159fb5caa... |
f14e659b-c4f0-4c73-acd6-a9b73bb2d290 | epruesse/ARB | DIST/di_protdist.hxx | // =============================================================== //
// //
// File : di_protdist.hxx //
// Purpose : //
// ... | ALGO | 0.997258 | 5.605862 | {
"github_metadata": {
"branch": "master",
"commit_count": 9367,
"repo_created_at": "2016-12-16T01:16:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "380d2e8... |
395e8fdd-452c-4c8a-affd-96f0791703ce | atubo/online-judge | leetcode/P0632.cpp | // https://leetcode.com/problems/smallest-range/#/description
// 632. Smallest Range
#include "BinaryTree.h"
#include "Graph.h"
#include "LinkedList.h"
#include "Util.h"
#include <bits/stdc++.h>
using namespace std;
class Solution {
using PII = pair<int, int>;
public:
vector<int> smallestRange(vector<vector<i... | ALGO | 0.999962 | 5.947577 | {
"github_metadata": {
"branch": "master",
"commit_count": 2295,
"repo_created_at": "2013-10-03T04:23:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f582504... |
f67aa57c-6110-4061-ba9e-db287af778ed | denis-gubar/TopCoder | II-144-1/Time.cpp | #include <algorithm>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <queue>
#include <vector>
using namespace std;
// BEGIN CUT HERE
#include <Windows.h>
#p... | TEST | 0.940545 | 4.052626 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-12-21T13:06: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": "2e7fbbd1cd... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.