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 |
|---|---|---|---|---|---|---|---|
40defe43-4ff8-473c-8aae-f17e2b36b46d | Fortuotu/Ott-Lang-ITA24 | src/file_utils.cpp | #include "file_utils.hpp"
std::vector<std::uint8_t> read_binary_file(const std::string& filename) {
std::ifstream file(filename, std::ios::binary);
if (!file) {
throw std::runtime_error("Error opening file");
}
file.seekg(0, std::ios::end);
std::streamsize file_size = file.tellg();
fil... | TOOL | 0.913143 | 6.82191 | {
"github_metadata": {
"branch": "refactor",
"commit_count": 42,
"repo_created_at": "2024-12-05T16:01:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34500ad... |
2fb515d2-3795-46d2-813a-ab2c26d9d598 | martakustra/AdventOfCode | 2021/Day5/day5_part2.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <string>
#include <map>
using namespace std;
int main() {
//read numbers from file and create vector
ifstream mySample("sample5.txt");
int column = 2;
int row = 10;
vector<vector <string> > pos_from(row);
vec... | ALGO | 0.99957 | 3.852445 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-12-01T21:10: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": "299bd23cd8c... |
d142d6b7-b53a-40ce-9a14-8c11573bbcff | biocro/biocro | src/module_library/partitioning_growth_calculator.h | #ifndef PARTITIONING_GROWTH_CALCULATOR_H
#define PARTITIONING_GROWTH_CALCULATOR_H
#include "../framework/module.h"
#include "../framework/state_map.h"
#include "BioCro.h" // for resp
namespace standardBML
{
/**
* @class partitioning_growth_calculator
*
* @brief Uses a set of partitioning coefficients to determi... | ALGO | 0.991297 | 7.092894 | {
"github_metadata": {
"branch": "main",
"commit_count": 3739,
"repo_created_at": "2015-03-04T02:15:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 46,
"forks": 23,
"issues": 26,
"pull_requests": 5
},
"file_meta": {
"content_id": "6ccb393... |
f6fae4ba-d14d-4ace-bd75-0b233048788b | pfmaggi/euler | cpp/src/p_0006.cc | #include "euler.h"
#include "iota_view.h"
// Function to calculate the sum of squares up to a given number
auto sum_of_squares(int upper_bound) {
// Use std::accumulate with a lambda for efficient summation of squares
auto numbers = iota_view{1, upper_bound + 1};
return std::accumulate(
numbers.beg... | ALGO | 0.995597 | 5.890403 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2022-12-24T15:14: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": "4f9de2a4c32... |
c388e143-71f5-4d5d-9e27-4f5118b369b1 | lucasxia01/Competitive-Programming-Problems | Codeforces/Stanford/WF Practice 1/B.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stdlib.h>
#include <time.h>
#include <complex>
#include <iterator>
#include <regex>
#include <fstream>
#include <utility>
#include <vector>
#include <string>
#include <cstring>
#include <stack>... | ALGO | 0.999969 | 4.743127 | {
"github_metadata": {
"branch": "master",
"commit_count": 227,
"repo_created_at": "2018-10-14T07:51: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": "fb636af4... |
2c92afd6-93ff-4fec-ae59-aaf3d6c4b9eb | mahroosanwar/CodingBlock | 23_LinkedLists/18CircularLinkedList_II_DeleteFunction.cpp | //Circular Linked List II - Delete Function
// Circular Linked List - Insertion
#include <iostream>
using namespace std;
//linked list is collection of nodes that store some data
//structure of node (need to rap your data and pointer into the same bucket)
class node{
public:
int data;
node*next;
// cons... | ALGO | 0.999836 | 5.054349 | {
"github_metadata": {
"branch": "main",
"commit_count": 542,
"repo_created_at": "2022-01-26T23:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3514ab7e22... |
5edcd8cc-66c8-4008-8587-0932bfe04648 | ytliu74/SJTU_Hogwarts | Paddle-Lite/lite/backends/arm/math/reduce_max_min.h | /* Copyright (c) 2019 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 applicable law or... | ALGO | 0.992389 | 6.948411 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-05-13T13:55:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ae95dc037d... |
9af9b071-7c07-4ce1-803a-bea361b5a003 | deepak-812/LeetCode_Submissions | Subarray with given sum - GFG/subarray-with-given-sum.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find a continuous sub-array which adds up to a given number.
vector<int> subarraySum(vector<int>arr, int n, long long s)
{
// Your code here
vector<int> ans... | ALGO | 0.999718 | 5.601333 | {
"github_metadata": {
"branch": "main",
"commit_count": 815,
"repo_created_at": "2022-08-31T08:46: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": "a4da28d7d7... |
648d65a3-ebd4-4690-9869-1cc938f01564 | ekamjit105/cpp_codes | PriorityqueueHeap.cpp | //<NAME>
//2019CSC1001
#include<iostream>
#include<cmath>
using namespace std;
//The binary tree used is implemented using array
class PqueueMinheap
{
int MAX; //total number of elements in heap
int *arr; //array to store heap elements
int n; //number of elements stored
public:
PqueueMinheap()
{ MAX... | ALGO | 0.999336 | 3.574777 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-20T09:27: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": "db23d468c35a... |
39e7b475-9f18-4326-aed2-8b71caecd89a | GGxiedongfeng/-work-area | BiTree/BiTree/main.cpp | #include<iostream>
#include"BinaryTree.h"
#include<string>
#include"queue.h"
using namespace std;
int main()
{
cout << "请输入前缀表达式(如+2*34+*34)或者字符串(如ABCD或12345):" << endl;
string definition;
cin >> definition;
char * def = NULL;
def = new char[definition.size() + 1];
def[0] = '#';
for (int i = 0; i < definition.... | ALGO | 0.999873 | 3.804888 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-04-25T06: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": "d37804afa... |
a539eb62-f29d-4760-a8c0-c013c6ea45f2 | sourabh59-coder/StriverA-Z_Sheet | Step 15: Graphs/Lec 4: Shortest Path Algorithms and Problems/08. Network delay Time/Approach1.cpp | class Solution {
public:
int networkDelayTime(vector<vector<int>>& v, int n, int k) {
vector<pair<int,int>> adj[n+1];
for(int i=0;i<v.size();i++)
{
int u1 = v[i][0];
int v1 = v[i][1];
int wt = v[i][2];
adj[u1].push_back({v1,wt});
... | ALGO | 0.999941 | 5.550434 | {
"github_metadata": {
"branch": "main",
"commit_count": 561,
"repo_created_at": "2024-05-18T07:12: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": "3233eeab06... |
3ef457fe-99b4-4bf3-8a6d-2fd01054c3a6 | marko1597/Programming-competitions | MIXTURES.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <math.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <ctime>
#include <time.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#includ... | ALGO | 0.999768 | 3.214892 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-10-25T16:37: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": "efbccb042a... |
c5c6acaf-3300-4046-b908-05d71b92779d | vu2825/Dynamic-Programming | 160725/bai19_1.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
struct Point {
double x, y;
Point(double x = 0, double y = 0) : x(x), y(y) {}
};
double distance(const Point& a, const Point& b) {
return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int main() {
... | ALGO | 0.999997 | 4.552988 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-07-13T10:21: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": "ca55eb0054bc... |
c4b37a59-bc55-42c6-a36f-910a38a82b72 | raykong1/Competitive-Programming-sols | Dmoj/ccc03s3.cpp | //
// Created by RayKo on 2020-03-03.
//
#include <bits/stdc++.h>
#define max 30
#define ll long long int
using namespace std;
char h[max][max];
bool vis[max][max] = {false};
//if u don't know bfs :sob:
int bfs(int r, int c){
int cur = 0;
list<vector<int>> q;
q.push_back({r,c});
if(vis[r][c]) return ... | ALGO | 0.999897 | 3.744112 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-05-08T00:29: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": "8e0f2bc383... |
210e49e3-4b4c-4d86-8690-c666b1e73e25 | fanzhijun301/leetcode | ValidParentheses.cpp | #include <iostream>
#include <string>
#include <stack>
using namespace std;
class Solution {
public:
bool isValid(string s) {
stack<char> pa_stack;
for (int i = 0; i < s.length(); i++) {
char c = s.at(i);
if (c == '(' || c == '[' || c == '{') pa_stack.push(c);
else {
if (pa_stack.empty()) r... | ALGO | 0.994627 | 6.075695 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-02-26T10:57: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": "afc59c412... |
cc353746-3b55-4a94-820c-6bdc62fa39b0 | LIZHICHAOUNICORN/Toolkits | leetcode/HashTable/max_points_on_a_line.cc | #include <algorithm>
#include <unordered_map>
#include <vector>
#include <gflags/gflags.h>
#include <glog/logging.h>
// Problem: https://leetcode-cn.com/problems/max-points-on-a-line/
using namespace std;
class Solution {
public:
int maxPoints(vector<vector<int>>& points) {
int len = points.size();
// 点的... | ALGO | 0.999651 | 5.593226 | {
"github_metadata": {
"branch": "main",
"commit_count": 370,
"repo_created_at": "2021-01-31T03:14:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5ccc8190f... |
b59be5ab-44c2-42b5-acd9-9b5040c6f3be | leshacsharp/itstep_C | lab 16/Source.cpp | #include<iostream>
#include<vector>
#include<algorithm>
class Count
{
int value;
public:
Count(const int x) : value(x){};
bool operator()(const int &y)
{
return y == value;
}
~Count(){};
};
class CountN
{
int value;
public:
CountN(const int x) : value(x){};
bool operator()(const int &y)
{
return y % valu... | TOOL | 0.992485 | 3.195155 | {
"github_metadata": {
"branch": "master",
"commit_count": 267,
"repo_created_at": "2017-02-02T17:23: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": "af230065... |
2a86ecb3-7c4a-4676-944f-314b5280752e | abahnasy/conpra | week_5/ProblemB.cpp | ////
//// Created by abahnasy on 21.05.20.
////
//// implementation based on https://www.geeksforgeeks.org/dinics-algorithm-maximum-flow/
//
//
//#include <bits/stdc++.h>
//#define REP(i,a,b) for (int i = a; i <= b; ++i)
//using namespace std;
//
///*
// Implementation of highest-label push-relabel maximum flow
// ... | ALGO | 0.993353 | 3.777312 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-04-24T23:49:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15b884e54... |
57fe0337-990c-421f-9075-052ced72a63d | gkahn13/bsp | slam/smooth/slam-smooth.cpp | #include "slam-smooth.h"
#include <vector>
#include <iomanip>
#include <sys/resource.h>
#include "util/matrix.h"
#include "util/Timer.h"
#include "util/logging.h"
extern "C" {
#include "smoothMPC.h"
smoothMPC_FLOAT **H_smooth, **f_smooth, **lb_smooth, **ub_smooth, **C_smooth, **e_smooth, **z_smooth;
}
Matrix<U_DIM>... | ALGO | 0.998756 | 5.343048 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2013-12-08T06:04:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5138090... |
167dd1b9-8741-4817-988b-cefda45f0320 | liuyubobobo/Play-Leetcode | 0501-1000/0853-Car-Fleet/cpp-0853/main.cpp | /// https://leetcode.com/problems/car-fleet/description/
/// Author : liuyubobobo
/// Time : 2018-06-17
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
/// Sort and Scan
/// Time Complexity: O(nlogn)
/// Space Complexity: O(n)
class Car{
public:
int position;
double time;
... | ALGO | 0.999594 | 5.931215 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "19... |
0bb6580b-df76-4088-a713-72235c7a8cfe | adrian-stanciu/adventofcode | 2021/07/main.cpp | #include <bits/stdc++.h>
using namespace std;
auto solve1(const vector<long>& v)
{
auto mid = v[v.size() / 2];
auto cost = 0l;
for (auto x : v)
cost += abs(mid - x);
return cost;
}
auto solve2(const vector<long>& v)
{
auto sum_n = [](auto n) {
return n * (n + 1) / 2;
};
... | ALGO | 0.999957 | 5.151929 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2019-12-29T08: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": "d7f96578... |
902cc940-bf96-4a01-a3e4-f0af39c7a10e | Snowbases/luna-plus | 4DyuchiGXGFunc/sort.cpp | #ifndef GLOBAL_FUNC_DLL
#define GLOBAL_FUNC_DLL extern "C" __declspec(dllexport)
#endif
#include "global.h"
GLOBAL_FUNC_DLL void __stdcall QSortIntASC(SORT_ITEM_INT* pArray,DWORD dwNum)
{
int pivot;
DWORD i,j,l,r;
SORT_ITEM_INT temp;
DWORD stp;
l = 0;
r = dwNum-1;
__asm
{
mov dword ptr[stp],esp
... | ALGO | 0.999555 | 4.384015 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-12-15T12:34:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 13,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "73e228a4... |
d4c544f9-19b9-4db7-8c8d-e3ceab85790e | xTayEx/xtayex-CompetitivePrograming | Codeforces/cf1427B.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#define mst(a, b) memset((a), (b), sizeof(a))
#define debug(x) cerr << "\033[01;31... | ALGO | 0.999974 | 3.434098 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2020-06-14T08: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": "20077ce3... |
89bfacd4-3142-432e-9b72-6ecbe416d210 | FaithALL/Hodgepodge | toy/lifeGame/Game.hpp |
#ifndef GAME_HPP
#define GAME_HPP
#include <array>
#include <random>
#include <memory>
#include <SDL2/SDL.h>
#include <algorithm>
template <int, int> class lifeGame;
//图形展示
template<int WIDTH, int HEIGHT>
class Game {
public:
Game() {
SDL_Init(SDL_INIT_VIDEO);
window.reset(SDL_CreateWindow("Gam... | ALGO | 0.959719 | 5.009766 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-12-25T07:48: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": "a950f48d0... |
f3cdf8f2-28e2-40fa-a190-d0a3add4999e | pranav-prashob-1602/Cpp-Codes | Competitive Programming/223339A.cpp | #include<bits/stdc++.h>
/*
shinchanCoder Here!!
*/
using namespace std;
#define pb push_back
#define all(x) begin(x), end(x)
#define allr(x) rbegin(x), rend(x)
#define sz(x) (int)(x).size()
#define ff first
#define ss second
#define mp make_pair
#define ll long long
#define ld long double
#define lli long long... | ALGO | 0.999997 | 3.828887 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-04-12T07:00: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": "460dfd4ee77... |
24ae7bf4-f7e7-45cf-9110-c54a31af3b9f | gp-antennas/Sph._Harmonics_And_Paperclip | SimpleLooping/SimpleLoopingMaximizer.cpp |
// Written by: <NAME>
// Date: 3/12/18
/* Goal: To see how well the SphHarEvolRing.1.3.cpp code works, we write this competitor code whose
job is to achieve a given fitness score for a given theta and phi by repeadedly randomly
generating 13 coefficients until one combination gets a score higher than asked for.
*... | ALGO | 0.999837 | 4.505569 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2017-06-30T02:01:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "942d541a66... |
235d6c22-8484-42e7-98e5-ebf9bed0292f | DiogoP98/Problem-Solving | SPOJ/PERIOD.cpp | /**
Complexidade: O(n);
Explicacao: Comecamos por executar a failure function do KMP, o que nos da um vetor f. Neste vetor,
estao guardados os possiveis shifts. Vamos depois percorrer o vetor e para cada posicao, se o valor
no vetor menos a posicao atual dividir a posicao atual, entao significa que e uma repetica... | ALGO | 0.999411 | 3.770067 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2018-09-26T21:39: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": "392c7a7e7... |
c985bdbd-711c-401e-8f35-29ed4d6365b7 | MakerFace/leetcode | src/Feb/2.23/14.cpp | /**
* @file 14.cpp
* @brief 最长公共前缀
* @author chenqi (<EMAIL>)
* @version 1.0
* @date 2022-02-23
*/
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution
{
public:
string longestCommonPrefix(vector<string> &strs)
{
string res;
char temp = ' ';
... | ALGO | 0.999107 | 4.92423 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2022-02-24T06:13: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": "a2d5b4d3b5... |
d1e7d24f-2c46-4d06-9a70-aaf1d24d2625 | risal-shefin/ProblemSolving | codeforces/1417/E.cpp | // #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define dd double
#define ld long double
#define sl(n) scanf("%lld", &n)
#define si(n) scanf("%d", &n)
#define sd(n) scanf("%lf", &n)
#d... | ALGO | 0.999761 | 3.505882 | {
"github_metadata": {
"branch": "master",
"commit_count": 1844,
"repo_created_at": "2021-09-16T15:53:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "556b8ba... |
e0dbc4a0-3781-42e1-8a4c-7d8c8108041f | swarnim992/tambola | tambola.cpp | #include<bits/stdc++.h>
using namespace std;
vector<vector<int>> tk(3,vector<int>(9));
//vector<vector<int>> tb(3,vector<int>(9));
vector<vector<vector<int>>> r;
int i, j, k;
vector<int> aa={0,1,2,3,4,5,6,7,8};
vector<vector<int>> nums={{1,2,3,4,5,6,7,8,9},{10,11,12,13,14,15,16,17,18,19},{20,21,22,23,24,25,26,2... | ALGO | 0.995948 | 4.360144 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-01-20T14:26: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": "f5faf84f7fc7... |
414906ee-231b-43f0-807c-df3697c0a95d | sonjoykp/buet-cse-homeworks | CSE 462 Algo Engineering Lab/Algo Engineering offline 2/offline_2_1205079_final_version/LPsetCover.cpp |
#include<bits/stdc++.h>
#define forl(i,n) for(int i=0;i<(int)n;i++)
#define pb(x) push_back(x)
#define mem(x,y) memset(x,y,sizeof(x))
#define mp make_pair
#define pii pair<int,int>
#define uu first
#define vv second
#define sdi(x) scanf("%d",&x)
#define sdii(x,y) scanf("%d%d",&x,&y)
using namespace std;
#define MA... | ALGO | 0.999706 | 3.118023 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-07-14T09:15: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": "7a9f4b7a0c... |
697cf6ff-ab28-4477-88a2-ea271566c340 | monalisagreen/lab2 | bst.cpp | #include<iostream>
using namespace std;
class Node{
public:
//class variables
int data;
Node * l;
Node * r;
Node(int value){
data = value;
l = NULL;
r = NULL;
}
};
class BST{
public:
Node * root;
//constructor
BST(){
root = NULL;
}
void in... | ALGO | 0.9999 | 4.314887 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-01-12T15:04: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": "e450e6ca69... |
3f9953d7-2f70-4064-a589-49748a4dca95 | Rohit--Sharma/CompetitiveCoding | GeeksForGeeks/UniqueRowsInABooleanMatrix.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <stack>
#include <map>
#include <queue>
#include <list>
#include <algorithm>
using namespace std;
#define MAX 1000
struct TrieNode {
TrieNode *children[2];
TrieNode() {
for (int i = 0; i < 2; i++)
children[i] =... | ALGO | 0.999222 | 4.273308 | {
"github_metadata": {
"branch": "master",
"commit_count": 175,
"repo_created_at": "2014-10-16T13:17: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": "16fd5f1c... |
9415a086-0723-417d-be5e-3fb9b4760b61 | krimson701/2019_Crypto_Contest | 2번_암호구현 및 최적화 문제/2019암호경진대회_2번_답안코드_조재훈.ino |
#include <Math.h>
#define ROUND_NUM 100
typedef unsigned char u8;
u8 key[2] = { 0x12, 0x34 };
u8 rnd[ROUND_NUM * 2] = { 0, };
u8 text[2] = { 0x56, 0x78 };
u8 sbox[256]={
0xFF,0xFE,0xFD,0xFC,0xFB,0xFA,0xF9,0xF8,0xF7,0xF6,0xF5,0xF4,0xF3,0xF2,0xF1,0xF0,
0xEF,0xEE,0xED,0xEC,0xEB,0xEA,0xE9,0xE8,0xE7,0xE6,0xE5,0xE4,0xE3,0xE... | ALGO | 0.999659 | 3.192507 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-19T13:03:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b98d4608e... |
43add802-a000-4734-af86-ee7885d0d3bd | Redleaf23477/ojcodes | codeforces/round711/C.cpp | // by redleaf23477
#include <bits/stdc++.h>
// iostream macros
#define endl '\n'
#define var(x) "[" << #x << "=" << x << "]"
// chrono macros
#define chrono_now std::chrono::high_resolution_clock::now()
#define chrono_duration(t1, t2) std::chrono::duration<double>(t2-t1).count()
#define chrono_rand_seed chrono_now.tim... | ALGO | 0.999977 | 4.96062 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2017-10-19T06:38: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": "7658902d... |
2ae9c437-249b-4848-bc9e-2648faeccf54 | tsuchan19991218/atcoder_achievement | atcoder.jp/zone2021/zone2021_c/Main.cpp | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
vector <int> dy = {0, 1, 0, -1};
vector <int> dx = {1, 0, -1, 0};
const int INF = 1000000000;
const ll INFLL = 100000000000000000;
long long pow(long long x, long long n) {
l... | ALGO | 0.999896 | 4.474454 | {
"github_metadata": {
"branch": "master",
"commit_count": 387,
"repo_created_at": "2020-08-24T19:03: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": "5597ea3d... |
c3f791f0-3b61-4e4a-9174-d05720dbbc8b | libaoquan95/LintCode | 第2章-38-搜索二维矩阵 II.cpp | #include <iostream>
#include<vector>
using namespace std;
class Solution {
public:
/**
* http://www.lintcode.com/zh-cn/ladder/6/-第2章-38-搜索二维矩阵 II
* @param matrix: A list of lists of integers
* @param target: An integer you want to search in matrix
* @return: An integer indicate the total occurr... | ALGO | 0.999957 | 5.388646 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-05-03T01:51:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57fbc04847... |
59ec51dc-74dd-4f59-ae35-f8742f910f68 | st117158/2023-cpp-autumn | 2023.09.22-Homework-2/Task4.cpp | #include <iostream>
int main (int argc, char* argv[])
{
int n = 0;
int Price1 = 15;
int Price5 = 70;
int Price10 = 125;
int Price20 = 230;
int Price60 = 440;
std::cin >> n;
int count60 = n / 60;
int n1 = n % 60;
int count20 = n1 / 20;
int n2 = n1 % 20;
int count10 = n2 /... | ALGO | 0.996652 | 3.506723 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2023-09-05T18:08: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": "37614d47313... |
4a2fe93b-230e-4d90-b659-9523d8158575 | Lange-Taylor/test | _3_23_1/_3_23_1/test.cpp | #include <stdio.h>
#include <stdlib.h>
void sxh(int n) {
int x, y, z;
x = n/100;
y = (n/10)%10;
z = n % 10;
if (x * x * x + y * y * y + z * z * z == n) {
printf("%d\t",n);
}
}
int main() {
///*int n = 7;
//int j = 0;
//int i = 0;
//for (j = 1; j <= n; ++j) {
// for (i = 0; i < 2 * n; ++i) {
// if (i ... | ALGO | 0.998088 | 3.059336 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2019-06-24T06:24: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": "8c2709171... |
defdba4a-951f-466c-bce8-40bf05dad411 | ishandutta2007/codeforces-j | jaroslavurban/normal/1365/F.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
// use unique(x) - removec consecutive items, returns vec.begin() + number of items
// for vector: sort(all(vec)); vec.erase(unique(all(vec)), vec.end());
// use iota(all(vec), 0) for filling a vector ... | ALGO | 0.999963 | 4.263899 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42: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": "38afc2fdb617... |
fa9ae88a-ab25-4f4b-a9e7-944ef23e8762 | parasguglani1/LeetCode | 0834-sum-of-distances-in-tree/0834-sum-of-distances-in-tree.cpp | class Solution
{
private:
// Function for the first DFS traversal
int dfs1(int node, int parent, vector<int> adj[], vector<int> &count_child, vector<int> &ans)
{
int sum = 0;
int val = 0;
// Traverse through the adjacent nodes of the current node
... | ALGO | 0.999976 | 6.011171 | {
"github_metadata": {
"branch": "main",
"commit_count": 2175,
"repo_created_at": "2022-12-18T12:37:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac1422df2... |
d737150f-ffe1-47ef-bdcd-d20176d0e650 | VastoLorde95/Competitive-Programming | CodeChef/SNACKDOWN/16/Elimination/Problem D/brute.cc | #include <bits/stdc++.h>
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(__typeof((v).begin()) it=(v).begin(); it != (v).end(); ++it)
#define meta __FUN... | ALGO | 0.999741 | 3.304034 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-07-25T11:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 171,
"forks": 41,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f55109... |
6878fd87-b526-4ba2-b7f3-a9632fcfa4b4 | ElinRin/algorithms_1.2 | levenshtein2.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <fstream>
using std::cin;
using std::cout;
using std::string;
using std::min;
using std::vector;
using std::swap;
using std::stringstream;
using std::ifstream;
void wagner_fischer_alg(string & line1, string & line2, int &result)
{ ... | ALGO | 0.999992 | 3.930172 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2014-03-03T11:30:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "009e0aa6f... |
82e6f390-12bf-47ab-bffe-185080327d3a | n-yata/AtCoder-ABC | C/C224.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
template<class t> inline bool chmax(t& a, t b) { if (a < b) { a = b; return 1; } return 0; }
template<class t> inline bool chmin(t& a, t b) { if (a > b) { a = b; return 1; } return 0; }
const ll inf = 1l... | ALGO | 0.99979 | 4.583711 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2021-01-29T20:45: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": "67089f1f8f6... |
271fe804-4050-4e13-8d94-3a69ccbaecd5 | junchanpp/algorithm | OLD/15569.cpp | #include <iostream>
using namespace std;
int memo[10001] = {0,};
int N, M;
long long solve(int index){//index(m)에서 블럭 생성
if(index > M){
return 0;
}
else if(index == M){
return 1;
} else if(memo[index] != 0){
return memo[index];
}
//항상 현시점에서 블럭을 1~N 크기까지 생성한다.
//마지... | ALGO | 0.999994 | 4.172799 | {
"github_metadata": {
"branch": "main",
"commit_count": 113,
"repo_created_at": "2023-02-16T10:07: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": "ecda32cf67... |
e3ecb08b-9bb3-4ba8-b1eb-3b471ec71be1 | bochko99/BAK-Labs | BAKLabs.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
class Spring {
public:
Spring(double c, double x) {
k = c;
lo = x;
l = x;
m1 = 0;
m2 = 0;
}
void deform (double dx) {
l += dx;
}
float length() {
return l;
}
float length0() {
return lo;
}
float Stif() {
return k;
}... | ALGO | 0.999651 | 4.100392 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2019-05-01T18:12:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40d4d07e6... |
c5a09ac6-5103-45fa-bec3-96f3d11b3e24 | hoangnv-bkhn/omnetpp_smart_transportation | src/veins_inet/Utility.cc | #include "Utility.h"
#include <bits/stdc++.h>
#include <chrono>
#include <cmath>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <random>
#include <string>
#include <vector>
#include <regex>
#include "Constant.h"
using namespace std;
using namespace Utility;
/... | DATA | 0.9012 | 3.423215 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-12-08T14:41: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": "f33c14907f... |
479c4f05-f72c-4e38-883d-3db731a2644d | PuppyRush/Algorithms | Codejam/CodeJam2016QualificationA_CountingSheep/CodeJam2016QualificationA_CountingSheep/solve.cpp |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;
int main() {
freopen("A-large-practice.in", "r", stdin);
freopen("A-large-practice.out", "w", stdout);
int size = 0;
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.precision(10);
int caseSize... | ALGO | 0.998973 | 3.677638 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2017-04-19T08:20: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": "e3cc80558... |
c97912b7-7204-4017-8e5f-905960647628 | RL-S/Kokkidio | src/tests/friction/friction_native_sycl.cpp | #include "friction.hpp"
namespace Kokkidio::gpu
{
template<Target target, Kernel k>
void friction(
ArrayXXs& flux_out,
const ArrayXXs& flux_in,
const ArrayXXs& d,
const ArrayXXs& v,
const ArrayXXs& n,
int nRuns
){
Index nCols { flux_out.cols() };
sycl::queue queue(sycl::gpu_selector{});
auto alloc = [&](cons... | ALGO | 0.998745 | 6.20443 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2024-07-30T14:35:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b3354493b6... |
d3d8f402-256e-4128-94a0-648f2117a7ac | Srivallikuppala/Gfg | Difficulty: Easy/Compare two fractions/compare-two-fractions.cpp | //{ Driver Code Starts
#include <iostream>
#include <regex>
using namespace std;
// } Driver Code Ends
class Solution {
public:
string compareFrac(string str) {
// Code here
vector<string> vtr;
string c,d,x,p;
float a,b;
float maxi = 0.0;
for(auto it:str){
... | ALGO | 0.996019 | 5.541514 | {
"github_metadata": {
"branch": "main",
"commit_count": 209,
"repo_created_at": "2024-01-06T04:29: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": "b767137522... |
2aee9d7c-5e7f-40c9-83fc-b6e16a92a628 | rasinhas/Maratona | codeforces/ABBYY/final/a.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <cstring>
#include <map>
#define pb push_back
#define mp make_pair
#define sz size()
using namespace std;
typedef long long ll;
ll a[500000];
ll ac[500000];
map <int,int> p;
int main()
{
in... | ALGO | 0.999995 | 3.55572 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2013-05-02T18:32:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41ac09cc6... |
2e005d3f-12b2-4ab9-92d2-c0de5cb2cfce | next-step-for-interview-prep/Daily-leetcode-problem_with_detailed_solutions | 010-10th_jan-Binary_tree_infected_time/code.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
#include <queue>
#include <unordered_set>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
... | ALGO | 0.99997 | 5.651938 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2023-12-27T00:41:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ed0b9afce... |
b2838ade-7872-452a-9aff-08e1a855d172 | Abu-Sayed11/Compiler_Design_Lab | Q4.cpp | /*
Build a lexical analyzer implementing the following regular expressions:
Integer variable = (i-nI-N)(a-zA-Z0-9)*
ShortInt Number = (1-9)|(1-9)(0-9)|(1-9)(0-9)(0-9)|(1-9)(0-9)(0-9)(0-9)
LongInt Number = (1-9)(0-9)(0-9)(0-9)(0-9)+
Invalid Input or Undefined = Otherwise
*/
// Sample input: Iakd34
#include <bits/stdc++... | ALGO | 0.99896 | 3.968056 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-02-04T04:21:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b03d15ac9221... |
48b64fa5-c1a5-41eb-b03f-28844efbd847 | justinmello32/cst370_hw3_2 | hw3_2.cpp | /*
* Title: hw3_2.cpp
* Abstract: This program reads an input graph data from a user first.
Then, it should present a path for the travelling salesman
problem.
* Author: <NAME>
* ID: 2002
* Date: 03/23/2021
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace ... | ALGO | 0.999891 | 4.216676 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-03-17T20:06: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": "90490529aee... |
dc318b35-0090-41a9-8ea3-01944655db28 | kasha01/comp-programing | geeks4geeks/_c++/code_jam/2017_round_b_a_math_encoder.h | #ifndef 2017_ROUND_B_A_MATH_ENCODER_H_INCLUDED
#define 2017_ROUND_B_A_MATH_ENCODER_H_INCLUDED
// https://code.google.com/codejam/contest/11304486/dashboard
using namespace std;
// my solution O(n^2)
#define m(a) (a%1000000007)
typedef unsigned long long int uint64;
uint64 power(uint64 x, unsigned int y, int p)
{
... | ALGO | 0.999939 | 4.514832 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2016-06-09T02:12:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c70ef3a97... |
400c6abb-72aa-474e-b7eb-c632915d483d | 95CXY/leetcode | TwoPointer/30_串联所有单词的子串/30.串联所有单词的子串.cpp | /*
* @lc app=leetcode.cn id=30 lang=cpp
*
* [30] 串联所有单词的子串
*/
// @lc code=start
class Solution {
public:
vector<int> findSubstring(string s, vector<string>& words) {
unordered_map<string, int> wordMap;
for (auto word : words) wordMap[word] ++;
unordered_map<string, int> wordMapTemp(word... | ALGO | 0.999919 | 6.49194 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2020-10-15T06:15:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aae2a9330879... |
928b583b-d3e3-46d4-9cec-416349174849 | Zachary-Crimmel/GitHub_Problems | Fibonacci/Fibonacci.cpp | #include <iostream>
using namespace std;
void fibonacciIterative(int n){
int n1 = 0;
int n2 = 1;
int sum = 0;
cout << n1 << " "<< n2 << " ";
for(int i = 0; i < n - 2; i++){
sum = n1 + n2;
n1 = n2;
n2 = sum;
cout << sum << " ";
}
return;
}
void tailRecursi... | ALGO | 0.999944 | 5.785913 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-03-05T02:57: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": "29cb5cdc0d5d... |
7ba88109-bc0f-4eea-ac9b-41b44c519bcb | dotpep/c_pp-sample-space | IITU_class_practice/class-11_11_2024/main.cpp | #include <iostream>
#include <cmath>
#include <cstdlib>
#include <string>
using namespace std;
#define M_PI 3.14159265358979323846
double function1(double x) {
return fabs(x - 1.5) + pow(x, 4.0 / 5.0) + pow(exp(3 * x) + 4, 1.0 / 3.0);
}
double function2(double x) {
return tan(5.0 / 3.0 * x) + log(fabs(2 *... | ALGO | 0.999315 | 4.073531 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2023-10-09T18:27:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc0f476c4... |
f111ff63-2b75-4f8b-91ba-2ce9bb5f6a11 | Vaibhavverma19/data-structures-and-algorithm | heaps/_002_heapsort.cpp | #include <bits/stdc++.h>
void heapify(int index, vector<int> &arr, int n)
{
int largest = index;
int left = 2 * index + 1;
int right = 2 * index + 2;
if (left < n && arr[largest] < arr[left])
{
largest = left;
}
if (right < n && arr[largest] < arr[right])
{
largest = rig... | ALGO | 0.999949 | 5.463266 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2023-07-18T14:55: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": "b2a26762d... |
29b7e28d-a797-4d51-8379-e9ef886cbff0 | yzx-1/parallel-string-match | kmp.h | // kmp.h
#pragma once
#include <vector>
#include <string>
#include <omp.h>
std::vector<int> computePrefix(const std::string& pattern) {
int m = pattern.size();
std::vector<int> prefix(m, 0);
int k = 0;
for(int i = 1; i < m; ++i) {
while(k > 0 && pattern[k] != pattern[i])
k = prefix[... | ALGO | 0.999843 | 5.736977 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-06-23T09:05:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7f1c236da2f... |
b4bd705a-78b7-4af1-b32e-059533ab60bb | punit1808/DSA | Extra_Course_Questions/Graph/CheckCycle.cpp | #include<iostream>
#include<unordered_map>
#include<list>
#include<queue>
using namespace std;
class Graph{
public:
unordered_map<int,list<int>> map;
void Insertion(int u,int v,bool check){
map[u].push_back(v);
if(!check){
map[v].push_back(u);
}
}
void display()... | ALGO | 0.999797 | 5.083146 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-26T14:37:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94ad02212d29... |
27d8bb36-e3d8-4ba6-b729-952287afca7f | Ing-Josef-Klotzner/python | _altf4_and_the_beetles.cpp | #include <iostream>
#include <algorithm>
using namespace std;
template <typename T> inline void inp (T &n) {
n = 0;
int ch = getchar_unlocked (), sign = 1;
while (ch < '0' || ch > '9') {
if (ch == '-') sign = -1;
ch = getchar_unlocked ();
}
while (ch >= '0' && ch <= '9')
n = (n << 3) + (n << 1) + ch - '0'... | ALGO | 0.99966 | 3.604611 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-05-28T14:05: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": "3fda420cf... |
393f55d8-e407-4728-b70c-d0aa3144aa13 | BHOJANE-VARUN/MyVscode | cp/topic_wise/bit manipulation/Mystical_Numbers.cpp | #define ll long long int
#include<bits/stdc++.h>
#define for0(i,b) for(ll i=0;i<b;++i)
#define rloop(i,a,b) for(ll i=a;i>=b;i--)
#define in(a,n) for(ll i=0;i<n;++i) cin>>a[i];
#define pb push_back
#define all(v) v.begin(),v.end()
#define dis(v) for(auto i:v)cout<<i<<" ";cout<<endl;
#define display(arr,n) for(int i=0; i... | ALGO | 0.999744 | 4.580607 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2024-02-11T12:33:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dace278233d... |
c924e671-0b00-458f-a7c3-a65a77982db0 | ecoon/ats-columns | src/pks/mpc/mpc_flowreactivetransport_pk.cc | /*
This is the mpc_pk component of the Amanzi code.
Copyright 2010-201x held jointly by LANS/LANL, LBNL, and PNNL.
Amanzi is released under the three-clause BSD License.
The terms of use and "as is" disclaimer for this license are
provided in the top-level COPYRIGHT file.
Authors: <NAME>
PK for cou... | TOOL | 0.974953 | 6.02714 | {
"github_metadata": {
"branch": "master",
"commit_count": 2750,
"repo_created_at": "2017-07-06T11:51: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": "606499e... |
1ed7a5f8-7f51-477c-8c6a-45692361f58b | nmpogg/CodePTIT | c/chatgpt.cpp | #include <stdio.h>
int main() {
int arr[] = {1, 2, 3, 4, 5, 1, 3, 6, 8};
int n = sizeof(arr) / sizeof(arr[0]);
int freq[n];
int count = 0;
// Kh?i t?o t?t c? các ph?n t? c?a m?ng freq là 0
for (int i = 0; i < n; i++) {
freq[i] = 0;
}
// Duy?t qua m?ng arr và tăng giá t... | ALGO | 0.999946 | 3.229049 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-09-06T09:00:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9fff7bf963... |
67cc0d4c-7df1-4240-8795-a322fc424ade | bvquoc/CP-Trainning-2021 | 0 - Contest 2020/Ninh Binh PreVNOI 2017/PREVNOIB/Contestants/Ti137/MINSUM.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <cmath>
#include <ctime>
#include <cstdlib>
#define NAME "MINSUM."
#define FOR(i,a,b) for(int i=a;i<=b;++i)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
ll a,b;
queue<ii> q;
vector<vector<bool>> d(2501,vector<bool>(2... | ALGO | 0.999845 | 3.776716 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2020-06-03T07:47:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3db1529... |
dd7cc2dc-5be9-452c-8e5d-78bd3c15c326 | vncoelho/optmarket-bittrex | OptFrame/Experimental/Moves/MoveVVSwapkIntra.hpp | // OptFrame - Optimization Framework
// Copyright (C) 2009-2015
// http://optframe.sourceforge.net/
//
// This file is part of the OptFrame optimization framework. This framework
// is free software; you can redistribute it and/or modify it under the
// terms of the GNU Lesser General Public License v3 as published by... | ALGO | 0.983933 | 6.706174 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-07-03T09:44:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "27e5d952b2... |
48deca3b-a452-4e6b-9d65-cbb6ebfc9fff | WhiZTiM/coliru | Archive2/4f/557a7ebb9959e0/main.cpp | #include <iostream>
constexpr int gcd( int a, int b ) { return a<b ? gcd(b,a) : b ? gcd( b, a%b ) : a ; }
constexpr int lcm( int a, int b ) { return a * b / gcd( a, b ) ; }
constexpr int sum_first_m_multiples_of_n( int n, int m ) { return n * m * (m+1) / 2 ; }
constexpr int sum_multiples_of_n_lt_m( int m, int n )
... | ALGO | 0.997874 | 4.8667 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16dfa0... |
b0f8d484-e112-4a7a-a7fa-d7771ab65320 | bjut-hz/basics | leetcode_c++/94.binary-tree-inorder-traversal.cpp | /*
* @lc app=leetcode id=94 lang=cpp
*
* [94] Binary Tree Inorder Traversal
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
publi... | ALGO | 0.999998 | 6.800966 | {
"github_metadata": {
"branch": "master",
"commit_count": 476,
"repo_created_at": "2018-08-13T12:30:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7db188ed... |
baedaa60-781d-41b4-9053-8f416214ec06 | ishandutta2007/codeforces-r | receed/normal/1242/A.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cassert>
#include <string>
#include <set>
#include <map>
#include <random>
#include <bitset>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <deque>
... | ALGO | 0.999891 | 3.916851 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de6978ea8d73... |
3978b215-42e3-4ed1-8e20-598bbdf5a07b | willemhscott/CSCI-2270 | lab-11/hash.cpp | // CPP program to implement hashing with chaining
#include<iostream>
#include "hash.hpp"
using namespace std;
node* HashTable::createNode(int key, node* next)
{
node* nw = new node;
nw->key = key;
nw->next = next;
return nw;
}
HashTable::HashTable(int bsize)
{
this->tableSize= bsize;
table =... | ALGO | 0.999483 | 4.952466 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-05-17T18:07: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": "bb1fa3768e... |
61868e65-6bfd-410d-9afd-28e7fff11e60 | artemp/closest_point | boost/geometry/extensions/strategies/cartesian/closest_point.hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2013 <NAME>, Amsterdam, the Netherlands.
// Copyright (c) 2008-2013 <NAME>, Paris, France.
// Copyright (c) 2009-2013 <NAME>, London, UK.
// Copyright (c) 2013 <NAME>, Lodz, Poland.
// Copyright (c) 2017 <NAME>, UK
// Use, modification and di... | ALGO | 0.999767 | 7.13072 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-09-15T13:52:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "21278cc0... |
442f62dc-b3f5-4b08-8b03-de9033c91539 | MuhammadAbuBakarQureshi/Cpp-Learning-Journey | Array/Exercise(W3-Resources)/Largest-Three-Numbers.cpp | #include <iostream>
#include <math.h>
using namespace std;
void threeLargest(int arrSize, int arr[])
{
int first = 0, second = 0, third = 0;
if (arrSize < 4)
{
cout << "Array Is Too Short To Perform This Task" << endl;
}
else
{
for (int i = 0; i < arrSize; i++)
{
... | ALGO | 0.999962 | 3.97771 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2024-02-27T14:47:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdf38006ac... |
96bebdcf-626a-4074-98d7-346935ebcc0d | Mathias3004/quantum-trajectories | utils/entropy.h |
#include "itensor/all.h"
#include "itensor/util/parallel.h"
#include "boson.h"
using namespace std;
using namespace itensor;
#ifndef entropy
#define entropy
double S_vn(IQMPS &psi, int b, int alpha=1)
{
if (b==0 || b==psi.N()){
return 0.;
}
//"Gauge" the MPS to site b
psi.position(b);... | ALGO | 0.995333 | 4.032125 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-05-21T13:59:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "045e6365525a... |
bbff1be6-1296-4585-871c-2edd6d67b409 | mysql/mysql-server | extra/boost/boost_1_85_0/boost/geometry/algorithms/detail/overlay/colocate_clusters.hpp | // Boost.Geometry
// Copyright (c) 2023 <NAME>, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_COLOC... | ALGO | 0.981208 | 7.35772 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 186679,
"repo_created_at": "2014-09-26T09:31:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11540,
"forks": 4072,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "... |
db9b2d47-dd0c-4474-a654-36aaa9b8de5c | 01prashu/Data-Structure-Algorithm | Tree/inorder_traversal.cpp | #include<iostream>
#include <stack>
#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 *createTree(node *root)
{
int d;
cout<<"Enter data"<<endl;... | ALGO | 0.999954 | 4.987368 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-06-28T12:46: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": "cfef8b849b... |
57bdb732-844b-40a9-92bf-01950b16bc54 | hatefsystems/search-engine-core | src/crawler/URLFrontier.cpp | #include "URLFrontier.h"
#include "../../include/Logger.h"
#include <algorithm>
#include <regex>
#include <sstream>
#include <iomanip>
URLFrontier::URLFrontier() {
LOG_DEBUG("URLFrontier constructor called");
}
URLFrontier::~URLFrontier() {
LOG_DEBUG("URLFrontier destructor called");
}
void URLFrontier::addU... | ALGO | 0.974812 | 6.637873 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2024-10-22T18:26:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "caef7df435... |
61128fa1-0215-404d-9880-edbcec53a7f3 | Kgotta-contribute/Leetcode | Strivers - Four Sum/Solutions.cpp | // <NAME>
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
vector<vector<int>> ans;
sort(nums.begin(), nums.end());
for(int i = 0; i< nums.size(); i++){
if(i>0 && nums[i] == nums[i-1]... | ALGO | 0.999988 | 5.607369 | {
"github_metadata": {
"branch": "main",
"commit_count": 282,
"repo_created_at": "2023-07-10T13:35:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2419e95338... |
0a01a2c6-cbc5-4c77-9a79-5ded53a7f962 | hi-ogawa/practice | codeforces/problemset/20C/main.cpp | // AC
#include <bits/stdc++.h>
using namespace std;
// Utility
#define ALL(X) (X).begin(), (X).end()
#define FOR(I, X, Y) for (int I = (X); I < (Y); I++)
using ll = int64_t;
using ull = uint64_t;
template<typename T> struct is_container {
template<typename C> static char test(typename C::const_iterator*); template<ty... | ALGO | 0.999995 | 4.230829 | {
"github_metadata": {
"branch": "main",
"commit_count": 888,
"repo_created_at": "2020-07-14T04:24: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": "2a25d580d9... |
a70c36b5-fe9e-466e-ab37-bf8820fcc45d | azh248/Competitive-Programming | Platinum/deleg.cpp | /*
ID:azh248
LANG:C++
TASK:deleg
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define MOD 1000000007
#define nl "\n";
#define pb push_back
int n, k;
vector<int> adjLists[100000];
int par[100000];
unordered_set<int> visited;
void dfs(int node) {
visited.insert... | ALGO | 0.999858 | 3.961678 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2021-11-15T19:18:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "045811c6ac4c... |
ce614b72-632e-4136-905d-e3f7437c41e9 | wolfviking0/webcl-box2d | Box2D/Common/OpenCL/b2CLSolver.h | /*
*
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must rep... | ALGO | 0.991266 | 5.300412 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2014-10-17T06:51:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f3648adc4da... |
3d0c6ab4-d677-42bd-83a5-e62978ce0a92 | amwolff/ALGO2020 | week-4/jed/jed.cpp | #include <algorithm>
#include <cstdio>
#include <map>
#include <vector>
using namespace std;
int main() {
int n;
scanf("%d\n", &n);
const size_t s = n;
vector<int> a(s), b(s), c(s);
for (size_t i = 0; i < s; i++) {
scanf("%d", &a[i]);
}
for (size_t i = 0; i < s; i++) {
scanf("%d", &b[i]);
}
... | ALGO | 0.999524 | 3.653837 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2020-03-11T20:13: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": "d18b7ef65... |
5581bbaf-ac5e-4fcb-a49d-c8ed9c6fce79 | hoshinon57/Algorithm | AtCoder/ABC301-400/ABC361-370/ABC362-C.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;
// const ll INF64 = 1LL << 60;
const ll INF64 = ((1LL<<62)-(1LL<<31)); // 10^18より大きく、かつ2倍しても負にならない数
const int INF32 = 0x3FFFFFFF; // =(2^30)-1 10^9より大きく、かつ2倍しても負にならない数
template<cla... | ALGO | 0.999998 | 3.993639 | {
"github_metadata": {
"branch": "master",
"commit_count": 2016,
"repo_created_at": "2022-04-21T13:54: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": "1c60971... |
6ef44f4d-ee9d-4c32-ae48-0383034a70cf | Hoikoro/procon | Codeforces/367D.cpp | #include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <functional>
#include <complex>
#include <numeric>
#include <bitset>
using namespace std;
typedef... | ALGO | 0.999852 | 3.414041 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2017-06-18T08:31: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": "d9e7173d9... |
d4da4747-1424-42fe-addb-9ff2f0a06b92 | Zapryanovx/FMI_2023_Introduction_to_Programming | 00_other_repos_tasks/exam_example_tasks_2022/08_check_if_year.cpp | //#include <iostream>
//
//const int MAX_SIZE = 100;
//
//int CheckDate(char* str);
//
//int main()
//{
// char str[MAX_SIZE] = "";
// std::cin.getline(str, MAX_SIZE);
//
// std::cout << CheckDate(str);
//
// return 0;
//}
//
//int CheckDate(char* str)
//{
// int size = 0;
// while (str[size])
// {
// size++;
// }
//
... | ALGO | 0.985651 | 3.724038 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2023-10-20T09:18:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2225b32f1a... |
43da08cf-c9d8-435a-89c9-84c4031de149 | Nickz163/ASM_MIET | Lab_4/ex2_3/main.cpp | //Лабораторная работа 4.
//Использование ассемблерных вставок в программах на C++
// ЗАДАНИЕ 2 (и 3).
/*
Разработайте и выполните программу, в которой реализуйте при помощи
ассемблерной вставки нахождение y(x)
y(x) = x%4 − x (2 ВАРИАНТ из лабораторной работы 3)
y(x) - функцию, вычисляющую целое выражение от... | ALGO | 0.989852 | 3.499516 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2017-10-10T17: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": "95b4b1d62... |
93736fb7-3ce7-4f94-bb19-852d961fc869 | Jinky-X/DataSturcture-Homework | Lab4/t4.cpp | #include<iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include<stdexcept>
#include<iomanip>
using namespace std;
const int MAX = 100;
template<class T>
struct node
{
T data;
int row, column;
node *rNext, *cNext;
};
template<class T>
class Matrix
{
node<T> firstRow[MAX], firstCol... | ALGO | 0.975032 | 3.94612 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-06-29T14:43:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69caba8ccd7... |
fd29adfb-8984-4bc5-aa8f-9d0620cd099d | FormigaHomem/Codes | cpp/ProgramacaoAvancada/DP/MaiorCaminhoEmGrafo/Investigation.cpp | #include <bits/stdc++.h>
#define MAXN (ll) 1e5 + 10
#define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define f first
#define s second
#define MOD (ll) 1e9 + 7
using namespace std;
typedef pair<long long, int> pli;
typedef long long ll;
ll N, M, dp[MAXN], dist[MAXN], min_arestas[MAXN];
... | ALGO | 0.999956 | 3.745355 | {
"github_metadata": {
"branch": "Codes",
"commit_count": 4,
"repo_created_at": "2022-01-17T17:45:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6dbb08a09a1... |
a2771f37-2a1b-41f3-9f64-0553e022aa85 | ishandutta2007/codeforces-b | bicsi/normal/549/D.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstring>
#include<unordered_map>
using namespace std;
typedef int var;
var A[500][500], B[500][500], n, m;
#define zeros(a) ((a)&(-a))
void add(var _i, var _j, var add) {
for(var i = _i; i<=n; i+=zeros(i))
for(var j = _j; j<=... | ALGO | 0.999708 | 3.39244 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05: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": "f4c1331e9893... |
9b10c365-4a29-4b3a-a0b2-bb9cb26cf10d | zeusptit/Hackerrank | Branch and Bound/04. Dãy con có tổng bằng K.cpp | #include <bits/stdc++.h>
using namespace std;
#define quick() ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
using ll = long long;
int mod = 1e9 + 7;
int n, a[100],k,X[100];
void in()
{
cin >> n >> k;
for(int i = 1; i <= n; i++)
cin >> a[i];
sort(a + 1, a + n + 1);
}
void out... | ALGO | 0.999921 | 4.077131 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2022-11-19T05:23:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5c84ed77... |
694a9c41-8405-4008-8748-17ffe01fbd22 | fyrsta7/LLM_on_ASAC | result_api_backup/en_md/gpt-4o/Divert_water_into_the_city.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int directions[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
int N, M;
bool isValid(int x, int y) {
return x >= 0 && x < N && y >= 0 && y < M;
}
void bfs(vector<vector<int>>& elevation, vector<vector<bool>>& canBeIrrigated, queue<pai... | ALGO | 0.999995 | 5.049792 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-08-11T08:13: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": "0b877672138... |
dba01256-a91d-4569-9cb4-6ee48f58f762 | arifur30/Codeforces-Submissions | A_Contest_Proposal.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define nl "\n"
#define arrin(arr, n) for(ll i = 0; i < n; i++) cin>>arr[i]
#define arrout(arr, n) for(ll i = 0; i < n; i++) cout<<arr[i]<<" ";cout<<nl
#define arrin2... | ALGO | 0.999941 | 4.293142 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2023-12-18T12:13: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": "d3bc55fc3d4... |
d41ea0ad-0906-4cdc-ac96-30000fc24038 | gongbaochicken/Coding-Practice | C++ Solutions/Dynamic_Programming/LC300_LongestIncreasingSubsequence.cpp | //Longest Increasing Subsequence
/*
Given an unsorted array of integers, find the length of longest increasing subsequence.
For example,
Given [10, 9, 2, 5, 3, 7, 101, 18],
The longest increasing subsequence is [2, 3, 7, 101], therefore the length is 4. Note that there may be more than one LIS combination, it is only ... | ALGO | 0.999936 | 5.951854 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2015-02-11T02:43:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64db2e6... |
0a1c87f6-e253-43ad-9590-adea83801695 | newiy/leetcode | merge-two-sorted-list.cpp | //Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
//https://leetcode.com/problems/merge-two-sorted-lists/description/
// topics: linked list, merge sort
#include <vector>
#include <unordered_map>
#include <string>
#include <... | ALGO | 0.999976 | 6.021605 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2017-10-01T21:46: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": "24683a370... |
14ceab05-ef8b-44db-b9a8-69bfbf5ca6cc | screw-44/Vision-2022 | modules/math-tools/algorithms.h | #ifndef ALGORITHMS_H_
#define ALGORITHMS_H_
#include <cmath>
#include <opencv2/core/types.hpp>
#include "hardware_acceleration.h"
namespace algorithm {
/**
* \brief Calculate both sine and cosine for 4 floats at the same time.
* \param [in] x Input 4 floats.
* \param [out] s Output sine value.
... | ALGO | 0.997552 | 6.097172 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-03-24T07:51:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "021a54063a... |
b89be466-4810-414d-9e6e-d10394c98e37 | Tony199110/PAT-Practice | 1056 Mice and Rice.cpp | # define _CRT_SECURE_NO_WARNINGS
# include <iostream>
# include <vector>
# include <queue>
# include <map>
# include <stack>
# include <set>
# include <algorithm>
# include <string>
# include <cstring>
# include <cctype>
# include <cmath>
# include <cstdio>
using namespace std;
int n, k, group, lastnum, maxn = -1, max... | ALGO | 0.999995 | 3.27171 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2022-08-14T15:52: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": "2c1d77e54f8... |
77d10e4d-3e32-4962-a2ab-48cdf03cb7f9 | a-ma-n/Leetcode-Solutions | 82-remove-duplicates-from-sorted-list-ii/82-remove-duplicates-from-sorted-list-ii.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* deleteDupli... | ALGO | 0.99999 | 5.337072 | {
"github_metadata": {
"branch": "master",
"commit_count": 3510,
"repo_created_at": "2022-02-23T18:52:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de212dc... |
6619860c-c545-4b0d-939a-c207c1eb73b8 | emuemuJP/AtCoder | ABC082/C.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll D... | ALGO | 0.999945 | 3.66088 | {
"github_metadata": {
"branch": "master",
"commit_count": 358,
"repo_created_at": "2020-03-11T10:53: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": "25b3664a... |
0b5fd045-9abd-45c4-a913-4bf06c0843f0 | Galor-sw/MVC_game | TicTacToe.cpp | #include "TicTacToe.h"
void TicTacToe::computerMove()
{
}
void TicTacToe::playerMove()
{
int number, check = 0, flag = 0;
while (!flag)
{
cout << "choose number to put your sign in" << endl;
cin >> number;
int check = this->checkValidation(number - 1);
if (check == 0)
cout << "this place already in use"... | ALGO | 0.996122 | 3.875887 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-09-25T17:37: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": "11211c3dfeff... |
125f3924-f921-4b9a-9ecd-b883c0eedd57 | doongwong2/1112Algorithm | Algorithm_1112/2_3_Kruskal’s_Algorithm.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
using namespace std;
typedef struct vertex* nptr;
struct vertex {
int head, end, value;
};
typedef struct edge* edgepointer;
struct edge {
int val;
edgepointer next;
};
edgepointer arr[40000];
int parent[40000];
int R[40000];
int ... | ALGO | 0.999972 | 4.012738 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-03-25T03:14: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": "51bbe5c0352b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.