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 |
|---|---|---|---|---|---|---|---|
e9f510d3-5d94-4fb2-9085-be82635906ca | dc-maggic/978-7-121-15535-2 | chapter15/Chapter15_9_4/Chapter15_9_4/prog15_9_4.cpp | #include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<memory>
#include<algorithm>
#include "TextQuery.h"
#include<set_intersection>
using namespace std;
class Query_base {
friend class Query;
protected:
using line_no = TextQuery::line_no;
virtual ~Query_base() = default;
private... | TOOL | 0.988279 | 4.353573 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-11-02T16:46: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": "66b892e8d... |
d65aabeb-d2ae-4ea2-95cf-4a0aabbe494b | Pallavikemburu/GeekforGeeks | Medium/Sum of Products/sum-of-products.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
long long pairAndSum(int n, long long a[]) {
// code here
long long ans=0;
for(long long i=0;i<32;i++)
... | ALGO | 0.999833 | 5.645598 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2024-01-05T16:08: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": "7b76023951... |
177b7167-f946-4918-a37d-3172a78838fa | 113bommy/LogicalErrorFixCodeT5 | LogicalErrorFix_metric/CodeT5_LineNumber_cpp_source/Problem_56_source_308.cpp | #include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
bool could[6][6];
bool could1[6][6][6];
map<long long, int> mp;
vector<long long> fuck[300];
int k, n;
void init() {
memset(could, 0, sizeof(could));
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 6; j++) {
if (i != j) {
could[i][j]... | ALGO | 0.999887 | 3.632685 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-03-14T17:56: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": "c67d073c2d1... |
4b5358c7-796d-4579-9e72-69b109a5e1be | FJG-004/test | test_3_3.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <algorithm>
using namespace std;
//sort函数的应用
//int main()
//{
// int n = 0;
// cin >> n;
// int arr[10];
// for (int i = 0; i < n; i++)
// {
// cin >> arr[i];
// }
// sort(arr, arr + n);
// for (int i = 0; i < n; i++)
// {
// cout << arr[i];
// cout << '... | ALGO | 0.997588 | 3.494811 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2024-07-28T04:12:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9866645493... |
40296853-4bd1-47e9-8eae-703f7e4b0345 | GIT-heyok/PS | BOJ/Solutions/DP/Tree DP/15681.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <sstream>
#include <string>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <set>
#include <map>
#include <cmath>
#include <memory.h>
#define FAST \
ios::sync_with_stdio(false); \
cin.tie(nu... | ALGO | 0.999936 | 4.046543 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2023-01-14T04:32:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31ab03cc1c5... |
825658e3-9b1c-4a10-8a3a-53b838f50c18 | splatlab/mantis | include/stat.h | //
// Created by <NAME> on 2019-02-01.
//
#ifndef MANTIS_STAT_H
#define MANTIS_STAT_H
#include <vector>
#include <unordered_set>
#include <queue>
#include "gqf_cpp.h"
#include "lru/lru.hpp"
#include "canonicalKmer.h"
#include "mstQuery.h"
#include "gqf/hashutil.h"
typedef uint32_t colorIdType;
#define MAX_VALUE(nb... | ALGO | 0.908507 | 5.687286 | {
"github_metadata": {
"branch": "master",
"commit_count": 299,
"repo_created_at": "2017-11-10T04:08:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 81,
"forks": 21,
"issues": 6,
"pull_requests": 2
},
"file_meta": {
"content_id": "9d31c0b... |
000b6636-86de-4c4c-af31-157e380a2a00 | jyjy250/Study | 문제해결프로젝트/스도쿠보드.cpp | #include<stdio.h>
#include<iostream>
using namespace std;
class SudokuBoard // 스도쿠 보드의 행,열,그룹을 정하기 위한 클래스 스도쿠 보드
{
public:
int getRowByIndex(int idx) // 인덱스를 매개변수로 행을 반환
{
return ((idx - 1) / 9) + 1; // 인덱스 에서 1을 빼준뒤 9로 나눈몫이 n이라면 n+1 행이다
}
int getColumnByIndex(int idx) // 인덱스를 매개변수로 열을 반환
{
return ((idx - 1)... | ALGO | 0.996518 | 4.532633 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-04-14T13:08:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a45ab568e... |
f31d58bc-c299-4e65-b38f-bc451a072796 | The-OpenROAD-Project/OpenROAD | src/cts/src/Clustering.h | // SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2019-2025, The OpenROAD Authors
#include <cmath>
#include <optional>
#include <string>
#include <utility>
#include <vector>
namespace utl {
class Logger;
} // namespace utl
namespace cts::CKMeans {
using utl::Logger;
struct Sink;
class Clustering
{
publi... | ALGO | 0.999623 | 6.325612 | {
"github_metadata": {
"branch": "master",
"commit_count": 31212,
"repo_created_at": "2019-10-28T17:48:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2056,
"forks": 696,
"issues": 386,
"pull_requests": 61
},
"file_meta": {
"content_id": ... |
7a4ddf36-5684-4af8-b976-eef101439009 | Ankur-Harshit/Leetcode | Find Largest Value in Each Tree Row.cpp | class Solution {
public:
// for the dfs
void dfs(TreeNode* root, int lvl, map<int,int> &mp){
if(root== NULL) return;
if (mp.find(lvl) == mp.end()) {
mp[lvl] = root->val; // Initialize with the first encountered value
}
else
mp[lvl] = max(mp[lvl],root->val);
... | ALGO | 0.999996 | 6.563772 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-12-04T17: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": "0124d93ffd8... |
48cb10d2-999e-41c5-806d-b90cb615fd37 | pristineio/webrtc-mirror | webrtc/modules/congestion_controller/bitrate_estimator.cc | /*
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | ALGO | 0.960936 | 7.819911 | {
"github_metadata": {
"branch": "master",
"commit_count": 19056,
"repo_created_at": "2015-02-19T21:38:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 161,
"forks": 79,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "dd00... |
d1ab7c1e-e946-415b-8d0f-aae7a1da70d1 | yopio/aoj | 0582.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int sankaku,eikaku,tyokkaku,donkaku;
int hen[3];
bool musi;
int main(void){
sankaku = eikaku = tyokkaku = donkaku = 0;
musi = false;
while( cin >> hen[0] >> hen[1] >> hen[2] ){
if( !musi ){
sort( hen , hen + 3 );
... | ALGO | 0.999002 | 3.657496 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-10-22T15:50: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": "97e50beb10... |
ea1c60ed-5bf4-4a6e-8897-faf87546cb97 | tokitsu-kaze/ACM-Solved-Problems | hdu/2000-2999/2892 area.cpp | ////////////////////System Comment////////////////////
////Welcome to Hangzhou Dianzi University Online Judge
////http://acm.hdu.edu.cn
//////////////////////////////////////////////////////
////Username: tokitsukaze
////Nickname: tokitsukaze
////Run ID:
////Submit time: 2017-06-10 18:06:52
////Compiler: GUN C++
/////... | ALGO | 0.999361 | 3.829949 | {
"github_metadata": {
"branch": "master",
"commit_count": 1180,
"repo_created_at": "2018-06-24T10:28: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": "b0902cc... |
82f95f47-e7f9-4c2f-a5d6-95ba64af5a68 | Ishwar6010/DSA | verticaltraversalbinarytree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999995 | 6.047222 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-03-03T12:25: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": "2db2281dc0f... |
ed708434-2e07-453e-807d-bc8ca424634e | paulocezar/problem-solving | TopCoder/SRMs/#709/Xscoregame.cpp | #include <bits/stdc++.h>
typedef long long int64;
typedef unsigned long long uint64;
using namespace std;
int N;
vector<int> a;
int cache[64][1 << 15];
char cached[64][1 << 15];
int solve(int msk, int x) {
if (!msk) return x;
int &res = cache[x][msk];
if (cached[x][msk]) return res;
cached[x][msk] = 1;
res ... | ALGO | 0.99988 | 4.268948 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2015-04-23T17:19:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adcee585... |
e5fe5d27-5e04-43e7-8bdd-93e5e44aff90 | KROU4/BSTU_1_SEM | ОАиП Белодед/Лабораторная 16/8.1/Source.cpp | //Дан двумерный массив, состоящий из N строк и М столбцов. Найти количество отрицательных, положительных и нулевых элементов массива.
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
// Константные значения для заполнения массива
const int N = 10;
const int M = 10;
int main()
{
setl... | ALGO | 0.999089 | 4.345121 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-17T22:06:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67f53a1f533b... |
d9095dd7-cc9d-462e-8e9f-0ee6793bf7cc | ishandutta2007/codeforces-e | ecnerwala/normal/1099/F.cpp | #define NDEBUG
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 mt(1203023);
using rand_int = mt19937::result_type;
struct treap {
rand_int pri = mt();
rand_int rkey = mt();
treap* ch[2] = {nullptr, nullptr};
ll key;
ll cnt;
auto getkey() {
return make_pair(key, rkey);
}
ll totcn... | ALGO | 0.999655 | 4.257075 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2c2f1512ee9... |
63c77d55-2e7b-473b-9f4e-a0c1c0228c2d | IMALB/ccodes | seqList.cpp | /*
* 内 容:静态顺序表 动态线性表
* 最后修改日期:2020.7.02
*/
#include <iostream>
using namespace std;
/*
// 静态顺序表
#define MaxSize 50 //顺序表最大长度
struct SqList {
int data[MaxSize];//顺序表元素
int length; //顺序表现在的长度
};
// 静态顺序表初始化
void InitList(SqList &L) {
L.length = 0;
// 全部赋值为0可以省略
for (int i = 0; i < MaxSize; i+... | ALGO | 0.997672 | 4.242679 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-07-02T12:37: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": "00360e89c... |
a454b8bb-5e66-4afa-b593-2fa3da0ef04e | tic40/atcoder | abc/abc314/f/main.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define endl '\n'
using mint = modint998244353;
int main() {
int n; cin >> n;
dsu uf(n);
vector g(n,vector<int>());
// sv[i] := 頂点 i のプレイヤー数
vector<int> sz(n*2-1,1);
// gv[i] ... | ALGO | 0.999926 | 4.555454 | {
"github_metadata": {
"branch": "main",
"commit_count": 2526,
"repo_created_at": "2019-04-03T12:15: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": "a07425977... |
21ec39a5-a4d2-450a-846c-099ad747b80c | geckods/CodeForces | 639/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// THINGS TO REMEMBER
// ENDL is slow, '\n' is fast
// Clear everything (including graphs) between test cases
// use anti-anti-hash: https://codeforces.com/blog/entry/62393
// pb-ds: https://codeforces.com/blog/entry/11080
// check when to use LLONG_M... | ALGO | 0.999863 | 4.323739 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-03-24T04:23: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": "f1f72b095a... |
a8d67a7c-7038-4e7a-9508-04d684862c2e | bluesky0904/codetree-TILs | 240128/단 한 번의 2048 시도/one-trial-of-2048-game.cpp | #include <iostream>
#include <vector>
using namespace std;
#define NONE -1
#define ASCII_NUM 128
int n = 4;
vector<vector<int>> grid(n, vector<int>(n));
vector<vector<int>> next_grid(n, vector<int>(n));
void Rotate() {
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
next_grid[i][j] = 0;
for (int i =... | ALGO | 0.999648 | 5.041636 | {
"github_metadata": {
"branch": "main",
"commit_count": 1377,
"repo_created_at": "2023-11-12T08:32: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": "2cf663e30... |
a6fc17b6-1ed4-45f9-b09b-897ab784f339 | ishandutta2007/codeforces-c | chelly/normal/913/C.cpp | #include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<functional>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<ctime>
#include<complex>
using namespace std;
typedef long long LL;
typedef complex<do... | ALGO | 0.999946 | 3.508095 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d405e00746e1... |
cfe870d8-59ba-4ac5-8e54-68776df141df | Laxen/object_identification_localization | headers/render_views_tesselated_sphere_modified.cpp | /*
* render_views_tesselated_sphere.cpp
*
* Created on: Dec 23, 2011
* Author: aitor
*
* Modified on: July - Dec, 2017
* By: Andreas
*/
#include "render_views_tesselated_sphere_modified.h"
void
Render_Views_Tesselated_Sphere_Modified::generateViews() {
//center object
double CoM[3];
vtkIdType... | TOOL | 0.927233 | 5.398006 | {
"github_metadata": {
"branch": "master",
"commit_count": 130,
"repo_created_at": "2018-01-26T08:05:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4ca5a554... |
a6e20c6d-f255-4256-a908-e099d1d0ee1d | AcademySoftwareFoundation/OpenShadingLanguage | src/testrender/raytracer.h | // Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
#include <vector>
#include <OpenImageIO/fmath.h>
#include "optix_compat.h"
#include "render_params.h"
#include <OSL/dual_vec.h>
#... | ALGO | 0.931241 | 6.213809 | {
"github_metadata": {
"branch": "main",
"commit_count": 3154,
"repo_created_at": "2011-03-10T02:44:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2198,
"forks": 383,
"issues": 58,
"pull_requests": 20
},
"file_meta": {
"content_id": "34d... |
ea320ec7-e004-43a7-b019-da9b5de88632 | realAYAYA/UnrealEngine-ToonLit | UnrealEngine/Engine/Plugins/Runtime/GeometryCache/Source/GeometryCache/Private/FloatCompression.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "FloatCompression.h"
#include "HuffmanTable.h"
//#include "RequiredProgramMainCPPInclude.h"
DEFINE_LOG_CATEGORY_STATIC(LogBlankProgram, Log, All);
//IMPLEMENT_APPLICATION(BlankProgram, "BlankProgram");
/**
Move data to an 16 byte larger array to make it... | TOOL | 0.917807 | 6.065282 | {
"github_metadata": {
"branch": "5.4",
"commit_count": 164,
"repo_created_at": "2023-03-14T06:10:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 66,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b04c6466a... |
741635a6-31a4-4816-9086-8ec8f160f706 | adrian-software-dev/my-codes-for-everything-OFICIAL | condicionales_2/area-de-interseccion-de-dos.triangulos.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
long long i,j,cont=1,N,aux,x,y;
long long ejex[4],ejey[4];
long long orgx[4],orgy[4];
for (i=0;i<4;i++) {
cin>>ejex[i]>>ejey[i];
orgx[i] = ejex[i];
orgy[i] = ejey[i];}
N = 2;
while (cont>0) {
cont = 0;
for (i=0;i<4-N;i++) {
if (orgx[i]>or... | ALGO | 0.999952 | 3.499246 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-12-17T22:45: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": "7cfb9a1f123c... |
9312f9bb-9f66-4a07-9082-c378349e76b2 | ipchelsea/343-Assignment-4-Implementation | drama.h | //--------------------------drama.h-------------------------------------------
//Created by <NAME> CSS343 Section B
//Created: 6/09/2019
//Last Modification: 6/09/2019
//------------------------------------------------------------------------------
//Purpose: This is the header file for a classic class that inherits fr... | TOOL | 0.947516 | 5.80852 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-06-09T19:22:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81d6ddd0e7... |
70210106-e291-4061-82d1-663eada6f559 | HoxelDraw-Org/hx-math | src/aabb.cpp | /*
aabb.cpp
April 11, 2023
Contributors:
<NAME>
*/
#include "aabb.h"
namespace hxm
{
// AABB3 (float) ------------------------------------------------------------
void aabb3f::addPoint(const vec3f& pt)
{
min.x = std::min(pt.x, min.x);
min.y = std::min(pt.y, min.y);
min.z = std::min... | TOOL | 0.938319 | 7.12366 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2024-08-05T21:58:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d357394ca... |
729c6f3a-8e17-4d0d-bdf3-d9e290f9207c | alikhan880/ACM | sdacha.cpp | #include <iostream>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <string>
#include <cstring>
#define rep(i,a,b) for(int i = a; i < b; i++)
#define sz(a) ((int)(a.size()))
#define pb push_back
#define... | ALGO | 0.999899 | 3.423887 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-05-10T17:36:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5daae3c2af... |
2cd8fb93-3f65-4fed-a0c5-c2996aa4b716 | nhirsama/cppLearn | problem/Luogu/P10532_XJTUPC_2024_.cpp | // P10532 [XJTUPC 2024] 筛法
#include <bits/stdc++.h>
using i64 = long long int;
using i32 = long long int;
using __i_know_i_need_int = int;
constexpr __i_know_i_need_int mod = 1e9 + 7;
#define int __i_cannot_use_int
#define IOS std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr);
#define en... | ALGO | 0.999734 | 5.506374 | {
"github_metadata": {
"branch": "master",
"commit_count": 589,
"repo_created_at": "2024-11-03T03:37:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "555128d4... |
0cd9e39c-164e-4456-8e13-f484cb973753 | frans-johansson/craytrace | src/materials.cpp | #include "dependencies.hpp"
// MATERIAL FACTORY
std::unique_ptr<DiffuseLambertian> MaterialFactory::makeDiffuseLambertian(Color _color, double _rho) {
return std::make_unique<DiffuseLambertian>(DiffuseLambertian{ _color, _rho });
}
std::unique_ptr<DiffuseOrenNayar> MaterialFactory::makeDiffuseOrenNayar(Color _co... | ALGO | 0.962068 | 6.620306 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2020-09-09T09:15: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": "eebf51cca... |
13bab38d-f66a-4a64-99bd-b66141da5d8a | yanglr/leetcode-ac | cpp-leetcode/leetcode598-range-addition-ii_solution1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int maxCount(int m, int n, vector<vector<int>>& ops) {
/* 数组row 存储水平向右方向1 的累加和, 数组col 存储竖直向下方向1 的累加和*/
vector<int> row(m);
vector<int> col(n);
for (auto op : ops)
... | ALGO | 0.999976 | 5.798529 | {
"github_metadata": {
"branch": "master",
"commit_count": 644,
"repo_created_at": "2016-04-23T08:14:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 135,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f02b... |
9a1a1334-fd0e-4337-9032-d02a804ee50a | emelyfig/cpp | Ejercicio-25-Suma de Pares e Impares y total..cpp |
#include <iostream>
using namespace std;
int main(int argc, char const*argv[])
{
// Variables
int pares = 0, impares = 0, total = 0;
// Pares
for (int i = 1; i <= 10; i++)
{
if (i % 2 == 0)
{
pares = pares + i;
}
cout << i << " ";
}
... | ALGO | 0.998165 | 4.634886 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2022-02-01T22:55:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a6c60dc287... |
a8d025c4-29f2-47b6-ad32-7773f42acc97 | TanYongF/algorithm | Leetcode/力扣日常/787.cpp | #include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <string>
#include <cstring>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <ctime>
#include <climits>
#include <vector>
#include <iostream>
#include <fstream>
#include <li... | ALGO | 0.999674 | 3.892783 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2021-10-25T01:34:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac2331d92... |
c09b1ae2-d16b-45a8-aecb-d4e861a0738a | uttom-akash/Problem-Solving-Second-Phase-2020 | B.ChessTournament.cpp | #include <bits/stdc++.h>
#define mx 10000
#define mod 1000007
#define ll long long
using namespace std;
void optimize()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
}
void setupFileIO(string fin = "input.txt", string fout = "output.txt")
{
freopen(fin.c_str(), "r", stdin);
freopen(fout.c_str(), "w", ... | ALGO | 0.999942 | 4.319232 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2020-10-26T17:27: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": "d84163277e1... |
d4010a7d-5b08-465b-8a2c-59ff3cdaff4f | WONILLISM/Algorithm | 03_Programmers/Second/60059.cpp | #include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<algorithm>
#define endl '\n';
#define ll long long
using namespace std;
bool solution(vector<vector<int>> key, vector<vector<int>> lock) {
int m = key.size(), n = lock.size();
int kcnt = 0, lcnt = 0;
for (int i = 0; i < ... | ALGO | 0.999979 | 4.439097 | {
"github_metadata": {
"branch": "master",
"commit_count": 202,
"repo_created_at": "2019-07-04T07:05: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": "d2fac0ea... |
b773d55c-7e0f-4a99-aeb3-a3ca57831d34 | deepam20050/competitive-programming | contests/A.cpp | #include "bits/stdc++.h"
using namespace std;
#ifdef DEBUG
#include "../algo/debug.hpp"
#else
#define debug(...)
#endif
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define sz(x) int((x).size())
#define all(x) begin(x), end(x)
#define eb emplace_back
using lli = long long;
using pii = pair < int, int >;
voi... | ALGO | 0.999949 | 4.583118 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-01-05T12:59:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a70ce8ab17... |
ce3c07d4-c2dc-4576-bd7f-70de0406d998 | armandld/3-body_problem_physNum | Exercice1_student.cpp | #include <iostream> // basic input output streams
#include <fstream> // input output file stream class
#include <cmath> // librerie mathematique de base
#include <iomanip> // input output manipulators
#include <valarray> // valarray functions
#include "ConfigFile.h" // Il contient les... | ALGO | 0.998849 | 3.684622 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2025-02-19T13:13: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": "b165f751dbb... |
b9143f11-bec0-47f8-b867-b457f098394c | Ausp3x/competitive-programming | [2] Personal Training/Codeforces Rounds/[25] 968 (Div. 2)/D1. Turtle and a MEX Problem (Easy Version).cpp | // 人外有人,天外有天
// author: Ausp3x
#pragma GCC optimize("O1, O2, O3, Ofast, unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define pb push_back
// #define DEBUG
typedef long long lng;
typedef _... | ALGO | 0.999937 | 3.569127 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2023-04-28T14:29: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": "0575512c5d1... |
46bd14a5-9c10-49c3-a309-dc147f19233a | Ponhrith/RUPP-BPL_Term2 | Week_2/Exercise5.cpp | /* 5. Write a function called display_longest_word that will accept a string, then displays the longest
word within the string. */
#include <iostream>
#include <string>
using namespace std;
void display_longest_word(string str){
string longest;
int count = 0, big_word = 0;
int size = str.size();
... | ALGO | 0.999131 | 4.617422 | {
"github_metadata": {
"branch": "main",
"commit_count": 169,
"repo_created_at": "2022-08-10T00:49:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7515632229... |
c7b788a8-3b13-40ef-9ad4-d5ca1ffa51a9 | AljonViray/CPP_Algorithms_Coursework | hw8/code/kruskals.cpp | // Code by <NAME> (86285526)
// ICS 46 - Homework #8 - kruskals.cpp
// Kruskal's Algorithm
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
using namespace std;
///////////////////// Classes /////////////////////
class Edge
{
public:
int src;
int... | ALGO | 0.99989 | 5.068849 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-06-08T18:36: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": "db0c502104... |
e6214f90-85e0-4c50-941b-5d79e1499679 | ledpear/algorithm | BAEKJOON/1000~/1644_소수의 연속합_c++/Source.cpp | #include <iostream>
#include <vector>
using namespace std;
//custum function
vector<int> getPrimeNum(int limit)
{
vector<int> primeNumArr;
vector<bool> primeNumCheck(limit + 1);
//에라토스테네스의 체
for (int num(2); num <= limit; ++num)
{
//방문하지 않은 수이면 소수이다
if (!primeNumCheck[num])
{
//배열에 추가하고
primeNumArr.... | ALGO | 0.999901 | 4.848538 | {
"github_metadata": {
"branch": "master",
"commit_count": 781,
"repo_created_at": "2018-06-07T03:14: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": "9067cd5f... |
117f04fc-7513-4409-a414-0b125c12a179 | Hngdcmnh/Algo-Second-Year | ma so.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
using namespace std;
void swap(int& a, int& b)
{
int c = a;
a = b;
b = c;
}
void sinhchu(vector <string>& chu, int a[], int n)
{
string s = "";
for (int i = 1; i <= n; i++)
{
//cou... | ALGO | 0.999995 | 3.540684 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-07-20T14:28:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5e89ebbfc98... |
629cf107-cc54-4e35-9ab2-8900f44c29a2 | Bruyq/Codingames-CPP | BinarySearchTreeTraversal/main.cpp | #include "tree.h"
// Input example :
// 5
// 8 6 13 10 5
//
// Output example :
// 8 6 5 13 10 (Graph traversed in Pre-Order)
// 5 6 8 10 13 (Graph traversed in In-Order)
// 5 6 10 13 8 (Graph traversed in Post-Order)
// 8 6 13 5 10 (Graph traversed in Level-Order/Breadth-First-Search)
//
int main()
{
std::... | ALGO | 0.999836 | 5.684037 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-04-02T18:29: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": "50adb03a1dd3... |
d79abb3d-51dd-492a-8955-aee735032f01 | jingtaozhang18/algorithm-exercises | code-interview/第2章 链表问题/2-反转单向链表.cpp | # include <bits/stdc++.h>
using namespace std;
struct list_node{
int val;
struct list_node * next;
};
struct double_list_node{
int val;
struct double_list_node * pre, * next;
};
list_node * input_list(void)
{
int n, val;
list_node * phead = new list_node();
list_node * cur_pnode = phead;
... | ALGO | 0.999839 | 3.937479 | {
"github_metadata": {
"branch": "master",
"commit_count": 746,
"repo_created_at": "2020-04-22T23:02:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "016be298... |
bdec076f-860b-4230-ac5d-69139fe5ac48 | saifullah-talukder/Competitive_Programming | Codes/Codeforces/Accepted/CF_529_E.cpp | /*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/
#include <bits/stdc++.h>
#define PII pair<int, int>
using namespace std;
map<int, bool> mymap;
vector<PII> coins;
int value[5005];
int main()
{
int i, j, x, y, z, n, m, k, q;
scanf("%d %d", &n, &k);
for (i = 0; i < n; i++)
scanf("%d", &value[i]);
for ... | ALGO | 0.999952 | 3.511605 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-05-10T06:16: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": "891468efa4f9... |
b8824127-e3a1-4b66-ab01-d0a7762c12e9 | abysmalocean/LeetCode | problem/72.edit-distance.cpp | /*
* @lc app=leetcode id=72 lang=cpp
*
* [72] Edit Distance
*/
// @lc code=start
class Solution {
public:
int minDistance(string word1, string word2)
{
int row = word1.length();
int col = word2.length();
vector<vector<int>> table(row+1, vector<int>(col+1, 0));
for (int... | ALGO | 0.999966 | 6.373283 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2019-11-19T03:58: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": "d145d68e3... |
2552111d-ffab-456f-8abf-969225620b69 | JAEHYEON-BAE/algorithm_study | 백준/Gold/2096. 내려가기/내려가기.cc | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n; scanf("%d", &n);
vector<int> dp(3, 0), rdp(3, 0), temp(3, 0);
for (int i=0;i<n;i++) {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if (i>0) {
... | ALGO | 0.999981 | 3.641822 | {
"github_metadata": {
"branch": "main",
"commit_count": 785,
"repo_created_at": "2024-01-07T13:37: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": "464052211b... |
cff2d8e6-6bd9-43e6-82d8-e08e2cb7dbbc | icl-utk-edu/magma | magmablas/zbcyclic.cpp | /*
-- MAGMA (version 2.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date
@author <NAME>
@author <NAME>
@precisions normal z -> s d c
*/
#include "magma_internal.h"
#ifdef MAGMA_HAVE_OPENCL
#define d... | ALGO | 0.953922 | 5.179861 | {
"github_metadata": {
"branch": "master",
"commit_count": 8870,
"repo_created_at": "2023-04-05T15:59:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 29,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "6c878... |
722236df-84af-4bec-a5c9-1a343e03a7d5 | salim7ali/HackerRank | CPP/Other Concepts/Attending Workshops/attending_workshops.cpp | // https://www.hackerrank.com/challenges/attending-workshops/problem
#include<bits/stdc++.h>
using namespace std;
//Define the structs Workshops and Available_Workshops.
struct Workshops{
int startT, duration, endT;
};
struct Available_Workshops{
int n;
Workshop* arr = new Workshop[n];//in C: Workshop* ... | ALGO | 0.999992 | 4.399033 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2020-07-24T18:19:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8be5131... |
3a6456c3-6941-4eb7-9616-09c226f9145f | vikasphulariya/Data-Structure-Udemy | LinkedList/lec182_max.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
struct Node *next;
} *first = NULL;
void create(int A[], int n)
{
struct Node *t, *last;
first = new Node;
first->data = A[0];
first->next = NULL;
last = first;
for (int i = 1; i < n; i++)
{
t = new Node;
... | ALGO | 0.999898 | 3.377597 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2023-08-03T18:16: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": "c1528befc2... |
c8903a0a-7e71-4b9c-8ce4-8528137c6bb0 | cashtonCode/271-Project0-LinkedListReview | CSCI208-2nd-linkedtest.cpp | #include <iostream> // IO operations
#include "linkedlist.h" // Linked lists files
using namespace std;
// Function Prototype
int readInt(string); // function that reads in input from standard input
// START OF MAIN PROCESSING
int main()
{
int choice;
int item;
int pos;
LinkedList a;
cout << "Th... | TOOL | 0.980574 | 4.294867 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-12-04T20:31: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": "94706c2a70... |
4b9bc464-96c8-4260-813b-0618ebf83099 | RapidCoders/Coding-Practice | DAY_38/Vaibhav/Program1.cpp | /*
Q.1 Write a program to calculate,
a. area of rectangle
b. perimeter of rectangle
c. check it is square or not
Input: length = 4.0, breadth = 6.0
Output: Area: 24.0, Perimeter: 20.0, is_square: No.
Input: length = 7.5, breadth = 7.5
Output: Area: 56.25, Perimeter: 30, is_square: Yes.
Input: length = 3.0, breadt... | ALGO | 0.986292 | 4.503417 | {
"github_metadata": {
"branch": "main",
"commit_count": 2184,
"repo_created_at": "2023-12-01T02:31:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "338283f537... |
ab10bbab-bdce-4420-8d4d-13761bcae2e5 | Moein-Karami/OlympiadCodes | projecteuler/Arranged probability/main.cpp | #include <bits/stdc++.h>
#define int long long int
#define double long double
using namespace std;
int t=1e12;
int base=1e4;
struct bg
{
int cnt;
int a[30];
void clean()
{
cnt=0;
for(int i=0;i<30;i++)
a[i]=0;
}
void fix()
{
for(int i=1;i<=cnt;i++)
... | ALGO | 0.999752 | 3.09265 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-08-26T06:01: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": "68a6a58f5473... |
9a8fdcb9-d38f-454a-99b5-0b68e8a82e4c | NoyaRoeT/CPU-based-Renderering | src/Mesh.cpp | #pragma once
#include "Mesh.h"
#include <fstream>
#include <sstream>
#include <iostream>
std::vector<int> Mesh::SplitVertexIndices(const std::string& str, char delim)
{
std::stringstream ss(str);
std::vector<int> indices;
std::string idx;
while (std::getline(ss, idx, delim))
{
if (idx == "") indices.push_back(-... | TOOL | 0.922879 | 5.33882 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-07-04T07:53:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a69634b2d69... |
f105a009-82d5-4e62-9d6b-cb5d5dae1d55 | Youssef645561/Problem-solving | 02 - Fivth course/A33.cpp | #include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
enum enCharType { CapitalLetter, SmallLetter, Digit, SpecialChar };
int ReadPositiveNum(string Message)
{
int Num;
do
{
cout << Message;
cin >> Num;
} while (Num <= 0);
return Num;
}
int RandomNumInRange(int From, int To)
{
ret... | TOOL | 0.930147 | 3.742583 | {
"github_metadata": {
"branch": "main",
"commit_count": 130,
"repo_created_at": "2025-04-17T05: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": "046870de47... |
554d88dd-1355-4992-a322-2c18cceb1453 | dasoya/Algorithm_Study | untitled/0X12 백트래킹/1759.cpp | //
// Created by dasoya on 3/5/24.
//
//
// Created by dasoya on 3/4/24.
//
#include "bits/stdc++.h"
using namespace std;
char arr[16];
int l, c;
int main(){
cin >> l >> c;
int combi[16];
for (int i = 0; i < c; ++i) {
cin >> arr[i];
combi[i] = i < l ? 0: 1; // tr... | ALGO | 0.99996 | 4.18735 | {
"github_metadata": {
"branch": "main",
"commit_count": 317,
"repo_created_at": "2023-09-05T23:57: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": "24fdd6fb65... |
f9170ecc-f2c7-49ef-8576-144dd90c399d | liuchuo/PAT | AdvancedLevel_C++/1015. Reversible Primes (20).cpp | #include <cstdio>
#include <cmath>
using namespace std;
bool isprime(int n) {
if(n <= 1) return false;
int sqr = int(sqrt(n * 1.0));
for(int i = 2; i <= sqr; i++) {
if(n % i == 0)
return false;
}
return true;
}
int main() {
int n, d;
while(scanf("%d", &n) != EOF) {
... | ALGO | 0.999967 | 3.527653 | {
"github_metadata": {
"branch": "master",
"commit_count": 703,
"repo_created_at": "2016-01-06T05:06:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3399,
"forks": 809,
"issues": 44,
"pull_requests": 9
},
"file_meta": {
"content_id": "fd... |
7cdfa4d5-bcbd-454e-a15c-922a40b68e8d | AhmedKamal1432/MySolvedProblem | d.cpp | /*
*
* solved by <NAME>
*/
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <sstream>
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <utility>
#include <algorithm>
#include <functional>
using namespace std... | ALGO | 0.99997 | 4.080381 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-05-20T21:26:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89e67e0aa... |
ca8626e5-4503-4388-b890-8ac25818ce11 | bheki-maenetja/small-projects-c | courses/learning-cpp/chapter_3/03_06/end/chips03_06_End.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
const float MAX_TURN = .5;
const int MAX_CHIPS = 100;
int main()
{
bool player1Turn = true;
bool gameOver = false;
int chipsInPile = 0;
int chipsTaken = 0;
string playerNames[2];
//seed the random num... | ALGO | 0.925869 | 4.032012 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-05-25T07:27:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf004f7b4... |
9b353f3f-ad0f-4ba1-9db7-d31b09584c81 | Yash59ops/Leetcode-Solution | Maximum Rectangular Area in a Histogram - GFG/maximum-rectangular-area-in-a-histogram.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find largest rectangular area possible in a given histogram.
vector<long long>next_small(long long arr[],int n){
vector<long long>ans(n);
stack<long long>st;
... | ALGO | 0.999569 | 6.344424 | {
"github_metadata": {
"branch": "main",
"commit_count": 1162,
"repo_created_at": "2023-01-24T17:20: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": "4fcac72fc... |
cbdae993-cbbd-4671-b2d8-6c8461ca3de3 | reduan2660/CP-Resources | Binary Search/problems/lightoj - Trailing Zeroes.cpp | // https://lightoj.com/problem/points-in-segments
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;
#define F(i,R) for (long long i = 0; i < R; i++)
const long long LIMIT = 1e18;
ll factorialPrimePower(ll n, ll b)
{
ll ans = 0, p=1, d=b;
while(d<=n){
ans += floor(n... | ALGO | 0.998187 | 3.653776 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-08-18T01:33:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4bb11fdd... |
3c0a5a45-2ec7-4279-9f89-f793034b7e12 | conorjeuss/baekjoon | Practice/1302.c++ | #include <iostream>
#include <map>
#include <string>
using namespace std;
int main() {
int n;
cin >> n;
map<string, int> bookSales; //map의 사용 빠르게 검색하기 위해 사용되는 저장 컨테이너. 만약 집어넣는 값이 없으면 자동으로 생성
//map은 애초에 저장공간의 크기를 미리 생각해놓지 않는다 새로생성되면 (ㅁ,0)이런식으로 map에 저장공간이 생성된다.
string bo... | ALGO | 0.999888 | 5.049154 | {
"github_metadata": {
"branch": "master",
"commit_count": 303,
"repo_created_at": "2023-04-30T07:37: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": "2f5ac108... |
553bfef5-b0ad-4f78-9827-551203740e88 | lam3082004/Code_in_thptchuyen.ntucoder.net | Bowling/Bowling.cpp | // Bowling (VOI2014_R2)
// Bowling là một trò chơi giải trí mà người chơi ném một quả bóng nặng cho chạy trên một đường
// băng dài và phẳng để làm đổ những chai gỗ đứng ở cuối đường. Ngày nay, Bowling được xem là
// một môn thể thao. Trong bài toán này chúng ta sẽ xét trò chơi Bowling cải biên như sau:
// Cuối đường... | ALGO | 0.999943 | 4.905522 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-07-21T15:04:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "83c11e6fb... |
a49b4349-b794-4c93-a41e-9a7ae7a843e1 | Gusabary/Leetcode | Weekly Contest/Weekly-Contest-178/3.cpp | #include <vector>
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x),... | ALGO | 0.999787 | 5.703235 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-12-16T04:41:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcef0254a... |
892398f0-8ef3-44b0-a776-5a82a24bea21 | AdAndRoll/vasilev-lab3 | vasilev-lab3/main.cpp |
#include <string>
#include <iostream>
#include <vector>
//#include <stack>
//#include <queue>
using namespace std;
template<typename T>
class TVectorQueue
{
size_t head;
size_t tail;
vector<T> mem;
public:
TVectorQueue() : head(0), tail(0) { }
size_t size() const { return tail - head; }
void push(const T& v... | ALGO | 0.99984 | 4.076268 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-11-28T13:10:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ef19a406b2... |
ec4f8407-ff38-4375-8b08-18df7c10b713 | jiyeonyooo/algorithm-problem-solving | 프로그래머스/성격유형검사하기(kakao).cpp | #include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
char select(char a, char b, int *result) {
int aidx = a - 'A';
int bidx = b - 'A';
if (result[aidx] > result[bidx]) return a;
else if (result[aidx] < result[bidx]) return b;
else if... | ALGO | 0.999941 | 4.440793 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2025-01-05T14:33: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": "20d87c7deba... |
bc337340-c5fc-4a10-b7a1-9704b37c82b4 | richard-shaw/algo | alg-example/数学/数论/素数判定/Miller-Rabin 素性测试.cpp | //
// Created by 走线大师 on 2022/9/11.
//
/**
* 时间复杂度O(T(logN)^3), T为测试次数
* 利用FFT等技术可以优化至 O(T(logN)^2loglogNlogloglogN)
*/
typedef long long int64;
typedef __int128 int128;
const int64 test_time = 10;
inline int64 fast_pow(int64 a, int64 b, int64 mod) {
int64 ans = 1;
int128 base = a;
while (b > 0) {
... | ALGO | 0.999517 | 4.254875 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2021-09-21T15:08: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": "1f6fc87dd... |
7dd39a5c-e55a-45d2-8e3b-40d344c28dc5 | Freym4n/Problemas-resueltos | UVA/572/26100691_AC_0ms_0kB.cpp |
#include <bits/stdc++.h>
using namespace std;
int dx[8] = {0,1,1,1,0,-1,-1,-1};
int dy[8] = {1,1,0,-1,-1,-1,0,1};
int n,m;
bool is_ok(int x, int y) {
return x >= 0 && x < m && y >= 0 && y < n;
}
void bfs(vector<string> &g, int i, int j) {
queue<pair<int,int>> q;
g[i][j] = '1';
q.push({i,j});
w... | ALGO | 0.999488 | 4.001145 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-01T03:24: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": "ebacaa3240... |
e7b7af2b-52a1-4c2c-b73f-7cc41830a131 | chenqwwq/_algorithm | src/top.chenqwwq/leetcode/archive/lcof2/_66/offer-66.cpp | //
// Created by chenqwwq on 2022/1/19.
//
#include "bits/stdc++.h"
#include "common.h"
using namespace std;
class MapSum {
private:
map<char, MapSum *> child;
char ch;
int val;
public:
/** Initialize your data structure here. */
MapSum() {
val = 0;
}
MapSum(char c) {
ch ... | ALGO | 0.99961 | 4.89017 | {
"github_metadata": {
"branch": "master",
"commit_count": 451,
"repo_created_at": "2019-07-05T09:54:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "4c8da64a... |
a369b64b-9299-4e62-a275-580099159027 | mohitshyoran/Leetcode-Problems | Top-150/18. 1D DP/70. Climbing Stairs.cpp | You are climbing a staircase. It takes n steps to reach the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Example 1:
Input: n = 2
Output: 2
Explanation: There are two ways to climb to the top.
1. 1 step + 1 step
2. 2 steps
class Solution {
public:
int clim... | ALGO | 0.999897 | 4.809382 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2023-10-12T17:19:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87a82b2d94... |
b81421d7-b754-4b23-84ce-e3a6f277f45d | 13061997priyankakhatri/Assignment-C-plus-plus | sort-the-array-using-templates.cpp | #include<iostream>
using namespace std;
template <class T>
void sort_array(T ar[], int n)
{
for (int p = 0 ; p < n - 1 ; p++)
{
for (int u = n - 1; p < u; u--)
{
if (ar [ u ] < ar[ u - 1 ])
{
swap(ar[u],ar[u-1]);
}
}
... | ALGO | 0.999667 | 5.479387 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-09-03T08:23:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00f13ab5b02... |
1be27a86-0e60-4cb0-b2c4-6773016ce4ce | mayankkaushik187/AlgoViser | Searching/Minimum Number of Days to Make m Bouquets.cpp | //Leetcode 1482
class Solution {
public:
bool isFeasible(vector < int > & nums, int mid, int m, int k) {
int flower = 0;
for (int i = 0; i < nums.size();) {
bool fl = false;
int j;
int count = 0;
for (j = i; j < i + k an... | ALGO | 0.999997 | 5.742776 | {
"github_metadata": {
"branch": "main",
"commit_count": 797,
"repo_created_at": "2021-07-03T03:30:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "109641d22... |
3b181e9d-a318-4055-a475-37468ed72764 | nesangcode/uva-solution | 10887.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
ll t; ll cs = 0;
while(cin >> t){
ll cs = 0;
while(t--){
ll m,... | ALGO | 0.999251 | 3.748906 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-04-21T02:49: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": "7571c9283b15... |
5e65f8d4-2ef6-441f-bd14-a17a9ea3bb71 | VikashTiwari1208/MyLeetcodeSolutions | 1803-count-pairs-with-xor-in-a-range/1803-count-pairs-with-xor-in-a-range.cpp | struct Node {
Node * links[2]={NULL};
int cnt=0;
bool contain(int ind) {
return (links[ind] != NULL);
}
Node * get(int ind) {
return links[ind];
}
void put(int ind, Node * node) {
links[ind] = node;
}
};
class Trie {
private: Node * root;
public:
Trie() {
root = new Node();
... | ALGO | 0.999972 | 5.402971 | {
"github_metadata": {
"branch": "main",
"commit_count": 809,
"repo_created_at": "2021-07-03T06:41:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c9bd47824... |
e49280b5-d186-43f5-b9f5-bb9e22fdc691 | Shahbaz898414/Codeforces | B/B. Madoka and the Elegant Gift.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define Time cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
#define pb push_back
#define mp make_pair
#define line cout<<endl;
#define ff first
#define ss second
#define vi vector<int>
#define no c... | ALGO | 0.999883 | 3.945917 | {
"github_metadata": {
"branch": "master",
"commit_count": 827,
"repo_created_at": "2023-04-07T07:21: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": "8f823b25... |
3d472d2f-3352-4487-9596-855c6009ff6b | Sunil-1508/CPP | Product of Array except itself.cpp | /*Given an array arr[] of n integers, construct a Product Array prod[] (of same size) such that prod[i] is equal to the product of all the elements of arr[] except arr[i]. Solve it without division operator in O(n) time.
Example :
Try Amazon Test Series that Includes topic-wise practice questions on all important DS... | ALGO | 0.999884 | 4.26396 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2021-11-23T16:27: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": "161320e8ec8... |
829b2f2b-8f01-432f-a74b-ff9269fb9de7 | cloudzfy/leetcode | src/127.word_ladder/code.cpp | class Solution {
public:
int ladderLength(string beginWord, string endWord, unordered_set<string>& wordList) {
if (wordList.size() == 0) return 0;
map<string, int> step;
queue<string> q;
q.push(beginWord);
step[beginWord] = 1;
while (!q.empty()) {
string c... | ALGO | 0.999971 | 5.764794 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2014-05-02T09:11:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2bcfab5... |
433edefe-0a10-44e4-965f-56bca62b18da | Daniel-Aga/Competitive-Programming | CODE/2DFenwick.cpp | #include <math.h>
using namespace std;
struct Fenwick2D
{
long long** arr;
int sz1, sz2;
Fenwick2D(int sz1_inp, int sz2_inp)
{
sz1 = 1 << (int)(log2(sz1_inp) + 1);
sz2 = 1 << (int)(log2(sz2_inp) + 1);
arr = new long long*[sz1 + 1];
for (int i = 0; i <= sz1; i++)
{
arr[i] = new long long[sz2 + 1];
... | ALGO | 0.999211 | 3.838135 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-02-26T10:45: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": "e3115c28fb9... |
323d903e-2d08-47de-9769-7c9210dd4fb7 | wallevex/dsa | include/dsa/select/quick_select.hpp | //
// Created by huhaolong on 2024/7/20.
//
#pragma once
#include <vector>
#include <cstdio>
template <typename T> T quickSelect(std::vector<T> arr, int k) {
int lo = 0, hi = arr.size() - 1;
while (lo < hi) {
int i = lo, j = hi;
int pivot = arr[i];
while (i < j) {
while ((... | ALGO | 0.999919 | 5.863522 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2024-07-13T14:37: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": "e4512f37365... |
f834aa4d-26e9-4f78-91f9-aa171023c04f | jdmr/oop | ch04/live04/dayenum2.cpp | #include <iostream>
enum days_of_week {Su,Mon,Tue,Wed,Thu,Fri,Sat};
int main() {
days_of_week day1, day2;
int userDay1, userDay2;
// ask user for the day
std::cout << "Enter day 1 (Su = 1, Mon = 2, ..., Sat = 7): ";
std::cin >> userDay1;
std::cout << "Enter day 2 (Su = 1, Mon = 2, ..., S... | ALGO | 0.992333 | 4.865705 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-01-05T17:58:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "917e71b50cd... |
c2a80db5-f32f-4d79-8376-35ccfbfe678d | ishandutta2007/codeforces-x | xay5421/normal/1603/D.cpp | // author: xay5421
// created: Sat Oct 30 23:32:59 2021
#ifdef xay5421
#define D(...) fprintf(stderr,__VA_ARGS__)
#else
#define D(...) ((void)0)
//#define NDEBUG
#pragma GCC optimize(2,3,"Ofast")
#endif
#include<bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define SZ(x) ((int)(x).size())
#define rep(i,a,... | ALGO | 0.999493 | 4.157587 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b655611a9817... |
243fc76c-c614-4590-ae57-292eccdd2301 | nguyenhoang4875/CompetitiveProgramming | cses/1_intro_problems/3_Repetitions.cpp | #include <bits/stdc++.h>
#define int long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define F first
#define S second
#define For(_i, _a, _b) for (int _i = (_a); _i <= (_b); _i++)
#define Ford(_i, _a, _b) for (int _i = (_a); _i >= (_b); _i--)
#define Fore(it, x) for (auto it = x.begin(); it != x.end();... | ALGO | 0.999652 | 3.83375 | {
"github_metadata": {
"branch": "main",
"commit_count": 328,
"repo_created_at": "2023-02-28T01:38:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f2a3e2f76... |
c6333d3a-8809-4699-ad5a-8327c28cdbea | kunidesuyo/competitive-programming | src/atcoder/abc/abc295/d/abc295_d.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#include <cmath>
#define all(x) (x).begin(), (x).end()
using ll = long long;
int main() {
string s;
cin >> s;
ll n = s.length();
map<string, ll> x;
vector<string> bit(n + 1);
bit[0] = "0000000000";
x[bit[0]]+... | ALGO | 0.999967 | 4.115022 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2021-05-23T09:30:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbbcf5d7... |
1a2ef4ce-b0a7-4c69-b49b-cd6d6ba877d0 | alexandraback/datacollection | solutions_5731331665297408_0/C++/hhhuang/c.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int m, n;
int map[60][60];
char cities[60][6];
int order[60];
int visited[60];
char ans[500];
char best[500];
int cmp(const void *a, const void *b) {
return strcmp((char *)a, (char *)b);
}
int DFS(int current, int num_visited, int num_cities) {
if (num_vis... | ALGO | 0.99999 | 3.936488 | {
"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": "9dca16993... |
2551ed1f-6dc8-49cd-aad0-5a1622055fb9 | blueskyson/leethub | 0102-binary-tree-level-order-traversal/0102-binary-tree-level-order-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999973 | 6.179197 | {
"github_metadata": {
"branch": "main",
"commit_count": 570,
"repo_created_at": "2024-06-10T10:48: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": "95297b31f5... |
ea5995e6-8f61-4a61-8620-8ed28965d86d | nami4mo/competitive-programming | 2_kakomon/arc/arc061_b.cpp | #include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using namespace std;
namespace defines{
typedef long long ll;
typedef pair<ll,ll> P;
#define FOR(i,a,b) for(ll i = a ; i < b ; i++) // for i in range(a,b)
#define REP(i,n) for(ll i = ... | ALGO | 0.999918 | 4.095595 | {
"github_metadata": {
"branch": "master",
"commit_count": 239,
"repo_created_at": "2020-08-08T04:00: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": "7d28389e... |
c4ef308d-d557-405b-8276-7751a74e20c4 | StevenJiao/420_BLAZE_LABS | lab1/Code/lab1.cpp | #include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
extern "C" {
#include "lab1_IO.h"
}
#include "timer.h"
int **A; int**B; int** C; int n;
int thread_cnt;
double start, end;
void* threadfunc(void* arg_p){
int rank = *((int *) arg_p);
// calculate the row (... | ALGO | 0.999834 | 4.650108 | {
"github_metadata": {
"branch": "main",
"commit_count": 174,
"repo_created_at": "2023-01-12T21:57: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": "613c4ee76c... |
b0ed2b97-9225-4b67-9bf5-6fc55f6e4a3b | nikhilsourav/Data-Structures-and-Algorithms | 17. Tree/15. Convert to DLL/dll.cpp | /*
Given a tree, convert it into a doubly linked list where
the list items should be inorder traversal of the tree.
eg:
10
/ \
5 20
/ \
30 35
output 5 <=> 10 <=> 30 <=> 20 <=> 35
*/
#include <bits/stdc++.h>
using namespace std;
// T... | ALGO | 0.999999 | 6.058968 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2021-07-09T05:37:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 70,
"forks": 19,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed92fa... |
423a4c42-8e04-4490-84f7-7bc4bc3ac072 | akshata123-gaw/Algorithms | JobSequencing.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9 + 7;
int par[1000005];
// function to find parent
int find(int i)
{
if(par[i] == i) return i;
return par[i] = find(par[i]);
}
// merge two segments
void merge(int a,int b)
{
a = find(a);
b = find(b);
par[b] = a;... | ALGO | 0.999973 | 4.714209 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-11-27T17:53:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "716950920b3d... |
d60e5a5f-1a58-4e88-b1b6-7831853a4283 | llordly/ploblem-solving | 10830.cpp | // 10830
#include <iostream>
#include <vector>
#define MOD 1000
using namespace std;
int n;
long long b;
vector<vector<long long>> A;
vector<vector<long long>> mulMatrix(vector<vector<long long>> A, vector<vector<long long>> B) {
vector<vector<long long>> result(n);
for (int i = 0; i < n; ++i) {
fo... | ALGO | 0.999945 | 4.010894 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-10-11T08:08: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": "ee1afdcc7... |
2afa7f49-c780-49df-9881-8fceafeb54ba | Yubo-Cao/algorithms | notes/basic/graph/src/maze.cpp | /**
* Given an n×m two-dimensional integer array to represent a maze, the array
* only contains 0 or 1, where 0 represents the path that can be walked, and 1
* represents the wall that cannot be passed.
*
* Initially, a person is located at the upper left corner (1,1), and it is
* known that the person can move o... | ALGO | 0.999982 | 5.371758 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2022-04-08T21:04:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60347da1... |
3fd3e434-89d3-40e6-ac69-4a821db8fc33 | carlosCosta24/cpp-journey | level_2/solutions/problem_11.cpp | #include <iostream>
using namespace std;
enum enStatus
{
pass,
fail
};
void ReadNumbers(int &Num1, int &Num2, int &Num3)
{
cout << "Enter the number firstnumber: ";
cin >> Num1;
cout << "Enter the number secondnumber: ";
cin >> Num2;
cout << "Enter the number therednumber: ";
cin >>... | ALGO | 0.993739 | 4.465037 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2025-04-20T06:59: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": "b2032a8809... |
0c294b12-e287-4bf4-8e6f-c6753e1cc172 | BinomialSheep/CompetitiveC-- | AtcoderProblems/期待値DP埋め/07_ソーシャルゲーム.cpp | #include <bits/stdc++.h>
// デバッグ用マクロ:https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<lo... | ALGO | 0.999703 | 4.126988 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2023-12-12T17:45: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": "4481b75ef... |
5ede93a8-73ab-4643-b217-99cd6cc80160 | GuiTaglietti/C-CPP | Beecrowd (aka URIOJ)/3247.cpp | /**
* @author GuiTaglietti
* @link https://judge.beecrowd.com/pt/problems/view/3247
*/
#include <bits/stdc++.h>
using namespace std;
#define MAX 1123
typedef pair<int, int> ii;
char LG[MAX][MAX];
bool vis[MAX][MAX];
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
int V;
inline bool is_valid(in... | ALGO | 0.999905 | 4.924598 | {
"github_metadata": {
"branch": "main",
"commit_count": 200,
"repo_created_at": "2022-07-19T18:34: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": "ef8c21ea85... |
080822a5-a60e-4dfd-951a-4575763bc377 | luyencode/cpp-solutions | solutions/wuSQx4gT.cpp | /*
Sưu tầm bởi @nguyenvanhieuvn
Thực hành nhiều bài tập hơn tại https://luyencode.net/
*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define MAX 100
void NhapMang(int a[][MAX], int &dong, int &cot)
{
//Nhập số dòng
do
{
printf("\nNhap vao so dong: ");
// Cách tà đạo: scanf("do... | ALGO | 0.999622 | 3.697192 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-04-10T08:00:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 96,
"forks": 98,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddd6db27bf... |
bbba9bcd-bb12-4a43-b37b-47af9165cf50 | vukanoa/Coding_Problems | 4_N_539/DP_2-D/221_Maximal_Square/maximal_square.cpp | #include <iostream>
#include <vector>
/*
==============
=== MEDIUM ===
==============
===========================
221) Maximal Square
===========================
============
Description:
============
Given an m x n binary matrix filled with 0's and 1's, find the largest
... | ALGO | 0.999801 | 6.407763 | {
"github_metadata": {
"branch": "main",
"commit_count": 2647,
"repo_created_at": "2022-10-27T12:00: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": "e9d7c6bd3... |
e1276822-c93a-470e-86bf-8ebd091b6b94 | TheCrashDown/DIHT-Algos-3sem | contest-3/task3.3 - Minkowski Summ/main.cpp | /* Task:
Даны два выпуклых многоугольника на плоскости.
В первом n точек, во втором m.
Определите, пересекаются ли они за O(n + m).
Указание. Используйте сумму Минковского.
developed by Crashdown
*/
#include <iostream>
#include <math.h>
#include <vector>
#include <algorithm>
struct Point
{
... | ALGO | 0.99981 | 4.545834 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-02-01T16:47: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": "3154e694c0... |
141ab556-2aba-457e-aff8-534bf25a8ed0 | aditya369007/Steering-Servo | sketch_nov15b.ino | /*
Name: Servo_VS.ino
Created: 10/11/2017 6:10:39 PM
Author: ADITYA
*/
#define mid 580 //found by physically setting the steering at mid
#define left_comp 695 //found by physically setting the steering at left max
#define right_comp 463 //found by physically setting th... | ALGO | 0.901075 | 4.780189 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-10-11T22:32: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": "fc6becd6d2... |
8934b708-f66c-43c4-9a29-78cacc2422fe | Zottel/opencl_scad_experiment | host_lib/util.hpp | // Copyright 2018 <NAME> <<EMAIL>>
//
// 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... | TOOL | 0.959222 | 6.298662 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-04-28T13:46:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2aae593b7e... |
cb17f1b2-d1bd-4614-8708-82b1c463ba4c | theodoreOnzGit/C-_YouTube_OpenFoam | functions/vector_2Darray_add.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
double vector_length(double x, double y, double z);
double vector_add(double vectorA[3][1],double vectorB[3][1]);
int main ()
{
// note this only works for single dimension arrays not 2D arrays
double l;
double vector1[3][1];
cout << ... | ALGO | 0.99651 | 4.842306 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2019-09-02T22:31:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11d42a93... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.