uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
fd66fda5-bb66-4a26-96ae-39a6171dff52 | Sachin4115/dsalgo | DP/Level_2/LongestCommonSubSequence.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
string s,p;
cin>>s>>p;
int n = s.length(),m=p.length();
vector<vector<int>>dp(n+1,vector<int>(m+1,0));
for(int i=1;i<=n;i++) dp[i][0]=0;
for(int i=0;i<=m;i++) dp[0][i]=0;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;... | ALGO | 0.9999 | 4.093499 |
10f4ac16-d581-455b-b667-4836954339f8 | Forrest-Z/Multi_Sensor_Fusion_for_Localization | localize/fast_gicp/thirdparty/Eigen/doc/snippets/MatrixBase_all.cpp | Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones());
Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs();
// let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax:
cout << "Is (" << p0.transpose() << ") inside the box: "
<< ((boxMin.array()<p0.array(... | ALGO | 0.983786 | 3.51303 |
a0a71a65-5c3e-45e7-ad84-54fcae268486 | bitcoin-cored/bitcoin-cored | src/cashaddr.cpp | #include "cashaddr.h"
namespace {
typedef std::vector<uint8_t> data;
/**
* The cashaddr character set for encoding.
*/
const char *CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
/**
* The cashaddr character set for decoding.
*/
const int8_t CHARSET_REV[128] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,... | ALGO | 0.972975 | 7.37803 |
46f71cb8-b673-4feb-a040-711d90fa753c | engrsakib/code-forces-daily-stack | 2025/February/09 contest/E_Skibidus_and_Rizz.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, m, k;
cin >> n >> m >> k;
if (k > max(n, m)) {
cout << "-1\n";
return;
}
string s;
// প্রথমে k সংখ্যক 0 বা 1 বসাই, যেটা বেশি সেটাকে আগে রাখি
if (n > m) {
for (int i = 0; i < k; i++) {
... | ALGO | 0.999908 | 5.549478 |
1fc3a438-b042-48ce-9898-0821ab71c3a7 | chenchen-cs/AcWingBasicAlgorithm | 1.基础算法/最长连续不重复子序列(双指针).cpp | #include <iostream>
using namespace std;
int n;
int a[1010];
int main()
{
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
int res = 0;
for (int i = 1; i <= n; i++)
for (int j = i + 1; j <= n; j++)
if (a[j] > a[j - 1])
res = max(res, j - i + 1);
... | ALGO | 0.999246 | 3.958267 |
d2089e3c-d17e-42ae-8c90-14d6324cd155 | TaniaAAAAAAA/- | laba_2/ЗАВ_2/Unit1.cpp | //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include<math.h>
#include<stdlib.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//----... | ALGO | 0.964457 | 3.248195 |
d822c6c6-dd8c-48e2-b145-2a8fbcf177a8 | nirajpatil2005/CPP | ARRAY/1D ARRAY/Array II/vector/6.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void display(vector<int> &v)
{
for (int i = 0; i < v.size(); i++)
{
cout << v[i] << " ";
}
}
int main()
{
int n;
vector<int> v;
cout << "enter size of array:";
cin >> n;
cout << "enter element of arra... | ALGO | 0.999112 | 4.151672 |
797b8077-6cc9-4670-a1ec-09cb5cd04cc7 | ishandutta2007/codeforces | xuanquang1999/normal/767/A.cpp | //84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define ft... | ALGO | 0.999975 | 3.639632 |
40ee2e7d-fc8e-444e-b26a-260ab62eea55 | Lydxn/Competitive-Programming | DMOJ/graph2p2.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef pair<int, ll> pill;
typedef pair<pa... | ALGO | 0.999921 | 4.20101 |
139e6809-9b72-4525-bc8f-6252819c7749 | Portgas-D-Asce/DesignPattern | chain_of_responsibility.cpp | #include <iostream>
#include <string>
using namespace std;
class IHandler {
private:
// 下一个处理人
IHandler* _next;
public:
explicit IHandler(IHandler* next) : _next(next) {}
virtual ~IHandler() = default;
// 判断是否由自己处理
virtual bool pred(const string& event) = 0;
// 处理请求
virtual void deal(... | ALGO | 0.988812 | 4.707718 |
6a122eb0-f2b3-4564-a9d8-b29b1cb46dea | dhnesh12/codechef-solutions | 04-CodeChef-Hard/327--Attack of the Clones.cpp | #include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld=long double;
const ld eps=1e-9;
#define WHATS(var)// cout<<__LINE__<<' '<<#var<<"="<<var<<endl;
template<class S, class T> ostream& operator <<(ostream &os, const pair<S, T> v){
os <... | ALGO | 0.999948 | 4.742831 |
41e01309-e77a-416d-a735-69268a2a5cab | AnnaKudr/infAnn | Поиск в массиве рядом стоящих пар одинаковых значений.cpp | // Поиск в массиве рядом стоящих пар одинаковых значений.cpp
// Поиск Х в массиве.cpp
#include <iostream>
#include <ctime>
using namespace std;
void masRand(int* a, int p) {
srand(time(NULL));
for (int i = 0; i < p; i++) {
a[i] = rand() % 6;
cout << a[i] << " ";
}
cout << "\n";
}
void... | ALGO | 0.998903 | 3.601738 |
d7d9c239-4a3e-4b6b-8dae-dae332554aad | QinHongZhe/hongzhe-leetcode | solution/1500-1599/1558.Minimum Numbers of Function Calls to Make Target Array/Solution.cpp | class Solution {
public:
int minOperations(vector<int>& nums) {
int ans = 0;
int mx = 0;
for (int v : nums)
{
mx = max(mx, v);
ans += __builtin_popcount(v);
}
if (mx) ans += 31 - __builtin_clz(mx);
return ans;
}
}; | ALGO | 0.999956 | 6.158409 |
7bc6d7e7-adf9-4274-a06a-b50646452418 | CTSRD-CHERI/llvm | lib/Analysis/IntervalPartition.cpp | #include "llvm/Analysis/IntervalPartition.h"
#include "llvm/Analysis/Interval.h"
#include "llvm/Analysis/IntervalIterator.h"
#include "llvm/Pass.h"
#include <cassert>
#include <utility>
using namespace llvm;
char IntervalPartition::ID = 0;
INITIALIZE_PASS(IntervalPartition, "intervals",
"Interval Par... | ALGO | 0.959661 | 7.577348 |
a2b92051-9fe0-42aa-8089-c1dcf9cb5ba6 | jessyoon14/leetcode | 117.populating-next-right-pointers-in-each-node-ii.cpp | /*
* @lc app=leetcode id=117 lang=cpp
*
* [117] Populating Next Right Pointers in Each Node II
*/
// @lc code=start
/*
// Definition for a Node.
class Node {
public:
int val;
Node* left;
Node* right;
Node* next;
Node() : val(0), left(NULL), right(NULL), next(NULL) {}
Node(int _val) : val(... | ALGO | 0.999691 | 6.189032 |
eed40dc7-f677-48bd-b77a-82cb656569df | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/july/temp_20200708003737.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#include<unordered_map>
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ... | ALGO | 0.999979 | 3.83893 |
45a784e7-bdff-4591-b8f4-ce0505379d54 | shivam-singh084/leetcode | 0039-combination-sum/0039-combination-sum.cpp | class Solution {
public:
void solve(int ind, int target, vector<int> &arr, vector<vector<int>> &ans, vector<int> &ds){
if(ind == arr.size()){
if(target == 0){
ans.push_back(ds);
}
return;
}
// pick up the element
if(arr[ind] <= ... | ALGO | 0.99998 | 6.618723 |
eeec524f-2e67-43b2-a72c-4d7ceafeee47 | jaiverma/experiments | recursion/factorial.cpp | #include <iostream>
#include <unordered_map>
#include <iomanip>
// __int128 is a gcc extension
// allow __int128 to work with cout
typedef unsigned __int128 __uint128;
std::ostream &operator<<(std::ostream &os, __uint128 x) {
std::string s;
while (x > 0) {
s = std::to_string((unsigned int)(x % 10)) + ... | ALGO | 0.999616 | 5.481301 |
5aede04d-c70b-4fc4-9791-1b1b397236da | gmargari/wumpus | tools/stuff/mergecompressed.cpp | #include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "../index/index_compression.h"
int main(int argc, char **argv) {
assert(argc == 2);
int N = atoi(argv[1]);
offset *first = new offset[N];
offset *second = new offset[N];
offset current = 23;
for (int i = 0; i < N; i++) {
current += random() % ... | TEST | 0.980193 | 4.2968 |
8857f6c3-e10d-4238-a61d-8669b1ac80f3 | rashmi-thakurr/DSA-LeetCode | Transitive closure of a Graph - GFG/transitive-closure-of-a-graph.cpp | // { Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// Back-end complete function Template for C++
class Solution{
public:
void dfs(vector<vector<int>> graph, vector<int> &vis, int i,int n){
vis[i]=1;
for(int j=0;j<n;j++){
... | ALGO | 0.999968 | 6.391651 |
9078adb9-d54d-40b1-9f60-0cc1afac98db | oiu850714/leetcode2022 | 474-ones-and-zeroes.cpp | #include "headers.hpp"
class Solution {
public:
int findMaxForm(std::vector<std::string> &strs, int m, int n) {}
}; | ALGO | 0.998809 | 6.291624 |
1690f5aa-7019-4bd3-b224-db4e3de3e048 | Toufik-Islam/XPSC_Phitron | Week 6/Day 7/Return_the_Change.cpp | /*\~~~~~~~~~~~~~~~~~\
\ TOUFIK \
\ ISLAM \
\~~~~~~~~~~~~~~~~~\*/
#include <bits/stdc++.h>
using namespace std;
#define FastIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
int main()
{
FastIO;
int t... | ALGO | 0.999327 | 4.227583 |
a8369224-84ed-48fa-bf53-2e62a9e6c9e9 | dheeraj-2000/dsalgo | Leetcode problems/1539-kth-missing-ele.cpp | //leetcode
//1539
//kth missing element
class Solution {
public:
int findKthPositive(vector<int>& arr, int k) {
int s=0,e=arr.size()-1,m;
while(s<=e)
{
m=s+(e-s)/2;
if((arr[m]-(m+1))>=k)
e=m-1;
else
s=m+1; }
ret... | ALGO | 0.999948 | 4.82081 |
ae08274c-3cd1-4ddf-ab5c-cc35c782316c | lukoshkin/schlum_internship | spring_18/numerical/test.cpp | #include <utility>
#include <fstream>
#include <iostream>
#include "numerical.h"
constexpr double gamma = 2 * tau / dt,
eta = 2 * D * dt / h / h,
kappa = alpha * dt;
class Layers
{
int call_number;
int * queue;
double ** u;
double scheme (int);
std::pair<double,d... | ALGO | 0.999659 | 4.171145 |
38c100a4-4783-459e-a634-a395c11f06d7 | upadhysh/HackerEarth | 055_Faster than Flash--1 .cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int getCount(vector<int> &v,string s){
int ans=-1,pre=0;
for(int i=0;i<v.size();i++){
if(v[i]){
ans=max(i-pre+((s[i]==s[pre]&&i==pre+1)?0:1),ans);
pre=i;
}
}
ans=max... | ALGO | 0.99933 | 4.697418 |
e6099ce7-765c-438b-b8f7-c97ac1ddf230 | jakkanaga/MeshlessMethods-EFGM | Code/maxent-cpp-1.0/include/eigen/doc/snippets/EigenSolver_EigenSolver_MatrixType.cpp | MatrixXd A = MatrixXd::Random(6,6);
cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl;
EigenSolver<MatrixXd> es(A);
cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl;
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
complex<double> l... | ALGO | 0.999393 | 3.093769 |
d815c9db-0151-4dfd-aec7-f8a4a0ee53cd | ishandutta2007/codeforces | kude/normal/1438/D.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using ll = long long;
using P = ... | ALGO | 0.999915 | 3.341994 |
710b3aa1-68e9-4b39-aac9-3867d8697295 | pratyush2331/DSA_Love-Babbar | 16. DP/3. DP on Strings/X_2_WordBreakII.cpp | // 140. Word Break II
// LeetCode : https://leetcode.com/problems/word-break-ii/
#include<bits/stdc++.h>
using namespace std;
/*
TC : O(2^n)
*/
class Solution {
void solve(int i, string& curr, string& s, unordered_map<string,int>& mp, vector<string>& ans) {
if(i == s.length()) {
ans.push_back... | ALGO | 0.999678 | 5.904164 |
e0f7cee8-e5fc-4b6f-9520-e4f44e2bae8b | ArshiaP/coding | GFG/linked lists/IntersectionPointinYShappedLinkedLists.cpp | // https://practice.geeksforgeeks.org/problems/intersection-point-in-y-shapped-linked-lists/1/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// { Driver Code Starts
/* Link list Node */
struct Node {
int data;
struct Node* nex... | ALGO | 0.999881 | 4.337855 |
0e81364b-40c9-4a66-b592-e76102a94cd9 | Keybinhoainam/codecpp | old document/Order Statistics 1.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
long long n,k,x;
cin>>n>>k;
priority_queue<long long, vector<long long>,greater<long long> >q;
for(int i=0;i<n;i++)
{
cin>>x;
q.push(x);
}
for(int i=1;i<=k-1;i++)
{
q.pop();
}
cout<<q.top()<<endl;
}
... | ALGO | 0.999936 | 3.317284 |
ec7ae94c-ae98-4737-b63a-8ae46c0c64b5 | Quantum-HG/Battery-Reminder | libraries/sfml/examples/ftp/Ftp.cpp |
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Network.hpp>
#include <fstream>
#include <iostream>
////////////////////////////////////////////////////////////
/// Print a FTP response into a standard output stream
//... | TOOL | 0.857362 | 4.753062 |
30a9b72f-7064-4c5b-85b1-c015b07d3c39 | zim2510/Online-Judge-Solves | Codeforces/230A.cpp | #include <bits/stdc++.h>
using namespace std;
struct drgn
{
int pr, bns;
};
bool cmp(drgn a, drgn b)
{
if(a.pr != b.pr) return a.pr<b.pr;
else return a.bns>b.bns;
}
int main()
{
int s, n;
scanf("%d %d", &s, &n);
drgn drag[n];
for(int i = 0; i<n; i++){
scanf("%d %d", &drag[i].pr, ... | ALGO | 0.999941 | 3.522329 |
7677287d-5b58-43bf-a6fa-c8ed705d2746 | sarvex/leetcode-mini-kanren | solution/0400-0499/0484.Find Permutation/Solution.cpp | class Solution {
public:
vector<int> findPermutation(string s) {
int n = s.size();
vector<int> ans(n + 1);
iota(ans.begin(), ans.end(), 1);
int i = 0;
while (i < n) {
int j = i;
while (j < n && s[j] == 'D') {
++j;
}
... | ALGO | 0.999988 | 6.216721 |
b5873efb-9d79-44d5-afbb-98581b5b5336 | vincent-maillou/dphpc_sinv | src/dphpc_sinv/RGF_GPU/single_lesser_greater_retarded.cpp | void rgf_lesser_greater_retarded(
unsigned int blocksize,
unsigned int matrix_size,
complex_h *system_matrix_diagblk_h,
complex_h *system_matrix_upperblk_h,
complex_h *system_matrix_lowerblk_h,
complex_h *self_energy_lesser_diagblk_h,
complex_h *self_energy_lesser_upperblk_h,
complex_h *... | ALGO | 0.999887 | 3.079556 |
0494aef3-7208-4f44-9adb-f8b48c7f42cc | KamaruzzamanFahad/Algorithm-With-CPP | Algorithom_Week_02_Cycle_Detection_&_Dijkstra/MidTram_Assignment/Knight_Moves.cpp | #include<bits/stdc++.h>
using namespace std;
int n, m;
pair<int,int> king, queen;
bool visited[1000][1000];
vector<pair<int, int>> moves = {{-2, -1}, {-2, 1}, {2, -1},{2, 1},{-1, -2}, {-1, 2}, {1, -2}, {1, 2}};
bool valid(int i, int j){
if(i<0 || i>=n || j<0 || j>= m){
return false;
}
return true;
... | ALGO | 0.99998 | 5.191096 |
91623e4e-a409-4126-9ae2-d4a8d183f051 | AsifWatson/codeforces | C/527C.cpp | /***********************************************************|
| /\ /-------| ----- |-----------| |
| / \ / | | |
| / \ | | | |
| / \ |----| | |-------| |
| / -... | ALGO | 0.999069 | 3.400875 |
b9fe2bad-00f5-400f-bda7-44598200d241 | FernandB/PigeonCakes | externals/Box2D/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp | #include "Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h"
#include "Box2D/Common/b2BlockAllocator.h"
#include "Box2D/Dynamics/b2Fixture.h"
#include <new>
b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->All... | ALGO | 0.979003 | 7.229167 |
3449dfa0-dbe0-49ef-9292-193951702b1f | NullAwe/competitive-programming | cses/sorting-and-searching/MovieFestival.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
vector<vector<int>> movies(n, vector<int>(2));
for (int i = 0; i < n; ++i) cin >> movies[i][1] >> movies[i][0];
sort(movies.begin(), movies.end());
int end = 0, ans = 0;
for (int i = 0; i < movies.size(); ++i) {
if (movies[i][... | ALGO | 0.999931 | 5.049012 |
23fb4f69-5ad8-4fb3-bd79-857981ca720e | crbnrsthbst/kyopro | atcoder/problems/chosen100/bfs/28.cpp | // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_11_C&lang=ja
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n + 1); i++)
#define rep2(i, m, n) for (int i = (m); (i) < (int)(n); ++(i))
int main() {
int n... | ALGO | 0.999752 | 4.131934 |
8fe3e250-5153-4a64-ad4e-b1a997252075 | mahirlabibdihan/Codeforces-Solution | 476540D.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
void solve()
{
ll n;
cin >> n;
ll sum = 0;
for (int i = 0; i < n; i++)
{
int tmp;
cin >> tmp;
sum += tmp;
}
cout << (sum % n) * (n - (sum % n)) << endl;
}
int main()
{
int t;
cin... | ALGO | 0.999833 | 3.99182 |
f9fb3f57-515d-4edc-8855-d07fcb123e66 | musfiqurR661/Data_Structure_II_UIU | Recursion/sumOf_odd_even.cpp | #include<bits/stdc++.h>
using namespace std;
void sumODD_EVEN(int start, int end, int &evenSUm, int &oddSum)
{
if(start>end) return;
if(start%2==0)
evenSUm+=start;
else
oddSum+=start;
sumODD_EVEN(start+1, end, evenSUm, oddSum);
}
int main()
{
int start, end;
cin>> start >> end;
int evenSUm=0;
... | ALGO | 0.999969 | 4.679897 |
52f9ecb6-d85d-413c-90d3-ccd799d45a23 | KC-git-usr/LeetCode | 20. Valid Parentheses.cpp | class Solution {
public:
bool isValid(string s) {
stack<char> my_stack;
unordered_map<char, char> hash_map {
{')','('},
{'}','{'},
{']','['}
};
for(const char& bracket : s) {
// character is a closing bracket
if... | ALGO | 0.999773 | 6.904526 |
a976739e-5644-48f4-a64f-d55d93c90297 | abhinavaggarwal018/C-- | Paths from top to bottom of matrix.cpp | #include<iostream>
using namespace std;
int main()
{
int arr[100][100],n;
cin>>n;
arr[0][0]=1;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
{
if(j>0)
arr[i][j]+=arr[i][j-1];
if(i>0)
arr[i][j]+=arr[i-1][j];
}
cout<<"\n";
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
cout<<arr[i]... | ALGO | 0.999846 | 3.003636 |
32faa655-867d-4bdf-a096-af62923f3bdc | cpvrlab/SLProject4 | externals/libigl/include/igl/mod.cpp | template <typename DerivedA, typename DerivedB>
IGL_INLINE void igl::mod(
const Eigen::PlainObjectBase<DerivedA> & A,
const int base,
Eigen::PlainObjectBase<DerivedB> & B)
{
B.resizeLike(A);
for(int i = 0;i<A.rows();i++)
{
for(int j = 0;j<A.cols();j++)
{
B(i,j) = A(i,j)%base;
}
}
}
templ... | ALGO | 0.933578 | 3.537506 |
1fd2d1a7-8288-4439-88c2-498015365229 | kawserhamim/Leetcode | 0063-unique-paths-ii/0063-unique-paths-ii.cpp | class Solution {
public:
int hamim( int n, int m, vector<vector<int>> &dp, int i, int j,vector<vector<int>> & obstacleGrid) {
if(j >= m or i >= n)return 0 ;
if(i == n - 1 and j == m - 1)
{
if( obstacleGrid[i][j] == 1)
{
// cout<<i<<sp<<j<<endl;
return 0 ... | ALGO | 0.999869 | 5.654982 |
a371af45-b909-41ef-98f4-8876f5994789 | anshika2417/MCA_CPPDSA_2_CipherSchool | Heap/heap.cpp | /*
Heap (It is implemented using array)
Heap is a complete binary tree that comes with a heap order property
i.e., either max heap or min heap.
Indexing:
Left child: 2*(i)th index |
Right child: 2*i+1 | When indexing starts from 1
Left child: 2*i+1 |
Rig... | ALGO | 0.999887 | 5.164818 |
83842975-f349-4ca6-972c-fb6078c108c7 | arm/arm-toolchain | libcxx/test/std/ranges/range.adaptors/range.filter/iterator/increment.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// constexpr iterator& operator++();
// constexpr void operator++(int);
// constexpr iterator operator++(int) requires forward_range<V>;
#include <ranges>
#include <array>
#include <cassert>
#include <concepts>
#include <type_traits>
#include <utility>
#include "test_iterat... | TEST | 0.910435 | 7.683105 |
59e74b44-896e-4fad-9be5-f3ccabe88f91 | codelableidenvelux/attysclone | highpass.cpp | #include "highpass.h"
#include<qfont.h>
#include<stdio.h>
Highpass::Highpass(float _samplingrate, float cutoff) : QComboBox() {
frequency = cutoff;
samplingrate = _samplingrate;
dcValue = 0;
dcCtr = _samplingrate*10;
setMinimumWidth ( fontMetrics().width("1000Hz") );
addItem(tr("off"),-1);
addItem(tr("-DC")... | TOOL | 0.957885 | 5.02782 |
6dd2cadb-a59e-4026-a691-cc11a8672eac | sr42-dev/CPP-course | Grade XI/Classroom/prog_15 - Factorial.cpp | /* To find the factorial of a given nummber*/
#include <iostream.h>
void main()
{
double i, n, prod1=1;
cout<<"Enter the desired number"<<endl;
cin>>n;
for (i=1; i<=n; i++)
{
cout<<i<<" * ";
prod1 = prod1*i;
}
cout<<"\b\b = "<<prod1;
} | ALGO | 0.999662 | 3.201458 |
1340376a-7065-4121-8f65-936e92b9fd6f | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5333_11.cpp | #include <bits/stdc++.h>
using namespace std;
const long long P = 1e9 + 7;
const int N = 405, M = 10005;
const int INF = (1 << 30) - 1;
const double pi = acos(-1);
mt19937 rng(time(0));
struct edge {
int to, nxt;
int w, c;
} e[M];
int n1, n2, n, m, x, y, r, b, id[N];
int ans, S, T, S_, T_, i, tot = 1, head[N], d[N]... | ALGO | 0.999916 | 4.16466 |
d0b32097-4cfd-4227-8af0-aa06e59f3ff9 | mohamedaminebennacef/Problem-Solving | CodeForces/A - Way Too Long Words/A - Way Too Long Words.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
while(n--) {
string s;
cin >>s;
if (s.length()<=10) cout<<s<<endl;
else cout <<s[0]<<s.length()-2<<s[s.length()-1]<<endl;
}
return 0;
| ALGO | 0.998978 | 4.257466 |
51b6a494-9c19-4698-99f6-d03745bed4ec | OmarHariry/LeetCode | 0053-maximum-subarray/0053-maximum-subarray.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums) {
int sum = 0, maxSum = INT_MIN;
for(int i=0;i<nums.size();++i) {
if (sum < 0)
sum = 0;
sum += nums[i];
maxSum = max(maxSum, sum);
}
return maxSum;
}
}; | ALGO | 0.99997 | 6.297609 |
337f2687-b417-4e02-9c37-7f4a577de71e | samuelzq/code_for_OI_lesson | 060 DFS/P1030.cpp | /**
* https://www.luogu.com.cn/problem/P1030
*
* @File: P1030.cpp
* @Author: Lao Zhang <EMAIL>
* @Date: 2025-03-23
*
*/
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// 根据中序遍历和后序遍历构建二叉树
// inorder 是中序遍历的字符串
// postorder 是后序遍历的字符串
// inStart 是当前子树在中序遍历字符串中的起始索引
// inEnd 是当前子树在... | ALGO | 0.999994 | 5.245373 |
22281f22-0f2d-4861-9466-819859372892 | theshameem/LeetCode-Problems-Solutions | 0279-perfect-squares/0279-perfect-squares.cpp | class Solution {
public:
int numSquares(int n) {
int vis[n + 5];
memset(vis, 0, sizeof vis);
queue<pair<int, int>> Q;
Q.push({n, 0});
while(Q.size()){
auto [val, step] = Q.front();
Q.pop();
if(vis[val]) continue;
... | ALGO | 0.999962 | 5.531093 |
5d4090dc-c0e1-46ee-bcf7-f2993885df3d | syedtawqeer/C-basic-Codes-practice | profit or loss.cpp | #include<iostream>
using namespace std;
main()
{
double C,S,P,L;
cout<<"Enter cost price of an item: "<<endl ;
cin>>C ;
cout << "Enter Selling price of the same: "<< endl ;
cin>>S;
if(S>C)
{
P=S-C;
cout << "Seller made profit of Rs." <<P << endl ;
}
else if(C>S)
... | ALGO | 0.981317 | 3.572557 |
91678ac3-17c9-4bea-8de4-ff34eb0fce69 | raincross7/code-similarity | codes/train_code/problem241/problem241_455.cpp | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define ll long long
#define double long double
#define pi 3.141592653589
using namespace std;
ll n, ans = 1; ll a... | ALGO | 0.999992 | 3.485294 |
f5ed7ed2-0506-4fea-9062-ec776078f34e | alex-roh/Cpp_PS_Study | 86 - 조합 구하기 (선수지식, for문 안에서 일어나는 재귀호출)/main.cpp | #include <iostream>
#include <iterator>
using namespace std;
int n, r;
int combination[100];
void DFS(int startPos, int level)
{
if(level == r){
copy(combination, combination + r, ostream_iterator<int>(cout, " "));
cout << "\n";
return;
}
else {
for(int i = startPos; i < n; i++){
combination[level] = i... | ALGO | 0.999755 | 3.666614 |
a67f2811-2cc7-4c71-af84-ea9ea41d5143 | Nabin-09/Data_Structures_and_Algorithms | 9-Recursion/Introduction/9_Palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
bool Palindrome_String(string s, int i, int len) {
if (i >= len / 2) { // Base case: reached the middle of the string
return true;
}
if (s[i] != s[len - 1 - i]) { // Characters don't match
return false;
}
return Palindrome_String(s, i + ... | ALGO | 0.997096 | 5.776062 |
632a7ddb-4864-46cb-b558-c6c48c52cc7e | Praneeth-22/Problem-Solving---Leet-code | Linked List/328. Odd Even Linked List.cpp | //328. Odd Even Linked List
//Solved
//Medium
//Topics
//Companies
//Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list.
//
//The first node is considered odd, and the second node is even, and so on.
//
//Note that... | ALGO | 0.999928 | 6.005573 |
50d00394-58d0-4c33-b43e-18294a383c91 | AbdelrahmanShaheen/Algoritms | Recursion/Taylor_Series.cpp | #include<iostream>
using namespace std;
//Taylor Series : e^x --> 1 + ((x^1)/1) + ((x^2)/2!) + ((x^3)/3!) + ((x^4)/4!)+......+n terms.
double e(int x, int n) //first approach
{
static double p=1,f=1;
double r;
if(n==0)
return 1;
r=e(x,n-1);
p=p*x;
f=f*n;
return r+p/f;
}
//e^x : 1 + (x/1)*[1 + (x/2)*[1 + (x/3... | ALGO | 0.999988 | 5.066273 |
b424d379-d0a8-4b08-8a2e-dadd35e159cd | codershenglinli/cpp_learning | cpp_ice/Chapter4Recursion/3.2.cpp | #include<iostream>
using namespace std;
int main(){
int m,n;
cin>>m>>n;
int num = 0;
for(int i=m;i<=n;i++){
bool flag = true;
for(int j=2;j<i;j++){
if (i%j==0) flag = false;
}
if (i==1) flag = false;
if (flag == true) num++;
}
cout <<num;
... | ALGO | 0.999961 | 4.049067 |
634a198e-0917-49b2-a429-3d23b8df899c | parsa/blaze | blazetest/src/mathtest/operations/dmatdmatmin/SDaMDb.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | TEST | 0.88857 | 7.407263 |
ccbc47fc-038b-41e8-b13c-2a5ee9875620 | jcsantos44/SistemasInteligentes | Genetic/chromossome.cpp | #include "chromossome.h"
bool operator<(const Chromossome &c1, const Chromossome &c2)
{
return c1.fitness < c2.fitness;
}
Chromossome::Chromossome()
{
}
Chromossome::Chromossome(int x1, int y1, int r1, int x2, int y2, int r2, int x3, int y3, int r3)
{
this->x1 = x1;
this->y1 = y1;
this->r1 = r1;
... | ALGO | 0.995938 | 4.611499 |
b1513d4b-a950-450c-a82c-216a14bc100a | ArionDas/Leetcode_Solutions | 1765-merge-in-between-linked-lists/merge-in-between-linked-lists.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* mergeInBetw... | ALGO | 0.999966 | 4.882915 |
dbd578ed-e390-4d97-be43-1c7dc5a61954 | ishandutta2007/codeforces | abc864197532/normal/1682/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
void abc() {cout << endl;}
template <typename T, t... | ALGO | 0.9999 | 3.84662 |
c7ccbade-d0bc-42e2-b034-7c03c3e97b66 | Cgfyufsygsm/OI-Codes | Luogu/P2224.cpp | #include <cstdio>
#include <cctype>
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define DEC(i, a, b) for (int i = a; i >= b; --i)
int read()
{
int ret = 0; int rev = 0;
char c = getchar();
while (!isdigit(c))
rev |= (c == '-'), c = getchar();
while (isdigit(c))
ret = 10 * ret + c ... | ALGO | 0.999952 | 3.785534 |
2bb6d10d-c8b7-4bcf-bae8-c71dd87bbdc8 | ritiksaxena124/Datastructures-and-Algorithms | Questions/5. Recursion/Strings/ReverseString.cpp | // https://www.codingninjas.com/codestudio/problems/reverse-the-string_799927?leftPanelTab=0&utm_source=youtube&utm_medium=affiliate&utm_campaign=love_babbar_13
#include <iostream>
using namespace std;
void reverse(string &s, int i)
{
// base case
int n = s.length();
if (i > n / 2)
{
return;
... | ALGO | 0.999903 | 6.298917 |
bb0e17c5-e7cb-4a5a-9925-04fcf337c713 | minutazos/trade | src/Bot.cpp | /*
** EPITECH PROJECT, 2021
** Trade
** File description:
** Trading bot implementation
*/
#include "Bot.h"
Bot::Bot()
{
this->wallet = new Wallet((double) this->settings.getStack(), 0.0, 0.0);
this->candles = new Candles();
numCandles = 0;
lastStack = 0;
maxValue = 0;
lastValue = 0;
actua... | ALGO | 0.888126 | 4.88 |
e20dcbcf-3e5c-4e73-9dd7-d4447ec95ec0 | anttonal/Prog3 | student/01/mean/main.cpp | #include <iostream>
#include <vector>
using namespace std;
// Splits the given string into several strings, by using the given delimiter
// as a separator.
// Returns the splitted string as a vector such that each string part is an
// element of the vector.
// User can specify if empty parts will be ignored or not.
v... | ALGO | 0.995908 | 6.627365 |
ecd581fc-0e79-4a48-8312-fe3e362e70e7 | behldevansh/NEETCODE | Contains_Duplicate.cpp | //Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
//https://leetcode.com/problems/contains-duplicate/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
s... | ALGO | 0.999766 | 5.155452 |
ceaaf2f7-a255-410b-a3ba-bb48c91e1ff1 | syf1913/IBAMR | src/adv_diff/BrinkmanAdvDiffSemiImplicitHierarchyIntegrator.cpp | /////////////////////////////// INCLUDES /////////////////////////////////////
#include "ibamr/AdvDiffConvectiveOperatorManager.h"
#include "ibamr/AdvDiffHierarchyIntegrator.h"
#include "ibamr/AdvDiffSemiImplicitHierarchyIntegrator.h"
#include "ibamr/BrinkmanAdvDiffBcHelper.h"
#include "ibamr/BrinkmanAdvDiffSemiImplic... | ALGO | 0.999674 | 5.674653 |
9bbea0b1-c92b-4fc4-97bc-efe7c3f92f82 | gonzalokun/AEDTP3Cod45 | src/sweep.cpp | #include "../include/sweep.hpp"
#include <fstream>
#include <sstream>
#define LEYENDO_PUNTOS 0
#define DEFINIENDO_DEMANDAS 1
#define DEFINIENDO_PUNTO_CENTRAL 2
void ListaAdyacencias::convertirAListaInc(ListaIncidencia &l) {
Arista ar;
list<AristaAd>::iterator it;
for (int i = 0; i < nodos.siz... | ALGO | 0.999714 | 4.068721 |
645cc0b0-a695-495a-9fdd-0cbd8d6a5f18 | zengjichuan/jetuum | strads/scheduler/getcorr.cpp | using namespace std;
// assume that rows in column vector is fully sorted on idx and has sorted vecotr of value corresponding to the sorted idx list
double getcorr_pair_sparse_vmat(spmat_vector &xcol, spmat_vector &ycol, uint64_t nsamples, double pxsum, double pxsqsum, double pysum, double pysqsum, int avail, uint64_t... | ALGO | 0.995291 | 4.742408 |
775af446-c116-4336-af4a-c55c476af2d9 | ishandutta2007/codeforces | atreus/normal/992/E.cpp | /**
* author: Atreus
* created: 21.01.2019
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5 + 10;
int n;
int mxm[4 * maxn];
int get(int id, int L, int R, int l, int r, int x){
if (l >= r)
return -1;
if (L == l and R == r){
if (mxm[id] < x)
return -1;
i... | ALGO | 0.999982 | 4.360635 |
1e65db02-3957-4b21-8a6a-b484c5eadfd8 | Ritwik7631/Leetcode_Solutions | 167-two-sum-ii-input-array-is-sorted/two-sum-ii-input-array-is-sorted.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
int n = nums.size();
for(int i = 0; i < n; i++)
{
int complement = target - nums[i];
int lo = 0;
int hi = n-1;
while(lo < hi)
{
... | ALGO | 0.999799 | 6.528391 |
45f59463-086c-4821-8e11-eb84f5789a06 | ishandutta2007/codeforces | kort0n/normal/1058/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main() {
//cout.precision(10);
int d, n;
cin >> n >> d;
int m;
cin >> m;
for(int time = 1; time <= m; time++){
int x, y;
cin >> x >> y;
if(... | ALGO | 0.999988 | 3.86829 |
c23f68d0-bf67-45ce-a4d9-db5c48ed8730 | mdmishu199088/7_february_25 | problam_2.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,m;cin>>n>>m;
vector<int>a(n+1),b(m+5),v,ans;
int l=0,ll=0;
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<m;i++){
cin>>b[i];
}
while(true){
if(... | ALGO | 0.999921 | 3.640478 |
9daf205e-fc9c-4825-8617-94e3ada8dd67 | SavioCartaxo/Estudos-de-CPP | Beecrownd/1557.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
while (cin >> a && a != 0) {
int b = pow(2, (2 * a - 2));
int tamanho = to_string(b).size();
int inicial = 1;
for (int i = 0; i < a; i++) {
int t = inicial;
for (int j = 0; j < ... | ALGO | 0.999676 | 4.306248 |
c7c7e850-d5e7-4fc1-81c8-8fe908408871 | Coder-Vippro/Code | Archived/BTVN/TEAM/TEAM.cpp | #include <bits/stdc++.h>
using namespace std;
long long C[1001][1001];
const int mod=1e9+7;
int main()
{
freopen("TEAM.INP","r",stdin);
freopen("TEAM.OUT","w",stdout);
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int a,b,x,y;
cin>>a>>b>>x>>y;
C[0][0]=C[1][0]=C[1][1]=1;
... | ALGO | 0.999929 | 4.150377 |
65969d0b-7a0f-435d-84d1-158582875319 | wu5040/DataStructure | Chapter4/Hanoi/Hanoi.cpp | #include "LinkStack.h" // ջ
struct Datatypes
{
short int retAddr; //ģ·صַ
int nDisk; //n
char SourcePeg; //A
char AuxPeg; //B
char DestPeg; //C
};
void SimuTowers(int n, char A, char B, char C)
{
Datatypes currArea; //ǰ
LinkStack<Datatypes> s;//... | ALGO | 0.999769 | 4.527614 |
9d6c791e-1969-4403-9efa-f73aa4ed8337 | q545244819/leetcode | 2020-07/1025_dp.cpp | class Solution {
public:
bool divisorGame(int N) {
vector<bool> dp(N + 1, false);
dp[0] = dp[1] = false;
for (int i = 2; i <= N; i++)
for (int j = 1; j < i; j++)
if (i % j == 0)
dp[i] = dp[i] || !dp[i - j];
return dp[N];
}
}; | ALGO | 0.999944 | 5.741542 |
baf3b61b-adae-4e96-b888-ceeef657440f | Geo-huang/CRT3DMT | contrib/eigen3.3.9/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.944455 | 4.152793 |
16840828-3e5c-4bdf-8a12-756bc2086634 | Adityagupta1625/450-DSA-Questions | linkedlist/p25.cpp | // Given elements as nodes of the two linked lists. The task is to multiply these two linked lists, say L1 and L2.
// Note: The output could be large take modulo 109+7.
// Input:
// The first line of input contains an integer T denoting the number of test cases. Then T test cases follow, the first line of each test ... | ALGO | 0.999551 | 5.925799 |
8c1817f9-4295-465b-b94b-be90c6ee0252 | ISRC-CAS/riscv-llvm | libcxx/test/std/algorithms/alg.nonmodifying/alg.adjacent.find/adjacent_find_pred.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, EquivalenceRelation<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
// constexpr Iter // constexpr after C++17
// adjacent_find(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
#include "test_mac... | TEST | 0.974941 | 5.991456 |
639b7d39-e32d-4a7e-9db1-6f0563ffee9a | robotics-upo/efficient_tether_parameterization | rrt_star_planners/src/birrt_planner.cpp | #include "rrt_planners/biRRTPlanner.hpp"
namespace PathPlanners
{
//*****************************************************************
// biRRT Algorithm Class Definitions
//*****************************************************************
// Default constructor
biRRTPlanner::biRRTPlanner()
{
std::string node_nam... | ALGO | 0.999754 | 3.830687 |
92474c6c-1a51-40b1-ad26-dd117eec728d | Suneela6/CPP_DSA_programming | slidingWindow/valid_paren.cpp | #include<iostream>
#include<string.h>
using namespace std;
int main()
{
string s="()((a))";
int n=s.size();
int count=0;
for(int i=0;i<n;i++){
if(s[i]=='(' ){
count++;
}
else if(s[i]==')'){
count--;
if (count < 0) {
cout << "Invalid" << endl;
return 1... | ALGO | 0.999051 | 3.867238 |
ae0a3336-cc27-4898-9e67-6cc4e3742628 | hillsoftware/SV05 | Marlin/src/feature/meatpack.cpp | /**
* MeatPack G-code Compression
*
* Algorithm & Implementation: Scott Mudge - <EMAIL>
* Date: Dec. 2020
*
* Character Frequencies from ~30 MB of comment-stripped G-code:
* '1' -> 4451136 '4' -> 1353273 '\n' -> 1087683 '-' -> 90242
* '0' -> 4253577 '9' -> 1352147 'G' -> 1075806 'Z' -> 34... | TOOL | 0.940993 | 5.899114 |
cbc3c494-1d00-4fb6-becf-96fe71cbf0c9 | AnuragChouhanDEV/LeetCode | 993. Cousins in Binary Tree/Accepted/Solution.cpp | // https://leetcode.com/problems/cousins-in-binary-tree/description/
/**
* 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) ... | ALGO | 0.999992 | 5.970257 |
abb90d1c-c404-461e-8df8-cd81812431f5 | luoxiao23333/ProcessResourceLimiter | containers/slam/opencv3/modules/features2d/src/kaze/KAZEFeatures.cpp | /**
* @file KAZEFeatures.cpp
* @brief Main class for detecting and describing features in a nonlinear
* scale space
* @date Jan 21, 2012
* @author Pablo F. Alcantarilla
*/
#include "../precomp.hpp"
#include "KAZEFeatures.h"
#include "utils.h"
namespace cv
{
// Namespaces
using namespace std;
/* ***************... | ALGO | 0.984278 | 3.241642 |
089b6a60-6c9c-4846-8b23-8e89a6fccfbb | TrishaSrivastava002/trisha-leetcode_solutions | 1539-kth-missing-positive-number/1539-kth-missing-positive-number.cpp | class Solution {
public:
int findKthPositive(vector<int>& arr, int k){
for(auto i:arr){
if(i<=k) k++;
}
return k;
}
}; | ALGO | 0.999909 | 4.956528 |
9c8fabe8-9055-4ca6-b6bd-194b1caf5138 | OoWoOI/C-Practice-1 | 03.基础数据结构/核心研发/05.tree-thread-mid.cpp | /*************************************************************************
> File Name: 05.tree-thread-mid.cpp
> Author:
> Mail:
> Created Time: Sun 22 Oct 2023 10:36:01 PM CST
************************************************************************/
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#defin... | ALGO | 0.999788 | 4.1881 |
eacdd23e-0084-4f6e-9658-e50d13605a8b | alptv/algorithms | lab09/i.cpp | #include <utility>
#include <queue>
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
struct AhoCorasick {
struct node {
node *parent;
node* suffixLink;
vector<node*> children;
node* near;
int isTerminal = -1;
bool used;... | ALGO | 0.999438 | 3.99565 |
ce1c80a5-2abf-4b2f-8c02-5a6c2427c0eb | LeeJuHwan777/gittest | 5086.cpp | #include<iostream>
using namespace std;
int main() {
int A, B;
while(1) {
cin >> A >> B;
if(A == 0 & B == 0) {
break;
}
if(B % A == 0) {
cout << "factor" << '\n';
}
else if(A % B == 0) {
cout << "multiple" << '\n';
}
else cout << "neither" << '\n';
}
} | ALGO | 0.999736 | 4.130326 |
715104d2-b1de-4751-b99f-a0924d683eb0 | EricEdmundXiang/Blink-detection | Source/Fft1.cpp | #include "Fft1.h"
CFft1::CFft1()
{
}
CFft1::~CFft1()
{
}
bool CFft1::is_power_of_two(int num)
{
int temp = num;
int mod = 0;
int result = 0;
if (num < 2)
return false;
if (num == 2)
return true;
while (temp > 1)
{
result = temp / 2;
mod = temp % 2;
if (mod)
return false;
if (2 == result)
r... | ALGO | 0.998395 | 3.991695 |
723856c6-acd4-4f8c-b13c-d2e735ea2663 | ABILLEST/my-code-learning | C++/c++程序设计教程/quanternary.cpp | #include <iostream>
#include <math.h>
using namespace std;
class quanternary
{
int value;
public:
quanternary():value(0){}
quanternary(int n):value(n){}
void Set(int n){value=n;}
int getValue(){return value;}
quanternary operator + (const quanternary &obj);
};
quanternary quanternary::operator +(const quantern... | ALGO | 0.99972 | 4.399181 |
5f1861e6-8824-4a5d-ae5e-44fe24f4bc92 | PatrickGono/n_body_simulation | src/simulation.cpp | #include "simulation.h"
#include "controller.h"
#include "tree.h"
#include <future>
#include <mutex>
#include <thread>
constexpr float_type g_const = 1;
constexpr float_type epsilon = 0.00001;
constexpr float_type max_speed = 250.0;
///
///
simulation::simulation(uint64_t n_particles)
: n_particles_{n_particles}... | ALGO | 0.998864 | 5.907244 |
c4208b8a-99a0-4f58-99dc-69b56e5ee3d2 | shawakation/PAT | GPLT/L1-039/main.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
string s;
int n;
vector<string> ans;
cin >> n;
cin.ignore();
getline(cin, s, '\n');
for (int i = 0; i < s.length();)
{
ans.push_back(s.... | ALGO | 0.999518 | 3.428239 |
38255f12-a5f4-42e1-afbc-3365a02cbd03 | wincle626/HLS_Bambu | src/frontend_analysis/IR_analysis/Bit_Value.cpp | /**
* @file Bit_Value.cpp
* @brief Full implementation of Bit Value analysis as described in
* BitValue Inference: Detecting and Exploiting Narrow Bitwidth Computations
* Mihai Budiu Seth Copen Goldstein
* http://www.cs.cmu.edu/~seth/papers/budiu-tr00.pdf
* This technical report is an extension of the following p... | ALGO | 0.991338 | 5.138954 |
30b08530-958b-4fdf-b0cf-055a5010b566 | cosmicray001/academic | problem_solving/UVA/10611/16891235_AC_10ms_0kB.cpp | #include <bits/stdc++.h>
#define le 50010
using namespace std;
int n[le];
int fnc(int a[], int len, int x){
int hi = len - 1, lo = 0, index = -1, mid;
while(lo <= hi){
mid = (lo + hi) / 2;
if(x == a[mid]){
index = mid;
hi = mid - 1;
}
else if(x < a[mid]) hi = mid - 1;
else lo = mid... | ALGO | 0.999963 | 3.847935 |
044608f9-d017-41f6-8b59-98dc51ebd14e | urmilas239/Openmp | binnedopenmp.cpp | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <vector>
#include <iostream>
#include "common.h"
#include "omp.h"
std::vector<std::vector<int> > bin_map;
std::vector<std::vector<int> > neighbor_bins;
//
// benchmarking program
//
int main( int argc, char **argv )
{
int n... | ALGO | 0.999498 | 5.993131 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.