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
793937f7-c28d-4098-a0d9-bb5892693042
sashagorbatyuk/Homework
CPP/CPP_06_2024.09.17/Homework6/Task2.7/Task2.7.cpp
#include <iostream> #include <algorithm> // for std::min using namespace std; /// <summary> /// Завдання 2.7. Користувач вводить два цілих числа. Необхідно вивести всі цілі числа, на які обидва введені числа діляться без залишку /// </summary> int main() { int num1, num2; cout << "Enter the first integer: ";...
ALGO
0.998525
5.614219
{ "github_metadata": { "branch": "main", "commit_count": 114, "repo_created_at": "2024-06-19T19:22: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": "4ede405e3e...
a3b3e587-5802-4e7e-88be-1385c4d885c1
archishmanghos/DSA-Contests
Companies/TCS/Codevita-2022/Pre-Qualifiers/D.cpp
#include <bits/stdc++.h> // #ifndef ONLINE_JUDGE // #include <D:/archishmanghos/Practice/Online_Judges/archiDebug.h> // #else // #define debug(x) // #endif #define int long long using namespace std; const int mxN = 2e5 + 5; const int INF = 1e18 + 7; int N; char A[105][105]; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, ...
ALGO
0.999965
3.868636
{ "github_metadata": { "branch": "master", "commit_count": 2328, "repo_created_at": "2021-08-03T05:06:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0b944a2...
db3dddba-a132-4fa9-85ec-8ea469bd234e
raresmoldovan07/Infoarena
Arhiva educationala/Ciclu hamiltonian de cost minim.cpp
#include <iostream> #include <fstream> #include <vector> #define inf 0x3f3f3f3f using namespace std; ifstream f("hamilton.in"); ofstream g("hamilton.out"); const int NMax = 18; int n, m, sol; vector < int > G[NMax + 2]; int cost[NMax + 2][NMax + 2], dp[(1 << NMax) + 5][NMax + 2]; int main() { f >> n >> m; ...
ALGO
0.999948
3.985398
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2019-01-08T21:50: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": "1311187e1a...
7fa628c9-7f2d-4da8-ba0c-a79330062de0
christinekommata/Computer-Graphics
Bresenham Line.cpp
#include<stdio.h> #include <math.h> #include <GL/glut.h> float x_rotation = 0.0f, y_rotation = 0.0f, tx = 0.0f, ty = 0.0f, tz = 0.0f; float dx = 0.0f, dy = 0.0f; int mouseClicked = 0; void createCube(){ //Dimiourgia kivou glTranslatef(tx, ty, tz); glBegin(GL_QUADS); // Tertragwno orofis glColor3f(0...
ALGO
0.963548
4.443529
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-07-11T09:43: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": "00df17c8158d...
6beb26df-6513-4f47-80d2-4f21da4d8ed7
AgustinAllamanoCosta/DataDragon
node/src/zkp/src/starkware/air/rescue/rescue_air_utils.h
#ifndef STARKWARE_AIR_RESCUE_RESCUE_AIR_UTILS_H_ #define STARKWARE_AIR_RESCUE_RESCUE_AIR_UTILS_H_ #include <array> #include <utility> #include <vector> #include "starkware/air/rescue/rescue_constants.h" #include "starkware/algebra/fields/base_field_element.h" namespace starkware { /* An inner state in the computa...
ALGO
0.999001
7.58986
{ "github_metadata": { "branch": "main", "commit_count": 38, "repo_created_at": "2023-12-18T01:48:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e106a5a1349...
74669419-9bbd-488f-a8c4-9846a7698073
wjdansrl7/Coding-Test
백준/단기간성장/3584_다른해설.cpp
/** * @file 3584_다른해설.cpp * @author your name (<EMAIL>) * @brief * @version 0.1 * @date 2023-09-28 * * 두 노드 u, v를 입력받으면 u부터 루트 노드까지 올라가면서 방문 표시를 한다. * 그리고 v에서 위로 거슬러 올라갈 때 만약 그곳이 u가 방문했던 곳이라면 최소 공통 조상입니다. * * @copyright Copyright (c) 2023 * */ #include <iostream> #include <cstring> using namespace std; int...
ALGO
0.999996
5.765232
{ "github_metadata": { "branch": "master", "commit_count": 489, "repo_created_at": "2023-03-07T14:20: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": "3bb6011d...
6d1cb58a-1040-48ad-a188-97c7ef1437c8
swami1991/Interactive-Ray-tracing-with-OpenCL
Real time ray tracing with OpenCL/bvh.cpp
// // bvh.cpp // Real time ray tracing with OpenCL // // Created by <NAME> on 4/11/17. // Copyright © 2017 <NAME>. All rights reserved. // #include "bvh.hpp" void CreateBVH_Texture(struct GPU_BVHNode *BVH,cl_float4 *bvh_lower,cl_float4 *bvh_higher, cl_uint4 *bvh_nodes, uint size){ for(uint i=0;i<size;i++...
ALGO
0.999288
4.927917
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-05-03T22:38: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": "e7be1c893a...
aa926378-fcce-4f23-8b1f-6784dce516c9
dynamic-wind/advent-of-code-2024-solutions
day12/part1.cpp
#include <array> #include <iostream> #include <string> #include <utility> #include <vector> const std::array<std::pair<int, int>, 4> offsets = {{ {1, 0}, {0, 1}, {-1, 0}, {0, -1}, }}; int area_fill( const std::vector<std::string>& garden, std::vector<std::vector<int>>& visited, int i, int j, int rows,...
ALGO
0.999736
5.944651
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2024-12-06T19:26: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": "2520f0a4a40...
23914300-63e0-414d-b09a-3da18f631fae
vincentiusar/cp-repo
iCyption2022/practice/nomor/solution.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; const ll M = 1e9 + 7; ull gcd(ull a, ull b) { if (b == 0) return a; return gcd(b, a % b); } ull checklcm(ull a, ull b) { ull Max = max(a, b), Min = min(a, b); ull P = M...
ALGO
0.999945
4.417586
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-12T16:19: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": "89aecd9ca565...
0d509ae5-82c7-4507-a5cc-dc7956a2e8e8
graceemlin/codeforces
2004/2004c.cpp
#include <bits/stdc++.h> using namespace std; int main(int argc, char* argv[]){ ios::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--) { long long n; cin >> n; long long k; cin >> k; vector<long long> items(n, 0); for (int i = 0; i < n; ++i) { cin >> items[i]; ...
ALGO
0.999909
3.66489
{ "github_metadata": { "branch": "main", "commit_count": 218, "repo_created_at": "2024-09-30T08:11:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "725f324170...
441ba80e-3c3d-42a7-a6ff-a3495367620d
AnkitApurv/BCA
SEM-III-DS/12 Singly Linked List/12 Singly Linked List.cpp
//singly linked list #include<iostream> #include<cctype> #include<cstdlib> using namespace std; struct node { int regno; char name[10]; struct node*link; }; typedef struct node nodet; nodet*start = NULL; int cqcreate(void) { char ch; int i = 0; nodet*curptr,*newnode; start = (nodet*)malloc(sizeof(nodet)); curpt...
ALGO
0.998468
3.793656
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-03-23T17:12:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "110d6ce746...
6f310d77-3e3e-4d8f-93ab-732e68b1a034
kittobi1992/ProblemSolving
Problems/Codeforces/NWERC 2009/H/main.cpp
#include <bits/stdc++.h> using namespace std; vector<int> cnt(5,0); struct Hexagon { int val; Hexagon *NE, *N, *NW, *SW, *S, *SE; Hexagon() : val(6), NE(nullptr),N(nullptr),NW(nullptr), SW(nullptr),S(nullptr),SE(nullptr) { } vector<pair<Hexagon*,s...
ALGO
0.9999
3.99577
{ "github_metadata": { "branch": "master", "commit_count": 165, "repo_created_at": "2015-05-26T22:12:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e7bcb78...
8d45c636-daf6-4296-bfba-58cf1ee9f2fc
oshinoooo/leet_code
problems0969/main.cpp
#include <iostream> #include <algorithm> #include <functional> #include <vector> #include <set> #include <unordered_set> #include <map> #include <unordered_map> #include <stack> #include <queue> #include <deque> using namespace std; class Solution { public: vector<int> pancakeSort(vector<int>& arr) { vect...
ALGO
0.999959
5.651069
{ "github_metadata": { "branch": "main", "commit_count": 265, "repo_created_at": "2022-02-16T17:47: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": "2049d1c1ed...
8da4d30d-73f9-46b9-a2a5-fd2dd19aa051
raju-gundu/micromouse_nano
pid.ino
float normal_steering_error() { float error=0; float left_error = (leftDesiredDistance - leftSensorValue()); float right_error = (rightDesiredDistance - rightSensorValue()); if(leftWall() && rightWall()){ error = left_error - right_error; // float errorD = errorP - oldErrorP; // totalError +=...
ALGO
0.998599
4.320527
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-05T05:22: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": "dafa9c7d4d7b...
0de259cc-f1c2-483a-9f3a-13e5d0177472
liruicrecky/leetcodec--
309.最佳买卖股票时机含冷冻期.cpp
// @before-stub-for-debug-begin #include <bits/stdc++.h> using namespace std; // @before-stub-for-debug-end /* * @lc app=leetcode.cn id=309 lang=cpp * * [309] 最佳买卖股票时机含冷冻期 */ // @lc code=start class Solution { public: int maxProfit(vector<int> &prices) { int n = prices.size(); vector<array<...
ALGO
0.99993
5.625267
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2022-10-05T14:55: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": "947c23bdd...
1f0c8ed7-9205-4170-9bbb-da9c921a9da5
GaussGreen/old-code
JP/code/drlib/market/edginc/ZC3CurveSegment.hpp
//---------------------------------------------------------------------------- // // Group : QR&D Core Analytics Team // // Filename : ZC3CurveSegment.hpp // // Description : Helper class for ALIB zero curve 3 bootstrapping method. // // Author : <NAME> // // Date : 13th May 2005 // //---...
ALGO
0.985771
7.45048
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-02-17T09:58:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c53de548d3ef...
31f54bbc-70f9-4183-82fa-5a6b82125791
simonnguyen175/cp-repo
training/anh_dung_day/6-18-2021(contest)/kingdom(dijkstra).cpp
#include <bits/stdc++.h> using namespace std; #define tpii tuple<int, int, int> const int N = 1e3 + 5; int n, adj[N][N], dp[N][N], ans = INT_MAX; bool vis[N][N]; priority_queue<tpii, vector<tpii>, greater<tpii> > Q; void solve() { cin >> n; for(int i = 1; i <= n; ++i) for(int j = 1; j <= n; ++j) cin >> adj[i]...
ALGO
0.99976
3.876423
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-11-16T14: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": "b54a2be258...
c2a72cfa-8563-49c9-aecf-98fd2c10dc7e
JanBiotech/BayesLiDiCal
BayesQLD/src/model.cpp
/* * Copyright (c) 2019 JanBiotech, Inc. * * 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 disclai...
ALGO
0.996447
5.415334
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2019-09-03T20:26:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e726d8743...
71f8b579-6499-47bb-b106-d398bce96563
Coders-Assemble/Sanket-Jagtap-DSA
Tree/Tree Problems/LC662-Maximum_Width_of_Binary_Tree.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; // TC => O(n) // SC => O(n) // 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), r...
ALGO
0.999848
5.835106
{ "github_metadata": { "branch": "master", "commit_count": 379, "repo_created_at": "2023-06-29T17:33:12.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "33c442fb4...
3ad1c471-c626-49e3-b034-849fc19fc10b
jmarko02/LeetCode
Trees/572SubtreeOfAnotherTree.cpp
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), left(left), right(right) {} }; class Solution { public: ...
ALGO
0.999976
5.785934
{ "github_metadata": { "branch": "main", "commit_count": 52, "repo_created_at": "2023-09-04T12:11: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": "592474053cd...
d44430b3-4727-4196-b2a5-6a2310577fa4
gsy1234567/CG
new_algorithm/kdtree_split.cpp
#include <iostream> #include <vector> #include <assert.h> #include <algorithm> #include <unordered_set> namespace gsy { template<unsigned Dim, typename T> struct Line; template<typename T> struct Line<1, T> { T pmin, pmax; }; template<typename T> T choose_split_number(const std::v...
ALGO
0.99977
5.382567
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2024-04-06T16:24: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": "9b9c8f1d6f...
af6d56f1-40af-4875-b37d-bd1bc45db7aa
milideva/Blockchain
asyncProtoServer.c++
#include "commonProto.h" vector <pair<ip::address, port_t>> vPeers; // Port on which this peer is offering a particular Service #define MY_SERVICE_PORT (1111) // Serialize a protocol message into json, a verbose serializer. // May want to move to Google protobuf or boost serializer Ar static Json::Value getMessageI...
WEB
0.938343
3.473528
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-07-15T12:05: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": "1b69f8ad0b92...
8552432a-b739-4b74-a22f-c96777f2739f
gorapang/PS
백준/Gold/1275. 커피숍2/커피숍2.cc
#include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; int n, q; vector<long long> tree; void set_tree(int i) { while (i != 1) { tree[i / 2] += tree[i]; i--; } } void update_val(int index, int value) { long long diff = value - tree[index]; while (index > 0) { tre...
ALGO
0.999591
4.646016
{ "github_metadata": { "branch": "main", "commit_count": 193, "repo_created_at": "2024-02-09T08:02: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": "58705221fa...
78212667-8926-486c-a136-f8fdcd84a7dc
10EastSea/programers-algo
dfs_bfs/87694.cpp
// 아이템 줍기 #include <string> #include <vector> // #include <iostream> #define MAP_SIZE 100*2 using namespace std; class Point { public: int x, y; int move_cnt; Point(int x, int y, int move_cnt) { this->x = x; this->y = y; this->move_cnt = move_cnt; } }; int is_equal(Point p1, Point p2...
ALGO
0.9995
3.974621
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2022-06-26T06:52: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": "6129c3dc1...
f215751f-2036-4ac6-98f7-cb06397f1e8f
PremiumGraphicsCodes/CGLib2022
CrystalSpace/CrystalSpace/CompactSpaceHash3d.cpp
#include "CompactSpaceHash3d.h" #include <bitset> #include "../../Crystal/Shape/IParticle.h" using namespace Crystal::Math; using namespace Crystal::Shape; using namespace Crystal::Space; namespace { constexpr long int p1 = 73856093; constexpr long int p2 = 19349663; constexpr long int p3 = 83492791; } CompactS...
ALGO
0.934083
5.532275
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2022-06-02T06:20: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": "548bcac00e34...
818578d9-2f9b-4e4e-aebe-18a826e14d98
YaminArafat/Codeforces
New folder/B. Vile Grasshoppers seive.cpp
#include <bits/stdc++.h> #define maxxx 1000000 using namespace std; vector<long long>prime; vector<long long>segmented_Primes; void seive(long long y,long long p) { bool flag[y]; memset(flag,0,sizeof(flag)); for (long long i=3;i*i<=y;i+=2) { if(!flag[i]) { for (long long j=i*...
ALGO
0.999989
3.467302
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2021-03-24T10:47: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": "0de10b48a...
08670877-7a8f-4eb9-bf88-d1e9e8864d23
jusancc/Proyecto_TT1
include/JPL_Eph_DE430.hpp
//$Header$ //------------------------------------------------------------------------------ // JPL_Eph_DE430 //------------------------------------------------------------------------------ // GMAT: General Mission Analysis Tool // // **Legal** // // Author: <NAME> // /** * @file JPL_Eph_DE43...
ALGO
0.99801
7.005209
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2025-03-28T08:57:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 6, "pull_requests": 0 }, "file_meta": { "content_id": "7a600ed2ab9...
27fed489-244f-419e-ac43-8c26ef1f5249
baactree/PS
BOJ/6086/6086.cpp14.cpp
#include "bits/stdc++.h" using namespace std; map<string, int> h; int node(string s) { if (h.count(s) > 0) return h[s]; int cnt = h.size(); return h[s] = cnt + 1; } int capacity[1000][1000]; int source, sink; bool trip[1000]; int par[1000]; int n; int bfs() { queue<int> q; q.push(source); par[source] = -1; tri...
ALGO
0.999863
4.051627
{ "github_metadata": { "branch": "master", "commit_count": 224, "repo_created_at": "2017-01-14T14:53:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e1b983d...
77610379-d769-4f9c-8a2e-530eb19f2a53
akanksha0812/Data-Structures
gfg/ptod/Stickler Thief.cpp
class Solution { public: //Function to find the maximum money the thief can get. int FindMaxSum(int arr[], int n) { // Your code here if(n == 0) return 0; if(n == 1) return arr[0]; int include = arr[0]; // Maximum sum including the previous element int excl...
ALGO
0.999788
5.086073
{ "github_metadata": { "branch": "main", "commit_count": 1116, "repo_created_at": "2022-04-18T17:18: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": "21838e532...
8dcf05ed-9d64-43ed-b27c-ed39ece1a1f2
SHL0915/BOJ_Problem_Solving
백준/Platinum/5551. 쇼핑몰/쇼핑몰.cc
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; const int INF = 0x3f3f3f3f; int N, M, K; vector <pii> graph[3005]; int adj[3005][3005]; int dist[3005]; int arr[3005]; void Dijkstra(); void solve() { cin >> N >> M >> K; for (int i = 0; i < M; i++) { int a, b, c; c...
ALGO
0.999961
4.04995
{ "github_metadata": { "branch": "main", "commit_count": 2813, "repo_created_at": "2022-08-29T05:15: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": "4c0ae5069...
7eba23ac-11ae-4769-b24a-162d7e8fd893
Itakello/Competitive-programming
Doc_files/fenwick_tree.cpp
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; int LSOne(int x) { return (x & (-x)); } // 🗒️NOTE: Easy to implement for multidimensional (just apply for another layer) // Point/Range update, class FenwickTree { private: vi ft; public: FenwickTree(int n) { // Initialize to zeros ft.assig...
ALGO
0.999697
5.666099
{ "github_metadata": { "branch": "master", "commit_count": 27, "repo_created_at": "2022-02-27T13:42: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": "3ea46bedb...
d45cc074-1b0a-4e12-ad82-b69e86628a0e
LordaeronESZ/LeetCode
0077组合/组合.cpp
#include<iostream> #include<vector> using namespace std; class Solution { public: vector<vector<int>> combine(int n, int k) { vector<vector<int>> res; vector<int> r; Func(res, r, n, k, 1); return res; } void Func(vector<vector<int>>& res, vector<int>& r, int n, int k, int cur...
ALGO
0.999979
5.667438
{ "github_metadata": { "branch": "master", "commit_count": 313, "repo_created_at": "2021-08-28T12:32: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": "16f2663d...
399c04f8-124b-42ba-a49d-6bf1ea22004c
Hamdi-Kaoubi/Programming-Advices-PSets
07 - Algorithms & Problem-Solving Level 3/problem10-sum-of-matrix.cpp
#include <iostream> #include <cstdlib> #include <iomanip> using namespace std; int RandomNumber(int From, int To) { return rand() % (To - From + 1) + From; } void FillThreeByThreeMatrixRandomly(int matrx[3][3], short rows, short cols) { for (short i = 0; i < rows; i++) { for (short j = 0; j < cols;...
ALGO
0.962626
3.906869
{ "github_metadata": { "branch": "main", "commit_count": 68, "repo_created_at": "2025-02-24T15:35: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": "72eeb1cf664...
15e588c1-e331-4dcc-b3b8-0598b3fe1f2d
Cube219/PS
CodeForces/1399 - Codeforces Round #661 (Div. 3)/D - Binary String To Subsequences.cpp
#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <utility> #include <vector> #include <string.h> using lli = long long int; int tNum; int n; char s[200001]; int r[200001], rNum; std::vector<int> zeroGroups; std::vector<int> oneGroups; int main(void) { // freopen("input.txt", "r", stdin); scan...
ALGO
0.999899
3.858435
{ "github_metadata": { "branch": "main", "commit_count": 1172, "repo_created_at": "2021-01-20T03:42:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "768ddd75c...
89733ed3-1ac6-417d-8b24-a4f70aa04f25
alextsui05/coding-practice
Leetcode.cpp/WordSearchII.cpp
#!/usr/bin/env cppsh #include <algorithm> #include <vector> #include <string> #include <iostream> #include <boost/unordered_set.hpp> using namespace std; using namespace boost; class TrieNode { TrieNode *child[26]; bool m_here; public: // Initialize your data structure here. TrieNode(): m_here(false) ...
ALGO
0.999692
5.623235
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2015-07-31T16:31:54.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "315b65f35...
495234ff-6198-4492-a6f3-ff7f10d23b7e
BtraRahul/LC-Problems
0105-construct-binary-tree-from-preorder-and-inorder-traversal/0105-construct-binary-tree-from-preorder-and-inorder-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.999993
6.399854
{ "github_metadata": { "branch": "main", "commit_count": 944, "repo_created_at": "2024-02-17T18:04: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": "1fbc0d439c...
7f5e80ff-5889-4046-acb2-8f5899d7dfd9
YnkDK/BioSeq-Project3
src/SP_EXACT_3.cpp
#include "SP_EXACT_3.h" void SP_EXACT_3::initialize(Parser& parser) { D.clear(); alignment.clear(); n1 = parser.sequences[0].size() + 1; n2 = parser.sequences[1].size() + 1; n3 = parser.sequences[2].size() + 1; D.resize(n1, vector<vector<int64_t>>(n2, vector<int64_t>(n3, 0))); this->parser...
ALGO
0.99977
4.170531
{ "github_metadata": { "branch": "master", "commit_count": 40, "repo_created_at": "2015-09-21T08:31: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": "c81de2578...
078f9391-21ac-460c-9707-37a00b31ec28
ehnryx/acm
asia-taipei-2021-cf103443/b.cpp
#include <bits/stdc++.h> using namespace std; //%:include "utility/fast_input.h" //%:include "utility/output.h" using ll = long long; using ld = long double; constexpr char nl = '\n'; constexpr int MOD = 998244353; constexpr ld EPS = 1e-9L; random_device _rd; mt19937 rng(_rd()); struct Result { int res, l, r; b...
ALGO
0.999996
6.045165
{ "github_metadata": { "branch": "master", "commit_count": 79, "repo_created_at": "2018-05-03T04:18:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "782132a83...
ad848396-bd07-4e48-921a-b99e8b427d64
nishchay-suteri/Practice-Questions
ArraysAndStrings/zeroMatrix/solution.cpp
#include "solution.h" #include<iostream> #include<algorithm> #include<unordered_map> /* * Note: for this problem, our BCR(Best Conceivable Time) is O(N) since we have to traverse every value */ // Base Class void Solution::display(){ for(int i=0;i<maxRow;i++) { for(int j = 0;j<maxCol;j++) { ...
ALGO
0.999958
5.461364
{ "github_metadata": { "branch": "master", "commit_count": 36, "repo_created_at": "2019-09-07T12:04:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6736a932b...
2d3d753d-c5b5-4cb1-b134-13f975d6935b
aquinoax3/Codewars_cpp_7kyu
pauls_misery.cpp
// Paul is an excellent coder and sits high on the CW leaderboard. He solves kata like a banshee but would also like to lead a normal life, with other activities. But he just can't stop solving all the kata!! // Given an array (x) you need to calculate the Paul Misery Score. The values are worth the following points: ...
ALGO
0.999335
5.154675
{ "github_metadata": { "branch": "main", "commit_count": 205, "repo_created_at": "2024-03-16T17:04: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": "423845fd20...
c22899d1-9827-4180-bc60-3aa223e733de
achrafoo2018/Competitive_Programming_Contests
extreme17/b.cpp
#include <bits/stdc++.h> using namespace std; #define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); #define sim template < class c #define ris return * this #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct r...
ALGO
0.999652
4.601707
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2022-02-22T18:08: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": "e339ec9acb1...
b6a7aac5-520b-46d6-b9fe-869e1cfd38e0
TelegramMessenger/Telegram-iOS
third-party/openh264/third_party/openh264/src/codec/processing/src/adaptivequantization/AdaptiveQuantization.cpp
/*! * \copy * Copyright (c) 2013, Cisco Systems * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above co...
ALGO
0.922919
3.078997
{ "github_metadata": { "branch": "master", "commit_count": 28524, "repo_created_at": "2018-11-14T18:06:49.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 6895, "forks": 1916, "issues": 531, "pull_requests": 45 }, "file_meta": { "content_id":...
7949c705-5997-48eb-a844-4c9d75209e70
pseeej/CodingTest
10299.cpp
#include <stdio.h> #include <string.h> #pragma warning(disable:4996) double checkWonso(char alpha); int main() { char chem[100]; int N; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%s", chem); double sum = 0; double wonso = 0; int check = 1; for (int j = 0; j < (int)strlen(chem); j++) { w...
ALGO
0.969022
3.235033
{ "github_metadata": { "branch": "master", "commit_count": 590, "repo_created_at": "2020-02-26T18:39:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a5198a3a...
82109d10-5e0c-40a9-a05d-4addc69172dc
MrIceCreamMan/PIM_Summer_2017
host/gen_single/host_generator.cpp
#include <iostream> #include <stdlib.h> // srand, rand #include <time.h> // time #include <fstream> // file stream #include "LockLinkedList.h" // Linked List using namespace std; int main(int argc, char* argv[]){ int left_bound = 0; int right_bound = 100; int initial_size = 30; ...
TOOL
0.976974
4.255059
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2017-06-20T13:45: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": "b6e2ae7fd...
ebee5fc6-2a0d-45c9-a946-008508926ee7
drewsortega/aoc19
day6/part2.cpp
#include <string> #include <map> #include <stack> #include <iostream> using namespace std; pair<string, string> get_pair(string); int count_orbits(map<string, string>&, map<string, int>&, string); stack<string>* trace(map<string, string>&, string); int main() { string line; map<string, string> orbits; ...
ALGO
0.999847
4.888057
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2019-12-01T22:23: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": "b3bcf3611...
5a21b089-0a82-479a-9ccc-ecdf660b9faa
TheRealIcaros/Procedural-City-Generator
Project/Project/Logic/header/PerlinNoise.h
#ifndef PERLINNOISE_H #define PERLINNOISE_H #include "Noise.h" #include <vector> #include <glm.hpp> /* Base Code from: SolarianProgrammer.com, upgraded by <NAME> and <NAME> for Procedural city generation using Perlin noise */ class PerlinNoise : public Noise { private: // The permutation vector std::vector<int> p...
TOOL
0.983104
6.199856
{ "github_metadata": { "branch": "master", "commit_count": 205, "repo_created_at": "2018-04-12T06:48:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "12b9965a...
fc3aa6bc-b320-4987-8175-23fb55e11299
ShoomanKhatri/Information-Security
C++ Version/vigenere-cipher.cpp
#include <iostream> #include <string> #include <cctype> using namespace std; string encryptVigenere(const string& plaintext, const string& key) { string ciphertext = ""; int keyLength = key.length(); int keyIndex = 0; for (char c : plaintext) { if (isalpha(c)) { char base = isuppe...
ALGO
0.999705
5.600695
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-07-04T10:05: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": "56a2a37e7005...
19f3c3cb-a6d2-4497-a598-3b8f8e85ac48
RastogiAdit/DSA_Assignments
asn10/D.cpp
#include <iostream> #include <vector> #include <queue> #include <stack> using namespace std; void bfs(vector <int> adj[], int vis[], int parent[], int s, int d) { queue <int> q; vis[s] = 1; q.push(s); while(!q.empty()) { int node = q.front(); q.pop(); for(auto it : adj[node]...
ALGO
0.999975
4.093782
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-09-06T11:40: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": "084ed2313dd8...
3635dbb1-b98f-48d0-b6a4-9553730266fd
muhammad-sayem/Codeforces
B_Array_Recovery.cpp
#include<bits/stdc++.h> #define nl '\n' #define yes (cout << "YES\n") #define no (cout << "NO\n") #define yy (cout << "Yes\n") #define nn (cout << "No\n") #define ll long long #define pb push_bac...
ALGO
0.999613
4.091009
{ "github_metadata": { "branch": "main", "commit_count": 378, "repo_created_at": "2023-04-27T08:21: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": "58b4fd7653...
07ef0bbc-6c35-4039-ae6c-746487948927
AdityaSeth777/6Companies30DaysChallenge
Walmart/2385. Amount of Time for Binary Tree to Be Infected/Solution.cpp
class Solution { public: void f(TreeNode *root, unordered_map<int, vector<int>> &adj, int parent) { if (!root) { return; // Aditya Seth. } int curr = root->val; if (!root->left) adj[curr].push_back(0); else adj[curr]...
ALGO
0.999992
5.206796
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2023-12-31T17:59: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": "31fd7ac6ba4...
244b019b-daf4-4544-bd7c-c194dcc9debb
CodingOfZero/DataStructure
sort/median.cpp
/* *median *2018年8月4日 17:22:07 */ #include<iostream> #include<vector> using std::vector; //中位数蛮力版:仅适用于max(n1,n2)较小的情况 O(n1+n2) //子向量S1[lo1,lo1+n1)和S2[lo2,lo2+n2)分别有序,数据项可能重复 int trivialMedian(vector<int> &S1,int lo1,int n1,vector<int> &S2,int lo2,int n2) { vector<int> S; int hi1 = lo1 + n1, hi2 = lo2 + n2; while ((l...
ALGO
0.999993
4.633753
{ "github_metadata": { "branch": "master", "commit_count": 72, "repo_created_at": "2018-07-14T02:54:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3dc855a94...
e3056ae4-0059-476a-ac0e-1c3f565f5081
0505eok/BOJ
1261.cpp
#include<iostream> #include<algorithm> #include<queue> using namespace std; int n,m; int xp[4] = {-1,0,1,0}; int yp[4] = {0,-1,0,1}; char arr[101][101]; int dist[101][101] = {-1,}; int main(){ cin >> m >> n; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin >> arr[i][j]; dist[...
ALGO
0.999914
3.719918
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2021-02-16T08:09:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6fbbdfd7b...
4cc09cfc-149b-46e9-bf8f-742183a77eab
nabil0203/Phitron_Algorithm
mod-03/3.09_BFS_on_2D-Grid-1.cpp
// similar to BFS(v-2.4) // changes are commented #include <bits/stdc++.h> using namespace std; char grid[105][105]; bool visited_array[105][105]; vector<pair<int, int>> d = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; int c, r; bool valid(int i, int j) { if (i < 0 || i >= r || j < 0 || j >= c) { retu...
ALGO
0.999854
3.647484
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2025-02-01T16:31: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": "b1bbc2be72f...
b2cc37d8-f808-4624-9ef0-0aad88fa190a
Basalisk9271/DiffusionModel
cpp/diffusion.cpp
//<NAME> //CSC330: Organization of Programming Languages //Project 2: Diffusion Model -> C++ //November 17th, 2022 #include <iostream> #include <string> #include <vector> #include <math.h> using namespace std; int main(int argc, char **argv) { int maxsize; char choice; //takes in the number for maxs...
ALGO
0.999769
4.902635
{ "github_metadata": { "branch": "main", "commit_count": 51, "repo_created_at": "2022-12-06T23:55:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7f5298f6da0...
d8b1bc98-ccd5-4b15-96ee-24445d7fcd18
ahay/src
user/junyan/vecmatop.cc
#include <rsf.hh> #include "numvec.hh" #include "nummat.hh" #include "numtns.hh" #include "vecmatop.hh" using std::cerr; using std::min; using std::max; //typedef long int int; //Y <- a M X + b Y // ---------------------------------------------------------------------- int dgemm(float alpha, const FltNumMat& A, co...
ALGO
0.999677
4.631821
{ "github_metadata": { "branch": "master", "commit_count": 15821, "repo_created_at": "2015-07-26T15:48:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 297, "forks": 177, "issues": 70, "pull_requests": 0 }, "file_meta": { "content_id": "8c...
68d1e9ab-bb01-4e95-b2ea-a616f0fdddd8
Jaygaur99/DS-Algo-Practice
Coding_Minutes/DP/12_Subsequence/1_longest_increasing_subsequence.cpp
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; typedef long long ll; typedef double dbl; typedef long double ldbl; t...
ALGO
0.999745
4.924591
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2022-04-18T06:08: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": "d6559e971f6b...
a0bfd4d0-738d-4998-bb1b-b3a77c5f71c9
kaumudip3/Practices
Arrays/rotateMatrixClockwise.cpp
// Note: Try to solve this task in-place (with O(1) additional memory), since this is what you'll be asked to do during an interview. //You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees (clockwise). std::vector<std::vector<int>> rotateImage(std::vector<std::vector<int>> a) { // ...
ALGO
0.999897
6.238417
{ "github_metadata": { "branch": "master", "commit_count": 47, "repo_created_at": "2020-01-16T13:22: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": "b6b5dc0ed...
a7942dbf-0630-43f3-9226-e6f625b88cb9
benjaminhuanghuang/ben-leetcode
0698_Partition_to_K_Equal_Sum_Subsets/solution.cpp
/* 698. Partition to K Equal Sum Subsets Level: Medium https://leetcode.com/problems/partition-to-k-equal-sum-subsets */ #include <iostream> #include <vector> #include <string> #include <stack> #include <queue> #include <unordered_map> #include <unordered_set> #include <numeric> #include <algorithm> #include "common...
ALGO
0.999856
6.051825
{ "github_metadata": { "branch": "master", "commit_count": 380, "repo_created_at": "2020-01-26T01:12:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c84743f4...
4a688977-c27c-4726-b336-790b049218c9
jacobisbell/College-Code-Projects
CSC 2111/Lab10/hanoi.cpp
/*--- hanoi.cpp ---------------------------------------------------------- Program to solve the Towers of Hanoi puzzle recursively. Input: numDisks, the number of disks to be moved Output: A sequence of moves that solve the puzzle Written by: <NAME> Add your name here and other info requested b...
ALGO
0.999899
6.15757
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2013-02-26T02:18: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": "57a3596ad7...
7c67ece1-87b7-459f-9bf4-1c620c679747
baserinia/FlowSolver
src/face_bnd_wall_dir.cpp
// Incompressible Flow Solver // Copyright (C) 2005 <NAME> //------------------------------------------------------------------------------ // Date: 05 Apr 2005 // Update: 05 Apr 2005 //------------------------------------------------------------------------------ #include "face_bnd_wall_dir.h" #include "cell.h" ...
ALGO
0.999196
5.201711
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2017-06-30T00:44: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": "31e5b4077b...
be060d32-7da8-4bb5-b84d-c080e8a3e41b
yokotech/competitive_programming
library/old/kruskal.cpp
#include<bits/stdc++.h> /* g++ -std=c++11 -Wall -g -fsanitize=undefined -D_GLIBCXX_DEBUG aoj/grl_2_a.cpp aoj/grl_2_aにてverify */ using namespace std; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define SZ(x) ((int)(x).size()) #define INF (1e16) typedef long long ll; vector<int> parent;// それぞれのnodeのparent,main内で...
ALGO
0.999986
4.572392
{ "github_metadata": { "branch": "master", "commit_count": 100, "repo_created_at": "2019-08-11T02:10: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": "9f6e9b68...
532f6646-2205-448e-b6bf-c17a4d7231c1
ishandutta2007/codeforces-h
heltion/normal/1156/D.cpp
//Author: Heltion //Date: 2019-05-01 #include<bits/stdc++.h> using namespace std; using LL = long long; template<typename T>void maxi(T &a, const T &b){if(b > a) a = b;} template<typename T>void mini(T &a, const T &b){if(b < a) a = b;} constexpr int maxn = 240000; vector<pair<int, int> > G[maxn]; int c[2][maxn], d[2][m...
ALGO
0.999958
4.295371
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T02:01: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": "65811ac4bb94...
0ad06a44-5d3c-4b69-be13-0dcc2df7e936
ghtjr026/algorithm
Programmers/다리를 지나는 트럭.cpp
/************************** 문제의 핵심 1. 유의사항 없음 **************************/ #include <iostream> #include <string> #include <vector> #include <queue> using namespace std; int solution(int bridge_length, int weight, vector<int> truck_weights) { int answer = 0; deque<int> bridge; for(int idx = 0 ; idx < bridg...
ALGO
0.999957
5.058362
{ "github_metadata": { "branch": "main", "commit_count": 96, "repo_created_at": "2022-01-26T10:28: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": "b3866c4a26d...
ab400906-ff1c-4eee-83a3-3c371e5dfa56
yabincui/oj_coding
poj/Fliptile.cpp
#include <stdio.h> #include <string.h> int M, N; int s[15][15]; int best[15][15]; int bestCount; void flipNode(int grid[15][15], int r, int c) { int dr[5] = {-1, 1, 0, 0, 0}; int dc[5] = {0, 0, -1, 1, 0}; for (int i = 0; i < 5; ++i) { int nr = r + dr[i]; int nc = c + dc[i]; if (nr < 0 || nr >= M |...
ALGO
0.999993
4.24017
{ "github_metadata": { "branch": "master", "commit_count": 107, "repo_created_at": "2015-04-25T02:59:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7bcf9b95...
2316f379-09c8-4dc3-b985-8936cb3c728f
MDGSF/JustCoding
cpp-leetcode/leetcode_0001/solution_01.cpp
#include "cpplang.hpp" class Solution { public: std::vector<int> twoSum(std::vector<int>& nums, int target) { std::map<int, int> maps; for (int i = 0; i < nums.size(); ++i) { int num = nums[i]; int peer = target - num; auto it = maps.find(peer); if (it != maps.end()) { return...
ALGO
0.999596
6.153834
{ "github_metadata": { "branch": "master", "commit_count": 470, "repo_created_at": "2019-08-11T03:52:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "435d0fb...
3cff7e5e-6e55-498a-8f44-15715a0a0ce1
ChenhanYu/hmlp
frame/containers/KernelMatrix.hpp
/** * HMLP (High-Performance Machine Learning Primitives) * * Copyright (C) 2014-2017, The University of Texas at Austin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either ...
ALGO
0.997988
6.347991
{ "github_metadata": { "branch": "master", "commit_count": 523, "repo_created_at": "2016-10-21T21:03:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 12, "forks": 8, "issues": 20, "pull_requests": 0 }, "file_meta": { "content_id": "f733e7...
7211f46f-5c6c-462b-a8da-74b7c4df248d
studouglas/GEANT4-GPU
geant4.10.02/source/processes/hadronic/models/rpg/src/G4RPGKZeroInelastic.cc
// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration...
ALGO
0.985959
5.182989
{ "github_metadata": { "branch": "master", "commit_count": 518, "repo_created_at": "2015-09-13T23:36:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 40, "forks": 18, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "57dd98...
bcd52d94-55d4-472e-b816-e62d7b5e8665
Tomius/LoE
src/cpp/engine/collision/spherized_aabb.h
// Copyright (c) 2015, <NAME> #ifndef ENGINE_COLLISION_SPHERIZED_AABB_H_ #define ENGINE_COLLISION_SPHERIZED_AABB_H_ #include "../misc.h" #include "./bounding_box.h" #include "../global_height_map.h" namespace engine { static constexpr double kEpsilon = 1e-5; struct Interval { double min; double max; }; static...
ALGO
0.966956
7.120546
{ "github_metadata": { "branch": "master", "commit_count": 90, "repo_created_at": "2015-03-23T15:39:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0bb91e9f...
7ae43662-3d05-4f4b-9f38-272a360cbf64
R4phou/kth-DD2352
Winning/ex2d.cpp
#include <iostream> #include <vector> #include <limits> #include <ctime> #include <fstream> #include <cmath> struct winning_streak_try { int n; float result; double time; }; float LIMIT = 1; float P = 0.99; int K = -1; std::vector<float> MEMOIZATION(1000, -1); void reset_memoization(int n) { MEMOIZA...
ALGO
0.998278
4.662817
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2024-01-16T14:51: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": "5fdd4b6fa36...
6b538812-1192-442c-874d-33fc5e0f9c31
Hinski2/CP
codeforces/problems/GCD Compression/cpp1163.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template<typename T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v){ for(const auto &u: v){ os << u << ' '; } return os; } te...
ALGO
0.999744
3.735964
{ "github_metadata": { "branch": "main", "commit_count": 799, "repo_created_at": "2023-06-07T17:30: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": "ae7f8bbdf1...
6dda3b32-3d08-4eb6-8140-0e7e7386c4d4
yaoshengzhe/codeforces
507B_Amr_and_Pins/Solution.cc
#define __STDC_FORMAT_MACROS #include <inttypes.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <algorithm> #include <list> #include <map> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define VAR(V,init) __typeof(init) V=(init) #de...
ALGO
0.999813
3.259458
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2013-02-19T20:32: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": "141f85ef8...
06759741-5c0b-41f0-876b-0f4618ff0620
bidhannath2001/leetCode_Top_interview_150
14. Longest Common Prefix.cpp
/* Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: strs = ["flower","flow","flight"] Output: "fl" Example 2: Input: strs = ["dog","racecar","car"] Output: "" Explanation: There is no common prefix among...
ALGO
0.999938
6.283993
{ "github_metadata": { "branch": "main", "commit_count": 28, "repo_created_at": "2024-08-31T14:54: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": "c13729d88fb...
3e61e512-362e-46ee-a286-b43b8bc19795
SiyangShao/codes
AtCoder/ABC286/C.cc
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll inf = 1e16; auto solve() { int n; cin >> n; ll a, b; cin >> a >> b; string s; cin >> s; ll ans = 1e16; for (int dif = 0; dif < n; ++dif) { // i->i-dif ll cnt = dif * a; for (int i = 0; i < n / 2; ++i) { if...
ALGO
0.999882
4.014812
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-04-08T14:41: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": "c0d6990c8eab...
665804b1-b3c4-4dab-9526-5876a1e63c82
bcyj/android_tools_leeco_msm8996
telephony-apps/ims/jni/media/ims_media_jni.cpp
/* Copyright (c) 2014 Qualcomm Technologies, Inc. All Rights Reserved. * Qualcomm Technologies Proprietary and Confidential. */ #define LOG_TAG "ims_media_jni" #define LOG_NDEBUG 0 #define LOG_NIDEBUG 0 #define LOG_NDDEBUG 0 #include "ims_media_jni.h" #include "ims_media_events.h" #include <cutils/log.h> #includ...
TOOL
0.921621
5.396248
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-06-10T01:30:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 46, "forks": 48, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "71081867...
4424547d-d3e3-4854-81e5-cc41f01dde58
johaneris/trabajoDelogica
ejercicio8.cpp
/*Crea un programa que permita al usuario ingresar dos vectores de la misma longitud y luego calcule su producto punto. Muestra el resultado al finalizar el cálculo.*/ #include <iostream> using namespace std; int main() { int longitud; cout << "Ingrese la longitud de los vectores: "; cin >> longitud; ...
ALGO
0.999757
4.826872
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2024-05-03T10:52: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": "455212109348...
57230d7d-df3e-4a49-a406-b07d9dd43b1f
greatbridf/greatbridf-lg
DP/missile.cpp
#include <iostream> #include <cstdio> #include <memory.h> using namespace std; int arr[100000], dp[100000]; int tmp = 0; int bfs(int n) { memset(dp, 0x00, sizeof(dp)); for (int i = 0; i < n; ++i) { for (int j = 0; j < i; ++j) { if (arr[j] >= arr[i]) { dp[i] = (dp[i] > dp[j] ? dp[i] : dp[j]); ...
ALGO
0.99996
3.062891
{ "github_metadata": { "branch": "master", "commit_count": 88, "repo_created_at": "2019-01-18T02:21: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": "ec41809ae...
617312a6-b60a-43d8-b224-5a6987ca5e1d
cmpArch207/benchmarks
tools/bigInt.cpp
#include "bigInt.h" using namespace std; ostream & operator<< (ostream & out, const bigint & num) { if (num.big_value.size() != 0) { //print the sign if (num.negative) out << "-"; //convert the vector into string string long_num; auto rit = num.big_value.crbegin(); for (; rit != num.big_val...
ALGO
0.950446
4.55505
{ "github_metadata": { "branch": "master", "commit_count": 87, "repo_created_at": "2015-12-28T19:17:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "587dbdf73a...
57601b75-e30d-4eba-955a-aece16160c34
agudeloandres/C_Struct_Files
C_Tutorships/data_structures_Cplusplus/GRAFOS/P550.CPP
#include "stdio.h" #include "conio.h" #include "stdlib.h" #include "alloc.h" #define MAXIMO 20 #define PR(x) printf ("%s",x) #define SALTO printf ("\n") #define localizar (nodo *)malloc (sizeof (nodo)) #define asigne_cola (FIFO *)malloc (sizeof (FIFO)) typedef struct nodo nodo; typedef struct GRAFO GRAFO; typedef str...
ALGO
0.999748
3.418911
{ "github_metadata": { "branch": "master", "commit_count": 13, "repo_created_at": "2015-10-22T02:49: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": "7ceb571de...
4bd9e36c-d026-4d38-8683-8b397829c733
laegit/MOPR_D
MoSTP/SourceCode/3obj/hyp_ind.cpp
/* This code was provided by PISA and adapted by <NAME> (2018) */ /*===========================================================================* * hyp_ind.c: implements the unary hypervolume indicator as proposed in * <NAME>., and <NAME>. (1998): Multiobjective Optimization * Using Evoluti...
ALGO
0.999826
3.586501
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-05-17T01:13: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": "0c5c489e52...
5572d297-ed4a-4c2d-8462-7b4e7e4cc4c3
michaelslewis/TSP_Contest
TSP_Contest/twoOpt.hpp
/*********************************************************** * Author: <NAME> * Date: 6/6/2017 * CS325, Spring 2017 * Description: Header file for 2-Opt Algorithm. ***********************************************************/ #ifndef twoOpt_hpp #define twoOpt_hpp #define MAX(x, y) (((x) > (y)) ? (x) : (y)) #define...
ALGO
0.999183
4.067354
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-06-28T23:45:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d9185776a6...
19b8d76f-2b36-4a8a-85e2-b5e456d14aa7
akshayaggarwal/LeetCode
Q_4.cpp
class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { int si1 = nums1.size(); int si2 = nums2.size(); int count,a,flag,i,j,total = si1+si2; double r; if(total%2 == 0) flag = 1; else ...
ALGO
0.999987
5.562142
{ "github_metadata": { "branch": "master", "commit_count": 325, "repo_created_at": "2017-06-02T06:08:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "731f900c...
c4f19e68-9afd-4323-a823-f97fe6f871cc
L0rd-AK/Competitive-Programming-practice
XPSC 05/Week-5/Day-6/Minimum_Xor.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long int #define f(x1, y1, z1) for (int x1 = y1; x1 < z1; x1++) #define endl "\n" #define yn(f) f ? cout << "YES\n" : cout << "NO\n" #define prnt(x) cout << x << endl #define all(x) x.begin(), x.end() #define debug(p) for(auto i:p)cout<<i<<" ";cout<<endl; ...
ALGO
0.999943
5.526372
{ "github_metadata": { "branch": "main", "commit_count": 616, "repo_created_at": "2023-08-23T17:29:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3d89e65335...
9df5579a-5fed-40e3-bf90-3e5def400e99
LanceKnight/Color-Space-Manipulation
Project1c/Project1c/Project1c/project1c.cpp
#include "opencv2/highgui.hpp" #include <iostream> using namespace cv; using namespace std; double* RGB2Luv(int r, int g, int b){ //cout << "r= " << r<<"\n"; //from pixel to nonlinear RGB double nonlinear_r = ((double)r) / 255; double nonlinear_g = ((double)g) / 255; double nonlinear_b = ((double)b) / 255; //...
ALGO
0.925937
4.468465
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2018-09-22T19:49: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": "2418a11ec1...
d7795484-ceff-4cfb-a355-65fe0fe56b4b
arimnrg16/CP
Contest & Online Judge/SPOJ/WPC5H.cpp
#include <bits/stdc++.h> using namespace std; const int N = 50005; const int LOG = 16; vector<int> adj[N]; int anc[N][LOG]; int BIT[N]; int in[N], ot[N]; int cnt; int depth[N]; int n,q; void update(int x,int val) { for(; x <= n ; x += x & -x) BIT[x] += val; } int query(int x) { int ret = 0; while(x) { ret +=...
ALGO
0.999966
4.818691
{ "github_metadata": { "branch": "master", "commit_count": 120, "repo_created_at": "2019-03-13T13:45:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ede5c2e7...
98a20f58-8cde-45b7-9f98-1ecd9e83ed72
hylade/Procedure-Design-Game
AOJ 0558 Cheese/main.cpp
#include <iostream> #include <cstdio> #include <queue> using namespace std; // 输入场地维度及工厂最大编号 int H, W, N; char field[1000][1000]; // 各点到当前工厂的距离 int d[1000][1000]; // 使用二维数组确定工厂的位置 int factory[15][2]; // 定义位置 typedef pair<int, int> P; // 定义方向 int direcion[4][2] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1}, }; int bfs(int sx, i...
ALGO
0.999977
3.747956
{ "github_metadata": { "branch": "master", "commit_count": 39, "repo_created_at": "2018-07-11T11:52: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": "4d6d8f3d1...
caccbf0e-7dce-4f9c-a37a-a91ba06e776c
caozq-China/hy2LPTFoam
lagrangian/LPT/Force/Drag/HendersonDrag/HendersonDrag.H
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | -----------------------------------...
ALGO
0.998154
6.516643
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2023-09-18T03:26:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4e72d41fc2a...
8a3f6699-0c02-4f97-a847-80cacb8a9c7b
HybridRobotics/cbf-convex-maps
include/sccbf/collision/distance_solver.h
#ifndef SCCBF_COLLISION_DISTANCE_SOLVER_H_ #define SCCBF_COLLISION_DISTANCE_SOLVER_H_ #include <IpIpoptApplication.hpp> #include <IpTNLP.hpp> #include <memory> #include "sccbf/data_types.h" namespace sccbf { struct CollisionPair; class DistanceProblem : public Ipopt::TNLP { public: DistanceProblem(CollisionPair...
ALGO
0.999336
6.208502
{ "github_metadata": { "branch": "main", "commit_count": 80, "repo_created_at": "2022-07-30T03:08:32.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 10, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3747e88dd2...
9b0675a5-4187-437b-b416-0cfff3360773
nolan0801/Competitive-Programming
Codeforces/Div3/702/F.cpp
/* link problem: Author : vidut_206_CNH */ #include <bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second #define pb push_back #define gcd(a,b) (__gcd(a,b)) #define lcm(a,b) (a/gcd(a,b)*b) #define fast_cin() ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define INF 2e18 t...
ALGO
0.999953
3.601767
{ "github_metadata": { "branch": "main", "commit_count": 144, "repo_created_at": "2021-12-21T06:10:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9f3403e076...
a4ecbd6e-8a5a-4cbc-89d2-d657cbc3a75c
mrpawan-gupta/Competitve-Coding
02. CodeChef/2]. Compete/4]. Starters/CodeChef Starters 36/Buying_Sweets.cpp
#include <bits/stdc++.h> using namespace std; #define F0R(i, n) for (int i = 0; i < n; i++) class Solution{ public: bool cmake_pair(pair<int, int> v1, pair<int, int> v2){ if (v1.second == v2.second) { return v1.first < v2.first; } return v1.second > v2.second; } void BuyingSweets(){ i...
ALGO
0.999993
4.2718
{ "github_metadata": { "branch": "master", "commit_count": 1794, "repo_created_at": "2021-10-15T13:41:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "abfe391...
02e91563-bae5-4adc-8e14-696c6c146060
dbriceno10/ucv_ayde_1_2025
recursividad/clase4.5-01-05-2025/mochila-profe.cpp
#include <iostream> using namespace std; const int MAX_ITEMS = 100; struct Item { int valor; int peso; }; // Variables globales int primera_solucion_valor = -1; bool primera_solucion[MAX_ITEMS] = { false }; int total_soluciones = 0; void imprimirSolucion(Item items[], int num_items, bool seleccion[], int v...
ALGO
0.999988
5.505134
{ "github_metadata": { "branch": "master", "commit_count": 102, "repo_created_at": "2025-04-23T23:44:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e5b7ee7e...
2e8e1103-ad15-4e5a-885f-7a8b64983932
ksks2012/symmetrical-barnacle
ungrouped/2975.cpp
#include "../include.h" class Solution { public: int maximizeSquareArea(int m, int n, vector<int>& hFences, vector<int>& vFences) { long long mod= 1e9 + 7; hFences.push_back(1); hFences.push_back(m); vFences.push_back(1); vFences.push_back(n); sort(hFence...
ALGO
0.999978
5.205214
{ "github_metadata": { "branch": "main", "commit_count": 1111, "repo_created_at": "2023-11-04T08:53: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": "c60115362...
60dd6635-1648-4e33-ab8e-5dc9afa217db
vster/OOP_CPP
Ch11/Ch11-Exercises/Ex08-2/Ex08-2.cpp
#include <iostream> #include <cstring> using namespace std; const int LEN = 80; // максимальная длина выражения const int MAX = 40; // /////////////////////////////////////////////////////////// class Token { public: virtual float getNumber() = 0; virtual char getOperator() = 0; }; //////////////////////...
ALGO
0.999678
3.764665
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2017-05-06T20:43: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": "15a90928f...
f686d6a9-1b2e-4319-92cb-167504edac39
phnam24/DSA-PTIT
Code-PTIT/DSA08010-Bien_doi_so_tu_nhien.cpp
#include <bits/stdc++.h> #define ll long long #define endl '\n' #define test int t; cin >> t; while(t--) #define nhap(a) for ( auto &i : a ) cin >> i using namespace std; int mod = 1e9 + 7; int snt[100000]; void seive() { snt[0] = snt[1] = 1; for(int i = 2; i * i < 100000; i++) { if(!snt[i]) ...
ALGO
0.999934
4.806437
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2023-01-30T14:47:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2dfee872cff...
f2beec60-7ea0-4505-9a45-7768a6449b71
AniketChavan1123/DataStructures
CLionProjects/64DFS_BFS/main.cpp
#include <iostream> using namespace std; class Node{ public: int data; Node* next; }*front= nullptr,*rear= nullptr; void enqueue(int x) { class Node *t; t=new Node; t->data=x; t->next= nullptr; if(front==nullptr){ front=rear=t; }else{ rear->next=t; rear=t; }...
ALGO
0.999996
4.532259
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-08-04T12:39: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": "62d89cf4936d...
ca0c8ac0-72aa-4a25-ba27-f2538c4b519c
plumenator/advent-of-c--2021
day4part2.cpp
/* --- Day 4: Giant Squid --- --- Part Two --- On the other hand, it might be wise to try a different strategy: let the giant squid win. You aren't sure how many bingo boards a giant squid could play at once, so rather than waste time counting its arms, the safe thing to do is to figure out which board will win last a...
ALGO
0.999896
6.587748
{ "github_metadata": { "branch": "main", "commit_count": 44, "repo_created_at": "2021-12-02T06:34: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": "7446cfe4677...
01f51354-f6a0-4388-a7a5-18336a7810c8
mylovedandanxiaohai/mylove
delete_node/main.cpp
//二叉树的经典面试题目 #include <iostream> using namespace std; template <typename T> struct BTreeNode { BTreeNode* left; BTreeNode* right; BTreeNode* parent; int value; }; template <typename T> BTreeNode<T>* creatTree() { static BTreeNode<int> ns[9]; for(int i=0;i<9;i++) { ns[i].value=i; ...
ALGO
0.999894
3.772578
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-02-04T13:03:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b9cc86b85e41...
7fdc55ad-6340-4c28-8962-39289dc724dd
rjenez/W266-final-project
data/programming-homework-dataset-plagiarism-detection/src/B2016/Z1/Z3/student4377.cpp
/*B 2016/2017, Zadaća 1, Zadatak 3 NAPOMENA: ulaz/izlaz za zadatke je specificiran javnim autotestovima. Zalbe za ne analiziranje testova se ne uvazavaju! NAPOMENA: nece svi (javni) testovi sa zamgera biti dostupni na c9. */ #include <iostream> #include <vector> #include <iomanip> void IspisiMatricu(std:...
ALGO
0.999879
5.265183
{ "github_metadata": { "branch": "main", "commit_count": 125, "repo_created_at": "2022-02-09T00:45:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4fe06254eb...
eca3dd29-08c2-4e90-bb7a-e6348cf61824
kamyu104/LeetCode-Solutions
C++/minimum-cost-for-cutting-cake-ii.cpp
// Time: O(mlogm + nlogn) // Space: O(1) // sort, greedy class Solution { public: long long minimumCost(int m, int n, vector<int>& horizontalCut, vector<int>& verticalCut) { sort(begin(horizontalCut), end(horizontalCut)); sort(begin(verticalCut), end(verticalCut)); int64_t result = 0; ...
ALGO
0.999976
5.303915
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
27114608-0653-49ad-92a0-376cd4f94b4a
hczhcz/algo-hw
1017.cpp
#include <iostream> using namespace std; const int bigint = 1000000000; int count; int dist[100][100]; int new_d[100]; bool act[100]; bool fin[100]; bool xfin[100]; int main() { while (1) { cin >> count; if (!count) return 0; for (int i = 0; i < count; ++i) { for (int j = 0...
ALGO
0.997417
3.240101
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2014-11-03T13:48: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": "0c290a56b...
d90e0196-006a-401d-8a75-6ca9703063d6
Putrus/consolants
consolants/logic/src/World.cpp
#include "../inc/Ant.h" #include "../inc/Anthill.h" #include "../inc/World.h" #include <algorithm> #include <cstdio> #include <ctime> namespace ants::logic { World::World(int x, int y, int colonies, int feed) : World(math::Point(x, y), colonies, feed) {} World::World(const math::Point& size, int colonies, int ...
ALGO
0.994803
5.585244
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2024-01-24T22:07: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": "eb725af90e4...