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 |
|---|---|---|---|---|---|---|---|
30bbbe0a-8614-4e27-a557-3147bbb41358 | yashparmar15/Cpp-Codes | Arya_Long_String.cpp | /*Arya has a string, S, of uppercase English letters. She writes down the string S on a paper K times.
She wants to calculate the occurence of a specific letter in the first N characters of the final string.
Input:
First line of input contains a single integer T denoting the number of test cases.
The first line of ea... | ALGO | 0.999896 | 4.279455 | {
"github_metadata": {
"branch": "master",
"commit_count": 831,
"repo_created_at": "2020-06-30T16:20:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ef2db4c... |
aa8cd58b-739f-493a-b007-f2fbd21970a6 | ishandutta2007/codeforces-p | peti1234/normal/1641/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int c=100005, sok=2e9;
int n, m, cnt, ans=sok+1, t[c][5], ert[c];
long long r[5]={123456789, 987654321, 87654319, 23456891, 54637219};
vector<pair<int, int> > sz;
unordered_map<long long, int> p;
void add(int a, int b) {
cnt+=b;
for (int i=1; i<(1<<m); i++) {... | ALGO | 0.999986 | 3.384861 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1678ea33adfd... |
fdec9835-2d8a-4093-9e7e-5b441466f606 | ishandutta2007/codeforces-d | dlalswp25/normal/1168/A.cpp | #include <bits/stdc++.h>
using namespace std;
int A[303030];
int N, M;
int main() {
scanf("%d%d", &N, &M);
for(int i = 1; i <= N; i++) scanf("%d", &A[i]);
int l = 0, r = M - 1;
while(l <= r) {
int m = l + r >> 1;
int a = 0;
bool ok = true;
for(int i = 1; i <= N; i++) {
int mn = A[i], mx = A[i] + m;
... | ALGO | 0.999989 | 3.407743 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "ee7cf9a628e0... |
17415923-1253-4ea3-948a-80d2f0f1c14f | NamanH16/DSA-PRACTICE | 0079-word-search/0079-word-search.cpp | class Solution {
public:
bool solve(vector<vector<char>>& board, string word, int i,int j,int index){
if(index==word.length())return true;
int m = board.size(), n = board[0].size();
if(i<0||j<0||i>=m||j>=n||board[i][j]!=word[index]||board[i][j]=='!'){
return false;
}
... | ALGO | 0.999754 | 5.697339 | {
"github_metadata": {
"branch": "main",
"commit_count": 1111,
"repo_created_at": "2022-06-03T04:16: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": "d848f1839... |
1f2eb05d-ca02-4acb-b995-9ba26cc244ff | brian00715/PnC-Interview-Coding | Others/86.cc | /**
* @name 86.N皇后问题
* @details
* @url
* @idea 回溯
* @note 暴力解法时间复杂度是C_{N^2}^{N},是一个组合数公式,第一个皇后有N^2个可能的位置,第二个皇后有(N^2-1)个可能的位置,以此类推。
*/
#include "../header.hpp"
class Solution
{
public:
vector<vector<string>> solveNQueens(int n)
{
vector<vector<string>> solutions;
vector<int> queens = vecto... | ALGO | 0.999937 | 5.515961 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-01T03:43:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b8aa265aea... |
276098e2-1068-4ed9-962d-e742c7d65267 | anandhu720/Leetcode-Solutions | Matrix Chain Multiplication - GFG/matrix-chain-multiplication.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:
int matrixMultiplication(int N, int arr[])
{
// code her
vector<vector<int>> dp(N-1,vector<int>(N-1,0));
... | ALGO | 0.999977 | 5.012683 | {
"github_metadata": {
"branch": "main",
"commit_count": 3955,
"repo_created_at": "2021-05-01T05:53: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": "2eb13fb79... |
e2403602-5fad-4fd7-a536-c0e9d54bf340 | kwdx/LeetCode-Practise | Cpp/241.为运算表达式设计优先级.cpp | /*
* @lc app=leetcode.cn id=241 lang=cpp
*
* [241] 为运算表达式设计优先级
*/
#include <iostream>
#include <vector>
#include <string>
using namespace std;
// @lc code=start
class Solution {
private:
string expression;
public:
vector<int> diffWaysToCompute(string expression) {
this->expression = expression;
... | ALGO | 0.999996 | 5.722802 | {
"github_metadata": {
"branch": "master",
"commit_count": 379,
"repo_created_at": "2019-11-29T10:20:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6838cb45... |
6b938f13-d5f5-4749-8a4c-62d604a6c385 | ankishb/Algorithm-DS-Problems | pallindromic_partitioning.cpp | // Given a string s, partition s such that every string of the partition is a palindrome.
// Return all possible palindrome partitioning of s.
#include <bits/stdc++.h>
using namespace std;
// bool check_pallindrome(string s){
// cout<<s<<endl;
// for(int i=0; i<s.length()/2; i++){
// if(s[i] != s[s.length()-i-1]... | ALGO | 0.999804 | 5.968062 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-08-06T04:21:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab4d17ae8... |
d7ca569c-2c07-40df-8081-f9d2706c63a4 | karayuumac/procon-archive | atcoder.jp/tessoku-book/tessoku_book_cg/Main.cpp | /*
* Created by karayuu.
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef int dint;
#define int ll
template<class T>
inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T>
inline bool chmax(T &a, T b) {
if (a < b) {
a... | ALGO | 0.999476 | 5.117455 | {
"github_metadata": {
"branch": "main",
"commit_count": 708,
"repo_created_at": "2025-03-10T01:49:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5aca4361a4... |
1826a1ff-1ea6-4a76-8182-61117dc44837 | Alpine-DAV/ascent | src/libs/dray/data_model/bezier_simplex.hpp | // Copyright 2019 Lawrence Livermore National Security, LLC and other
// Devil Ray Developers. See the top-level COPYRIGHT file for details.
//
// SPDX-License-Identifier: (BSD-3-Clause)
#ifndef DRAY_BEZIER_SIMPLEX_HPP
#define DRAY_BEZIER_SIMPLEX_HPP
#include <dray/dray_config.h>
#include <dray/dray_exports.h>
#incl... | ALGO | 0.997936 | 6.95786 | {
"github_metadata": {
"branch": "develop",
"commit_count": 1179,
"repo_created_at": "2017-02-08T19:21:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 211,
"forks": 68,
"issues": 194,
"pull_requests": 5
},
"file_meta": {
"content_id": "7d... |
fa4d121e-003c-43d6-add4-f8c9c3662388 | ishandutta2007/codeforces-nonalphabetic | .tx/normal/1217/E.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
template <typename K, typename V = __gnu_pbds::null_type>
using tree = __gnu_pbds::tree<K, V, less<K>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;
using llong = long ... | ALGO | 0.999775 | 4.269451 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fca5fb452b87... |
eeea45ae-23dc-4bd1-8ed5-58780478d466 | brennadev/algorithms-datastructures | PriorityQueue/PriorityQueue.cpp | //
// PriorityQueue.cpp
// PriorityQueue
//
// Created by <NAME> on 10/11/17.
// Copyright © 2017 <NAME>. All rights reserved.
//
// REUSE AND REDISTRIBUTION NOTICE: You may not modify or redistribute this code in any form including, but not limited to, source or binary. You may download it for informational purpos... | ALGO | 0.999114 | 5.355164 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-02-16T01:04: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": "9ad99a05a8... |
8007fefd-637e-444b-b313-c80949dd8c2a | S-1729/STL | Swapping pairs make sum equal.cpp | class Solution {
public:
int findSwapValues(int a[], int n, int b[], int m) {
unordered_set<int>S;
for(int i=0;i<m;i++)
S.insert(b[i]);
int sum1=accumulate(a,a+n,0);
int sum2=accumulate(b,b+m,0);
int sum=abs(sum1-sum2);
if(sum==0)return 1;
if(sum%2==... | ALGO | 0.999981 | 5.001225 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-04-05T12:49:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44b082f6ed3... |
9154d901-426e-444c-a27e-66cc6bebe4c6 | X0lotl/procedural-programming | lab8/quickFibMatrixRecursive.cpp | //
// Created by x0lotl on 18.11.22.
//
struct Matrix2x2 {
int _11, _12, _21, _22;
};
struct Vector2 {
int _1, _2;
};
Matrix2x2 matrixMultiplication(Matrix2x2 m1, Matrix2x2 m2) {
return {
(m1._11 * m2._11 + m1._12 * m2._21),
(m1._11 * m2._21 + m1._12 * m2._22),
(m1._21 * m2._11 + m1._22 * m2._2... | ALGO | 0.999779 | 5.517952 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2022-09-14T09:25:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c63f32181d... |
2051b48c-f3bc-49a8-8b91-203bdea576bc | Hoff22/CompetitiveProgramming | CSES/Graphs/77.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 100000
int n, m;
vector<int> g[N+1];
int spt[N+1];
void bfs(int root){
memset(spt, 0, sizeof(spt));
queue<int> q;
q.push(root);
spt[root] = -1;
while(q.size()){
int u = q.front(); q.pop();
for(int v : g[u]){
... | ALGO | 0.999995 | 4.321157 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-10-24T23:39: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": "35c8507e952... |
1e7dbe49-da39-4b8f-90ea-74f5eb492949 | henryzera/abstract-data-type | estruturas-11.cpp | #include <iostream>
#include <string>
using namespace std;
const int MAX = 100;
string fila[MAX];
int inicio = 0, fim = -1;
void chegarCliente(string nome) {
if (fim == MAX - 1) {
cout << "Fila cheia!" << endl;
return;
}
fila[++fim] = nome;
cout << nome << " entrou na fila." << endl;
}... | ALGO | 0.997279 | 4.995553 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-06T02:24:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42a67973475e... |
8884c1c6-8130-43d0-b79b-81951efecd08 | ZJU-FAST-Lab/GCOPTER | gcopter/include/gcopter/root_finder.hpp | /*
MIT License
Copyright (c) 2020 <NAME> (<EMAIL>)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, cop... | ALGO | 0.999964 | 5.379873 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2021-03-02T03:11:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1002,
"forks": 178,
"issues": 18,
"pull_requests": 1
},
"file_meta": {
"content_id": "0f94b... |
482fb3cd-181d-4be0-8560-a2402f8f2e99 | sensen963/AtCoder | ABC/ABC101/C.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdio>
using namespace std;
int main(){
int N, K;
cin >> N >> K;
int a[100001];
int auau, iter;
for (int i = 0; i < N; i++){
auau = scanf("%d",&a[i]);
if (a[i] == 1) iter = i;
}
int num;
... | ALGO | 0.999529 | 3.397499 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2017-11-07T19: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": "fb4a7c9b... |
dd4f7085-bb61-4d53-a9c4-d8b57ee793dc | chmousNedovolniy/pastebin_ADS_notes | cppTrieAdvanced.cpp | #include <iostream>
#include <string>
#include <vector>
const int kAlphabetSize = 26;
class Trie {
public:
class Node {
public:
std::vector<Node*> children_ = std::vector<Node*>(kAlphabetSize, nullptr);
char c_;
bool is_end_of_word_ = false;
Node(char c) {
c_ = c... | ALGO | 0.999437 | 5.536212 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-05-19T19:59: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": "3ae0a3b8784... |
0de2eeaf-5389-4a2c-b09e-999e9cf98f02 | HindaLi999/OI-Workspace | DONE/JZOJ100035/JZOJ100035.cpp | #include<bits/stdc++.h>
#define ll long long
#define N 22222222
#define INF 0x3f3f3f3f
using namespace std;
ll n,k,P,A,B,C,D,cnt=0,st,ed,ans=0;
int s[N],sum1[N],sum2[N];
namespace IOstream
{
#define int long long
#define print(a,b) prints(a),putchar(b)
int BUF[22],BUFSIZE,IONUM,SIGN;
char GET;
inl... | ALGO | 0.999973 | 3.938679 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-10-21T07:03: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": "66d91a91a... |
6b64f1ee-596b-4a2e-ba84-450c365aca16 | Muskan-Mittal/Solutions | CHEFTMA.cpp | #include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define ll long long
#define F first
#define S second
#define ONLINE_JUDGE freopen("input","r",stdin); freopen("output","w",stdout);
#define M 1000000007
#define pb(x) push_back(x)
#define N 100001
#define endl "\n"
void MOD(ll &x)
{
if (x >= ... | ALGO | 0.999929 | 3.937491 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-03-24T06:50: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": "73ccefd3f... |
fc6847e5-c072-4cb8-898f-68fd7636c4ed | yuehuarulian/Tongji-23-DataStructures | HW4 图状结构/图的遍历/main.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#define MAX_NUM 2000
//typedef int AdjMatrix[MAX_NUM][MAX_NUM];
typedef struct MGraph {
int vexs[MAX_NUM] = { 0 };//节点
std::vector<std::vector<int>> arcs; // 邻接矩阵
//int arcs[MAX_NUM][MAX_NUM];//邻接矩阵
int... | ALGO | 0.999892 | 4.610652 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-11-23T08:45:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07c5f3961a... |
6cd5e9c8-dd98-4d01-8180-780f91086df2 | mazen-fahim/coachacademy | dsu/2-learning-languages.cpp | // problem link: https://codeforces.com/problemset/problem/277/A
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int p[200];
int sz[200];
const int eoff = 100;
void make_set(int u)
{
p[u] = u;
sz[u] = 1;
}
int find_set(int u)
{
if (u == p[u])
return u;
return p[u] = find_set(p[u]);
}
v... | ALGO | 0.999756 | 3.675232 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-12-18T23:48: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": "fe27df91c7d... |
e88aa2f9-1ae1-4a4e-b574-bdc433b471e8 | yiqunchen/SpikeInference | src/rcpp_fpop.cpp | #include "fpop.h"
#include "fpop_inference.h"
#include "funPieceList.h"
#include "selective_inference.h"
#include "utils.h"
#include <vector>
#include <Rcpp.h>
#include <algorithm> // std::min
#include <math.h>
using namespace Rcpp;
/*
*
* Utility functions
*
*/
// utility function for fpop intervals
NumericM... | ALGO | 0.998403 | 4.394987 | {
"github_metadata": {
"branch": "main",
"commit_count": 131,
"repo_created_at": "2021-01-26T01:12:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "022a0a2143... |
98126e5c-20b4-48a3-a0b4-32920f14d64e | radiga1023/sample_programs | StringReverseByWord.cpp | // Example program
#include <iostream>
#include <string>
using namespace std;
void reverseString(char* str, unsigned int stringLen)
{
unsigned int strLength = stringLen - 2;
unsigned int start = 0;
unsigned int end = strLength;
cout << str << endl;
while (start < end)
{
str[start] = st... | ALGO | 0.999929 | 4.743168 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2018-12-15T04:26:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2611b74d... |
4a29b4b1-f2c0-4f2c-8825-758b36b1957c | IamLucif3r/Data-Structure-Algorithm | 450-DSA-Cracker/Linked-List/add-1-to-linked-list.cpp | // { Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void printList(Node* node)
{
while (node != NULL) {
cout << node->data;
n... | ALGO | 0.999788 | 6.175107 | {
"github_metadata": {
"branch": "main",
"commit_count": 399,
"repo_created_at": "2021-06-07T09:27:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6a30c9fd1... |
b2bf919f-08ce-429c-a516-a5818ba28c93 | mimoex/HLS-ECC | old/fp.cpp | #include "fp.h"
void add_fp(const long long int& a, const long long int& b, const long long int& p, long long int* c)
{
*c = a + b;
if (*c >= p) *c -= p;
*c = *c % p;
}
void sub_fp(const long long int& a, const long long int& b, const long long int& p, long long int* c)
{
*c = (a - b);
*c = (*c % p + p) % p;
}
... | ALGO | 0.99975 | 4.319838 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-06-08T04:00: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": "7fa4a697e6d... |
2b6c2c95-9b1c-40d0-9c70-fda0acce6427 | 1092772959/My-ACM-code | 2018夏/8.8/1007.cpp | #include<bits/stdc++.h>
const int MAX = 2e5+5;
#define EPS (1.0 / (points - 1))
using namespace std;
typedef long long LL;
const int INF = 0x3f3f3f3f;
const int mod = 998244353;
LL fpow(LL a,LL n)
{
LL res=1;
while(n){
if(n&1) res= res* a %mod;
a = a*a%mod;
n>>=1;
}
return res;
... | ALGO | 0.999762 | 4.754478 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-10-04T14:43: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": "94b046f006... |
280f7c0f-12b1-48ce-9251-ecb26740a464 | Mysterious786/Leetcode-Solution | 1449-form-largest-integer-with-digits-that-add-up-to-target/1449-form-largest-integer-with-digits-that-add-up-to-target.cpp | class Solution
{
private:
string maxi(string &a, string &b)
{
if (a.back() == '0') return b;
else if (b.back() == '0') return a;
else if (size(a) == size(b))
return max(a, b);
else if (size(a) > size(b)) return a;
else retur... | ALGO | 0.999945 | 5.180871 | {
"github_metadata": {
"branch": "main",
"commit_count": 1130,
"repo_created_at": "2023-11-10T09:58: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": "afa65cdf2... |
be4cf289-e699-4760-ade6-6abda9f6903c | rhammad7/Supersymmetry_Analysis | external/TrackCovariance/AcceptanceClx.cc | #include <TVector3.h>
#include "AcceptanceClx.h"
#include <iostream>
//
// Pt splitting routine
//
void AcceptanceClx::VecInsert(Int_t i, Float_t x, TVectorF& Vec)
{
// Insert a new element x in location i+1 of vector Vec
//
Int_t N = Vec.GetNrows(); // Get vector nitial size
Vec.ResizeTo(N + 1); // Increase size
... | ALGO | 0.997803 | 4.314919 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-02-27T17:42:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "394f16a12d1... |
0a08951a-9321-4094-a5a9-a64326005fa1 | moondemon68/cp | Codeforces/PastContests/1371/D.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define INF 1234567890
#define pii pair<int,int>
#define LL long long
using namespace std;
int main () {
//clock_t start = clock();
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.999859 | 3.460068 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2018-09-17T12:29: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": "50a3328c... |
562ce815-ecab-4c00-8262-d186cab8bba5 | StrawHatWess/Competitive-Programming-Solutions | Dmoj/DMOPC/Jan 2021/B.cpp | //Never stop trying
#include "bits/stdc++.h"
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
typedef string str;
typedef long double ld;
typedef pair<int, int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector<pi> vpi;
#defi... | ALGO | 0.999962 | 3.407564 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-04-18T12:51: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": "fff5e10a6313... |
c0c926fa-a865-4d8d-ba30-ab71351cc42b | LostKnowledge33/practice | 프로그래머스/unrated/172927. 광물 캐기/광물 캐기.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int solution(vector<int> picks, vector<string> minerals) {
int answer = 0, sum = 0;
int ea = (picks[0] + picks[1] + picks[2]) * 5;
vector<int> use(ea / 5);
vector<pair<int, int>> sums;
for(int i... | ALGO | 0.994029 | 4.884404 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2021-05-31T06:58: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": "18f58c3475d... |
650d0e2f-94e8-4eca-b89d-43ae8de09db3 | vegerot12/LeetCodeDailyChallenges | 1352-maximum-profit-in-job-scheduling/maximum-profit-in-job-scheduling.cpp | class Solution {
private:
// finds a job that ends before the cur job starts
// O(log n)
int binarySearch(vector<vector<int>>& jobs, int i){
int l = 0, h= i-1;
while(l<=h){
int m = l+(h-l)/2;
if(jobs[m][0] <= jobs[i][1]){ // check if mid job ends before cur job s... | ALGO | 0.999936 | 6.092579 | {
"github_metadata": {
"branch": "main",
"commit_count": 1104,
"repo_created_at": "2023-09-01T17:39: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": "006b40e8a... |
17fa89ce-d1d3-4201-8cf0-5bd56c71d9a7 | traseta01/heapCpp | heap.cpp | #include "heap.h"
/********* Metodi klase heap **********/
/**** konstruktor ****/
int Heap::brel_heap()
{
return _hv.size();
}
// vrati broj spratova (visinu) heapa
int Heap::brsprat_hip()
{
int brsprat = 0;
int pom = _hv.size()/2;
while (pom > 0)
{
brsprat++;
pom /= 2;
}
return brsprat;
}
// swap fu... | ALGO | 0.925467 | 3.739245 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-01-13T00:40: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": "97d1b35930... |
a6aa7172-a777-42ea-a0ed-91d1d43fdeb2 | partmor/SDC-Model-Predictive-Control | src/MPC.cpp | #include "MPC.h"
#include <cppad/cppad.hpp>
#include <cppad/ipopt/solve.hpp>
#include "Eigen-3.3/Eigen/Core"
using CppAD::AD;
size_t N = 10;
double dt = 0.18;
// Lf is the length from the front of the car to CoG, it is a physical characteristic of the vehicle.
// It was obtained by measuring the radius formed by th... | ALGO | 0.999784 | 5.405808 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-09-06T18:23:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c007d96d5... |
1c7e31a5-a0be-4831-8833-60807c16c8bb | samir22072/DSA_Codes | Assignment_4.cpp | //============================================================================
// Name : Assignment_4.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#inclu... | ALGO | 0.995603 | 4.290514 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-01T05:11: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": "d7d2569c8f41... |
826e8164-469e-45dd-9c9f-cd8ec3faaedf | misakamm/StandardTetris | StandardTetrisMSVC2005/StandardTetrisMSVC2005/source/CPF.StandardTetris.STFileList.h | // All contents of this file written by <NAME> ( http://colinfahey.com )
// 2007 June 4 ; Visit web site to check for any updates to this file.
#ifndef STFileListHeader
#define STFileListHeader
// Disable unimportant "symbol too long" error for debug builds of STL string
#pragma warning( disable : 4786 )
#include... | TOOL | 0.93965 | 4.388806 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-07-16T05:28:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3390b0e20... |
4e325082-4f83-4c5e-8165-ced4691b967d | CGAL/cgal | Surface_mesh_segmentation/test/Surface_mesh_segmentation/test_compute_sdf_values_and_segment_exact_rational.cpp | #include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_rational.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/mesh_segmentation.h>
#include <CGAL/property_map.h>
#include <iostream>
#include <fstream>
typedef CGAL::Simple_cartesian<CGAL::Exact_rational> Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
in... | ALGO | 0.978808 | 4.80479 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
98ec0e06-faaf-4520-be87-297d140a7e20 | usask-arg/sasktran | include/sktran_disco/sktran_do_linalg.h | #pragma once
#include "sktran_disco/sktran_do.h"
namespace sasktran_disco
{
// Linear algebra namespace.
namespace la
{
// Used to index a submatrix of some larger matrix. Essentially just
// calls mat(i + tl_i, j + tl_j) on any index operation (i, j).
template<class MatrixClass>
class MatrixBlock
{
... | ALGO | 0.998136 | 4.185479 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-06-29T19:09:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 14,
"pull_requests": 2
},
"file_meta": {
"content_id": "2414f80f845... |
50098650-bc3f-41ea-a107-f558f76140e3 | plasma-hamper/plasma | libLoam/c++/Matrix44.cpp |
/* (c) oblong industries */
/*
* Note on glh:
*
* Matrix44::Invert () is based on glh::matrix4::inverse ()
* The remainder of glh has been stripped. The following appears
* as part of the obligation attending glh's aforementioned (adapted)
* use.
*/
/*
glh - is a platform-indepenedent C++ OpenGL helper l... | TOOL | 0.95703 | 6.162379 | {
"github_metadata": {
"branch": "iz",
"commit_count": 74,
"repo_created_at": "2022-09-12T02:12:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1859ade74cd6f... |
493569a3-d725-49da-b950-40a245b2a4cc | amirhshah1383/MyProjects | main4.cpp | #include <iostream>
using namespace std;
main() {
char letter;
cout << "please enter a letter : ";
cin >> letter;
switch (letter){
case 'A':
cout << "VOWEL";
break;
case 'a':
cout << "VOWEL";
break;
case 'E':
cout << "VOWEL";
break;
case 'e'... | ALGO | 0.994704 | 3.67867 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-12-03T20:04: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": "dc527a907ca... |
ce6a7f10-7d56-44af-bc01-e1fe0dcbe263 | google-parfait/federated-compute | fcp/secagg/server/distribution_utilities.cc | /*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | ALGO | 0.995091 | 6.190987 | {
"github_metadata": {
"branch": "main",
"commit_count": 1153,
"repo_created_at": "2021-09-14T15:04:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 90,
"forks": 21,
"issues": 3,
"pull_requests": 11
},
"file_meta": {
"content_id": "8720bb0... |
64beb86b-ebe2-4fe4-8fc3-349946ede3bf | Mityai/contests | camps/lksh-2014/day4/LCIS.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
typedef long long ll;
using namespace std;
const int MAX_NM = 5000;
int d[MAX_NM][MAX_NM];
int main() {
freopen("interview.in", "r", stdin);
freopen("interview.out", "w", stdout);
int n, m;
scanf("%d%d", &... | ALGO | 0.999931 | 3.538612 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-02-04T09:44:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a75340150... |
cd795ac2-3702-4228-b46e-22e547b4cebc | ceimos/CPP_Sols_PPP_BjarneSt | chapter8/CH8EX7_.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void print_vector(const vector<string>& v, string vector_type) //vector_type - original vector or reversed vector.
{
cout<<vector_type<<" : {";
for(string i:v)
{
cout<<i;
if(i!=v[v.size()-1]){cout<<", ";}
}... | ALGO | 0.984714 | 4.154873 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-11-27T06:06: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": "f53955562b6... |
73e9f915-f610-4615-9791-3472dbd698be | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03062/s702700877.cpp | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>... | ALGO | 0.99997 | 4.033475 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "34ddd33da3... |
996b972c-8568-473b-98f6-26526c111b0a | raptazure/experiments | cpp/algorithms/HAA_sub#792.cpp | #include<iostream>
#include<vector>
using namespace std;
//判断是否有 A >= B
bool cmp(vector<int> &A, vector<int> &B)
{
//先判断位数
if (A.size() != B.size()) return A.size() > B.size();
//位数相同从高位开始比
for (int i = A.size() - 1; i >= 0; i--)
if(A[i] != B[i])
return A[i] > B[i];
//所有位都相等... | ALGO | 0.999975 | 3.88748 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2019-10-12T03:59:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 0,
"pull_requests": 81
},
"file_meta": {
"content_id": "c3ed98... |
d4a96b00-5741-42d3-ba3f-ab76676f1017 | ForgotDream/Problemset | Contest/Codeforces/1842/C.cpp | #include <bits/stdc++.h>
using i64 = long long;
constexpr int inf = 1e9;
void solve() {
int n;
std::cin >> n;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
std::vector<int> max(n + 1, -inf);
std::vector f(n, std::vector<int>(2));
max[a[0]] = 0;
for (int i = 1; i < n... | ALGO | 0.999605 | 4.942764 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2023-04-20T07:00: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": "157f5db809... |
bee1e876-1425-43dd-ba72-5632daa1b3ea | DavidMoralesUTAD/RepoUTAD | IngSoft_Practica01/IngSoft_Practica01/IngSoft_Practica01.cpp | // IngSoft_Practica01.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
void main()
{
//Constantes
const int moverIzq = 'k';
const int moverDer = 'l';
const int disparaIzq = 'i';
const int disparaDer = 'o';
const unsigned int anchoMundo = 80;
//Variables
int posPlayer = a... | TOOL | 0.900469 | 3.595716 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-11-15T18:10: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": "c8dbdff781... |
c9e761d0-eb7a-4d7b-ae90-32ff53177f43 | bilbo3000/coding | leetcode/longest_substring_no_repeat/LongestSubstringNoRepeat.cpp | class Solution {
public:
int lengthOfLongestSubstring(string s) {
// IMPORTANT: Please reset any member data you declared, as
// the same Solution instance will be reused for each test case.
int size = s.size();
if (size == 0) {
return 0;
}
... | ALGO | 0.99994 | 6.081079 | {
"github_metadata": {
"branch": "master",
"commit_count": 981,
"repo_created_at": "2014-03-08T03:04:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e20645d4... |
fa2e7a74-e360-4622-b393-ec226738c5c6 | wuqiongjin/Algorithm | 动态规划/子序列问题/编辑距离/392. 判断子序列.cpp | class Solution {
public:
bool isSubsequence(string s, string t)
{
//这里默认是s的长度 < t的长度
//if(s.size() == 0) return true;
//if(s.size() > t.size()) return false;
//我们再开辟dp数组的时候最好多开一个空间,方便进行初始化和推导
//dp[i][j]: 所有以i-1作为结尾的串s和以j-1作为结尾的串t,它们的相同的子序列的长度为dp[i][j]
//我们最终想要... | ALGO | 0.999899 | 5.693163 | {
"github_metadata": {
"branch": "main",
"commit_count": 111,
"repo_created_at": "2021-06-21T01:30: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": "ddc791b763... |
a5eb3d3d-30cc-4b7b-bf6e-31a3c09c178d | Soulsender/proto-code | proto-code.ino | /*
Version 3.1 Last update: 11-02-2020
This code will control the Left and right of the protogen helmet matrices.
The library for controlling the matrices has to be added to the Arduino IDE before the code can work. The library
that comes with this code has been modified so that you can link up to 14 matric... | TOOL | 0.917335 | 4.517606 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-10-12T06:03: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": "9a5e0c71d4a5... |
ad7b0ca4-5f1b-4768-a5ef-00aee309114d | kabasset/Splider | Splider/Splider/mixins/Hermite.h | /// @copyright 2023-2024, <NAME> (CNES)
// This file is part of Splider <github.com/kabasset/Splider>
// SPDX-License-Identifier: Apache-2.0
#ifndef _SPLIDER_MIXINS_HERMITE_H
#define _SPLIDER_MIXINS_HERMITE_H
#include "Splider/Partition.h" // TODO rm
#include "Splider/mixins/Builder.h"
#include <initializer_list>
n... | ALGO | 0.956891 | 7.12695 | {
"github_metadata": {
"branch": "develop",
"commit_count": 142,
"repo_created_at": "2023-05-10T11:47:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9dfa06... |
841a9292-ebe9-4a99-9382-8e7c52540d28 | Ascnbeta/oi_code | luogu/P5524.cpp | #include <bits/stdc++.h>
#define ls p<<1
#define rs p<<1|1
using namespace std;
const int maxn = 1e6+50;
int n,m,q;
int op[maxn];
int val[maxn<<2],tim[maxn<<2],tagx[maxn<<2],tagt[maxn<<2];
inline void read(int& a) {
int s = 0, w = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-') w =... | ALGO | 0.999976 | 4.265702 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2025-01-08T11:30: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": "a2dfebe908... |
f7d94774-57f9-4625-875f-a6acd27ccee3 | cptalpdeniz/CPSC2150 | Assignment/9/bonus/Commands.cpp | // Author: <NAME>
// A univariate polynomial term in x
// Course: CPSC 2150
// Copyright 2020
#include "Commands.h"
#include <sstream> // std::stringstream
#include <map> // std::map
#include <iostream> // std::cin std::cout
#include <string> // std::string
#include <fstream> // std::ifstream std:... | TOOL | 0.956604 | 5.243273 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-09-16T00:49: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": "0c97aeb22... |
913f02c1-2163-4321-920f-b5f443768dff | td2r/kt-y2019 | ml/L.cpp | #include <bits/stdc++.h>
// #define DEBUG
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef long double floating_t;
floating_t const EPS = 1e-9;
map<int, int> calc_ranks(vector<int> values) {
map<int, int> ranks;
for (auto const& v : values) {
... | ALGO | 0.999609 | 4.512572 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-04-23T14:56: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": "cc308ea1eb... |
8ded1b40-1b26-4b73-8a13-621fdbe8460c | grzelo728/AiZO1 | pliki/LinkedList.cpp | //
// Created by <NAME> on 14.04.2023.
//
#include "LinkedList.h"
#include <iostream>
#include <fstream>
#include <string>
LinkedList::LinkedList() : head(nullptr), tail(nullptr), size(0) {}
void LinkedList::addAtBeginning(int value) {
Node* newNode = new Node(value, head);
if (head != nullptr) {
he... | TOOL | 0.979575 | 4.464452 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-05-09T09:11: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": "7e258be12831... |
367324fe-b1f3-46fd-bc9c-9e9da00ac8ea | AnshulBhaisare/CodSoft | Task 2 -Tic-Tac-Toe/Tic-Tac-Toe.cpp | #include <iostream>
#include <vector>
#include <limits>
using namespace std;
const char HUMAN = 'X';
const char AI = 'O';
const char EMPTY = ' ';
// Function prototypes
void printBoard(const vector<vector<char>>& board);
bool isMovesLeft(const vector<vector<char>>& board);
int evaluate(const vector<vector<char>>& bo... | ALGO | 0.999559 | 7.121252 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-01-25T08:28: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": "76509313e70c... |
a154a2b0-b2ae-46fc-9596-7efad9547d90 | JacqueRobles/arbol_c- | arbolAVL.cpp | //arbol avl en c++
#include <iostream>
using namespace std;
class AVL;
class Nodo {
public:
Nodo (const int dat, Nodo *pad=NUL, Nodo *izq=NUL, Nodo *der=NULL):
dato(dat), padre(pad), izquierdo(izq), derecho(der), FE(0){}
int dato;
int FE;
Nodo *izquierdo;
Nodo *derecho;
Nodo *padre;
friend class AVL;
};
class AVL{
... | ALGO | 0.999905 | 4.485578 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-06-06T13:54:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a62f67d2a3d... |
bff74800-f74a-49a3-9254-dfbc369954fa | VanBao985/Algorithm-Data-Structure | Tree data structure/7_6_Search_AVL.cpp | #include<bits/stdc++.h>
using namespace std;
struct node
{
int data;
node *left;
node *right;
};
node *t = NULL;
int n, x;
node *insert(node *t, int x)
{
if (t == NULL)
{
node *temp = new node;
temp -> data = x;
temp -> left = NULL;
temp -> right = NULL;
... | ALGO | 0.999977 | 4.039735 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-01-23T19:06:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08365c34d1... |
92b9c9f5-d4cb-4536-9c42-099354e36018 | sylvaus/hyperspharm | include/legendre.h | /**
* @file legendre.cpp
* @author Sylvaus
* @date Mon Jan 08 2018
* @brief
*
* Legendre Polynomial Helpers
*/
#pragma once
#include <cmath>
#include <vector>
#include "utils.h"
#include "types.h"
namespace hyperspharm
{
class NormalizedLegendreArray;
class LegendrePoly
{
public:
static const real_t SQR... | ALGO | 0.999175 | 5.962052 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2017-12-19T02:56:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e5609194... |
ff9974a2-75f0-4763-bc0f-4306ef051065 | Ivan255Mhz/templ_matriks | templ_matriks/Matrix.h | #pragma once
#include <iostream>
template <class T>
class Matrix {
T** arr;
int sz;
public:
template <class U>
friend Matrix<U> operator+(const Matrix<U>& lhs, const Matrix<U>& rhs);
template <class U>
friend Matrix<U> operator-(const Matrix<U>& lhs, const Matrix<U>& rhs);
template <class U>
friend ... | ALGO | 0.91741 | 4.510025 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-09-09T17:23:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67e0dce510... |
b7651262-3576-49f6-b8d4-5a655931ebd1 | uxlfoundation/oneDAL | cpp/daal/src/algorithms/engines/mrg32k3a/mrg32k3a.cpp | /* file: mrg32k3a.cpp */
/*******************************************************************************
* Copyright contributors to the oneDAL project
*
* 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 L... | ALGO | 0.977759 | 6.624537 | {
"github_metadata": {
"branch": "main",
"commit_count": 2361,
"repo_created_at": "2016-03-28T22:39:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 636,
"forks": 224,
"issues": 23,
"pull_requests": 37
},
"file_meta": {
"content_id": "3ddf... |
65a709b7-4199-4d05-b5fa-8b42fe7f397f | tiankonguse/leetcode-solutions | contest/2/244/A.cpp | #include "base.h"
typedef long long ll;
typedef long long LL;
typedef unsigned long long ull;
typedef unsigned long long ULL;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
// const int mod = 1e9 + 7;
template <class T>
using min_queue = priority_queue<T, vector<T>, greater<T>>;
template <class T>
using max_qu... | ALGO | 0.999949 | 4.349815 | {
"github_metadata": {
"branch": "master",
"commit_count": 1037,
"repo_created_at": "2015-04-11T09:31:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 81,
"forks": 26,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7aec... |
2b809c0c-2bc7-42ea-abf9-1e12e7dd48b3 | goel-aman/CompetitiveCoding | Codeforces_Problems/Vacations.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
// prev - 1 means she was in gym.
// prev - 0 means she was in contest;
// prev - 2 means she had rest;
ll dp[101][3];
ll solve(ll * a,ll index,ll prev,ll n){
if(index == n){
return 0;
}
if(dp[index][prev] != -1){
retu... | ALGO | 0.999985 | 3.645519 | {
"github_metadata": {
"branch": "master",
"commit_count": 1081,
"repo_created_at": "2020-08-18T14:58:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c49862... |
cc845754-1ba4-4db9-be5c-189fc36b2040 | Vladimir-97/thread | main.cpp | #include <iostream>
#include <omp.h>
#include <fstream>
#include <time.h>
#include <fstream>
#include "timetest.h"
using namespace std;
ifstream fin("in.txt");
ofstream fout("out.txt");
void draw() {
fout << "|| Test number ";
fout << "|| m ";
fout << "|| n ";
fout << "|| k ";
fout << "|| alg1 ";
fout... | ALGO | 0.998965 | 3.458513 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-02-09T07:23: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": "e74cca39f85f... |
68987457-a020-472d-b1fa-186ae45800f1 | ntrntr/hellworld | abc1.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int N, M;
char S[50004];
struct Splay
.{
Splay *P, *L, *R;
int v, c, d, f;// v : Value, d : Delta, c : Current, f : Cover;
bool ff;// ff : Whether Cover;
int Size;
Splay()
{
P = L = R = NULL;
v = c = d = f = 0;
ff = false;
Size = 1;
}
void Updat... | ALGO | 0.999983 | 3.596775 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-09-23T14:02: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": "5597f06aaf... |
f11fe79d-a6de-4fdd-b377-a9d3f652f330 | caprariuap/infoarena | 2016/January-June/expresie2/main.cpp | #include <fstream>
#include <cstring>
using namespace std;
ifstream fin("expresie2.in");
ofstream fout("expresie2.out");
long i,l;
long solutie,nrnumere;
int st[100002],r[55000],d[55000];
long vst,vr,vd;
char s[100001];
int quickselect(int *a, int st, int dr, int k)
{
int i,ir,j,l,mid;
int p,temp;
l=st; ir=dr;
... | ALGO | 0.99964 | 3.391552 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-11-05T21:44:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2a9b6cd5e... |
7ade65fb-78a3-4f0a-ba1c-0620f4b93cb2 | DanielR-spec/Analisis-de-Algoritmos | 01_example_sorting/sorting/Insertion.h | // =========================================================================
// @author <NAME> (<EMAIL>)
// =========================================================================
#ifndef __Insertion__h__
#define __Insertion__h__
#include <iterator>
namespace sorting
{
/**
* Sorts a sequence.
* @input b Beg... | ALGO | 0.999651 | 6.125515 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-08-02T06:40:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b230d72635d... |
ba14196f-7a1c-4383-ba22-e5cd231fff88 | Charbel-11/Competitive-Programming | Contests/Codeforces/627 Div3/E.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int DP[2002][2002];
int n, h, l, r;
vector<int> a;
int maxGood(int i, int curH) {
if (i >= n) {
if (curH >= l && curH <= r) { return 1; }
return 0;
}
if (DP[i][curH] != -1) { return DP[i][curH];... | ALGO | 0.999529 | 3.81349 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2021-02-23T22:39:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60f578160... |
9cb74904-1dba-42fa-97d1-7e5db3bab117 | YoungDevelopers3/Competitive-Programming | SelectionSort.cpp | #include<bits/stdc++.h>
using namespace std;
void SelectionSort(int arr[],int n){
for(int i=0;i<n-1;i++){//loop till n-1 because the last element left will automatically be the largest one
int i_min=i;
for(int j=i+1;j<n;j++){ //using j=i+1, because now we are gping to check the unsorted array again ... | ALGO | 0.999982 | 5.111141 | {
"github_metadata": {
"branch": "main",
"commit_count": 886,
"repo_created_at": "2024-11-19T11:19: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": "660599247d... |
790c5d20-fb7e-4865-9b17-d43256e0e33c | ishandutta2007/codeforces-j | joisino/normal/105/A.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for( int i = (a); i < (int)(b); i++ )
#define REP(i,n) FOR(i,0,n)
#define YYS(x,arr) for(auto& x:arr)
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort( (x).begin(),(x).end() )
#define REVERSE(x) reverse( (x).begin(),(x).end() )
#define UNIQUE(x) (x).erase( unique( ... | ALGO | 0.999623 | 3.506341 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3cee36407ba... |
bf638a69-494d-4104-9fc1-d3353d9ece1c | golmman/plancv | tessx64/corners_connect.cpp | #include "corners_connect.h"
bool compare_width(const LineSegW& l0, const LineSegW& l1) {
return (l0.width > l1.width); // descending
}
void cc_process(const Point& line_point, float width, pcv::Raster<PointPtrW>& raster) {
// find points close to the line start
vector<pcv::RasterPoint<PointPtrW>*> rpoints;
rast... | ALGO | 0.954312 | 4.595184 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-08-09T14:18: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": "b8f8c9a468... |
11261350-0434-4758-bc34-7fce1f71168a | WebKit/WebKit-http | Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp | /*
* Copyright (C) 2013-2019 Apple Inc. All rights reserved.
*
* 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 conditi... | ALGO | 0.915193 | 4.946327 | {
"github_metadata": {
"branch": "master",
"commit_count": 231005,
"repo_created_at": "2011-01-11T13:50:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4992,
"forks": 1983,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
29a98cc1-c35c-46f6-a4d2-aa7763f80387 | kaldi-asr/kaldi | src/chainbin/nnet3-chain-compute-post.cc | // nnet3bin/nnet3-chain-compute-post.cc
// Copyright 2012-2015 Johns Hopkins University (author: <NAME>)
// 2015 <NAME>
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in comp... | DATA | 0.997839 | 6.155159 | {
"github_metadata": {
"branch": "master",
"commit_count": 9405,
"repo_created_at": "2015-04-20T17:23:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14986,
"forks": 5368,
"issues": 189,
"pull_requests": 63
},
"file_meta": {
"content_id":... |
df4d7f7a-4f6b-4da7-bca4-2d3819ff2b5a | dvdg6566/CP-solutions | Dunjudge/Misc/4cuts.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
typedef vector<pi> vpi;
typedef double dl;
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define MOD 1e9+7
#define lb lower_bound
#define ub upper_bound
#define dst distance
ll ... | ALGO | 0.999894 | 3.62571 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2019-01-14T14:51: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": "03cc32a5... |
eab166b5-b602-4c3b-bbc8-02550deac0fc | Tukoshi/NeuralNetwork | Neuron.h | #pragma once
#include <math.h>
#include<iostream>
using namespace std;
class Activators
{
public:
double a;
Activators::Activators() { a = 1.0; }
Activators::Activators(double a) { this->a = a; }
double activate(int function, double value)
{
double actValue;
switch (function)
{
default:
case 1:
actV... | ALGO | 0.998626 | 5.053008 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-05-07T23:30: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": "d6bf9eef0... |
8de42f81-9d68-43b8-a03e-35e354f032cf | ArseniiGalaida/university_algorithms-course | lesson6/binary_trees.cpp | #include <iostream>
struct binary_tree {
int info;
binary_tree* left;
binary_tree* right;
};
using namespace std;
typedef binary_tree* Node;
Node formTree(); // function to forming binary tree
int findNodes(Node node, int info_to_comp); // function to count number of elements with chosen information in b... | ALGO | 0.999807 | 4.411857 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2023-09-09T18:55:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5088915c... |
e96d06bd-e673-4469-9923-92c88c780929 | noahc66260/C-PrimerPlus | Chapter17/pe17-5.cpp | // pe17-5.cpp -- description here
// This is exercise 5 of chapter 17 in C++ Primer Plus 5e by <NAME>
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<vector>
#include<algorithm>
#include<iterator>
#include<cctype>
using namespace std;
void check(ifstream & infile, string filename);
void check(ofstrea... | TOOL | 0.985357 | 4.779284 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2014-10-04T20:06:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 79,
"forks": 45,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5629df6c... |
3458bdd9-c8f5-435b-8f27-860d973a5408 | simongog/sdsl-lite | benchmark/document_retrieval/src/doc_list_index_greedy.hpp | /*!
* This file contains a document listing class, which implements
* strategy GREEDY in the article:
* <NAME>, <NAME>, <NAME> and <NAME>:
* ,,Top-k Ranked Document Search in General Text Databases''
* Proceedings Part II of the 18th Annual European Symposium on
* Algorithms (ESA 2010)
*/
#ifndef DOCUMENT_LISING... | ALGO | 0.996777 | 5.08598 | {
"github_metadata": {
"branch": "master",
"commit_count": 1969,
"repo_created_at": "2013-02-28T22:34:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2269,
"forks": 354,
"issues": 71,
"pull_requests": 25
},
"file_meta": {
"content_id": "... |
9ab82fd9-ab0f-4fdd-a278-bfc3ded3581d | nevikw39/oj | LeetCode/0427.hpp | /** _ _ _____ ___
* _ __ _____ _(_) | ____ _|___ // _ \
* | '_ \ / _ \ \ / / | |/ /\ \ /\ / / |_ \ (_) |
* | | | | __/\ V /| | < \ V V / ___) \__, |
* |_| |_|\___| \_/ |_|_|\_\ \_/\_/ |____/ /_/
**/
#ifndef nevikw39
#pragma GCC optimize("Ofast,unroll-loops,no-stack-pr... | ALGO | 0.998787 | 4.517308 | {
"github_metadata": {
"branch": "master",
"commit_count": 2018,
"repo_created_at": "2020-02-22T14:59:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57ba20... |
df1c293b-85b3-452b-a0a0-85d26fb885c0 | suliutree/AcceleratedCPP | chapter02/2-5.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
const int height = 5;
int row;
int col;
//*********************正方形**********************//
row = 0;
col = 0;
while (col < height)
{
cout << '*';
++col;
}
cout << endl;
++row;
while (row < height - 1)
{
col = 0;
while (col... | ALGO | 0.999453 | 3.04517 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2015-07-14T01:35: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": "e3fb64137... |
47f7f32d-4000-4dca-8296-5cb20bb12284 | EzaRasheed/CS2150 | LAB11/IN-LAB/traveling.cpp | // <NAME>
// er6qt
// 04-23-19
// traveling.cpp
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#include "middleearth.h"
/** @brief Program to implement that will find a brute force solution to the
* traveling salesperson problem
* @details The TSP takes ... | ALGO | 0.999903 | 4.850673 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2020-01-18T20:43:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91e0b9d4... |
11a0beaf-1b0c-4b10-862d-dd8d7c18edca | AntonioNahimana/zuma | src/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>
void populate_vector(std::vector<int>& vec)
{
std::string input;
std::cout << "Introduceti secventa de numere separate prin spatii: ";
std::getline(std::cin, input);
std::istringstream iss(input);
int num;
while (i... | ALGO | 0.999595 | 5.279036 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-04-06T12:28:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf5eae7cf3... |
ad0dab24-38e7-4044-b424-6990e299ca2b | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/03/0312/personal_submission/cf226d_djl777.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n, m, g[N][N];
int flipx[N], flipy[N], totx[N], toty[N];
int minseq(int* a, int sz) {
int mi = a[0];
for (int i = 1; i < sz; i++)
mi = min(mi, a[i]);
return mi;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullp... | ALGO | 0.999973 | 3.465858 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "3c00... |
82a7bcfa-b74e-45ea-9481-c9b4c0f011b0 | IHR57/Leetcode-Solutions | 0374-guess-number-higher-or-lower/0374-guess-number-higher-or-lower.cpp | /**
* Forward declaration of guess API.
* @param num your guess
* @return -1 if num is lower than the guess number
* 1 if num is higher than the guess number
* otherwise return 0
* int guess(int num);
*/
class Solution {
public:
int guessNumber(int n) {
long long low ... | ALGO | 0.999994 | 5.100943 | {
"github_metadata": {
"branch": "main",
"commit_count": 169,
"repo_created_at": "2022-10-12T15:09: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": "42e908c311... |
755c653a-c501-4771-9ee3-e6de33a4a265 | jaaan-t/AoC2023 | Day_02/day02.cpp | #include "../helper.hpp"
vector<string> getSubStrings(const vector<string>& input, char dlm, const string& exclude) {
vector<string> subStrings;
for (const string& line: input) {
stringstream stream(line);
while (stream.good()) {
string substr;
getline(stream, substr, dl... | ALGO | 0.9731 | 5.57061 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-12-04T21:27: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": "7afbf332a1c... |
c71c3d3f-1ba6-4322-b2e9-a25a3dd35256 | pntepa/Myschoolwork | calculatingareaofshapebychoice.cpp | #include <iostream>
#include <cmath>
double calculateSquareArea() {
double side;
std::cout << "Enter the length of the side: ";
std::cin >> side;
return pow(side, 2);
}
double calculateRectangleArea() {
double length, width;
std::cout << "Enter the length and width: ";
std::cin >> length >... | TOOL | 0.970009 | 4.602289 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-22T18:09: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": "b9f1494cbfc7... |
712c1b15-0f8d-4fa7-af38-4f1dc37226de | arpitgupta1906/datastructures | datastructures/AVLtree/implementation.cpp | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int key;
Node *left;
Node *right;
int height;
};
int max(int a,int b){
return (a>b)?a:b;
}
int height(Node *n){
if(n==NULL)
return 0;
else
return n->height;
}
int getBalance(Node *n){
if(n==NULL)
return 0;
return hei... | ALGO | 0.999978 | 5.265061 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2019-10-28T17:52: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": "cca66c2f5... |
13fcbf55-a7a1-40b0-b0bf-eafcb737c332 | Yujun-Qian/algorithm | EulerianPath/theirFleury.cpp | class Solution {
private:
int nVertex;
int nEdge;
map<string, int> airport2int;
map<int, string> int2Airport;
vector<vector<int>> graph;
vector<int> outDegree;
vector<int> inDegree;
int buildGraphHelper(string airport) {
int v;
vector<int> placeholder;
if (ai... | ALGO | 0.99998 | 6.174344 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2019-09-02T02:19: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": "4df59ad56... |
db97e9d0-acc5-4345-8860-b54fd55b930a | TaiKonne/Code_Forces | anton_and_digit.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl << '\n'
#define vti vector<int>
#define vtll vector<long long>
#define yep cout << "YES" nl
#define nope cout << "NO" nl
#define ll long long
#define lg long
#define db double
#define pb push_back
#define bg begin()
#define ed end()
#define rbg rbegin()
#define ... | ALGO | 0.998884 | 3.008413 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-05-01T17:16: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": "683e874ed59... |
b80d3c50-cc3f-444a-9fbf-9a1179c8985e | ishandutta2007/codeforces-l | lhic/normal/954/A.cpp | #ifndef BZ
#ifndef __clang__
#pragma GCC optimize "-O3"
#endif
#endif
#include <bits/stdc++.h>
#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)
#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif
typedef long long ll;
typedef long double ld;
type... | ALGO | 0.999452 | 3.38911 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "2be6982249cc... |
3fceca46-655e-4cfc-b78e-0e30cbc2cab1 | elemental/Elemental | src/optimization/prox/Clip.cpp | /*
Copyright (c) 2009-2016, <NAME>
All rights reserved.
This file is part of Elemental and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
*/
#include <El.hpp>
namespace El {
template<typename Real>
void... | ALGO | 0.956503 | 6.608746 | {
"github_metadata": {
"branch": "master",
"commit_count": 3773,
"repo_created_at": "2012-05-06T08:37:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 513,
"forks": 110,
"issues": 38,
"pull_requests": 7
},
"file_meta": {
"content_id": "02e... |
9b1c7f14-74d5-471f-80fb-f444577b8acd | samuderaahr/PX4_AHRS | src/modules/fw_pos_control_l1/runway_takeoff/RunwayTakeoff.cpp | /****************************************************************************
*
* Copyright (c) 2015 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistri... | TOOL | 0.963925 | 6.587072 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-08-31T20:13:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e078018f66... |
8af6759f-7626-4a19-b63d-0591f2c2d568 | yancouto/competitive-programming | ojs/poj/3118.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }
ll memo[1123][11... | ALGO | 0.999948 | 3.324285 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2016-08-26T11:17:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89c9f25d... |
56925656-7c69-4f69-b5a5-11c95613df99 | SamFerebee/Trade-Analyzer-console | tradeanalyzer.cpp | #include <Windows.h>
#include <algorithm>
#include "PersonClass.h"
#include "otherFunctions.h"
#include "lopsidedalgorithm.h"
#include <fstream>
//complete lopsided algorithm
//add all other relevant player values
//pass things by reference and const where appropriate
//clean up code: rename functions, variables, add ... | ALGO | 0.99902 | 4.177089 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-06-25T04:41: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": "23cb72f252... |
b2ded349-be54-4bf4-9207-302afe364fb2 | RichardBanh/cpp | bloop15.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cout << "Please enter n lines: "<< endl;
cin >> n;
for (int i = n; i >=1; i-=1){
int stars = (2*i)-1;
for( int space = 0; space < n - i; space += 1) {
cout << " ";
}
for (int starcount = i; starco... | ALGO | 0.999436 | 4.338457 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-08-30T05:20: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": "a88d009a1e... |
aaf7ae7e-5935-40d2-963d-7ddbd03087d1 | noabauma/csp22ex | ex03/ex03_sol/solutions/ising_cpp/src/metropolis.cpp | #include "metropolis.hpp"
#include <cassert>
Metropolis::Metropolis(int L, int dimension) : IsingLattice(L, dimension) {}
void Metropolis::doSweep(const int sweep_size)
{
for (int i = 0; i < sweep_size; ++i)
doStep();
}
void Metropolis::setBeta(Real beta)
{
beta_ = beta;
// Set probability lookup table.
... | ALGO | 0.999832 | 6.479285 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-27T14:15: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": "7b9cb0d3295e... |
58727ea9-9b89-4f1d-9ded-436981c2884a | shyamal2411/DSA-Practice | Cpp_Misc/How_much_Scholarship.cpp | #include <bits/stdc++.h>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
#define int long long
#define nl endl
#define f(i, a, n) for (int i = a; i < n; i++)
#define rf(i, a, n) for (int i = n - 1; i >= a; i--)
#define read(arr, n) \
for (int i = 0; i < n; i++) \
cin >> arr... | ALGO | 0.999791 | 3.177923 | {
"github_metadata": {
"branch": "master",
"commit_count": 1689,
"repo_created_at": "2020-11-28T04:42:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26ca61f... |
5ee054d0-8ca6-4513-bc3e-c120c2a68f26 | LuisAlbertoVasquezVargas/CP | otherRepos/Codes/Laptop_W7/luis/10301_UVA.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define all(v) v.begin() , v.end()
#define rall(v) v.rbegin() , v.rend()
#define FOR(it,A) for(typeof A.begin() it = A.begin(); it!=A.end(); it++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define vi vector<int>
#define v... | ALGO | 0.999548 | 3.80291 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-02-12T20:18:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c83d2bd70... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.