uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a7b3aca1-179b-4054-a764-9c96ff9dc24c | Jai4/Algorithms | src/LeetCode/LongestIncreasingSubsequence.cpp | class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
int n=nums.size();int tem,t;
if(n==0){return 0;}
vector<int> index,val;
int length=0;
for(int i=0;i<nums.size();i++)
{
if(i==0)
{
index.push_back(0);
... | ALGO | 0.999987 | 5.833352 |
f4467f96-b949-45c7-bb02-314c88b9f302 | emilymryan/LAMMPS-SPH-Source-Code | src/USER-INTEL/npair_skip_intel.cpp | /* ----------------------------------------------------------------------
Contributing author: W. Michael Brown (Intel)
------------------------------------------------------------------------- */
#include "npair_skip_intel.h"
#include "atom.h"
#include "comm.h"
#include "error.h"
#include "modify.h"
#include "my_... | TOOL | 0.945387 | 5.807302 |
af16297e-e901-4f3e-9c69-7f582c7954dd | gangwarady/Codeforces | Boy or Girl.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
set<char> letters;
for(int i =0;i<s.size();i++){
letters.insert(s[i]);
}
if(letters.size()%2){
cout<<"IGNORE HIM!\n";
}
else{
cout<<"CHAT WITH HER!\n";
}
}
| ALGO | 0.998554 | 3.646073 |
082de948-c802-431f-95c5-96ba4f149f00 | dbondin/progs | c++examples/src/example-29/main.cpp | #include<algorithm>
#include<vector>
#include<iostream>
using namespace std;
template<class T>
void print_container(T & c) {
for (typename T::iterator i = c.begin(); i != c.end(); i++) {
if (i != c.begin()) {
cout << ", ";
}
cout << *i;
}
cout << endl;
}
int main(int argc, char **argv) {
vector<int> v;... | ALGO | 0.998242 | 4.638466 |
a73407e8-2deb-4f4b-855f-db947b77b3e3 | wudeape/algorithm | 数据结构代码/简单的算法题/c/二维数组转置.cpp | #include <iostream>
using namespace std;
/*
*˼·תþ[i][j][j][i]ת
*Ϊݵ0ûԪת1ֻһתã2תã磺һеĵ0Ҫת Դ
*j<ij<=nôмαת
*/
void fun(int arr[][3],int n);
int main(){
int arr[3][3]={1,2,3,4,5,6,7,8,9,};
fun(arr,3);
return 0;
}
void fun(int arr[][3],int n){
int t;
int i,j;
for(i=0;i<n;i++){
for(j=0;j<i;j++){
t=arr[i][j];
... | ALGO | 0.999965 | 3.213456 |
a086a403-fec6-475b-bc2a-743491a1750b | manishbagela/Codeforces-solutions | 800/elephant.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int x; cin >> x;
int res = x / 5;;
if(x % 5 > 0){
res++;
}
cout << res << endl;
return 0;
} | ALGO | 0.999629 | 4.255469 |
c55c8069-932a-454a-8b5d-5896c34cc779 | shelltdf/osgall | prebuild/cgal-master/Matrix_search/examples/Matrix_search/sorted_matrix_search.cpp | #include <CGAL/Random.h>
#include <CGAL/Cartesian_matrix.h>
#include <CGAL/sorted_matrix_search.h>
#include <vector>
#include <algorithm>
#include <iterator>
#include <boost/functional.hpp>
typedef int Value;
typedef std::vector<Value> Vector;
typedef Vector::it... | ALGO | 0.99999 | 5.252057 |
a27d2c55-1077-499b-b1e0-e0609c485722 | maharshi6864/college_programs | Sem4/DS/Assignments/Assignment-unit-1/Assign10.cpp | #include <iostream>
using namespace std;
int main()
{
int sum = 0;
int arr[3][3] = {{1, 1, 3}, {0, 1, 2}, {0, 0, 1}};
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
cout << arr[i][j] << " ";
}
cout << endl;
}
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j+... | ALGO | 0.998716 | 3.816523 |
4cda38de-324f-44ac-a313-eddc4395f9b5 | mingqian-233/cpp-school | semester2/Code_Examples/ch05/fig05_05/fig05_05.cpp | // Fig. 5.5: fig05_05.cpp
// Summing integers with the for statement.
#include <iostream>
using namespace std;
int main()
{
unsigned int total = 0; // initialize total
// total even integers from 2 through 20
for ( unsigned int number = 2; number <= 20; number += 2 )
total += number;
cout << "Sum ... | ALGO | 0.998952 | 4.050189 |
8e5e4383-680c-4223-a815-f47bfb531430 | MdHamzaHossain/competitive-programming | solves/codeforces/1941-A-Rudolf and the Ticket/CPP 1941-A-Rudolf and the Ticket.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define cinline(s) getline(cin, s)
#define ENDL "\n"
#define SCANINT(A) scanf("%d", &A)
#define SCANDOUBLE(A) scanf("%lf", &A)
#define SCANSTR(A) scanf("%s", A)
#de... | ALGO | 0.999952 | 3.95063 |
da25535e-e4fe-439f-af39-18e8a2e012eb | Rohitrky2021/JavaSourceCode | =C--P/Aditya Verma/Aditya-verma-youtube-playlist-code-main/Sliding Window/02 First negative integer in every window of size k.cpp | /*
Time Complexity: O(n)
Auxiliary Space: O(k)
*/
vector<long long> printFirstNegativeInteger(long long int A[],long long int N, long long int K) {
long long i;
long long j;
vector<long long> ans;
list<long long> l;
while (j<N){
if (A[j]<0)
l.push_back(A[j]);
if (j-i+1<K) j++;
else if ((j-i+1)... | ALGO | 0.99999 | 4.446011 |
2073aabb-4c7a-4ba4-b470-1da30f4a41a0 | ninopereira/MPC | src/Eigen-3.3/bench/benchmarkXcwise.cpp | // g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef VECTYPE
#define VECTYPE VectorXLd
#endif
#ifndef VECSIZE
#define VECSIZE 1000000
#endif
#ifndef REPEAT
#define REPEAT 1000
#endif
int main(int argc, c... | ALGO | 0.95479 | 3.896122 |
40223079-5660-49eb-8ab6-9ad775ff42c3 | jsyeh/2025aaia | week09/week09-3.cpp | // week09-3.cpp
# include <stdio.h>
# include <algorithm>
# include <vector>
using namespace std;
int main()
{
vector<int> a(100); //int a[100];
for(int i=0; i<100; i++){
scanf("%d", &a[i] );
}
std::sort(a.begin(), a.end());
for(int i=0; i<100; i++){
printf("%d ", a[i] );
}
}
| ALGO | 0.998513 | 3.774138 |
a4fffe7f-6d8d-4286-afce-7508e0ece9f0 | anishakd4/ds | BinaryTree/ConstructionAndConversion/5ConstructFullBinaryTreeFromGivenPreorderAndPostorderTraversals.cpp | #include<iostream>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node *left, *right;
};
Node* newNode(int data){
Node* new_node = new Node();
new_node->data = data;
new_node->left = new_node->right = NULL;
return new_node;
}
void printInorder(Node *root){
... | ALGO | 0.999979 | 5.419813 |
02f443f0-98c5-4d65-a585-95f7db476bd0 | Lab-ANT/DMatrix | TCM_DBLP/sketch.cpp | #include "sketch.hpp"
TCM::TCM(int depth, int length, int width, int lgn) {
mv_.depth = depth;
mv_.length = length;
mv_.width = width;
mv_.lgn = lgn;
mv_.sum = 0;
mv_.counts = new SBucket *[depth*length*width];
for (int i = 0; i < depth*length*width; i++) {
mv_.counts[i] = (SBucket... | ALGO | 0.996628 | 3.507123 |
1925a204-b565-424b-a354-9fbc66197476 | 1004gite/CS_Study | 알고리즘/Greedy/O_bj13305.cpp | /*
각 도시는 수평으로 일직선상에 있다.
각 도시마다의 기름값은 다를 수 있다.
각 도시 사이의 거리도 다를 수 있다.
가장 왼쪽 도시에서 출발하여 가장 오른쪽 도시로 갈 때의 최소 기름값은?
도시의 개수는 최대 100,000 이고, 각 거리는 최대 1,000,000,000, 리터당 가격은 최대 1,000,000,000 이므로 long long 사용
풀이 1
1. 도시간 이동 중 이후의 도시들의 기름값이 더 크다면 그 도시에서 기름을 모두 충전하고 나머지 도시를 이동한다.
2. 기름값순으로 도시를 정렬한다.
3. 도시정보에는 기름값, 종착 도시까지의 거리정보를 ... | ALGO | 0.999879 | 4.298124 |
2fcfe1c8-f3e5-46ef-b0ff-cadafd68c2ca | KMsojib/LeetCode | Year-2025 Problem List/June 2025/3442. Maximum Difference Between Even and Odd Frequency I.cpp | /*
# Problem : 3442. Maximum Difference Between Even and Odd Frequency I
# Time Complexity : O(n)
# space Complexity : O(1)
# C++ Solution
*/
class Solution {
public:
int maxDifference(string s) {
map<char, int> mp;
for (auto ch : s) {
mp[ch]++;
}
int maxiOdd ... | ALGO | 0.999955 | 5.597497 |
ab076d73-d9a1-4773-92f6-ff7f744ccd12 | SamiaShareen/Cupcode | CF_800rat.cpp/two_tower.cpp | // Bismillahir Rahmanir Raheem
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef vector<ll> vl;
#define all(a) ((a).begin()),((a).end())
#define pb push_back
#define forcin(n) for(auto &x : n) cin >> x
#define forcout(n) for(auto x : n) cout << x << " "
#define sz(n) (... | ALGO | 0.999964 | 3.167648 |
24527478-61b0-4db7-be62-183499286c36 | Arcadia-Science/2024-organismal-selection | src/perm_test_within_non_ref.cpp | #include <Rcpp.h>
#include <random>
using namespace Rcpp;
// [[Rcpp::export]]
NumericMatrix perm_test_within_non_ref(NumericMatrix dist_mat, NumericMatrix focal_dists, int n_permutations)
{
// Input: Takes a full distance matrix (dist_mat) between all proteins and a
// matrix (focal_dists) of distances ... | ALGO | 0.999095 | 7.002969 |
b6cce744-99e3-439b-9b14-dbdb60418924 | zjkang/algorithm | leetcode/035. Search Insert Position.cpp | /*
Author: Zhengjian kang
Email: <EMAIL>
Problem: Search Insert Position
Source: http://oj.leetcode.com/problems/search-insert-position/
Difficulty: Easy
Tags: {Array}, {Binary Search}
Notes:
Given a sorted array and a target value, return the index if the target is found. If not,
retur... | ALGO | 0.999969 | 6.488982 |
70e339a0-0752-46e4-a19e-0ef31138cff1 | Rvpro/EmeraldDreamv3 | dep/g3dlite/source/AABox.cpp | /**
@file AABox.cpp
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2004-01-10
@edited 2006-01-11
*/
#include "G3D/platform.h"
#include "G3D/AABox.h"
#include "G3D/Box.h"
#include "G3D/Plane.h"
#include "G3D/Sphere.h"
#include "G3D/BinaryInput.h"
#include "G3D/BinaryOutput.h"
namespace... | TOOL | 0.922056 | 7.868921 |
1a126654-78b4-4243-930f-005d9c1c54a8 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2964_9.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int n, m, t[200005], D[200005], s[200005], num[600005], dis[600005],
root[200005], sum[200005];
long long u[200005], d[200005], ans[200005], ANS, cnt[200005];
vec... | ALGO | 0.999818 | 3.564082 |
a3214dba-dbed-4c36-b03b-515e8b4e18a9 | llvm-mirror/test-suite | MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/waxpby.cpp | /////////////////////////////////////////////////////////////////////////
// Routine to compute the update of a vector with the sum of two
// scaled vectors where:
// w = alpha*x + beta*y
// n - number of vector elements (on this processor)
// x, y - input vectors
// alpha, beta - scalars applied to x and y respe... | ALGO | 0.999889 | 4.972465 |
92617421-b61c-4b44-aa78-e787623cc421 | a00012025/Online_Judge_Code | CodeForce/460-B.cpp | #include<bits/stdc++.h>
#define LL long long
using namespace std;
int cal(LL x)
{
return x ? x%10+cal(x/10) : 0 ;
}
LL pw(LL x,int n)
{
return n ? pw(x,n-1)*x : 1LL ;
}
vector<int> v ;
main()
{
int a,b,c ; scanf("%d%d%d",&a,&b,&c) ;
for(int i=1;i<100;i++)
{
LL x=b*pw(i,a)+c ;
if(x... | ALGO | 0.999063 | 3.36603 |
8bc7a99c-ff85-4cc8-9746-dda4bfeefb55 | AlexaAndreas99/Faculty | DataStructuresAndAlgorithms/sdalab3/sdalab3/SLL.cpp | #include "SLL.h"
#include <Windows.h>
#include <stdexcept>
SLL::SLL()
{
this->head = new SLLnode;
}
struct SLLnode * SLL::search(Tvalue e)
{
struct SLLnode *current = this->head;
while (current != nullptr&¤t->data != e)
{
current = current->next;
}
return current;
}
void SLL::insert_first(Tvalue e)
{
... | TOOL | 0.926554 | 3.965549 |
47f67a1c-85a3-444a-86aa-3ba2a6c11c58 | yliu-cs/ACM | NowCoder/牛客练习赛37-A.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 5;
bool IsPrime[maxn];
int Tot;
int PrimeYear[maxn];
int Month[6] = {1, 2, 3, 10, 11, 12};
int Day[6] = {10, 20, 30, 1, 11, 21};
void PrimeInit() {
for (int i = 0; i < maxn; ++i) {
IsPrime[i] = true;
}
Tot = 1;
for (long lon... | ALGO | 0.99965 | 4.068365 |
feed6948-3e40-4002-a588-aa9b1d371faf | victorkc/c-code | 10_juego/balaMejorada.cpp | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <curses.h>
#define DELTA .1
#define X 0
#define Y 1
struct TCoordenada{
double x;
double y;
};
int main(int argc, char *argv[]){
// a = aceleración, v = velocidad, s = altura.
// En el struct de abajo hace referencia a que dentro de cada variabl... | ALGO | 0.892043 | 3.257308 |
ac7551e1-ea4c-450f-9670-d3a1a8b485a2 | manishsingh027/code | Ass 1-BFS HPC.cpp | #include <bits/stdc++.h>
#include<omp.h>
using namespace std;
const int N = 1e5+5;
vector<int> g[N];
bool vis[N];
void bfs(int s)
{
queue<int> q;
q.push(s);
vis[s] = true;
while(!q.empty())
{
int u = q.front();
q.pop();
#pragma omp paraller for
for(int i = 0; i<g[u].size(); i++)
{
int v = g[u]... | ALGO | 0.99997 | 3.651225 |
019298cc-21e6-4c10-bea4-125544d485f2 | OhYee/sourcecode | ACM/HDU/1195.Open the Lock.cpp | /*
By:OhYee
Github:OhYee
Email:<EMAIL>
Blog:http://www.cnblogs.com/ohyee/
かしこいかわいい?
エリーチカ!
要写出来Хорошо的代码哦~
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <iostream>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <map>
using namesp... | ALGO | 0.99979 | 4.346828 |
775e558b-90f4-477d-b995-b8893ac31555 | yonsei-hpcp/gcom | third-party/boost_1_86_0/libs/geometry/doc/src/examples/algorithms/discrete_hausdorff_distance.cpp | //[discrete_hausdorff_distance
//` Calculate Similarity between two geometries as the discrete hasdorff distance between them.
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/linestring.hpp>
int main()
{
typedef boost::geomet... | ALGO | 0.998458 | 7.199407 |
5bde0df7-48fd-463d-b641-b60a8f4f9a34 | farrelpit/C | LATIHAN QUIZ UTS/binary.cpp | #include <stdio.h>
#include <string.h>
int main()
{
int t;
int binary[33] = {0};
scanf("%d", &t);
int i = 0;
while (t > 0)
{
binary[i] = t % 2;
t /= 2;
i++;
}
for(int j = i - 1; 0 <= j; j--)
{
printf("%d", binary[j]);
}
return 0;
}
| ALGO | 0.999868 | 3.957141 |
b5dfe4f2-f046-4438-bc32-8cc69930db6c | seunghyeonL/ProblemSolving | 프로그래머스/1/133502. 햄버거 만들기/햄버거 만들기.cpp | #include <string>
#include <vector>
using namespace std;
void match(int &answer, vector<int> &v) {
auto endIt = v.end();
if (*(endIt - 1) == 1 && *(endIt - 2) == 3 && *(endIt - 3) == 2 &&
*(endIt - 4) == 1) {
v.pop_back();
v.pop_back();
v.pop_back();
v.pop_back();
... | ALGO | 0.999706 | 5.815383 |
526ddcb9-7529-41e2-9e2d-ff917804ccdf | Datguyprasham/CompetitiveProgramming | Codeforces sol/1515B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long int lli;
typedef vector<int> vi;
typedef vector<long long int> vlli;
#define pb push_back
#define pi 3.1415
const lli MOD= 1e9+7;
bool issquare(int n){
int temp=sqrt(n);
return temp*temp==n;
}
//no odd numbers ,... | ALGO | 0.999576 | 5.235191 |
e345bd2f-a2d5-4839-a94b-abd6046ae295 | mrityunjay33/DSA | 0938-range-sum-of-bst/0938-range-sum-of-bst.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.999996 | 6.580276 |
83a8cc1b-774c-44cb-aceb-758ae3e4d723 | mahfuzfahad/Data-Structure | Module 5/dynamic_node_create.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node* next;
Node(int val)
{
this->val=val;
this->next=NULL;
}
};
int main()
{
Node* head =new Node(10);
Node* b =new Node(29);
head->next=b;
cout<<head->val<<endl;
cout<<head->... | ALGO | 0.997673 | 3.164733 |
dba20c5a-3b93-4a68-b435-55e46bf689a1 | nhatrongbp/DSA_codePTIT | sobuocitnhat.cpp | #include <bits/stdc++.h>
using namespace std;
int t,n,a[1005],b[1005],r;
int main()
{
cin>>t;
while(t--){
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<<n-r<<"\n";
}
return 0;
}/*
1 2 5 4 6 2
1 2 3 3 4 ... | ALGO | 0.999657 | 3.924429 |
aab68659-3865-452e-addf-f23a5995f4af | fafa1899/BuildCppDependency | Source/boost-1.86.0/libs/numeric/odeint/examples/harmonic_oscillator.cpp | #include <iostream>
#include <vector>
#include <boost/numeric/odeint.hpp>
//[ rhs_function
/* The type of container used to hold the state vector */
typedef std::vector< double > state_type;
const double gam = 0.15;
/* The rhs of x' = f(x) */
void harmonic_oscillator( const state_type &x , state_type &dxdt , const ... | ALGO | 0.999282 | 7.235958 |
17aa6918-f794-4129-833f-982eb69bdfe7 | nomuundal-AI/bmstu | sem_04/computer-graphics/lab_04/number.cpp | #include "number.h"
int myRound(double num)
{
return int(num + 0.5 * num / num);
}
int negative(int cx, int x)
{
return cx - abs(cx - x);
}
| TOOL | 0.99922 | 4.730898 |
177c4c81-2ace-402d-8476-e16e65ecdb1d | ejrcarr/Kattis | Solutions/Modulo/modulo.cpp | #include <iostream>
#include <vector>
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main()
{
bool found[42] ... | ALGO | 0.998701 | 3.576977 |
4c15f41b-a905-4302-b963-ee91cb38bb22 | rzarey/Quantum-Encrypt-for-Matdis-Project-2 | .history/percobaan 1_20230707102908.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
// Fungsi Caesar Cipher
string caesarCipher(string text, int shift) {
string result = "";
for (int i = 0; i < text.length(); i++) {
if (isupper(text[i]))
result += char(int(text[i] + shift - 65) % 26 + 65);
... | ALGO | 0.999928 | 5.925318 |
8e10ff8f-90bc-4282-be01-e51816d5e1f2 | sajjadhossanshimanto/stupid-C | cpp basic/module 1/6. if-else.cpp | #include <iostream>
using namespace std;
// same to same as `c`
int main(){
int x=5;
if (x%2==1){
cout << "odd" << endl;
} else{
cout << "even" << endl;
}
// tarnary -> (condition) ? True : False
x%2==1 ? cout << "odd": cout << "even" << endl;
return 0;
} | ALGO | 0.981788 | 3.583576 |
ba11ece5-6a76-436a-849c-c25748879897 | falt3/leetcode | 060_stack_queue/0933_easy.cpp | // https://leetcode.com/problems/number-of-recent-calls/description/?envType=study-plan-v2&envId=leetcode-75
#include <iostream>
#include <queue>
using namespace std;
class RecentCounter {
queue<int> q;
public:
RecentCounter() {
}
int ping(int t) {
q.push(t);
while (t - ... | ALGO | 0.973198 | 6.188795 |
776c8202-2de6-4ae0-94a3-9913c3978942 | Davo911/ORBSLAM2-Win64-Archaeonaut | Thirdparty/win/eigen/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.979149 | 4.156673 |
b2bc6931-1d40-428e-b816-749230471e55 | Mukul-Bhardwaj-01/Analysis-and-design-of-Algorithm | Lab 8 (10 April 2025)/Matrix chain multiplication.cpp | #include <iostream>
#include <vector>
#include <limits.h>
using namespace std;
int matrixChainOrder(vector<int>& p, int n)
{
vector<vector<int>> dp(n, vector<int>(n, 0));
// l is chain length
for (int len = 2; len < n; ++len)
{
for (int i = 1; i < n - len + 1; ++i)
{
int j ... | ALGO | 0.999961 | 4.228807 |
d97cbce1-6b68-4520-b0ef-95b626f3f5e2 | VietTho1989/TurnBasedGame | IOS/HundredGamesMaster/Classes/cpp/StockFishChess/Core/chess_stock_fish_endgame.cpp | #include <algorithm>
#include <cassert>
#include "chess_stock_fish_bitboard.hpp"
#include "chess_stock_fish_endgame.hpp"
#include "chess_stock_fish_movegen.hpp"
using std::string;
using namespace std;
namespace StockFishChess
{
namespace {
// Table used to drive the king towards the edge of the ... | ALGO | 0.998578 | 5.479578 |
3f4bf565-4523-480e-a391-6ff2f07aa40a | uwgraphics/hierarchicaldd | external_libraries/Physbam/Public_Library/PhysBAM_Tools/Krylov_Solvers/CONJUGATE_GRADIENT.cpp | using namespace PhysBAM;
//#####################################################################
// Destructor
//#####################################################################
template<class T> CONJUGATE_GRADIENT<T>::
~CONJUGATE_GRADIENT()
{}
//####################################################################... | ALGO | 0.999835 | 5.749342 |
c75382de-a3f3-48cc-84b6-31ab5dc05081 | mdshemul48/Data-Structures-And-Algorithms-Practice-Codes | 12. Recursion - 1 Basics/countZero.cpp | #include <bits/stdc++.h>
using namespace std;
int countZero(int number)
{
if (number == 0)
{
return 0;
}
return number % 10 == 0 ? 1 + countZero(number / 10) : countZero(number / 10);
}
int main()
{
cout << countZero(404040) << endl;
return 0;
} | ALGO | 0.999709 | 4.585886 |
9f39401e-55a6-4ea4-bc07-2cdd59a23ad3 | ravi-pushkar/CSES | Introductory Problems/IncreasingArray.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,y;
cin>>n;
int x;
cin>>x;
long long int ans=0;
int cnt=1;
while(cnt<n)
{
int y;
cin>>y;
if(y<x)
{
ans+=(x-y);
}
else
{
x=y;
}
c... | ALGO | 0.999861 | 3.067336 |
8b6f8a51-4465-4393-a1a6-1840f585484e | NextGenPiyush/Data-Structures-and-Algorithms | Graphs/matrix_bfs_dfs/shortest_bridge.cpp | #include<bits/stdc++.h>
using namespace std;
vector<pair<int,int>> direction = {{0,1},{1,0},{-1,0},{0,-1}};
int shortestBridge(vector<vector<int>>& grid); // Leetcode-934
int multiBFS(vector<vector<int>>& grid, queue<pair<int,int>> &q);
void markIslandAndCollectBorders(vector<vector<int>>& grid, int i, int j, queue<p... | ALGO | 0.999965 | 5.949036 |
bb1c4631-2b2f-45d2-8ceb-653635eac149 | king-rohit777/Programming-Hub | Striver/SDE-SHEET/Arrays/StockSellBuy.cpp | /*
Approaches
-----------
1) Brute force -> TC :o(n^2) , SC: o(1)
2) efficient -> TC: o(n) , SC: o(1)
*/
// brute force
class Solution
{
public:
int maxProfit(vector<int> &prices)
{
int i = 0, j = 1, profit = 0;
for (int i = 0; i < prices.size(); i++)
{
for (int j = i + 1... | ALGO | 0.99972 | 6.407307 |
1d35ffec-8836-4515-87e3-8f067d41b05c | WGowi/SICT_InterView | 2018/T2.cpp | //
// Created by Gowi on 2023/2/19.
//
//把一个文件中的字符排序后放入到另外一个文件中
#include <cstdio>
#include <cstdlib>
#define N 100
int main()
{
int n = 0;
char str[N], ch;
FILE *f1 = fopen("../2018/data.txt", "r+");
FILE *f2 = fopen("../2018/new_data.txt", "w");
if (f1 == NULL || f2 == NULL)
{
printf("文件操作失败\n");
exit(0)... | ALGO | 0.999402 | 3.530046 |
507748ce-b0e6-4aef-acea-3f2a022b1ca3 | callmepathak/DsaCodingNinja | DSA_CODING_NINJA/Stacks and Queues/Balanced Parenthesis.cpp | /*
For a given a string expression containing only round brackets or parentheses, check if they are balanced or not. Brackets are said to be balanced if the bracket which opens last, closes first.
Example:
Expression: (()())
Since all the opening brackets have their corresponding closing brackets, we say it is balanced... | ALGO | 0.9996 | 6.144851 |
608fe784-2b90-4a52-8bf5-b6b433cc7b66 | boostorg/flyweight | example/serialization.cpp | #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/flyweight.hpp>
#include <boost/flyweight/serialize.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/toke... | TOOL | 0.853039 | 7.609066 |
003c5ded-dfea-4862-ac1c-7fe29d9109a7 | khoivux/CodePTIT | CodePTIT_CPP/CPP0515.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
struct SinhVien
{
string id, name, clas, day;
float gpa;
};
string chuanhoa(string s)
{
vector<string> v;
stringstream ss(s);
string tmp;
while(ss >> tmp) v.push_back(tmp);
string res = "";
for(auto it : v)
{
... | ALGO | 0.971673 | 4.268292 |
23792017-2775-42ed-bbad-40666ad54f0e | KrastanDraganov/Competitions | Algorithms/rabin_karp.cpp | #include<iostream>
#include<string>
#define endl '\n'
using namespace std;
const long long BASE=31,MOD=1e9+7;
bool rabin_karp(string p, string s){
int n=(int) p.size(),m=(int) s.size();
long long hashP=0,pow=1;
for(int i=0;i<n;++i){
hashP=(hashP*BASE+p[i])%MOD;
pow=(pow*BASE)%MOD;
}... | ALGO | 0.99997 | 4.721947 |
314b6c45-2ba5-4b59-805c-b0e70d7de349 | Carl-1999/code_study | src/704search_2.cpp | /*
*
* @Author : Tianfeng Guo
* @Contact : <EMAIL>
* @Data : 2023-05-31 10:53
* 如果说定义 target 是在一个在左闭右开的区间里,也就是[left, right) ,那么二分法的边界处理方式则截然不同。
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int search(vector<int>& nums, int target) {
int left = 0;
in... | ALGO | 0.999952 | 5.6429 |
d21356e8-64cb-4a2c-8137-06f9f3dc4532 | yanyucc8/cpp-learning | learning_56.cpp | #include <iostream>
using namespace std;
/*
4.3.4 const修饰成员函数
1.常函数:
1.1 成员函数后加const后我们称为这个函数为常函数
1.2 常函数内不可以修改成员属性
1.3 成员属性声明时加关键字mutable后,在常函数中依然可以修改
2.常对象:
2.1 声明对象前加const称该对象为常对象
2.2 常对象只能调用常函数
*/
class Person
{
public:
int m_A;
mutable int m_B; //mutable修饰属性,在常函数中也可以修改
Person... | TOOL | 0.976451 | 4.566178 |
db9ffcb6-1856-44a0-91bc-2de1c87a8957 | Karansingh1221/DSA | 3461-find-the-minimum-area-to-cover-all-ones-i/find-the-minimum-area-to-cover-all-ones-i.cpp | class Solution {
public:
int minimumArea(vector<vector<int>>& grid) {
atexit(+[](){ofstream("display_runtime.txt") << 0 << '\n';});
int m=grid.size();
int n=grid[0].size();
int row1=m,row2=0,col1=n,col2=0;
bool flag=false;
for(int i=0;i<m;i++){
for(int j=0... | ALGO | 0.999794 | 6.151917 |
7004f872-33fb-4eb5-b5a0-2f6a3c79679e | Markz2z/Fuck-the-Leetcode | 33-Search-In-Rotated-Sorted-Array.cpp | class Solution {
public:
int binary_search(vector<int>& nums, int target, int start, int end) {
int idx = -1;
if (end - start == 1) {
return nums[start] == target ? start : -1;
}
while (end > start) {
int halfIdx = start + (end - start) / 2;
int ha... | ALGO | 0.999995 | 6.139634 |
dbeeda9f-a7b9-4457-a516-670724346fec | wuvei/algorithm | Algorithm/cpp/1779.FindNearestPointThatHastheSameXorYCoordinate/nearestValidPoint.cpp | class Solution {
public:
int nearestValidPoint(int x, int y, vector<vector<int>>& points) {
int ans = -1, dis = INT_MAX;
for (int i = 0; i < points.size(); ++i) {
int t = -1;
if (points[i][0] == x) {
t = std::abs(y - points[i][1]);
}
el... | ALGO | 0.999982 | 5.981996 |
716e01ad-a4f4-4c84-bab6-e46a217df30c | somnath-saha/silver-parakeet | g questions/g1 longest_inc_subarray/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int longIncSubarray(vector<int> a)
{
if(a.size()==0) {
return 0;
}
int res = 1, retVal=1;
for(int i = 1; i<a.size(); i++) {
if(a[i]>a[i-1]) {
res++;
}
else if(res>1) {
retVal = std::max(r... | ALGO | 0.999481 | 4.581162 |
0d3436fa-3dfa-480b-81d9-aeb4a7eeb7f6 | joswinemmanuel/Abdul-Bari-DSA-C-Cpp | S07_113_Array_Operations_Sorting_Demo.cpp | #include<stdio.h>
#include<stdlib.h>
struct Array
{
int A[10];
int size;
int length;
};
void Display(struct Array arr)
{
int i;
printf("\nElements are\n");
for(i=0;i<arr.length;i++)
printf("%d ",arr.A[i]);
}
int isSorted(struct Array arr)
{
int i;
for(i=0;i<arr.length-1;i++)
... | ALGO | 0.99433 | 4.268128 |
d441d9f2-830f-41c8-936a-db963670b82c | manmarru/CodingTest | CodingTest/Q/2775 부녀회장이 될 테야.cpp | #include "pch.h"
#include "Header.h"
void Solve(ifstream* _pLoadStream)
{
/*
k nȣ
k-1 1ȣ nȣ ֹε ոŭ ƾ Ѵ.
0 nȣ n .
ù Է¿ ̽ , ״ k, n Է
߿ ȭ Ǫ
*/
int iInput(0);
int iFloor(0), iDoor(0);
*_pLoadStream >> iInput;
for (int i = 0; i < iInput; ++i)
{
*_pLoadStream >> iFloor >> iDoor;
if (iDoor == 1)
... | ALGO | 0.999433 | 4.440879 |
39474015-75d1-4a0b-b9c4-278248e0cf69 | BeyondTrust/pbis-open | openldap/servers/slapd/back-ndb/modify.cpp | /* modify.cpp - ndb backend modify routine */
/* $OpenLDAP: pkg/ldap/servers/slapd/back-ndb/modify.cpp,v <IP_ADDRESS> 2009/02/05 19:35:54 quanah Exp $ */
/* ACKNOWLEDGEMENTS:
* This work was initially developed by Howard Chu for inclusion
* in OpenLDAP Software. This work was sponsored by MySQL.
*/
#include "porta... | TOOL | 0.970344 | 4.882739 |
de4044bf-8b2b-498f-955a-dfa2c37f4c9e | chatzialex/citylab_project | robot_patrol/src/direction_service.cpp | #include "rclcpp/node.hpp"
#include "rclcpp/rclcpp.hpp"
#include "rclcpp/service.hpp"
#include "robot_patrol/srv/detail/get_direction__builder.hpp"
#include "robot_patrol/srv/get_direction.hpp"
#include <algorithm>
#include <functional>
#include <iterator>
#include <memory>
#include <numeric>
using GetDirection = robo... | TOOL | 0.858784 | 7.290174 |
7c8c5809-a5fa-4a6a-9b0d-4b56316ca3e0 | foodotbar/leetcode2 | 404.Sum-of-Left-Leaves.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int sumOfLeftLeaves(TreeNode* root) {
if(!root||!root->left&&!root->right)
... | ALGO | 0.999901 | 6.367665 |
c9323df1-e9f2-41ea-8ef8-b2b1a276039f | AlvaroArizu/Cpp | Modelos 1er Parcial /Resueltos /rally.cpp | Una organización de Rally en la Argentina, desea organizar los resultados del año 2020.
Para ello cuenta con datos de:
10 (diez) camionetas 4x4 (con números identificatorios de entre 500 y 1200) y
5 (cinco) etapas (codificados del 0 al 4).
*/
#include <stdio.h>
#include <iostream>
#include <conio.h>
#include <ioman... | TOOL | 0.987101 | 3.204247 |
400699f3-af62-4c63-8c33-3c3192f08ce1 | kaustubh0777/DSA_Redefined | arrays/medium/stockbuysell.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,in;
cin>>n;
vector<int>v;
for(int i=0;i<n;i++)
{
cin>>in;
v.push_back(in);
}
int minp=INT_MAX;
int maxpro=INT_MIN;
for(int i=0;i<n;i++)
{
minp=min(v[i],minp);
maxpro=max(maxpro,v[i]-minp);
... | ALGO | 0.999615 | 3.927429 |
b28c580b-46b4-4448-b206-aff5c1e9594b | dreamhighcodestar/coin | src/rpc/blockchain.cpp | #include <rpc/blockchain.h>
#include <amount.h>
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
#include <coins.h>
#include <consensus/validation.h>
#include <core_io.h>
#include <hash.h>
#include <index/blockfilterindex.h>
#include <node/coinstats.h>
#include <node/context.h>
#include <node/utxo_... | WEB | 0.944621 | 6.347803 |
ec5d8f39-b677-4924-bb3b-f39316519999 | devedu-AI/Data-Structures-and-Algorithms-in-Cpp-Mayank-Arora | 014 - Sorting/countsortonstrings.cpp | class Solution{
public:
string countSort(string arr){
int n = arr.length();
int count[27] = {0};
for(int i = 0; i < n; i++)
{
count[int(arr[i]) - 97]++;
}
for(int i = 1; i < 27; i++)
{
count[i] = count[i - 1] + count[i];
... | ALGO | 0.99998 | 5.451077 |
21043290-cf3e-4d87-8074-5d038a11cb0a | harnitsoni28/C-Plus-Plus-Learning | Coding Ninjas C++/OneToN.cpp | #include <iostream>
using namespace std;
int main(){
int n ;
cout<<"Enter the no."<<endl;
cin>>n;
for(int i=1; i<=n; ++i){
cout<<i<<endl;
}
return 0;
} | ALGO | 0.975318 | 3.239976 |
09b1b3ea-634a-4106-80a7-f5499b6448ed | abhay-byte/DSA_Practice | CB/LEC8/1_array_introduction.cpp | #include<iostream>
using namespace std;
int main(){
int arr[5];
cout << endl << sizeof(arr) << endl;
char str[5];
cout << sizeof(str) << endl;
double bbr[5];
cout << sizeof(bbr) << endl;
//assigning value to arr
for(int i = 1; i <= 5; i++)
{
arr[i] = i;
cout << a... | ALGO | 0.941882 | 3.449325 |
dc14fbbe-b9e7-45db-91e8-9d3686294d0e | NagarjunA2223/CSA0697-Design-And-Analysis-Algorithm | armstrong (1).cpp | #include <stdio.h>
#include <math.h>
int isArmstrong(int num) {
int originalNum, remainder, n = 0;
double result = 0.0;
originalNum = num;
// Count the number of digits
for (originalNum = num; originalNum != 0; ++n) {
originalNum /= 10;
}
originalNum = num;
// Calculate the ... | ALGO | 0.999845 | 5.491533 |
715f9859-653b-430f-93f7-26979ef9ca6a | pigeonsL/LeetCode | 102_levelOrder.cpp | #include <iostream>
#include <vector>
#include <queue>
/*给定一个二叉树,返回其按层次遍历的节点值。 (即逐层地,从左到右访问所有节点)。 */
using namespace std;
//Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
... | ALGO | 0.999935 | 5.111728 |
556c454e-bf99-4c53-8544-4e4ba0a217e3 | sanyache/lecture_c | binsearch/bin_search_rec.cpp | #include<iostream>
#include<vector>
using namespace std;
int bin_search(const vector<int> &A, int x, int left=0, int right=-2){
right = (right != -2) ? right : (A.size()-1);
if (right >= left){
int mid = (left + right)/2;
if (A[mid] == x) return mid;
if (x < A[mid]) {
bin_... | ALGO | 0.999722 | 5.467076 |
ef698cea-8fc6-4c38-9f76-af8bb5ae98cc | IlRomanenko/MemHawk | source/memhawk/tests/benchmarks/bench_algo.cpp | #include "impl/algo.h"
#include "impl/config.h"
#include <absl/types/span.h>
#include <benchmark/benchmark.h>
#include <cstdint>
#include <cstring>
#include <string_view>
void SetUpData(std::string_view input, void** output)
{
for (size_t i = 0; i < input.size(); i++)
{
output[i] = reinterpret_cast<v... | TEST | 0.964001 | 7.160824 |
182cedfe-6e66-4047-83d2-6bde56a1b7df | ishandutta2007/codeforces | physics0523/normal/1646/A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while(t>0){
t--;
long long n,s;
cin >> n >> s;
long long st=0,fi=n+1;
while(st<=fi){
long long te=(st+fi)/2;
long long rem=(n+1)-te;
long long l=n*n*... | ALGO | 0.999808 | 3.546309 |
cbbcbb1c-1ccc-40d8-9a35-cf968cafaaa0 | Geant-RnD/GeantExascalePilot | source/Geant/cuts/src/Spline.cpp | /**
* @file Geant/cuts/src/Spline.cpp
* @brief Originated in the GeantV project
*/
//===----------------------------------------------------------------------===//
#include "Geant/cuts/Spline.hpp"
#include <cstdlib>
#include <algorithm> //lower_bound
namespace geantx {
inline namespace GEANT_IMPL_NAMESPACE {
// ... | ALGO | 0.996755 | 6.660081 |
d4625b58-38f5-4e1d-bf7c-45f03d0f2d55 | ujjwalkapil09/Leetcode2022 | 1920-build-array-from-permutation/1920-build-array-from-permutation.cpp | class Solution {
public:
vector<int> buildArray(vector<int>& nums) {
vector<int> ans;
for(int i=0;i<nums.size();i++){
ans.push_back(nums[nums[i]]);
}
return ans;
}
}; | ALGO | 0.999992 | 5.664851 |
b7a6931b-5a9e-4102-984f-3de222c1fd29 | Electr0Gunner/PvZ-Quality-of-the-Lawn-Decompile | Debug/src/compression/unbalz.cpp | // original code by ilia muraviev
// modifications for implementing it as memory2memory decompression only by Luigi Auriemma
// balz.cpp is in the public domain
#define _CRT_DISABLE_PERFCRIT_LOCKS // for vc8 and later
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// common data types
typedef unsigned cha... | ALGO | 0.998033 | 5.189954 |
d785819a-f69d-45a0-ab0a-17a2c26507b4 | IntelLabs/c3-llvm | libc/src/math/generic/llrint.cpp | #include "src/math/llrint.h"
#include "src/__support/FPUtil/NearestIntegerOperations.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(long long, llrint, (double x)) {
return fputil::round_to_signed_integer_using_current_rounding_mode<double,
... | TOOL | 0.998183 | 6.187697 |
6879b17e-9999-4d66-a225-cc89ead5a0ab | Aadarshg087/competitive-programming | CodeChef/June 2022/ATM2.cpp | /* There is an ATM machine. Initially, it contains a total of KK units of money. NN people (numbered 11 through NN) want to withdraw money; for each valid ii, the ii-th person wants to withdraw A_iA
i units of money.
The people come in and try to withdraw money one by one, in the increasing order of their indices. Wh... | ALGO | 0.999918 | 3.059916 |
4f1adc74-4cec-49db-b914-2211c57cbc4d | Despention/App_design_patterns | week1/lab1.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Employee {
protected:
string name;
int employeeId;
string position;
public:
Employee(string name, int employeeId, string position) : name(name), employeeId(employeeId), position(position) {}
virtual double calcula... | TOOL | 0.974538 | 4.91844 |
9c94f8c2-538b-47ea-b39e-adf376d4ca65 | 11223uhh/Stm32_Deploy_AI | Example/opencv/图像腐蚀/实验13 TFT LCD显示实验/opencv/cvaux/src/cvcorrimages.cpp | #include "_cvaux.h"
//#include "cvtypes.h"
//#include <float.h>
//#include <limits.h>
//#include "cv.h"
//#include "highgui.h"
#include <stdio.h>
/* Valery Mosyagin */
/* ===== Function for find corresponding between images ===== */
/* Create feature points on image and return number of them. Array points fills by ... | ALGO | 0.972762 | 3.533464 |
a56c5377-d27a-4aa8-ab0b-df6721d74fd6 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2877_4.cpp | #include <bits/stdc++.h>
using namespace std;
int vis[10000];
int colour[10000];
vector<int> adj[10000];
int ans = 0;
void dfs(int N, int clr) {
stack<int> S;
S.push(N);
if (colour[N] != clr) {
ans++;
}
while (!S.empty()) {
int u = S.top();
S.pop();
int l = adj[u].size();
for (int i = 0; i... | ALGO | 0.999676 | 3.865152 |
c35c0e9e-89bd-4455-9420-fc8067dccb83 | cmu-ci-lab/mitsuba_clt | src/libcore/spline.cpp | #include <mitsuba/core/spline.h>
MTS_NAMESPACE_BEGIN
Float evalCubicInterp1D(Float x, const Float *values, size_t size, Float min, Float max, bool extrapolate) {
/* Give up when given an out-of-range or NaN argument */
if (!(x >= min && x <= max) && !extrapolate)
return 0.0f;
/* Transform 'x' so that knots lie ... | ALGO | 0.999794 | 7.491416 |
43042da9-7768-42dc-8b6a-08c5f34ae8df | raj607-dev/Repository-7 | Bloom.cpp | struct Seed {
int p;
int g;
};
class Solution {
public:
int earliestFullBloom(vector<int>& plantTime, vector<int>& growTime) {
int ans = 0;
int time = 0;
vector<Seed> seeds;
for (int i = 0; i < plantTime.size(); ++i)
seeds.emplace_back(plantTime[i], growTime[i]);
ranges::sort(seeds, ... | ALGO | 0.99994 | 6.417122 |
daf8f90d-4452-456e-9a10-4c93bb5e4d98 | dbsrjs/UnReal_Lecture | 07.28/square/square1.cpp | #include <iostream>
using namespace std;
int getExp(int base, int exp) {
int value = 1;
for (int n = 0; n < exp; n++)
value *= base;
return value;
}
int main() {
int v = getExp(2, 3);
cout << "2의 3승은 " << v << "입니다." << endl;
int e = -getExp(2, -3);
cout << "2의 -3승은 " << e << "입니다." << endl;
}
| ALGO | 0.998389 | 4.191809 |
cca5b271-4855-4684-99d5-c1a9289b9f9d | chendawei/MyLeetCode | RotateList/main.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *rotateRight(ListNode *head, int k) {
if (head == NULL) return NULL;
if (k == 0) return head;
... | ALGO | 0.99998 | 5.722097 |
3153164d-b242-4ec1-92ac-129c984594b4 | Aydhiny/FIT-Faculty-Work | other/Personal Coding Challenges/LeetCode Practices/sum 2 vectors.cpp | #include <iostream>
#include <vector>
const char* crt = "-------------------------------\n";
using namespace std;
void Ispis(vector<int>& v)
{
for (size_t i = 0; i < v.size(); i++)
{
cout << v[i] << " | ";
}
cout << endl;
}
int main()
{
vector <int> v1 = {1,2,3,4,5,6,10};
vector <int> v2 = {4,6,8,3,1,2,25};... | ALGO | 0.99407 | 4.52563 |
cb9d1df7-c5de-47ec-a975-287d325062ea | DNS/Cafu | ExtLibs/bullet/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp | #include "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCompoundShape.h"
#include "BulletCollision/BroadphaseCollision/btDbvt.h"
#include "LinearMath/btIDebugDraw.h"
#include "LinearMath/btAa... | ALGO | 0.999284 | 6.772989 |
81c9ab42-370f-4c12-a86a-692c0f3977d6 | gahara086/AtCorderPromblems-BootCampForBeginners | Medium100/23.cpp | #include <bits/stdc++.h>
#include <algorithm>
#include <cmath> // abs() for float, and fabs()
#include <cstdlib> // abs() for integer
#include <iostream>
#include <string>
using namespace std;
bool debug_flag = true;
void logint1(int n) {
if (debug_flag) cout << "arg_1 = " << n << endl;
}
void logint2(int n... | ALGO | 0.999989 | 4.093541 |
d7f84049-f60f-4c42-b614-da268ac6437d | johanvdw/SAGA-gis-git-mirror | saga-gis/src/tools/shapes/shapes_points/select_points.cpp | //---------------------------------------------------------
#include "select_points.h"
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//-------------------------------------------------... | TOOL | 0.911084 | 6.032281 |
1af7d009-b30e-468e-ae02-4f6e36ce2618 | hemant-45/Coding-Interview-Questions | Maximum-Sum-Of-K.cpp | // Given an array of integers of size ‘n’.
// Our aim is to calculate the maximum sum of ‘k’
// consecutive elements in the array.
// https://www.geeksforgeeks.org/window-sliding-technique/
// Sliding Window Technique
#include<bits/stdc++.h>
using namespace std;
int maxSum(int *a, int n, int k){
int max_sum = 0;
... | ALGO | 0.999405 | 4.88334 |
15ee4536-4551-4c5f-89c1-dc54382d1e06 | ishandutta2007/codeforces | yzyyy1x/normal/1592/C.cpp | #include <bits/stdc++.h>
#define pii pair<int,int>
#define fi first
#define sc second
#define pb push_back
#define ll long long
#define trav(v, x) for(auto v:x)
#define VI vector<int>
#define VLL vector<ll>
//define double long double
#define all(x) (x).begin(),(x).end()
using namespace std;
const double eps = 1e-10;//... | ALGO | 0.999987 | 4.878032 |
0b7eb67e-b7b5-49dc-93f8-4da17e42b46b | its-AbhaySahani/Data-Structures-and-Algorithms | Important Questions/Trapping-rain-water.cpp | // 42 leetcode - Two pointer approach
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int trap(vector<int>& height) {
int left = 0, right = height.size() - 1;
int leftMax = 0, rightMax = 0;
int result = 0;
while (left < right) {
if (h... | ALGO | 0.999999 | 7.55811 |
4c23a73b-8aa3-4805-87d9-85f1fe371f06 | invariantfields/Active_particles-LAMMPS | src/ASPHERE/pair_gayberne.cpp | /* ----------------------------------------------------------------------
Contributing author: Mike Brown (SNL)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_gayberne.h"
#include "math_extra.h"... | ALGO | 0.998339 | 6.27499 |
1079c3b2-e6e4-4299-af62-e1e03b906095 | priyanshuanandd/Code_Submissions | StringChallenge81.cpp | #include <bits/stdc++.h>
using namespace std;
int canBeFormedOrNot(string s1, string s2)
{
map<char, int> mainmap;
map<char, int> sub;
for (auto &i : s1)
{
mainmap[i]++;
}
for (auto &i : s2)
{
sub[i]++;
}
for (auto i : sub)
{
if (mainmap[i.first] < i.seco... | ALGO | 0.999991 | 4.963224 |
5c7a8a3e-51f3-4504-8e38-c9ef9fcc02d2 | abdirakhman/Olymp | Math and Code/Summer Elimination/K/main.cpp | /**
SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAj... | ALGO | 0.999928 | 3.320022 |
e9a01ece-c306-4ac2-b748-0b3294c2f4d7 | Shweta2762/LeetCode | 2-add-two-numbers/2-add-two-numbers.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbe... | ALGO | 0.999926 | 6.187682 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.