uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0d94c06b-4da5-45fc-8918-344fef5a6ab5 | ruiwng/program | PAT/advanced/1017.cpp | #include <stdio.h>
#include <list>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct
{
int HH;
int MM;
int SS;
}times;
typedef struct
{
times arrive;
unsigned int process;
}customer;
bool operator<(times t1,times t2)
{
if(t1.HH!=t2.HH)
return t1.HH<t2.HH;
if(t1.MM!=t2.MM)
return t... | ALGO | 0.998165 | 3.726956 |
e501aa43-9ec2-4075-a610-7d665083015d | Indie365/CCF | src/crypto/key_wrap.cpp | #include "ccf/crypto/key_wrap.h"
#include "ccf/crypto/key_pair.h"
#include "ccf/crypto/rsa_key_pair.h"
#include "ccf/crypto/symmetric_key.h"
#include "openssl/symmetric_key.h"
#include <cstdint>
#include <stdexcept>
#include <vector>
namespace crypto
{
// With inspiration from
// http://docs.oasis-open.org/pkcs1... | TOOL | 0.930031 | 7.475679 |
f754f5e5-5861-48e7-9af1-751dc53ef634 | Sidhant-Gupta/SDE-Problems | Dynamic Programming/Top Down(Memoisation)/SubsetSum.cpp | // https://practice.geeksforgeeks.org/problems/subset-sum-problem2643/1/?track=ppc-dp&batchId=221
int dp[100][100000];
int rec(int aval[],vector<int> chosen,int s,int ind,int n){
int sum=accumulate(chosen.begin(),chosen.end(),0);
if(sum==s) return true;
if(sum>s) return false;
if(ind==n) return fal... | ALGO | 0.999927 | 5.052009 |
5ebd6e42-8fa3-42a2-ba66-21cd1005ecd1 | code-fans/books-source | 动态规划/05_二维费用背包问题/5.6三角形/Triangle.cpp | //
//б߶ϣ֪ܳ,ֻҪ֪
//ÿ߳ᳬܳһ룬Աöһ
//dp[i][j][k]ʾǰiľܷɵһΪjڶΪk
//
#include<bits/stdc++.h>
using namespace std;
int dp[1005][1005],l[1005];
int Area(int a,int b,int c)//
{
double p=(a+b+c)*0.5;
return int (sqrt(p*(p-a)*(p-b)*(p-c))*100);
}
int main()
{
//freopen("Triangle.in","r",stdin);
//freopen("Triangle.out","w"... | ALGO | 0.999449 | 4.05491 |
9d9202a3-32d0-4e95-97e1-8632a775aaa1 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6412_7.cpp | #include <bits/stdc++.h>
int n, k, a[500010], b[500010];
struct node {
struct path {
int x, y;
path() : x(), y() {}
path(int const &a, int const &b) : x(a), y(b) {}
path operator+(path const &k) const {
return a[x] + b[y] < a[k.x] + b[k.y] ? *this : k;
}
} va, vb, vc;
int aa, ab, ba, bb,... | ALGO | 0.999984 | 3.548511 |
e712f716-c3dc-45f0-8852-4c960ef60a19 | levendlee/data-structure-and-algorithms | c++/leetcode/0692-Top_K_Frequent_Words-M.cpp | // 692 Top K Frequent Words
// https://leetcode.com/problems/top-k-frequent-words
// version: 1; create time: 2019-12-30 11:34:15;
class Solution {
public:
vector<string> topKFrequent(vector<string>& words, int k) {
std::unordered_map<string, int> hashmap;
for (const auto& str : words) {
... | ALGO | 0.999975 | 6.388744 |
48169f86-3489-488c-a409-c4d37930ed84 | ritesh5556/DSA_Workout | Trees/class3/rightView.cpp | #include<iostream>
#include<queue>
#include<vector>
using namespace std;
class Node{
public:
int val;
Node *left;
Node *right;
Node(int val){
this->val = val;
this->left = NULL;
this->right = NULL;
}
};
Node * createTree(){
cout<<"enter value for Node : ";
cou... | ALGO | 0.999919 | 4.933012 |
b7f5d7dd-1d3c-4f94-931a-bef7b05ef7d2 | nodchip/icfpc2021 | libs/boost_1_76_0/libs/math/example/luroth.cpp | using boost::math::constants::pi;
using boost::math::tools::luroth_expansion;
using boost::multiprecision::mpfr_float;
int main() {
using Real = mpfr_float;
mpfr_float::default_precision(1024);
auto luroth = luroth_expansion(pi<Real>());
std::cout << luroth << "\n";
}
| ALGO | 0.977102 | 3.078429 |
4210e947-2bd5-4b39-bb2b-af61ebaeb4ee | Nghaiz/CodePTIT_CPP | CPP0714.cpp | #include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int t;
cin >> t;
while (t--){
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
... | ALGO | 0.999859 | 4.450974 |
8bb68eda-078f-4224-a7f3-d4e96924e3df | Gnaroshi/practice-algorithm-solvedac | With_Levels/Silver/Silver_4/11558.cpp | // problem: The Game of Death
// id: 11558
// tag:
// time taken:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
using ll =... | ALGO | 0.999862 | 4.685226 |
49c563a3-750d-46e1-9493-ec83684a5790 | thecreatorsir/DailyDSA | recursion/permutation-with-spaces.cpp | #include<iostream>
using namespace std;
void solve(string ip,string op){
if(ip.length()==0){
// if(op!="")
cout<<op<<" ";
return;
}
string op1 = op;
op1.push_back('_');
op1.push_back(ip[0]);
string op2 = op;
op2.push_back(ip[0]);
ip.erase(ip.begin()+0);
solve(ip,op1);
solve(ip,op2);
return... | ALGO | 0.999917 | 3.170622 |
570f24d6-e501-4584-89a9-b8232214bade | ShrutikaGawas/OOPD-Experiments | Experiment 4/Progrm 3.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main(){
cout.setf(ios::showpoint);
cout<<setw(5)<<"n"<<setw(15)<<"Inverse_of_n"<<setw(15)<<"Sum_of_terms"<<"\n\n";
double term,sum=0;
for(int i=1;i<=10;i++){
term=1.0/float(i);
sum=sum+term;
cout<<setw(5)
<<i<<setw(15)
<<setiosflags(ios::scient... | ALGO | 0.950816 | 3.564106 |
cfc51f3b-11d9-4d92-9f32-b6f04bdab052 | snikolov3/DEMSI_newLAMMPS | LAMMPS/src/KOKKOS/pair_coul_cut_kokkos.cpp | #include "pair_coul_cut_kokkos.h"
#include <cmath>
#include "kokkos.h"
#include "atom_kokkos.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "memory_kokkos.h"
#include "error.h"
#include "atom_masks.h"
using namespace LAMMPS_NS;
#define KOKKOS_CUDA_MAX_THREADS 2... | ALGO | 0.965375 | 6.362401 |
2cef1075-7bdc-40e6-9948-2d973f87387d | vlazzarini/aurora | examples/svfdrive.cpp | #include "BlOsc.h"
#include "Env.h"
#include "TwoPole.h"
#include <cstdlib>
#include <iostream>
double inline nlm(double s, double dr) { return std::tanh(s * dr) / dr; }
int main(int argc, const char *argv[]) {
if (argc > 7) {
double sr = argc > 8 ? std::atof(argv[8]) : Aurora::def_sr;
auto dur = std::atof(... | ALGO | 0.993666 | 5.819035 |
9fc0d079-ee16-41c7-b2b7-7fe7c744d75f | twt-gmbh/getme | Cpp/Mathematics/Source/vector2d_algorithms.cpp | #include "Mathematics/vector2d_algorithms.h"
#include "Mathematics/bounding_box.h"
#include "Utility/exception_handling.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include <numbers>
#include <random>
bool Mathematics::areEqual(const std::vector<Vector2D>& first,
const std::... | ALGO | 0.997192 | 7.338422 |
7d6a1abe-b27f-4fd5-9ff4-fbdb9d75219f | raincross7/code-similarity | codes/train_code/problem350/problem350_385.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
... | ALGO | 0.999267 | 3.956153 |
10ae53d0-180d-4731-936a-2f4e612ba2e0 | maozlev/cpp-ex1-b | snowman.cpp | #include "snowman.hpp"
#include <iostream>
#include <stdexcept>
#include <array>
using namespace std;
namespace ariel{
const int maximum_digits = 99999999;
const int maximum_leagele_digits = 44444444;
const int fixed_one_for_array = 1;
const int ZERO = 0;
const int make_short_by_ten = 10;
const int one_digit_from_rig... | TOOL | 0.988582 | 5.325583 |
b97f9153-fbed-4864-8c7a-a0cff41a37a1 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4627_21.cpp | #include <bits/stdc++.h>
using namespace std;
long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1},
ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
long long gcd(long long a, long long b) {
if (!a) return b;
return gcd(b % a, a);
}
long long lcm(long long a, long lo... | ALGO | 0.999969 | 4.405735 |
751e7372-4569-47d6-854b-189f02d0724a | trinhminhtriet/leetcode | solutions/2800-2899/2864.maximum-odd-binary-number/Solution.cpp | class Solution {
public:
string maximumOddBinaryNumber(string s) {
int cnt = count(s.begin(), s.end(), '1');
return string(cnt - 1, '1') + string(s.size() - cnt, '0') + '1';
}
}; | ALGO | 0.999992 | 5.930408 |
4ba37870-08e1-4106-aa0b-96b881f13c1f | samuel21119/Cpp | CodeForces/contest/1321/e.cpp | /*************************************************************************
> File Name: e.cpp
> Author: Samuel
> Mail: <EMAIL>
> Created Time: Tue Mar 3 11:52:36 2020
*************************************************************************/
#include <bits/stdc++.h>
using namespace std;
int n, m, p;
int ans ... | ALGO | 0.999786 | 4.129521 |
c847732b-c11f-4c49-bc8b-459c614246aa | Husainbw786/LeetCode | Coin Change - GFG/coin-change.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
long long int count(int coins[], int N, int sum) {
// code here.
long long dp[N+1][sum+1];
int i,j;
for(i=0;i<N+1;i++)
{
dp[i][0] = true;
... | ALGO | 0.999894 | 6.023459 |
f7853072-07db-4f71-996c-b68820f3ba81 | bananaappletw/online-judge | leetcode/text-justification.cpp | class Solution {
public:
vector<string> fullJustify(vector<string>& words, int maxWidth) {
queue<string> line;
vector<string> answer;
int N=words.size();
int remain=maxWidth-words.front().length();
line.push(words.front());
for(int i=1; i<N; i++)
{
... | ALGO | 0.999973 | 6.143502 |
349e43d6-5a41-4775-bd95-b564076c4dca | nouremara/Helios-Presi-HSB | helios-base-master/src/player/planner/action_chain_graph.cpp | // -*-c++-*-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "action_chain_graph.h"
#include "hold_ball.h"
#include <rcsc/player/player_agent.h>
#include <rcsc/common/server_param.h>
#include <rcsc/common/logger.h>
#include <rcsc/time/timer.h>
#include <string>
#include <sstream>
#include <queue>
#include... | ALGO | 0.999532 | 3.366515 |
9c613de4-1815-42cd-a947-63ef0f24f7eb | lballabio/quantlib-old | QuantLib/Examples/Bonds/Bonds.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This example shows how to set up a term structure and then price
some simple bonds. The last part is dedicated to peripherical
computations such as "Yield to Price" or "Price to Yield"
*/
// the only header you need to use Qu... | TOOL | 0.979098 | 7.829487 |
9822143d-fb45-4ef1-b2ce-a48d97afd607 | ruchipotamsetti/Leetcode | Bit Manipulation/Hamming Distance.cpp | // Problem can also be "Find number of bits to change, to convert x to y"
class Solution {
public:
int hammingDistance(int x, int y) {
int a=x^y;
int cnt=0;
while(a > 0){
a = a & (a-1);
cnt++;
}
return cnt;
}
};
| ALGO | 0.999917 | 5.681995 |
3e5c2b5a-79b0-418a-92af-0c4915a4847d | Evaintain/boj | 1725.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/*
1725번 문제 접근 방식
->
프로그래밍 대회에서 배우는 알고리즘 문제해결전략책을 보고
19챕터의 스택부분을 보고 푸는글이다.
i번째의 높이, 오른쪽, 왼쪽으로 넓이를 구한다.
r[i] > r[i + 1]
r[i]에 대한 크기 계산 가능 (오른쪽 왼쪽이 전부 결정나므로)
r[i] < r[i + 1]
계산 불가능 둘다 오른쪽 이 결정이 나지않음.
6549번에서 한번만 돌리면 됨.
*/
/*
태그
. 자료 구조... | ALGO | 0.999928 | 4.731205 |
1c349ce7-185e-4ee2-a5ea-5c0ef9931005 | trinhminhtriet/leetcode | solutions/1400-1499/1471.the-k-strongest-values-in-an-array/Solution.cpp | class Solution {
public:
vector<int> getStrongest(vector<int>& arr, int k) {
sort(arr.begin(), arr.end());
int m = arr[(arr.size() - 1) >> 1];
sort(arr.begin(), arr.end(), [&](int a, int b) {
int x = abs(a - m), y = abs(b - m);
return x == y ? a > b : x > y;
}... | ALGO | 0.999995 | 5.460139 |
8260de19-fdb9-42a6-8d8a-0d4dd6a951a5 | ScaredHD/Code | Leetcode/2025-0203/3258m_countKConstraintSubstrings.cpp | // 2025/03/02
// [简单] 3258. 统计满足 K 约束的子字符串数量 I
#include <array>
#include <string>
using namespace std;
class Solution
{
public:
int countKConstraintSubstrings(string s, int k)
{
auto n = s.size();
int i = 0;
std::array<int, 2> count;
int res = 0;
for (int j = 0; j < n; ++j) {
++count[s[... | ALGO | 0.999906 | 6.070037 |
84390463-d55d-4928-bffb-bfe92a0147fa | ishandutta2007/codeforces | gmusya/normal/474/C.cpp | #include <iostream>
#include <vector>
using namespace std;
const int INF = 1e9;
bool check(vector <int> x, vector <int> y) {
{
int a = x[2] - x[1];
int b = y[2] - y[1];
int c = x[0] - x[1];
int d = y[0] - y[1];
if (a * c + b * d) {
swap(x[2], x[1]);
swap(y[2], y[1]);
}
}
for... | ALGO | 0.99982 | 3.993485 |
9e3f7f69-f74f-4d60-b030-cbe2833ff843 | FangLiu68/LC2016 | LC2016/preOrder Traverse.cpp | #include "BinaryTree.h"
#include <vector>
#include <stack>
using namespace std;
/*
Implement an iterative, pre-order traversal of a given binary tree, return the list of keys of each node in the tree as it is pre-order traversed.
Examples
5
/ \
3 8
/ \ \
1 4 ... | ALGO | 0.999993 | 5.605742 |
d6d234ba-ec49-4df0-8d6c-17fa02a44155 | 9759176595/LeetCodeQuestion | 01 Matrix.cpp | class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& mat) {
queue<pair<int,int>>q;
vector<vector<int>>ans(mat.size(),vector<int>(mat[0].size(),-1));
for(int i=0;i<mat.size();i++){
for(int j=0;j<mat[0].size();j++){
if(mat[i][j]==0){
... | ALGO | 0.999934 | 6.297866 |
6e74dcda-8d3c-46a9-a5fd-85cceed7fc31 | ReNginx/acm | vjudge/Wk 4/A/a.cpp | #include <map>
#include <set>
#include <cmath>
#include <queue>
#include <vector>
#include <iomanip>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef long double ld;
const int maxm = 1e4+1, maxn = 1e5 ... | ALGO | 0.99966 | 3.757964 |
58d51068-fc0c-472e-98a6-84e8cb68eb1d | AnshulKumawat1/leetcode | 3235-minimum-cost-to-convert-string-i/3235-minimum-cost-to-convert-string-i.cpp | class Solution {
public:
vector<int>dijkstra(int n,vector<pair<int,int>>adj[],int src){
set<pair<int,int>>s;
s.insert({0,src});
vector<int>dis(n,1e9); dis[src]=0;
while(s.size()>0){
auto it=*s.begin();
int node=it.second;
int dist=it.first;
... | ALGO | 0.999983 | 5.59504 |
19e0765e-c17c-47c8-bc05-42c3fc96bbd4 | KennyChiu0503/Algorithm-and-Problem-Solving-Practice | hw1/src/grade_sorting_simplified.cpp | #include <bits/stdc++.h>
using namespace std;
struct Student {
int scores[5]; // scores in the order: Chinese, English, Mathematics, Science,
// Social Studies
// Calculate the total score of the student
int total_score() const {
int total = 0;
for (int i = 0; i < 5; ++i) {
total... | ALGO | 0.999602 | 6.599305 |
5e34b109-34c2-4617-becf-4bf6a3ba1da7 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/arc019/B/2263920.cpp | #include <iostream>
#include <climits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define DEBUG false
using namespace std;
int main(){
ios::sync_with_stdio(... | ALGO | 0.999649 | 3.587434 |
cdbbd4e8-4762-46f2-9eff-cceef868ab93 | PegasusOS/android_external_libcxx | test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval_param.pass.cpp | // <random>
// template<class RealType = double>
// class chi_squared_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <cassert>
#include <vector>
#include <numeric>
#include <cstddef>
template <class T>
inline
T
sqr(T x)
{
return x * x;
... | TEST | 0.988512 | 4.568384 |
00fea492-d5de-437f-b466-7d31ac87f266 | ANKIT-KANDULNA/CPP-Codes | factors.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
int MOD=1e9+7;
void factor(int n){
for(int i=1;i*i<=n;i++){
if(n%i==0){
cout<<i<<" ";
if(i!=n/i){
cout<<n/i<<" ";
}
}
... | ALGO | 0.999598 | 4.869129 |
019624aa-e66c-40e4-87f8-413cf1f8fcea | Cyber-Hunterr/CSES-Problemset | Searching and Sorting/Nearest_Smaller_Values.cpp | #include <bits/stdc++.h>
using namespace std;
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// template <typename T, typename R> u... | ALGO | 0.999994 | 4.419317 |
49740a53-82f4-44fe-b782-a59c18a1f980 | orangain/opencv | modules/imgproc/src/corner.cpp | #include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
namespace cv
{
static void calcMinEigenVal( const Mat& _cov, Mat& _dst )
{
int i, j;
Size size = _cov.size();
#if CV_SSE
volatile bool simd = checkHardwareSupport(CV_CPU_SSE);
#endif
if( _cov.isContinuous() && _dst.isContinuous() )
{
... | ALGO | 0.999561 | 3.067975 |
8b027d9f-3003-4310-b99d-bab4605a805e | ishandutta2007/codeforces | wifiiii/normal/1552/G.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n, k;
cin >> n >> k;
if(n == 1) return cout << "ACCEPTED" << endl, 0;
vector<ll> a;
for(int i = 0; i < k; ++i) {
int m;
cin >> m;
ll x = 0;
for(int j = 0; j < m; ++j) {
i... | ALGO | 0.999888 | 5.273661 |
85091036-9dbf-43c4-90ae-863ef69bcbde | hyeonseong0917/Codeforces | random/1780B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
using namespace std;
#define ll long long
ll gcd(ll a, ll b){
if(b==0) return a;
return gcd(b,a%b);
}
int main() {
// your code goes here
int t=0;
cin>>t;
while(t--){
// a: 길이 n
// k>1인 k를 고른다
// k개의 subsegment로 배열을 ... | ALGO | 0.999675 | 3.518572 |
85b83db9-72d2-40fb-971f-cecf991c3538 | Nikhil562/DSAinCPP | 2225-find-players-with-zero-or-one-losses/2225-find-players-with-zero-or-one-losses.cpp | class Solution {
public:
vector<vector<int>> findWinners(vector<vector<int>>& matches) {
unordered_map<int,int>lost_map;
for(int i=0;i<matches.size();i++)
{
int lose=matches[i][1];
lost_map[lose]++;
}
vector<int>notLost;
vector<int>onceLost;
... | ALGO | 0.999851 | 5.50318 |
f307e682-50b7-4ae1-b0c4-b0b660423f07 | dingliang1989/ThirdParty | Source/boost_1_88_0/libs/graph/example/topo-sort-file-dep2.cpp | using namespace boost;
namespace std
{
template < typename T >
std::istream& operator>>(std::istream& in, std::pair< T, T >& p)
{
in >> p.first >> p.second;
return in;
}
}
typedef adjacency_list< listS, // Store out-edges of each vertex in a std::list
vecS, // Store vertex set in a std::vector
directe... | ALGO | 0.999589 | 5.506413 |
b889d4c5-1163-445c-9b5e-053113919696 | ishandutta2007/codeforces | hellkitsune/normal/792/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long LL;
typedef pair<int, int> PII;
string s;
int n;
string solve(string s) {
int need = 0;
for (char c : s) {
need += c - '0';
}
need %... | ALGO | 0.999976 | 4.148201 |
715a4152-1837-49b7-af46-d70d0a440805 | junlong-gao/recreations | src/code_practise/hackerrank/largest_permutation/main.cpp | #include <cmath>
#include <utility>
#include <map>
#include <cstdio>
#include <vector>
#include <deque>
#include <queue>
#include <iostream>
#include <algorithm>
#include <numeric>
#ifndef DEBUG
#define DEBUG 0
#endif
#define FILENAME "test.txt"
#include <fstream>
using namespace std;
using ll = long long;
#define forn... | ALGO | 0.999974 | 3.437633 |
49d91640-f7ac-4979-b71b-b88badb0def5 | anukraticodes/DailyCodeChallenges | 0943-sum-of-subarray-minimums/0943-sum-of-subarray-minimums.cpp | using ll=long long;
const int MOD= 1e9 + 7;
class Solution {
public:
int sumSubarrayMins(vector<int>& nums) {
int n=nums.size();
vector<int> left(n, -1);
vector<int> right(n, n);
stack<int> st;
for(int i=0; i<n; i++){
while(!st.empty() && nums[st.top()]>=nums[i]... | ALGO | 0.999996 | 5.04597 |
fa459dc8-8aa9-43c7-bbad-23f08b134c10 | ZongleiJiao/OntologyViewer | libogdf/src/energybased/Planarity.cpp | /*
* $Revision: 1.5 $
*
* last checkin:
* $Author: gutwenger $
* $Date: 2007-12-14 21:43:55 +0100 (Fri, 14 Dec 2007) $
***************************************************************/
#include <ogdf/internal/energybased/Planarity.h>
namespace ogdf {
Planarity::~Planarity()
{
delete m_edgeNums;
del... | ALGO | 0.999848 | 5.785686 |
997dce2d-4e73-45ca-84e8-2fadd56220e4 | 43Atharv/oop-practical | linked_list.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
};
class List{
public:
Node* head;
List(){
head = nullptr;
}
// head->data = 1;
// head->next = nullptr;
void insert( int val )
{
Node* newNode = new Node;
newNode->data=val;
newNode->next=head;
head=newNo... | ALGO | 0.920438 | 4.228424 |
6c3d8d32-16bd-4229-a21a-36c90027cbc3 | richa-dasila/LeetCode-Questions | 1662-check-if-two-string-arrays-are-equivalent/1662-check-if-two-string-arrays-are-equivalent.cpp | class Solution {
public:
bool arrayStringsAreEqual(vector<string>& word1, vector<string>& word2) {
//two pointer
//w1=["ab","c"] w2=["a","bc"]
int m = word1.size(), n = word2.size();
int w1 = 0, w2 = 0;//pointer to word
int s1 =0, s2 = 0;//pointing to individual string
... | ALGO | 0.999208 | 6.126147 |
a91e472c-88ea-46d9-8328-f788d648fce6 | AdvTrainEvalSrcDomain/adv-train-evaluation-source-code-domain | code-imitator/data/dataset_2017/dataset_2017_8_formatted_macrosremoved/abisheka/8294486_5681755159789568_abisheka.cpp | #include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utilit... | ALGO | 0.999683 | 3.758305 |
471011b1-4d69-4d7d-8cb8-386cbbf7d224 | midibox/mios32 | apps/synthesizers/midibox_sid_v3/juce/JuceLibraryCode/modules/juce_graphics/images/juce_ImageConvolutionKernel.cpp | ImageConvolutionKernel::ImageConvolutionKernel (const int size_)
: values ((size_t) (size_ * size_)),
size (size_)
{
clear();
}
ImageConvolutionKernel::~ImageConvolutionKernel()
{
}
//==============================================================================
float ImageConvolutionKernel::getKernelVa... | TOOL | 0.853586 | 6.632215 |
f4a03e2f-81d2-4576-a09a-5b5a682c7d2d | BGI-Qingdao/SLR-superscaffolder | src/main/GapSize.cpp | /**********************************************************
*
* @Brief :
* Estamate gapsize by linear regression model.
*
* *******************************************************/
#include "utils/args/argsparser.h"
#include "utils/log/log.h"
#include "utils/files/file_writer.h"
#include "utils/files/file_r... | DATA | 0.974267 | 5.714264 |
2a49388e-a4bd-46f7-8aff-47f3444eebd6 | habib302/LeetCode-Solution | 0090. Subsets II.cpp | class Solution {
public:
vector<vector<int>> subsetsWithDup(vector<int>& nums) {
int n=nums.size();
vector<int> temp;
sort(nums.begin(),nums.end());
helper(0,temp,nums);
return res;
}
//backtracking
void helper(int index,vector<int... | ALGO | 0.999908 | 6.02006 |
d065dd5f-bcab-46e8-b3eb-7bc4dd81ac30 | michaelberks/isbe | machine_learning/forests/randomforest-matlab/RF_Reg_C/src/mex_regressionRF_train.cpp | #ifdef MATLAB
#include "mex.h"
#endif
#include "math.h"
#include "reg_RF.h"
#define DEBUG_ON 0
void regRF(double *x, double *y, int *xdim, int *sampsize,
int *nthsize, int *nrnodes, int *nTree, int *mtry, int *imp,
int *cat, int maxcat, int *jprint, int doProx, int oobprox,
int biasCorr, doubl... | ALGO | 0.980972 | 4.713921 |
3e470424-09fc-4c17-97d6-042e8d844dcf | iamzay/leetcode | C++/771_JewelsAndStones.cpp | #include <iostream>
#include <unordered_set>
using namespace std;
class Solution {
public:
int numJewelsInStones(string J, string S) {
unordered_set<char> jewelTypes(J.begin(), J.end());
int res = 0;
for (char c: S) {
if (jewelTypes.count(c)) {
++res;
... | ALGO | 0.999049 | 5.291653 |
c6e2bfc7-06d3-4028-8dc6-b8c7e096e279 | cmin764/cmiN | FII/L1/ACSO/asm/primesum.cpp | #include <cstdio>
using namespace std;
int _PrimeSum(int nr)
{
int sum = 0, last = 2;
while (nr-- > 0) {
printf("%d ", last);
sum += last;
while (1) {
++last;
int ok = 1;
for (int i = 2; i <= last / 2 && ok; ++i)
if (!(last % i))
... | ALGO | 0.999732 | 4.021498 |
8157d39b-d31d-4e95-8c90-ddb8924a32c2 | jianminchen/leetcode-14 | src/count-complete-tree-nodes-tle.cpp | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <stack>
#include <ctime>
#include <climits>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
bool try_exist(long long m... | ALGO | 0.999763 | 5.299966 |
9df15ada-3240-4300-929b-349160db1464 | rwalia2405/Codeforces_Raman | C+=.cpp | # include <iostream>
using namespace std;
int main()
{
int t;
cin>>t;
for(int i=0;i<t;i++)
{
long long int a,b,n;
cin>>a>>b>>n;
if(b>a)
{
long long int c=a;
a=b;
b=c;
}
long long int d=a;
long long int j=0;
while(d<=n)
{
if(j%2==0)
{
a+=b;
d=a;
}
else
{
... | ALGO | 0.999972 | 3.262597 |
616e2602-f420-4aa6-bd17-24fa00bc411c | suman319dega/Leetcode | 0128-longest-consecutive-sequence/0128-longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
unordered_set<int> s;
for(int i=0;i<nums.size();i++){
s.insert(nums[i]);
}
int count;
int maxi = 0;
for(auto num : s) {
if(s.find(num-1) == s.end()) {
count = ... | ALGO | 0.99994 | 5.662397 |
5ee68aa2-4ff8-4b40-8a57-e8f63a037a70 | nhatrongbp/DSA_codePTIT | daycontangdainhat.cpp | #include <bits/stdc++.h>
using namespace std;
int t,n,a[1005],b[1005],r;
int main()
{
cin>>n;r=1;
for(int i=0;i<n;++i){
cin>>a[i];b[i]=1;
for(int j=0;j<i;++j){
if(a[j]<a[i])b[i]=max(b[i],b[j]+1);
r=max(r,b[i]);
}
}
cout<<r;
return 0;
}/*
1 2 5 4 6 2
1 2 3 3 4 2
1 2 3 4 5 1 2 3 4 6
1 2 3 4 5 1 2 3 4 6*... | ALGO | 0.999953 | 3.838574 |
d8eb0253-97d6-48d2-a21a-6f0661cd9eb1 | armanhossen-dev/CPP | sort_an_array_smallToBig.cpp | #include <iostream>
void sort(int ar[], int size);
void printElements(int ar[], int s);
int main()
{
int array[] = {10, 7, 4, 3, 9, 0, 2, 1, 6, 5, 8};
int arrayElementNumber = sizeof(array) / sizeof(array[0]);
sort(array, arrayElementNumber);
return 0;
}
void sort(int ar[], int size)
{
int temp;
... | ALGO | 0.999425 | 4.006137 |
b864e011-c083-47d2-8ff9-2e599790396f | ThgSousa/diversos | C/8.cpp | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main(void){
setlocale(LC_ALL, "Portuguese");
float l1,l2,area;
area=0;
printf("Esse programa determina a area de um triangulo qualquer");
printf("\n\nDigite o lado 1: ");
scanf("%f",&l1);
printf("\n\nDigite o lado 2: ");
scanf("%f",&l2);
area ... | ALGO | 0.987411 | 3.833479 |
23d75c7b-9dde-4bdc-a176-984fbec945cf | podgorskiy/MinimalFem | eigen/doc/examples/class_VectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived>
segmentFromRange(MatrixBase<Derived>& v, int start, int end)
{
return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
}
template<typename Derived>
const Eigen::Vec... | TOOL | 0.985937 | 4.383477 |
b20493b2-fca1-4b80-9a3e-7841ab894ad6 | amanpandey45/cipherschool_dsa | Lecture18/Lecture18.cpp | #include<iostream>
using namespace std;
int main()
{
int i;
int a[10];
cout<<"enter the elememts which we have to sort:";
for(i=0;i<10;i++)
{
cin>>a[i];
}
int j;
for(j=0;j<9;j++)
{
int temp;
for(i=0;i<10-j;i++)
{
if(a[i+1]<a... | ALGO | 0.999459 | 3.180611 |
71cf0351-f91c-4c84-9f3f-8a34bb2c7630 | algo-seacow/NCTU-ItoA-2020-Fall | 1125/submissions/accepted/309552025_lcs.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[7001][7001];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
string s1, s2;
cin >> s1 >> s2;
for(int i = 0; i < s1.size(); i++){
for(int j = 0; j < s2.size(); j++){
if(s1[i] == s2[j]) dp[i+1][j+1] = dp[i][j] + 1;
else dp[i+1][j+1] = max(dp[i+1][... | ALGO | 0.999968 | 4.557225 |
7b3fb5d7-aa84-4fab-aa61-fa6bcf046875 | kulagins/dynamic-scheduler | extlibs/memdag/src/graph-algorithms.cpp | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <graphviz/cgraph.h>
#include "fifo.hpp"
#include "graph.hpp"
#include "heap.hpp"
//#define DEBUG_GRAPH_ALGO
/**
* \file graph-algorithms.c
* \brief Traverals and other tools on graphs
*/
/**
* Computes the maximal memory of a schedule
* @param ... | ALGO | 0.999833 | 3.508429 |
245a1de5-98f9-44f4-982d-85737dd8597c | hauxir/mupen64plus.js | boost_1_59_0/libs/polygon/example/voronoi_basic_tutorial.cpp | // Boost.Polygon library voronoi_basic_tutorial.cpp file
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstdio>
#include <vector>
#include <boost/polygon/voronoi.hpp>
using boost::polygon::voronoi_builder;
using boost::polygon::voronoi_diagram;
using boost::polygon::x;
using ... | ALGO | 0.999473 | 6.482969 |
eada1794-2c70-4ce0-af44-1592187c8f17 | parthasarathi94/LeetCode | 3223. Minimum Length of String After Operations.cpp | // Question Link: https://leetcode.com/problems/minimum-length-of-string-after-operations/description/
class Solution {
public:
int minimumLength(string s) {
int n = s.length();
vector<int>freq(26, 0);
int deletedCharCount = 0;
for(int i=0; i<n; i++){
freq[s[i] - 'a']++;... | ALGO | 0.999964 | 6.473905 |
8519ece5-00e8-401f-8f06-b9908f87ac79 | GravStark/Cpp-ENG-ITA-SUO | .cpp/do-while-repeating-numbers-ENG.cpp | #include <iostream>
using namespace std;
int main()
{
int x, sum=0;
cout<<"The program will continue adding numbers until a 0 is entered!" <<endl;
do
{
cout<<"Enter a number: " <<endl;
cin>> x;
sum=sum+x;
}
while (x!=0);
cout<<"The sum of the numbers is: " <<sum <<endl;
system ("pause");
return 0;
}
| ALGO | 0.973348 | 3.647315 |
7e51a2c1-85a6-4dfc-aedd-feb4c8a5bf31 | RoninNada/android_frameworks_av | media/libstagefright/codecs/m4v_h263/dec/src/chvr_filter.cpp | #include "mp4dec_lib.h"
#include "post_proc.h"
#ifdef PV_POSTPROC_ON
void CombinedHorzVertRingFilter(
uint8 *rec,
int width,
int height,
int16 *QP_store,
int chr,
uint8 *pp_mod)
{
/*----------------------------------------------------------------------------
; Define all local v... | ALGO | 0.999648 | 5.08971 |
c59f1197-a4a0-456b-8f99-5fed5b9ebeae | Heart-1ess/CodeRepository | C++Repo/PTA/top/1002-Business.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
#define MAXN 55
const int MAXD = 1e5;
int N;
int dp[MAXN][MAXD];
int ddl = 0;
struct Project{
int P, L, D;
bool operator<(const Project X){
return D < X.D;
}
}prj[MAXN];
void solve(){
sort(prj + ... | ALGO | 0.999594 | 3.873867 |
071d75fd-a9df-4da8-849e-82079f0c9e53 | CalebSarikey/cplusplus | SumSeries.cpp | #include <iostream> //cin, cout
using namespace std;
//A recursive function that given a positive integer N, it will return the sum of all numbers from 1 to N.
int sumASeries(int N);
int main() {
int N;
cout << "Enter a number: ";
cin >> N;
cout << "The sum of the numbers from 0 to " << N << " is " << sum... | ALGO | 0.999036 | 4.810424 |
48f7847c-51e3-4fd9-bd82-c92ba0904193 | BoYiZhang/openjdk-12-32_src | src/hotspot/share/services/attachListener.cpp | #include "precompiled.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/systemDictionary.hpp"
#include "gc/shared/gcVMOperations.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "oops/typeArrayOop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
#i... | TOOL | 0.895568 | 6.963177 |
8fe86a45-5007-43f8-b849-a98dc0c2150d | ivanrafli14/CP-Archives | TROC 11 Robot.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
string s; cin >> s;
int x = 0, y = 0;
for(int i=0; i <s.size(); i++){
if(s[i] == 'R'){
x +=1;
}
if(s[i] == 'L'){
x +=-1;
}
if(s[i] == 'U'){
y +=1;
}
if(s[i] == 'D'){
y +... | ALGO | 0.999882 | 3.230072 |
d1a0bb85-a1e7-4983-8868-15b8b156a7fc | sstarodubov/algo_tasks | leetcode/111.cpp |
#include <algorithm>
#include <iostream>
#include <unordered_map>
#include <vector>
#include "./tree_node.cpp"
class Solution {
public:
int minDepth(TreeNode* root) {
if (root == nullptr) return 0;
return minDepth_(root);
}
int minDepth_(TreeNode* root) {
if (root == nullptr) ... | ALGO | 0.999924 | 7.143395 |
0bf01447-af15-44c2-bc82-e7d2d3bf6298 | nobinov/image_resizer_server | include/boost_1_75_0/libs/graph/example/adj_list_ra_edgelist.cpp | #include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <iostream>
int main()
{
using namespace boost;
typedef adjacency_list< vecS, vecS, bidirectionalS, no_property,
property< int, edge_weight_t >, no_property, vecS >
Graph;
const std::size_t n = 3;
typedef std... | ALGO | 0.984545 | 4.514025 |
4bacd3d3-2050-4999-9ece-baf361349906 | mohsystem/llm-generated-code-c-cpp | tests/claude/Task170/Task170_test.cpp | // Task170_Test.cpp
#include <iostream>
#include <vector>
#include <sstream>
#include <string>
#include <algorithm>
class Solution {
public:
int countRangeSum(std::vector<int>& nums, int lower, int upper) {
std::vector<long long> prefixSum(nums.size() + 1, 0);
for (int i = 0; i < nums.size(); i++) ... | ALGO | 0.999992 | 6.661284 |
feb8a8aa-d58f-4b17-8ee9-9624668bb6c5 | dipeshsirohia/DSA-Using-C | 101-symmetric-tree/symmetric-tree.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.999918 | 6.937464 |
c1e4abbf-a286-4058-8d6a-b8b25f197f2d | joaoRozetti/Atividade-05-02-09-2024 | ParametrosAula/Ex7D.cpp | #include <iostream>
using namespace std;
void inverterVetor(int a[], int tamanho) {
int inicio = 0;
int fim = tamanho - 1;
while (inicio < fim) {
int temp = a[inicio];
a[inicio] = a[fim];
a[fim] = temp;
inicio++;
fim--;
}
}
void imprimirVetor(con... | ALGO | 0.999459 | 5.592811 |
7e2ebf64-90bc-4a3e-86d2-542fc0f91a67 | FIngerFrings/leetcode | Easy/leetcode130.cpp | /*
* 给你一个 m x n 的矩阵 board ,由若干字符 'X' 和 'O' ,找到所有被 'X' 围绕的区域,并将这些区域里所有的 'O' 用 'X' 填充。
*/
//方法一:DFS
//思路:换位思考,和边界上的O相连的O一定不会是被X包围,所以只要对边界上的O进行搜索,找到所有与边界上的O相连的O,并标记为A,剩下的O就是被X包围的O
//之后遍历数组,将所有的A换成O,将所有的O换成X
class Solution {
public:
vector<int> direction{-1, 0, 1, 0, -1};
void dfs(vector<vector<char>>& board, i... | ALGO | 0.999206 | 6.069373 |
1012e14b-0145-4232-ba31-be4701a130b0 | byungwook-min/Algorithm | test/BFS.cpp | //
// BFS.cpp
// DS
//
// Created by 민병욱 on 2022/04/15.
//
#include <iostream>
using namespace std;
#define FASTIO ios::sync_with_stdio(0); cin.tie(0);
#define MAX_ROW 101
#define MAX_COL 101
#define MAX_SIZE 1000
int Queue[MAX_SIZE];
int Head, Tail;
int init(){
Head = Tail = 0;
return 0;
}
int isEmpty()... | ALGO | 0.99995 | 4.619004 |
e9fb5f6b-7e13-4497-b4d6-08fdf0a23235 | AbhJ/some-cp-files-1 | codeforces1426F.cpp | //Coded by Abhijay Mitra
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <numeric>
#include <vector>
#include <iterator>
#include <map>
#include <set>
#include <climits>
#include <queue>
#include <cmath>
#include <stack>
#include <cctype>
#i... | ALGO | 0.999948 | 3.952787 |
795a7f41-fa8f-482f-bfa7-767074f3b8ea | nikhilmahale/DataStructuresAndAlgorithms | data_structures/linear/stackUsingArrays.cpp | /**********************************************************
* Author: Nikhil Mahale
* Description: This code presents a program menu for a
* stack with following options. Stack is created using a
* fixed dimensional array :
* 1. Push (Adds value to top of stack)
* 2. Pop (Removes value from top of stack)
* 3. Is... | TOOL | 0.968642 | 4.1275 |
486a4bec-bb1b-461f-8ea3-3d70443d1896 | gudwnsgur/Algorithm | BOJ/10807_개수세기.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#define endl '\n'
using namespace std;
int main() {
int n, v, res = 0;
cin >> n;
vector<int> vec(n);
for (int i = 0; i < n; i++) cin >> vec[i];
cin >> v;
for (int i = 0; i < n; i++) if (vec[i] == v) res++;
cout << res << endl;
return 0;
}
| ALGO | 0.999876 | 4.908505 |
7a69358b-b99e-45e1-8686-e5c46946076f | ugidol/atcoder | abc206/b.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void){
int n;
cin >> n ;
int v = 0;
int ans = 0;
while(v<n){
v += ++ans;
}
cout << ans << endl;
return 0;
}
| ALGO | 0.999861 | 3.382807 |
6cd14302-b8c3-4fbd-9dfd-0660710d1c20 | ElenaR1/BT-int | exam.cpp | #include <iostream>
#include <stack>
#include <vector>
#include <map>
#include <assert.h>
using namespace std;
struct node {
int data;
node* next;
node(): next(NULL) {}
node(int data,node* next): data(data), next(NULL) {}
};
void f1(node* head1,node*head2)
{
map<int,bool> mp;
node*current1=head1;
whil... | ALGO | 0.999887 | 3.957483 |
11e82e69-676f-483c-acad-7e378bbd915c | andeplane/molecular-dynamics-fys3150 | main.cpp | #include "math/random.h"
#include "lennardjones.h"
#include "velocityverlet.h"
#include "system.h"
#include "statisticssampler.h"
#include "atom.h"
#include "io.h"
#include "unitconverter.h"
#include <iostream>
#include <iomanip>
using namespace std;
int main(int numberOfArguments, char **argumentList)
{
int numb... | ALGO | 0.983027 | 3.554025 |
2488dff4-b66d-4c27-83c6-62445213a7cc | zhixingfeng/iGDA | tools/seqan/seqan-library-2.4.0/share/doc/seqan/html/demos/dox/graph_algorithms/bellman_ford_algorithm.cpp | #include <iostream>
#include <seqan/graph_algorithms.h>
using namespace seqan;
int main()
{
typedef Graph<Directed<> > TGraph;
typedef VertexDescriptor<TGraph>::Type TVertexDescriptor;
typedef Size<TGraph>::Type TSize;
// Create graph with 10 directed edges (0,1), (0,3), ...
TSize numEdges = 10;
... | ALGO | 0.999775 | 5.615785 |
b1d4268d-b4be-45bf-b110-e4626e74c56b | Abhinav7076/My-Codes | LeetCode-Solutions-master/C++/is-subsequence.cpp | // Time: O(n)
// Space: O(1)
// Greedy solution.
class Solution {
public:
bool isSubsequence(string s, string t) {
if (s.empty()) {
return true;
}
int i = 0;
for (const auto& c : t) {
if (c == s[i]) {
++i;
}
if (i ==... | ALGO | 0.999936 | 6.96768 |
72e849f8-7a5b-430b-be39-bacc87dae6b1 | tanmoykdas/Codeforces-problem | jezhu_and_children.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
float m;
cin >> n >> m;
int a[n], b[n];
int max = 0, index = 0;
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
int mx = *max_element(a, a + n);
int min = ceil((float)mx / m) - 1;
min *... | ALGO | 0.999979 | 3.771016 |
00eb28cc-8392-45cd-87e2-2fd3160cd91f | ishandutta2007/codeforces | tute7627/normal/983/B.cpp | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define P... | ALGO | 0.999992 | 4.126815 |
712e27ba-0fad-4881-ac45-987a3f66abdc | yplusplus/aabbyy | 20140427/c.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MOD = 3 << 18 | 1;
const int ROOT = 10;
const int K = 16;
const int N = 1 << K;
LL powerMod(LL a, int p) {
a %= MOD;
LL s = 1;
while (p > 0) {
if (p & 1) s *= a, s %= MOD;
a *= a, a %= MOD, p >>= 1;
}
return s;
}
inline LL inverse(... | ALGO | 0.999956 | 3.692224 |
47893967-0a0d-4ccc-bbc9-4ce5421de51a | claymodel/antivirus | clamav-debian/libclamav/c++/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp | #define DEBUG_TYPE "post-RA-sched"
#include "llvm/CodeGen/PostRAHazardRecognizer.h"
#include "llvm/CodeGen/ScheduleDAG.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrItineraries.h"
using namespace llvm;
PostRAHazardReco... | ALGO | 0.863861 | 6.986059 |
ab2ad2f5-53ab-4851-ada6-6365f6ce1b05 | jfcarocota/sfml-roguelike-cc | src/dynamics/b2_friction_joint.cpp | #include "box2d/b2_friction_joint.h"
#include "box2d/b2_body.h"
#include "box2d/b2_time_step.h"
// Point-to-point constraint
// Cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-I -r1_skew I r2_skew ]
// Identity used:
// w k % (rx i + ry j) = w * (-ry i + rx j)
// Angle constraint
// Cdot = w... | ALGO | 0.994935 | 7.56649 |
4735580e-6511-423d-9241-1257f9df4596 | shelltdf/osgall | prebuild/cgal-master/Orthtree/examples/Orthtree/orthtree_build.cpp | #include <iostream>
#include <CGAL/Epick_d.h>
#include <CGAL/Orthtree.h>
#include <CGAL/Orthtree_traits_d.h>
#include <CGAL/Random.h>
// Type Declarations
typedef CGAL::Dimension_tag<4> Dimension;
typedef CGAL::Epick_d<Dimension> Kernel;
typedef Kernel::Point_d Point_d;
typedef std::vector<Point_d> Point_vector;
typ... | ALGO | 0.999643 | 6.31261 |
c4fabc32-a4a5-4ede-aa2c-5b6f75e06db7 | misterpurple98/CPSC-351-myShell | myShell/myShell.cpp | // myShell.cpp : Simple Command Line Interpreter
// Names : Oliver Escalante, Jacob Berry, Nicholas Haga
// Group : 1
#include <Windows.h>
#include <iostream>
#include <vector>
//Thread function
DWORD WINAPI SendCommand(LPVOID Param) {
std::system((const char*)Param);
return 0;
}
int main()
{
std::cout << "Welcom... | TOOL | 0.874838 | 4.201997 |
934447c0-6e66-4cee-afd9-aca586373968 | rashigupta01/450-DSA-Questions | Dynamic Programming/q48.cpp | // Exponential approach: got tle
// couldn't memoize it
int res = 0;
int util (int K, int N, int A[], int pos, int boughtAt, int cur) {
if (pos == N || K==0) {
return cur;
}
if (boughtAt!=-1) {
return max (util (K, N, A, pos+1, boughtAt, cur), util (K-1, N, A, pos+1, -1, cur+A[pos]-boughtAt)... | ALGO | 0.999837 | 5.583038 |
63ba6d04-fdd1-4650-809b-2fabc25fb33b | Deepro111/My-CPP-files | swap_alternate.cpp | #include<iostream>
using namespace std;
void printArray(int arr[], int n){
for(int i=0; i<n; i++){
cout<< arr[i] <<" ";
}
}
void swapAlternate(int arr[], int size){
for(int i=0; i<size; i+=2){
if(i+1<size){
int temp = arr[i];
arr[i] = arr[i+1];
arr[i+1] ... | ALGO | 0.999921 | 4.925225 |
b19ab941-b359-4c1c-8612-c587541c9008 | devvirfans/pemrograman | CPP/Pewarisan_Pegawai.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Pegawai {
protected:
string id;
int usia, tipe;
int income;
public:
void set(string pid, int u, int t )
{
id = pid;
usia = u;
tipe = t;
}
string getID()
{
return id... | TOOL | 0.969389 | 4.337176 |
a1719b07-5f8d-4721-8766-3d879de213bb | Ninja-OS/frameworks_native | cmds/installd/otapreopt.cpp | #include <algorithm>
#include <inttypes.h>
#include <limits>
#include <random>
#include <regex>
#include <selinux/android.h>
#include <selinux/avc.h>
#include <stdlib.h>
#include <string.h>
#include <sys/capability.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <android-base/logging.h>
... | TOOL | 0.954031 | 7.611017 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.