uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
974f4798-53b8-4a59-a6e1-a713e9fa3ea8 | Valerion052/codeforces | training/Codeforces_Round/Перебор/801A/main.cpp | #include <iostream>
#include <map>
using namespace std;
int counter(string &s) {
int count=0;
for (int i=0; i<s.size()-1; ++i) {
if (s.substr(i, 2)=="VK") {++count;}
}
return count;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string s;
cin >> s;
... | ALGO | 0.999198 | 4.350599 |
74a18622-d02d-4f6f-ab2f-b30aa2700cc9 | wzx140/ProgramDesign-Algorithm | AlgorithmBasis/week10/q6.cpp | #include <iostream>
#include <queue>
using std::endl;
using std::cin;
using std::cout;
using std::queue;
// 6:献给阿尔吉侬的花束
struct State {
int time = 0;
int x = 0, y = 0;
};
// 上下左右
int dir[4][2] = { {0,1} ,{0,-1} ,{-1,0} ,{1,0} };
// 迷宫大小
int r = 0, c = 0;
// 迷宫,这里visted和迷宫放在一起
bool visit[300][300];
// 记录open1与op... | ALGO | 0.999818 | 3.408617 |
70768ad6-e995-4075-a23b-a563fe7cc972 | work-mohit/Placement-Practice | Love Babber OnGoing Placement/Tries/TrieImplementation.cpp | #include<iostream>
using namespace std;
class TrieNode {
public:
char data;
TrieNode* children[26];
bool isTerminal;
TrieNode(char ch){
data = ch;
for(int i = 0; i < 26;i++){
children[i] = NULL;
}
isTerminal = false;
}
};
class Trie{
public:
... | ALGO | 0.999971 | 5.051909 |
b84052d4-2785-4749-8b3f-8ceac038f833 | medwards/darkreign2 | coregame_ai/tactical_process.cpp | /////////////////////////////////////////////////////////////////////////////
//
// Includes
//
#include "tactical_private.h"
#include "unitobjfinder.h"
#include "unitobj.h"
#include "target.h"
#include "taskctrl.h"
#include "tasks_restoremobile.h"
#include "tasks_restorestatic.h"
#include "tasks_unitattack.h"
#include... | TOOL | 0.949543 | 6.385386 |
c9268098-e120-4c40-93f7-89e3a9e1679b | ashu12chi/Interviewbit-Solution | Arrays/maximum-absolute-difference.cpp | int Solution::maxArr(vector<int> &ar) {
int n = ar.size();
vector<int> v;
for(int i=0;i<n;i++)
v.push_back(ar[i]+i);
sort(v.begin(),v.end());
int ans = v[n-1] - v[0];
v.clear();
for(int i=0;i<n;i++)
v.push_back(ar[i]-i);
sort(v.begin(),v.end());
ans = max(ans,v[n-1]-v... | ALGO | 0.999167 | 4.501393 |
7ac95f35-c6e1-49e2-b34d-c0c0c4d705ff | jgillick/ThunderPack | examples/STM32Cube/shared/Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.921643 | 7.471897 |
6bc1b240-99b5-4355-95e6-ee8d3c0321af | gabrielvillarart/godot-init | thirdparty/msdfgen/core/msdf-error-correction.cpp |
#include "msdf-error-correction.h"
#include <vector>
#include "arithmetics.hpp"
#include "Bitmap.h"
#include "contour-combiners.h"
#include "MSDFErrorCorrection.h"
namespace msdfgen {
template <int N>
static void msdfErrorCorrectionInner(const BitmapRef<float, N> &sdf, const Shape &shape, const Projection &projecti... | ALGO | 0.987882 | 6.889186 |
e794edd4-a792-4a89-ab2e-e4bab3011f7f | sidharthtripathi/striverA-Z | dp/dp on subseq/partition equal subset sum(cn).cpp | bool answer(int index, int target, vector<int>&arr,vector<vector<int>> &dp){
if(target == 0) return true;
if(index == 0) return arr[index] == target;
// check if we got the ans
if(dp[index][target]!=-1) return dp[index][target];
// not picking
bool notPick = answer(index-1,target,arr,dp);
// picking
bool pick ... | ALGO | 0.999982 | 5.642153 |
abab2a4e-41af-44a7-b4de-a2f5f06380bd | InwooLeeme/Algorithm | Boj/17197.cpp | #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds... | ALGO | 0.999894 | 5.029072 |
4fa65f07-5628-47cd-b7ed-f90c247bdcc9 | mamyrbekova/ADS_22B031581 | lab6/i.cpp | #include <iostream>
using namespace std;
int partition(string &str, int left, int right)
{
int pivot = str[right];
int i = (left - 1);
for (int j = left; j <= right - 1; j++) {
if (str[j] < pivot) {
i++;
swap(str[i], str[j]);
}
}
swap(str[i + 1], str[ri... | ALGO | 0.999989 | 5.692332 |
00ce44b0-922b-4941-879e-ba713c680579 | abdullaabdullazade/rio-semifinal-submissions-2025 | Cansu_Zeynalova_Rauf qızı_8.0_4_10BAL_RIO2025_Semifinal_J4.cpp | #include <bits/stdc++.h>
using namespace std;
long long const mod=1e9+7;
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];
}
if(a[0]==*min_elemen... | ALGO | 0.999932 | 3.885285 |
15719c5a-2018-4cf0-a472-6d1436930e56 | Joseph-MingEn/Cpp_MingEn | zerogudje/a915.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int x,y;
vector<pair<int, int>> dots;
int i;
pair<int, int> d;
cin >> n;
while(n--) {
cin >> x >> y;
dots.push_back({x, y});
}
sort(dots.begin(), dots.end());
for(i = 0; i <dots.size(); i++) {
... | ALGO | 0.999849 | 4.473027 |
0618d994-69ce-4177-81f1-d5af6e55062b | saurabhkoshatwar/Analysis-of-the-Execution-Time-Variation-of-OpenMP-based-Applications | src/mat_vec_mul.cpp |
#include<iostream>
#include<omp.h>
double total_time_serial,total_time_parallel;
using namespace std;
int main()
{
int n = 20000;
int * vec = new int[n];
int ** mat = new int*[n];
for(int i=0;i<n;i++)
{
mat[i] = new int[n];
}
int * sum_serial = new int[n];
int ... | ALGO | 0.998428 | 3.445444 |
fd7915e3-cc8e-4100-bbc3-d8de89194152 | bae-sh/BOJ | Problems/12865.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int N, K;
int *W, *V;
int dp[100001];
int main() {
cin >> N >> K;
W = new int[N];
V = new int[N];
for (int i = 0; i < N; i++) {
cin >> W[i] >> V[i];
}
for (int i = 0; i < N; i++) {
for (int j = K; j >= 1; j--) {
if (W[i] <= j) {
dp[j] = max(d... | ALGO | 0.999963 | 3.900437 |
430e2c3b-1969-497d-acbf-c7c6d7370d50 | zero0000007/githubLocalTest | 操作系统实验/实验3源代码/bankersAlgorithm/bankersAlgorithm/main.cpp | #include<iostream>
#include "process.h"
void initialize(process p[]) {
int max[5][3] = { {7,5,3},{3,2,2},{9,0,2},{2,2,2},{4,3,3} };
int allocation[5][3] = { {0,1,0},{2,0,0},{3,0,2},{2,1,1},{0,0,2} };
for (int i = 0; i < 5; i++) {
p[i].setId(i);
p[i].setMax(max[i]);
p[i].setAllocation(allocation[i]);
}
}
int... | ALGO | 0.999402 | 3.360191 |
630ea22d-1e77-4bbf-8d41-525bb0c80477 | Leetheking33/DataStructureCourseWork | class-code/13-insertion-sort-array/src/main.cpp | #include <iostream>
#include <list>
#include <queue>
#include <utility>
int toSort[] { 3,13,5,89,-53,4,27,44,1,-3 };
void print(int *ary, const int size) {
for (int i = 0; i < size; i++) {
std::cout << ary[i] << " ";
}
std::cout << "\n";
}
void insertionSort(int *ary, const int size) {
int ne... | ALGO | 0.999729 | 5.246293 |
ef3f7e7d-e5aa-4272-9ad2-b22a91d978a7 | AustinBoyuJiang/Competitive-Programming | Competitions/CCO/Training Contests/2024/9/Weight Assignment.cpp | /*
* Author: Austin Jiang
* Date: 5/25/2024 10:10:27 PM
* Problem:
* Source:
* Description:
*/
/* Configuration */
//#define MULTICASES
//#define LOCAL
//#define READLOCAL
//#define FILESCOMP
//#define SETMEM
#define FASTIO
//#define NDEBUG
#define OPTIMIZE
//#define INTTOLL
#ifdef OPTIMIZE
#pragma GCC optimize(... | ALGO | 0.998059 | 4.171268 |
6b0ae0c6-868d-4ab9-b53f-c388987b1323 | AmiEklasMohin/LeetCode | longest_consecutive_seq.cpp | /*https://leetcode.com/problems/longest-consecutive-sequence/*/
#include <iostream>
#include <vector>
#include <unordered_set>
#include <algorithm>
using namespace std;
class Solution {
public:
int longestConsecutive(vector<int>& nums) {
unordered_set<int> uset;
int maximum_length = 0;
for ... | ALGO | 0.999828 | 4.856532 |
690a776a-6039-4b7d-8be8-afe5ea0ab306 | Vihanga-Nirmitha/Messenger-App- | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
29317987-1361-4168-a029-cf623498f49e | BhaveshPatil12/CPP-OOPS | OOPS58.cpp | #include<iostream>
using namespace std;
class String {
private:
char str[30];
public:
void putString() {
cout << "Enter String : ";
cin.getline(str, 30);
}
char smallest() {
char min = str[0];
for (int index = 1; str[index]; index++) {
if (str[index] < min) {
min = str[index];
... | ALGO | 0.967666 | 4.031247 |
5fbca795-9b2f-48d3-aa1e-ac58c71793ff | Khairul-Anam-Mubin/Codeforces-Solutions | Contest/Educational Codeforces Round 6/C.cpp | /***
** Bismillahir Rahmanir Rahim
** ALLAHU AKBAR
**
** Author: Khairul Anam Mubin (__Broly__)
** Bangladesh University of Business and Technology,
** Dept. of CSE.
***/
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second ... | ALGO | 0.999494 | 3.385617 |
e4300be6-0a18-464a-83db-f44becf7a5c4 | MartinSkachkov/Data-structures-and-algorithms | Seminars/Sem. 04/Additional2/task5.cpp | #include "ll-utils.h"
int reverseNum(int x) {
int rev = 0;
while (x) {
rev = rev * 10 + x % 10;
x /= 10;
}
return rev;
}
template <typename T>
int llToNum(const Node<T> *ll) {
int num = 0;
while (ll != nullptr) {
num *= 10;
num += ll->data;
ll = ll->ne... | ALGO | 0.998495 | 5.415916 |
573e98cd-94f4-4bc3-8ca0-6a17d0b1679d | Hyunsubs/STL_DataStructure | Vector/main.cpp | #include <iostream>
#include <vector>
int main()
{
// vector
std::vector<int> vector1;
// Ȯϴ ΰ
// if(vector1.size() == 0)
// Effective STL size 0 ϱ⺸ empty ϴ° ٰ
if (vector1.empty())
{
// true ƴϸ false
std::cout << "vector .\n";
}
// ڷ
for (int ix = 0; ix < 1000; ix++)
{
// push_back emplace... | TOOL | 0.90964 | 3.865831 |
786e6bab-0e48-4785-a5b8-d032f6bdf2a4 | Priyanshu6268/GFG_POTD | 2025/02 - FEB/11Feb24.cpp | class Solution {
public:
// Function to check whether a Binary Tree is BST or not.
void solve(Node* root,vector<int>&ans){
if(root==NULL) return;
solve(root->left,ans);
ans.push_back(root->data);
solve(root->right,ans);
}
bool isBST(Node* root) {
// Your code he... | ALGO | 0.999959 | 6.889332 |
7582ab89-b581-4c44-9818-e4dfb1f3be07 | Daniil2612/example | nasledovanie (1).cpp | #include <iostream>
#include <limits>
#include <memory>
using namespace std;
double eps = numeric_limits<double>::epsilon();
class Value{
public:
virtual Value* CreateZeroValue() = 0;
virtual Value* Duplicate() = 0;
virtual Value* operator+=(const Value&) = 0;
virtual Value* operator-=(const Value&)... | ALGO | 0.991024 | 4.069593 |
970f2672-b895-4e27-87d6-dc03eae820a7 | kamyu104/LeetCode-Solutions | C++/sum-of-left-leaves.cpp | // Time: O(n)
// Space: O(h)
/**
* 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) {
return sumOfLeftLe... | ALGO | 0.999823 | 6.837802 |
544ac265-52be-4993-8d89-3562d2a2fa49 | damnlebowski/Student-Record-Bloc | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.99887 | 6.783439 |
2bcb88a4-c749-46cf-87c7-963d42c605d1 | BoleynSu/CompetitiveProgramming | archives/problemset/codeforces.com/227C.cpp | //Boleyn Su's Template for Codeforces
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <c... | ALGO | 0.999959 | 3.28922 |
dc5cc8ed-e3c4-4b4b-aa8b-eb1a5bd92f5d | mu7ammad-3issa/clear-connect | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
b31289b7-3e4a-4a56-9d1d-6b16e59dbf9f | nanohaikaros/sams_teach_cpp | 5/10.cpp | #include <iostream>
using namespace std;
int main()
{
cout << "Use sizeof to determine memory used by arrays" << endl;
int myNumbers[100] = {0};
cout << "Bytes used by an int: " << sizeof(int) << endl;
cout << "Bytes used by myNumbers: " << sizeof(myNumbers) << endl;
cout << "Bytes used by an elem... | TOOL | 0.858443 | 3.520856 |
761ed93c-496d-4e2c-a1e8-bc56f758bff5 | tmd2018/ollvm-tll | tools/clang/lib/Index/IndexBody.cpp | #include "IndexingContext.h"
#include "clang/AST/RecursiveASTVisitor.h"
using namespace clang;
using namespace clang::index;
namespace {
class BodyIndexer : public RecursiveASTVisitor<BodyIndexer> {
IndexingContext &IndexCtx;
const NamedDecl *Parent;
const DeclContext *ParentDC;
SmallVector<Stmt*, 16> StmtSt... | TOOL | 0.870555 | 5.177547 |
a02b23d8-b835-41b7-aaa7-dd01846e077b | bhavyagoel/LeetCode | 1. Septermber'21/happy-number/happy-number.cpp | class Solution {
public:
bool isHappy(int n) {
int sum = 0;
while(n){
sum += pow(n%10, 2);
n /=10;
}
if(sum < 5 && sum!=1){
return false;
}
if(sum==1) {
return true;
}
return isHappy(... | ALGO | 0.999972 | 6.38215 |
d415a847-b17f-4ac7-95f2-77e470ac5a93 | nitrieu/libFPE | thirdparty/linux/miracl/miracl_osmt/source/williams.cpp | /*
* Program to factor big numbers using Williams (p+1) method.
* Works when for some prime divisor p of n, p+1 has only
* small factors.
* See "Speeding the Pollard and Elliptic Curve Methods"
* by Peter Montgomery, Math. Comp. Vol. 48. Jan. 1987 pp243-264
*
* Requires: big.cpp zzn.cpp
*
*/
#incl... | ALGO | 0.999966 | 5.78008 |
9f20f19f-6842-48bc-96ed-39a871085f62 | dl8sd11/online-judge | 0contest/2019-2020 ICPC Asia Taipei-Hsinchu Regional Contest/pB.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define REP(i,n) for(int i=0;i<n;++i)
#define REP1(i,n) for(int i=1;i<=n;++i)
#define SZ(i) int(i.size())
#define eb emplace_back
#define ALL(i) i.begin(),i.end()
#define X first
#define Y second
#ifd... | ALGO | 0.999604 | 4.125331 |
6e0ada2a-ec57-4904-be42-7d5c1807a009 | jojeongmin304/Algorithm_Problem_Solving | 프로그래머스/1/42840. 모의고사/모의고사.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> answers) {
vector<int> answer;
vector<int> first = {1, 2, 3, 4, 5};
vector<int> second = {2, 1, 2, 3, 2, 4, 2, 5};
vector<int> third = {3, 3, 1, 1, 2, 2, 4, 4, 5, 5};
int one = 0;
int... | ALGO | 0.999943 | 5.369808 |
22f64636-fd83-4bef-9c1d-88fa57a68a37 | sinian666/code_102_8 | cpp_副本56/chapter_backtracking/preorder_traversal_i_compact.cpp | /**
* File: preorder_traversal_i_compact.cpp
* Created Time: 2023-04-16
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
vector<TreeNode *> res;
/* 前序遍历:例题一 */
static void preOrder(TreeNode *root) {
if (root == nullptr) {
return;
}
if (root->val == 7) {
// 记录解
res... | ALGO | 0.999939 | 5.612921 |
799fa488-1cda-4351-9a1f-45e6b30f61b6 | chetan-2002/Leetcode-DSA-Questions | 938.range-sum-of-bst.cpp | /*
* @lc app=leetcode id=938 lang=cpp
*
* [938] Range Sum of BST
*/
// @lc code=start
/**
* 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(null... | ALGO | 0.999996 | 7.256936 |
fb3ff8d2-f3d8-4d30-9e06-23110840ddf7 | muwasifk/competitive-programming | DMOJ/treepractice1.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <queue>
#include <cstring>
#include <climits>
#define f first
#define s second
using namespace std;
#define MAXX 500001
vector<pair<int, int>> graph[MAXX];
int diameter;
int furthest;
int radius = INT_MAX;
int distances[MAXX], previous[MAXX];... | ALGO | 0.999496 | 4.200063 |
de22c359-83f6-4da7-a2a9-d5a4fb046787 | lucaszhang-code/algorithm | Array_shellSort.cpp | #include <iostream>
using namespace std;
#include <array>
void shellSort(array<int,10> &arr){
int gap = arr.size();
while(gap > 1){
gap /= 2;
for(int i = 0; i < gap; i++){
for(int j = gap; j < arr.size(); j += gap){
int key = arr[j];
int k = j - gap;
... | ALGO | 0.999902 | 4.892243 |
a4b838f7-5098-4d06-824b-1f04241120c5 | tejus0/TLE-Eliminators | R-900/JellyfishandUndertale.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int test;
cin >> test;
while (test--)
{
int a, b, n;
cin >> a >> b >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
long long total = b;
for (auto x : ... | ALGO | 0.99833 | 3.61042 |
49fbb17f-7f30-4065-a77d-da54d79ca5cc | alstn1234/CodingTest | 프로그래머스/unrated/161990. 바탕화면 정리/바탕화면 정리.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<string> wallpaper) {
vector<int> answer;
int s_x = wallpaper.size()-1, b_x = 0;
int s_y = wallpaper[0].size()-1, b_y = 0;
for(int i = 0; i < wallpaper.size(); i++){
for(int j = 0; j < wallpaper[0].size();... | ALGO | 0.998043 | 4.702111 |
1189c77b-a86b-4a3f-8b81-a0fef6cf8508 | liuq901/code | SGU/s_103.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <ctime>
#include <cstdarg>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <set... | ALGO | 0.999942 | 3.386494 |
53c4e0bf-fdb0-4b57-9086-bc6aaefd3522 | AMIRIOX/MyLuoguRepo | rehab-230820/P1036.cpp | #include <iostream>
#include <cstdio>
using namespace std;
const int maxn = 50;
const int maxm = 2e5+10;
int n, k, a[maxn], ans;
int prime[maxm];
void isp(){
prime[0]=prime[1]=1;
for(int i=2; i*i<=maxm; i++) {
if(prime[i]==0)
for(int j=i<<1; j<=maxm; j+=i) {
prime[j]=1;
}
}
};
void dfs(int ind, int al, in... | ALGO | 0.999909 | 3.58333 |
bc550e76-45f2-466e-bb40-7a9c85eacc26 | Veda-Coin/Veda-Core | src/arith_uint256.cpp | #include "arith_uint256.h"
#include "uint256.h"
#include "utilstrencodings.h"
#include "crypto/common.h"
#include <stdio.h>
#include <string.h>
template <unsigned int BITS>
base_uint<BITS>::base_uint(const std::string& str)
{
SetHex(str);
}
template <unsigned int BITS>
base_uint<BITS>& base_uint<BITS>::operator... | ALGO | 0.957673 | 6.599471 |
7d5de8d3-57d5-4ae4-818d-a132f53e83f1 | Jae-Hyuk-Jang/baekjoon-source-code | Level/Ruby/main.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
class TreeNode {
public:
unordered_map<int, int> edges; // ġ
int value;
TreeNode() : value(1) {}
};
class Forest {
private:
vector<TreeNode> nodes;
vector<i... | ALGO | 0.999699 | 5.741067 |
99137ab3-3e82-4ab1-852e-292d8982636b | sanyukta001/cppPrograms | Assignments/cppAsgn/nnumbers.cpp | #include<bits/stdc++.h>
using namespace std;
int getNegativeNumbersCount(vector<int> &arr)
{
int c=0;
for(int i = 0; i <arr.size() ; i++)
{
if(arr[i]<0)
c = c+1;
}
return c;
} | ALGO | 0.999813 | 4.669862 |
81085b8d-fd4d-4c23-81aa-aef7b3b8ef89 | Mukeshkumar1611/Leetcode | Medium/Difference_Between_Ones_and_Zeros_in_Row_and_Column.cpp | class Solution {
public:
vector<vector<int>> onesMinusZeros(vector<vector<int>>& grid) {
int n = grid.size();
int m = grid[0].size();
map<int, int>row1s;
map<int, int>col1s;
map<int, int>row0s;
map<int, int> col0s;
for(int i = 0; i < n; i++)
{
... | ALGO | 0.999925 | 6.264791 |
b979cb9e-f391-4acf-a546-bab4dfaf1ba2 | ShwetankDohroo1/LeetCode | 2807-insert-greatest-common-divisors-in-linked-list/2807-insert-greatest-common-divisors-in-linked-list.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:
int gcd(int a,int b){... | ALGO | 0.999972 | 5.756497 |
09646bac-66f8-4937-b37b-1225ea587bed | pranay0-2/DSA-2.0 | 15_bitwiseOperator/get_ith_bit.cpp | #include <iostream>
using namespace std;
int getIthBit(int n , int i){
int bitmask = 1<<i; // 1 at ith position and 0 at all other positions
if((n & bitmask) == 0){
return 0;
}
else{
return 1;
}
}
int main(){
int n , i ;
cout<< "Enter a number: "<<endl;
ci... | ALGO | 0.994749 | 4.81319 |
1dbed569-5584-4925-a6dc-65775f815bf2 | kumarshivam03/Cpp-Pr | Leetcode+CodNin/CodNinja/maxcountnoofcharactergfg.cpp | https://www.geeksforgeeks.org/problems/maximum-occuring-character-1587115620/1
class Solution
{
public:
//Function to find the maximum occurring character in a string.
char getMaxOccuringChar(string str)
{
int ans=0,max=-1,i,number;
int arr[26]={0};
for(i=0;i<str.length();i++){
... | ALGO | 0.99983 | 5.112288 |
ac622997-2e64-4965-9843-5fe3b370d49b | Kawser-nerd/CLCDSA | Source Codes/AtCoder/agc015/C/1332041.cpp | #include"iostream"
#include"cmath"
#include"vector"
#include"algorithm"
#include"list"
#include"set"
#include"unordered_set"
#include"map"
#include"unordered_map"
#include"string"
#include"cstring"
#include"iomanip"
using namespace std;
typedef long long ll;
const int maxn=2010;
bool rec[maxn][maxn];
int h[maxn][maxn],... | ALGO | 0.999785 | 4.142528 |
01d4a502-3c22-426e-b7d9-aab5e72af0b5 | KevinMathewT/Competitive-Programming | IntrusionDetection.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
// Kevin Mathew T
// Birla Institute of Technology, Mesra
// GitHub - https://github.com/KevinMathewT
// CodeForces - https://codeforces.com/profile/KevinMathew
// CodeChef - https://www.codechef.com/users/KevinMathew
// HackerRank ... | ALGO | 0.999857 | 3.822335 |
c1c7c75a-6520-4a25-aa45-87789f0ebde9 | SONTAX/KNU | 4_term/OOOP/lab1/Matrix.cpp | #include "Matrix.h"
string Matrix::PrintMatrix() const {
string output;
int k = 0;
int size = col.size();
for (int i = 0; i < dimension; i++) {
for (int j = 0; j < dimension; j++) {
if (k < size) {
if ((row[k] == i) && (col[k] == j)) output += to_string(val[k++]) + " ";
else output += "0 ";
}
el... | ALGO | 0.998341 | 3.405183 |
aeb9930e-77e0-48fa-a298-ce634be786d6 | shashank1623/DAA-2022 | week10/q2.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX 7
struct job
{
int timetaken;
int deadline;
int index;
};
bool cmp(job a1, job a2)
{
return a1.deadline < a2.deadline;
}
void jobScheduling(job arr[])
{
sort(arr, arr + MAX, cmp);
int dead = 0;
vector<int> t;
for (int i = 0; i < M... | ALGO | 0.999991 | 4.152285 |
05bcb646-65cd-4aca-a1dd-6c34411a238d | harrybp/advent_of_code_2020 | day_04/part2.cpp | #include <cstdio>
#include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <map>
#include <regex>
#include <cstring>
int main(){
// Input file
std::string inputText;
std::string tokenText;
std::ifstream inputFile("input.txt");
// Store passport info in a map
std::ma... | ALGO | 0.97548 | 6.006381 |
326daaa0-2b68-4c21-b3ca-c5f951294167 | JasonCeng/MultipartyPSI-Pro | thirdparty/win/miracl/miracl_osmt/source/ecn6.cpp | /*
* MIRACL C++ Implementation file ecn6.cpp
*
* AUTHOR : M. Scott
*
* PURPOSE : Implementation of class ECn6 (Elliptic curves over n^6)
*
* WARNING: This class has been cobbled together for a specific use with
* the MIRACL library. It is not complete, and may not work in other
* applications
*... | ALGO | 0.993273 | 5.07141 |
36bb5840-d04a-4439-90d9-b4b2984f50fc | canuguess/andy-dev | Leetcode/Answer/leetcode-master/src/combinationSum/combinationSum.II.cpp | // Source : https://oj.leetcode.com/problems/combination-sum-ii/
// Author : Hao Chen
// Date : 2014-07-19
/**********************************************************************************
*
* Given a collection of candidate numbers (C) and a target number (T), find all
* unique combinations in C where the cand... | ALGO | 0.999941 | 6.107505 |
1a0b8a94-293f-4786-82f8-04c141920854 | MohHossary/DataStructuresAndAlgorithmsSpecialization | res/Data_Structures/Unzipped/week4_binary_search_trees/1_tree_traversals/tree-orders.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#if defined(__unix__) || defined(__APPLE__)
#include <sys/resource.h>
#endif
using std::vector;
using std::ios_base;
using std::cin;
using std::cout;
class TreeOrders {
int n;
vector <int> key;
vector <int> left;
vector <int> right;
public:
void re... | ALGO | 0.999989 | 4.48521 |
9d6b9867-cb1e-446c-b927-3af1ce84f0e7 | numbqq/opencv | samples/cpp/tutorial_code/ImgTrans/houghlines.cpp | /**
* @file houghlines.cpp
* @brief This program demonstrates line finding with the Hough transform
*/
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
// Declare the output variables
M... | ALGO | 0.992476 | 5.88318 |
b88d1fcd-bc36-4ff6-8d31-5e37537fbb6d | greatzero728/zero.icpc | Contest/codeforces/Educational Codeforces Round 170 (Rated for Div. 2)/(C).cpp | #include<bits/stdc++.h>
using namespace std;
using INT = long long;
const int NN = 202020;
int a[NN];
int val[NN], num[NN];
int solve() {
int n, k; scanf("%d %d", &n, &k);
for(int i = 1; i <= n; i++) scanf("%d", a + i);
sort(a + 1, a + n + 1);
int nn = 0;
for(int i = 1, j = 1; i <= n; i = j... | ALGO | 0.999719 | 4.128074 |
59f7fa60-a2dd-4030-ba98-22717aeb0e1c | mealsOrder/SW | baekJoon/review/15663_1.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int MX = 30;
int arr[MX];
int ans[MX];
bool vis[MX];
int N,M;
void back(int x){
if(x == M){
for(int i=0;i<M;i++){
cout << ans[i] << " ";
}
cout << '\n';
return;
}
else{
int ... | ALGO | 0.999996 | 4.027859 |
115bd1c0-f27d-46ec-9933-08b5afcdd45b | rudransh-mishra-04/DSA-CODES- | DSA/REVERSE_CHARACTER.cpp | #include <iostream>
using namespace std;
void reverse(char name[],int n){
int start=0;
int end=n-1;
while(start<=end){
swap(name[start++],name[end--]);
}
}
int get_length(char name[]){
int count=0;
for(int i=0; name[i]!='\0';i++){
count++;
}
return count;
}
int main(){
char name[20];
cout<<"Enter the n... | ALGO | 0.997409 | 4.287597 |
6e80b437-3384-4dae-abb5-4660623fac81 | sanyagargg/LeetcodeSolutions | POTD/POTDMay/Number-of-Equivalent-Domino-Pairs.cpp | class Solution {
public:
int numEquivDominoPairs(vector<vector<int>>& dominoes) {
unordered_map<int, int> count;
int result = 0;
for (auto& d : dominoes) {
int a = d[0], b = d[1];
int key = min(a, b) * 10 + max(a, b); // Normalize the domino
result += co... | ALGO | 0.999792 | 7.193993 |
64facf18-5a00-467e-9ef4-3b79bbe7d06c | figurekim317/Udacity-CarND-Projects | P7-Path-Planning-Project/src/Eigen-3.3/unsupported/doc/examples/MatrixSquareRoot.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(2,2);
A << cos(pi/3), -sin(pi/3),
sin(pi/3), cos(pi/3);
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix square root of A is:... | ALGO | 0.999132 | 3.930508 |
03ee1d9c-7e0e-47a6-92e1-af936896a201 | AnaCorralD/FAL | Divide y vencerás/08 - El juego del bongo/08.cpp | // Ana Laura Corral Descargue
// E17
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
// función que resuelve el problema
int resolver(std::vector<int> const &v, int ini, int fin, int const cantado) {
if (ini > fin) return -1;
else {
int m = (ini + fin) / 2;
if (v[m] == cantado + m) ... | ALGO | 0.999975 | 3.941296 |
b564f429-4f68-4d31-b547-4dcd9d7f09be | aleen42/LightOpenCV | LightOpenCV/radialBlurFilter.cpp | /***********************************************************************
* _
* _____ _ ____ _ |_|
* | _ |/ \ ____ ____ __ ___ / ___\/ \ __ _ ____ _
* | |_| || | / __ \/ __ \\... | ALGO | 0.976122 | 5.345909 |
ed932ff9-bb6e-4a06-b8d8-46c4d43e7946 | Somya-Singhal/Leetcode-Daily-Practise | 1189-maximum-number-of-balloons/1189-maximum-number-of-balloons.cpp | class Solution {
public:
int maxNumberOfBalloons(string text) {
vector<int>cnt(26,0);
int n=text.length();
int ans=INT_MAX;
for(int i=0;i<n;i++)
{
if(text[i]=='b' || text[i]=='a' || text[i]=='l' || text[i]=='o' || text[i]=='n')
cnt[text[i]-'a']++;
... | ALGO | 0.999765 | 4.762826 |
538073a9-fde3-4bb9-981c-98a7260f5bfd | IsaacAsante/LeetCode-Solutions | 345. Reverse Vowels of a String/reverse vowels of a string.cpp | /* Author: Isaac Asante
* LeetCode URL for this problem: https://leetcode.com/problems/reverse-vowels-of-a-string/
* Original video explanation: Pending
* Last verified on: March 4, 2023
*/
/* IMPORTANT:
* C++ headers are missing from the code below.
* Only the Solution class is included.
*/
class Solution... | ALGO | 0.99988 | 6.689799 |
feb417fc-a005-4bf4-adf8-ce984472605d | 6108/codetree-TILs | 240430/코로나 메뉴얼2/covid-manual2.cpp | #include <iostream>
using namespace std;
int main() {
char c;
int n;
int arr[5] = {};
for (int i = 0; i < 3; i++) {
cin >> c >> n;
if (c == 'Y' && 37 <= n)
arr[0]++;
else if (c == 'N' && 37 <= n)
arr[1]++;
else if (c == 'Y' && n < 37)
... | ALGO | 0.998133 | 3.171895 |
55647759-1587-4e31-a9cc-ccc7f6e73021 | quangcaptain26-3/DS-A-CODE | oop2/os.cpp | #include <iostream>
using namespace std;
class MT{
private:
int n,m;
int** data;
public:
MT(int h = 5, int c = 5) : n(h), m(c) {
data = new int*[m];
for (int i = 0; i < m; i++) {
data[i] = new int[n];
}
}
~MT(){
for (int i = 0; i < m; i++) {
delete... | ALGO | 0.999693 | 3.96532 |
96d0209f-41d1-4415-b8d6-2b61b4d02340 | dyllandry/learncpp | chapter-6/4-sorting/q-4/main.cpp | #include <algorithm>
#include <iostream>
int main() {
int array[]{6, 3, 2, 9, 7, 1, 5, 4, 8};
const int arrayLength =
static_cast<int>(sizeof(array)) / static_cast<int>(sizeof(array[0]));
// Sort array in place using bubble sort.
for (int i{0}; i < arrayLength - 2; i++) {
bool hasSwapp... | ALGO | 0.999838 | 7.02226 |
f4390598-91f5-4d59-8fdd-4480aab93716 | ishandutta2007/codeforces | chasedream/normal/1207/A.cpp | #pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define RE register
#define rint RE int
#define rep(i, l, r) for (rint i = l; i <= r; i++)
#define req(i, l, r) for (rint i = l; i >= r; i--)
#define Each(i) for (rint i = head[u]; i; i = edge[i].n... | ALGO | 0.997888 | 3.667761 |
e2b9f880-d683-4ac6-95d1-b9f1eb7219ca | sigsegv-mvm/sigsegv-mvm | libs/ann/src/brute.cpp | #include <ANN/ANNx.h> // all ANN includes
#include "pr_queue_k.h" // k element priority queue
//----------------------------------------------------------------------
// Brute-force search simply stores a pointer to the list of
// data points and searches linearly for the nearest neighbor.
// The k nearest ... | ALGO | 0.99978 | 6.679107 |
9decbf15-3bee-480e-9410-c6d333e7ab90 | minhmoidz/gioaap | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
2de08b2e-8e00-464d-bb08-cfa5558aad91 | SukunaShinmyoumaru-hust/RoboRTS-Sukuna | roborts_planning/local_planner/src/robot_position_cost.cpp | #include "local_planner/robot_position_cost.h"
namespace roborts_local_planner {
RobotPositionCost::RobotPositionCost(const roborts_costmap::Costmap2D& cost_map) : costmap_(cost_map) {
}
RobotPositionCost::~RobotPositionCost() {
}
double RobotPositionCost::PointCost(int x, int y) {
unsigned char cost = costmap_... | ALGO | 0.997637 | 5.112068 |
5ed7356f-2ae6-4f09-83f5-8f3805757fc9 | kishanrajput23/Coding-Buddies-Community-Contributions | Love_Babbar_DSA_busted.c/heap/convert_a_min_heap_to_max_heap.cpp | #include <bits/stdc++.h>
using namespace std;
// approach
// simply build a max heap provided a random array (min heap)
// time complexity: O(n)
// space complexity: O(N)
void maxHeapify(int *arr, int n, int i)
{
int lci = (2 * i) + 1;
int rci = (2 * i) + 2;
int largest = i;
if (lci < n and arr[larges... | ALGO | 0.999629 | 4.816373 |
aa65119f-ef82-47c5-aae2-0f6788403093 | kobe24o/LeetCode | algorithm/leetcode5663.cpp | class Solution {
public:
int kthLargestValue(vector<vector<int>>& mat, int k) {
int m = mat.size(), n = mat[0].size();
vector<vector<int>> dp(m+1, vector<int>(n+1, 0));
vector<int> ans(m*n);
for(int i = 1; i <= m; i++)
dp[m][1] = mat[i-1][0];
for(int i = 1; i <= n... | ALGO | 0.999991 | 5.878119 |
4d76c5b5-4daa-461e-8709-0604a4f75e76 | ritikbanger/Hacktoberfest2022-DSA | 21. Trie/InsertSearch.cpp | // C++ implementation of search and insert
// operations on Trie
#include <bits/stdc++.h>
using namespace std;
const int ALPHABET_SIZE = 26;
// trie node
struct TrieNode
{
struct TrieNode *children[ALPHABET_SIZE];
// isEndOfWord is true if the node represents
// end of a word
bool isEndOfWord;
};
// Returns new... | ALGO | 0.999908 | 5.389757 |
b0ac667c-b36d-4413-96a2-bbc18ca6303d | AnnaGawrysiak/Colours | Convert_to_HSV.cpp | #include "Convert_to_HSV.h"
#include <vector>
#include <iostream>
HSV Colour_Converter::Convert_to_HSV(double red, double green, double blue)
{
/*
The RGB model makes use of the fact that when we mix these three primary colors, we will be able to
achieve other colors. For that purpose, we represent these primary c... | TOOL | 0.919901 | 4.701614 |
7900cbb8-ea69-435e-8e24-c6b86fd83b85 | mminos/Algorithm | baekjoon/1932.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[501][501];
int a[501][501];
int res = -1;
int main(void) {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
for (int j = 0; j <= i; j++)
scanf("%d", &a[i][j]);
}
dp[0][0] = a[0]... | ALGO | 0.99999 | 3.595167 |
c5a9b488-65be-4a4d-b83d-57bc51a10333 | Vector-013/CP-Vector013 | Codeforces/climb/Contests/997/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using i64 = long long;
typedef unsigned long long ull;
typedef long double ld;
const int inf = 2e9;
const ll linf = 9e18;
void solve()
{
int n;
cin >> n;
vector<int> ans(n);
for (ll i = 0; i < n - 1; i++)
ans[i] = i + 1;
an... | ALGO | 0.999968 | 5.097425 |
745a5fc5-eaa8-4d78-99bd-75f4897dba39 | mrinal-mann/Leetcodeproblems | 0062-unique-paths/0062-unique-paths.cpp | class Solution {
public:
int uniquePaths(int m, int n) {
int N=n+m-2;
int r=m-1;
double res=1;
for(int i=1;i<=r;i++){
res=res*(N-r+i)/i;
}
return (int)res;
}
}; | ALGO | 0.999923 | 6.374911 |
20c500ae-4b6c-4537-99aa-6772992130c5 | heeba-khan/Leetcode-Solutions | 0326-power-of-three/0326-power-of-three.cpp | class Solution {
public:
// long long pow(int m,int n){
// // if(n==0) return 1;
// return pow(m,n-1)*m;
// }
bool isPowerOfThree(int n) {
if(n==0) return false;
while(n%3==0){
n=n/3;
}
if(n==1) return true;
return false;
}
}; | ALGO | 0.999695 | 5.615358 |
7399a9a8-8ff7-4e4e-a7df-6c74168287c9 | sangeeta0201/fpsanitizer | llvm/tools/clang/lib/AST/RawCommentList.cpp | #include "clang/AST/RawCommentList.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Comment.h"
#include "clang/AST/CommentBriefParser.h"
#include "clang/AST/CommentCommandTraits.h"
#include "clang/AST/CommentLexer.h"
#include "clang/AST/CommentParser.h"
#include "clang/AST/CommentSema.h"
#include "clang/Basic/C... | TOOL | 0.922219 | 5.371778 |
70a02575-1473-43fa-8bb8-174a9b285c20 | zwe1in/Leetcode | src/1004_longestOnes/main.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> dailyTemperatures(vector<int>& temperatures)
{
vector<int> result(temperatures.size());
stack<int> st;
for(int i = 0; i < temperatures.size(); ++i)
{
... | ALGO | 0.999701 | 4.540255 |
fd9c035d-34c2-4527-a37a-fc22c5e6e58b | Art3m1sHun/DSA | Bai tap sap xep/insertsion.cpp | #include <iostream>
using namespace std;
void insertsionsort(int a[], int n){
for (auto i = 1; i < n; i++){
int pos = i - 1, x = a[i];
while(pos >= 0 && a[pos] > x){
a[pos + 1] = a[pos];
--pos;
}
a[pos + 1] = x;
}
}
int main(){
int n; cin >> n;
i... | ALGO | 0.999882 | 5.305414 |
48ade693-0642-4cbd-a894-84ae3da078d1 | soumak09/arrays | minimumPlatformGFG.cpp | // { Driver Code Starts
// Program to find minimum number of platforms
// required on a railway station
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
//Function to find the minimum number of platforms required at the
//railway station such that no train waits.... | ALGO | 0.999969 | 5.55062 |
5e2b7d0f-25f9-42c5-91f8-122f9307404e | raincross7/code-similarity | codes/train_code/problem432/problem432_397.cpp | #include <bits/stdc++.h> // This will work only for g++ compiler.
#define for0(i, n) for (int i = 0; i < (int)(n); ++i) // 0 based indexing
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) // 1 based indexing
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) // closed interver from l to r r inclu... | ALGO | 0.999878 | 3.475557 |
de0a94b7-3e13-470d-a2a7-97f862d1efd4 | anthrofax/My-C-plus-plus-Learning-History | C++/Tugas Screening HIMTIKA/soal-2.cpp | #include <iostream>
using namespace std;
int MenghitungLuasPersegiPanjang(int panjang, int lebar) {
return panjang * lebar;
}
int main() {
int panjang, lebar, luas;
cout << "Masukkan nilai untuk panjang dari persegi panjang: ";
cin>>panjang;
cout << "Masukkan nilai untuk lebar dari persegi panjang... | TOOL | 0.957773 | 3.480247 |
66389be0-e59d-4373-a4c3-b69072270dbc | xiamenwcy/extended-caffe | src/caffe/layers/argmax_layer.cpp | #include <algorithm>
#include <functional>
#include <utility>
#include <vector>
#include "caffe/layers/argmax_layer.hpp"
namespace caffe {
template <typename Dtype>
void ArgMaxLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
const ArgMaxParameter& argmax_param =... | DATA | 0.944569 | 6.640243 |
804b5b2e-b44f-4b66-b4aa-ffe66d4af1cd | Upadhyayayush30/LeetCode-Solutions | 268-missing-number/missing-number.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
sort(nums.begin(),nums.end());
int n = nums.size();
if(nums[0] != 0)return 0;
if(nums[n-1] != n)return n;
for(int i =1;i<nums.size();i++){
if(nums[i] != i){
return i;
}
... | ALGO | 0.999969 | 5.58916 |
5d5e5466-84f7-4cc3-a020-66cb7d882a5a | neil0604/leetcode | 1940-maximum-xor-for-each-query/maximum-xor-for-each-query.cpp | class Solution {
public:
vector<int> getMaximumXor(vector<int>& nums, int maximumBit) {
int n = nums.size(),xorr = nums[0],maxxorr = pow(2,maximumBit)-1;
//int xorr=nums[0];
vector<int>ans(n);
ans[0]=nums[0];
for(int i=1;i<n;i++) {ans[i]=xorr^nums[i];
xorr=xorr^nums[i];}
... | ALGO | 0.999973 | 5.448766 |
e3f4efb5-3245-431d-b6dd-37d8f55dfc31 | Deivmercer/LinearSystemSolver | src/LinearSystemSolver/IterativeSolver.cpp | //
// Created by David on 31/05/2024.
//
#include "IterativeSolver.h"
#include "Utils.h"
#ifndef NDEBUG
#include <iostream>
#endif
IterativeSolver::IterativeSolver() : n_iteration(0)
{
}
void IterativeSolver::solve(const Matrix &A, const Eigen::VectorXf &b, const Eigen::VectorXf &xk, float tolerance)
{
x = xk;... | ALGO | 0.999749 | 6.173478 |
6445ab16-9fe2-40e7-9703-32074b637b63 | YasArcher/CursoP2 | CursoP2/ejercicio29.cpp | #include <iostream>
using namespace std;
void lab_2_8_6() {
int vector[] = { 1, 7, 3, 8, 3, 7, 1 };
bool ispalindrome = true;
int n = sizeof(vector) / sizeof(vector[0]);
for (int i = 0; i < n / 2; i++) {
if (vector[i] != vector[n - 1 - i]) {
ispalindrome = false;
break;
}
}
if (ispalindrome)
cout ... | ALGO | 0.993524 | 3.594272 |
ea0366c7-a100-4f1f-abca-33cf3b8563e7 | minhducvo04/CSES | Introductory Problems/Chessboard_and_Queens.cpp | #include <bits/stdc++.h>
#include <algorithm>
#include <iterator>
using namespace std;
bool huyen[15], sac[15], row[8], col[8];
set <pair <int, int>> res;
int cnt = 0;
string str;
void DP(int now, bool hu[], bool sa[], bool ro[], bool co[]){
for(int i = 0; i < 8; i++){
if(!(hu[now - i + 7] || sa[now + i] ... | ALGO | 0.99855 | 3.134491 |
80d1074d-747c-4615-89f8-69365a1515ee | Siddharthmishraweb/MyLeetCodeSolutions | 257-binary-tree-paths/binary-tree-paths.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.999977 | 5.771326 |
54170385-bdfe-4087-945e-c18869f57360 | ishandutta2007/codeforces | pikel_rik/normal/1453/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7;
const double pi = acos(-1.0);
const int inf = INT_MAX;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
vector<ull> E = {0, 2};
for (; E.back() < (ull)1... | ALGO | 0.999782 | 4.465892 |
40d242a4-a966-4819-8bc3-ce38fb4c5547 | JustJie2002/Leetcode | Problem/Medium/P2958/code.cpp | /********************************************
* author : Jie Chen (3rd Year CS)
* school : Rochester Institute of Technology
* created: 03.28.2024 17:15:34
*********************************************/
using i64 = long long;
class Solution {
public:
int maxSubarrayLength(vector<int>& a, int k) {
int n... | ALGO | 0.99989 | 5.917263 |
a14a6f3f-0643-4d42-9b77-fa343519e368 | shadannamazi/Photo-Scramble | block_given.cpp | #include "block.h"
/**
* Given functions for the Block class.
*
* ****WARNING****
*
* You should not modify this file. It is not one of the files
* you will submit. We will grade your submission using the
* original version of this file.
*/
// Return "distance" between rightmost column of this (leftBlock)
/... | TOOL | 0.883459 | 4.703759 |
1907071d-7574-4f78-86d7-a18a0b4f4bf4 | kushagra414/100-Days-of-Code | Deepak Kumar/Programs/Day 33/33.3.Reverse a string using Stack.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
void reverse(char *str, int len);
int main()
{
long long int t;
cin>>t;
while(t--)
{
char str[10000];
cin>>str;
long long int len=strlen(str);
reverse(str,len);
cout<<str;
cout<<endl;
... | ALGO | 0.999678 | 5.120553 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.