uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f031f56c-2e51-49de-8043-629a3a6e3feb | HenriqueOliveiradaRocha/programcaoealgoritmos | Decisão Encadeada/Exercicio 4.cpp | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
int main(){
setlocale(LC_ALL,"Portuguese");
int MES;
puts("Que ms estamos ? ");
puts("Digite o ms de 1 a 12");
scanf("%d",&MES);
switch (MES){
case 1: puts("Estamos em janeiro\n");break;
case 2: puts("Estamos em fevereiro");break;
case 3: puts("Est... | TOOL | 0.977707 | 3.51044 |
d2f788fe-eb6b-446d-95a9-cf8de00fe922 | lytzsuck1ym/algorithms | Sorting/Quick_Sort.cpp | #include<stdio.h>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int partition(int *arr,int l,int r)
{
int key=arr[r],x=l;
for(int i=l;i<r;i++)
{
if(arr[i]<=key)
{
swap(arr[x],arr[i]);
x++;
}
}
swap(arr[x],a... | ALGO | 0.999986 | 3.883724 |
e2213299-27cc-45ae-8fe7-2c9494c4088a | AvivBk/minimum_spanning_tree_algorithms | MinimunSpanningTree_Algorithms/Heap.cpp | #include "Heap.h"
namespace minimum_spanning_tree
{
Heap::Heap() : m_heap(nullptr), m_max_size(0), m_heap_size(0), m_allocated(false)
{
}
void Heap::build_heap(const heap_node* i_arr, const int i_size)
{
allocate_heap(i_size);
m_heap_size = i_size;
for (int i = 0; i < i_size; ++i) {
const auto node = ne... | ALGO | 0.9993 | 4.235467 |
2178e3a6-5a27-47c8-aef4-f2e89ddffa00 | FootyCash/FootyCash | src/rpcnet.cpp | #include "rpcserver.h"
#include "alert.h"
#include "main.h"
#include "net.h"
#include "netbase.h"
#include "protocol.h"
#include "sync.h"
#include "timedata.h"
#include "util.h"
#include <boost/foreach.hpp>
#include "json/json_spirit_value.h"
using namespace json_spirit;
using namespace std;
Value getconnectioncoun... | WEB | 0.926637 | 6.776259 |
a8a2f619-a6eb-4a6b-937c-3fe514a4b288 | Eddy1108/PasswordTask | Class Task 17.11.20/Class Task 17.11.20.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <conio.h>
static constexpr int KEY_UP = 72;
static constexpr int KEY_DOWN = 80;
static constexpr int KEY_LEFT = 75;
static constexpr int KEY_RIGHT = 77;
class Board {
public:
std::vector<char> password{ 'A', 'B', 'C', 'D', 'E', 'F... | TOOL | 0.869777 | 4.057462 |
820c7c22-8450-4030-b6fc-5aa96e234fbf | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/October/CovidRun_20201002212822.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#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 printM... | ALGO | 0.999634 | 3.227251 |
410d5d6c-0b91-4bb7-9a7a-a69a2dd8112e | gitchaofang/leetcode | 311.cpp | class Solution {
public:
vector<vector<int>> multiply(vector<vector<int>>& A, vector<vector<int>>& B) {
int row = A.size();
int col = B[0].size();
std::vector<std::unordered_set<int>> ma(row);
std::vector<std::unordered_set<int>> mb(col);
std::vector<std::vector<int>> res(row... | ALGO | 0.999945 | 6.17709 |
14d12cbb-51a2-46cd-a9d3-54acb311f292 | lock3/meta | llvm/lib/Support/KnownBits.cpp | #include "llvm/Support/KnownBits.h"
#include <cassert>
using namespace llvm;
static KnownBits computeForAddCarry(
const KnownBits &LHS, const KnownBits &RHS,
bool CarryZero, bool CarryOne) {
assert(!(CarryZero && CarryOne) &&
"Carry can't be zero and one at the same time");
APInt PossibleSumZero... | ALGO | 0.996379 | 7.483075 |
55cbf11d-eec3-459c-8cd1-2355d3db16be | Ace-Krypton/LeetCode | Medium/ZigzagConversion/tests/test.cpp | #include "../include/solution.hpp"
class ZigzagConversion : public ::testing::Test {
protected:
~ZigzagConversion() override = default;
};
TEST_F(ZigzagConversion, FirstTest) {
int32_t num_rows = 3;
std::string word = "PAYPALISHIRING";
std::string result = Solution::convert(word, num_rows);
std::... | TEST | 0.873152 | 6.582683 |
85d2d95f-f345-417c-86b3-ca9ea0c8b9d5 | ishandutta2007/codeforces | mateocv/normal/407/A.cpp | #include <bits/stdc++.h>
#ifdef DEMETRIO
#define deb(...) fprintf(stderr,__VA_ARGS__)
#define deb1(x) cerr << #x << " = " << x << endl
#else
#define deb(...) 0
#define deb1(x) 0
#endif
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ThxDem=b;i<ThxDem;++i)
#... | ALGO | 0.999918 | 3.198557 |
ef35a559-7322-4d5d-a84b-1c9b80f72d97 | KwanWaiPang/DBA-Fusion_comment | thirdparty/gtsam/gtsam/geometry/Point2.cpp | /**
* @file Point2.cpp
* @brief 2D Point
* @author Frank Dellaert
*/
#include <gtsam/geometry/Point2.h>
#include <cmath>
#include <iostream>
using namespace std;
namespace gtsam {
/* ************************************************************************* */
double norm2(const Point2& p, OptionalJacobian... | ALGO | 0.999827 | 3.67025 |
38e2cf55-24b5-4fce-86a7-6c256a9ba54d | Manan007224/street-coding | Leetcode/lexicographical_numbers.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> lexicalOrder(int n) {
vector<int> R;
for(int i=1; i<=9; i++) {
if(i > n) break;
R.push_back(i);
go(i, n, R);
}
return R;
}
void go(int n, int t, vector<int> &R) {
for(int i=0; i<=9; i++) {
int next = ... | ALGO | 0.999043 | 6.332266 |
841550fc-0a33-4934-8cd6-a17f264aea86 | a1ive/plopkexec | src/tools.cpp | #include "tools.h"
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "sys/time.h"
#include "time.h"
#include "stdio.h"
double Curtime()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec + tv.tv_usec / 1000000.0;
}
void RemoveNL (char *t)
{
int i = 0;
while (... | TOOL | 0.9638 | 4.18715 |
8fc14e58-0f61-4cde-b413-485abc93a2b3 | CinkhQiu/concurrent_calculator | src/Calculator.cpp | #include "Calculator.h"
#include <sstream>
#include <stdexcept>
#include <cctype>
#include <stack>
#include <vector>
#include <string>
// 一个仅支持整数 + - * / 的简化表达式求值器
int Calculator::evaluate(const std::string& expression) {
std::istringstream iss(expression);
std::vector<std::string> tokens;
std::string toke... | TOOL | 0.982833 | 6.14822 |
b2d4df86-5700-4086-9dd9-74c2d1ddb51e | CAEL0/algorithm | manacher.cpp | // BOJ 13275 가장 긴 팰린드롬 부분 문자열
#include <bits/stdc++.h>
#define sz size()
#define bk back()
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
vector<int> manacher(string &s) {
int n = 2 * s.sz + 1;
vector<char> w(n);
for (int i = 0; i < n; i++) {
... | ALGO | 0.999826 | 4.704945 |
0bcb32a5-65e1-4690-b6ec-7a079b1e0392 | Roonil03/CodeChefGrind | Contests/Starters191/ColouredArray.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct HK {
int n, m;
vector<vector<int>> adj;
vector<int> d, pu, pv;
const int INF = 1e9;
HK(int n, int m): n(n), m(m),
adj(n+1), d(n+1), pu(n+1), pv(m+1) {}
void addEdge(int u, int v){
adj[u].push_back(v);
... | ALGO | 0.999958 | 4.284561 |
8e314603-f224-4871-ac31-02debe4b7511 | RafaelOliveira215/uiux | flutter_application_1/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.997899 | 6.763549 |
bd5667b8-d4a8-4c8b-8dbf-af06f2e4287f | raincross7/code-similarity | codes/train_code/problem216/problem216_66.cpp | #include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
int n,m;cin>>n>>m;
map<int,int> mp;
mp[0]=1;
int sm=0;
ll ans=0;
for (int i=0;i<n;i++) {
int a;cin>>a;
sm=(sm+a)%m;
ans+=mp[sm];
mp[sm]++;
}
cout<<ans<<endl;
return 0;
} | ALGO | 0.999963 | 4.262291 |
8c0f1b54-4fe4-4e3c-bd21-4ddd3cc5e4ec | ishandutta2007/codeforces | froggyzhang/normal/1682/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 100010
typedef long long ll;
int n;
char s[N];
void Solve(){
cin>>n;
cin>>(s+1);
int ans=n&1;
for(int i=n/2;i>=1;--i){
if(s[i+1]^s[n-i+1])break;
ans+=2;
}
cout<<ans<<'\n';
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int T;
cin>>T;
while(T-... | ALGO | 0.999765 | 4.276318 |
d92a946e-e1a0-4c34-9ae6-90854afddff2 | forked-llvm/Polaris-Obfuscator | clang-tools-extra/clangd/URI.cpp | #include "URI.h"
#include "support/Logger.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Path.h"
#include <algorithm>
LLVM_INSTANTIATE_REGISTRY(clang::clangd::URISchemeRegistry)
namespace clang {
namespace clangd {
namespace {
bool isWindowsPa... | TOOL | 0.88709 | 7.579123 |
92321259-abeb-4579-b335-ccf5dcfb4d29 | nishgpt/competitive_programming | codeforces/637_div2/B.cpp | /*
Author : Nishant Gupta 2.0
*/
#include<bits/stdc++.h>
#define LL long long int
#define pb push_back
#define mp make_pair
#define MAX 100005
#define MOD 1000000007
using namespace std;
int main() {
int i, t, n, k;
cin>>t;
while(t--) {
cin>>n>>k;
int a[n+1];
int peak[n+1];
int cum[n+1];
memset(cum,... | ALGO | 0.999928 | 3.684153 |
bfaa2f05-d80a-4d6f-beb5-0451d4dbbfc6 | LiamxZhang/Multi-agent-docking | Simulator/TestRobot/Lib/eigen/bench/perf_monitoring/gemm/lazy_gemm.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <Eigen/Core>
#include "../../BenchTimer.h"
using namespace Eigen;
#ifndef SCALAR
#error SCALAR must be defined
#endif
typedef SCALAR Scalar;
template<typename MatA, typename MatB, typename MatC>
EIGEN_DONT_INLINE
void lazy_gemm(const MatA &A, const Ma... | ALGO | 0.976636 | 6.117427 |
4c08f4a1-5f56-415b-9909-c389c25946e8 | yadavsahil28/Stack | Next Greater Element II.cpp | class Solution {
public:
vector<int> nextGreaterElements(vector<int>& nums) {
int n = nums.size();
vector<int> ans(n);
stack<int> s;
s.push(INT_MAX);
for(int i=2*n-1; i>=0; i--){
int item = nums[i%n];
while(!s.empty() && item >= s.top()){
... | ALGO | 0.999976 | 5.582318 |
efc509f9-da7b-4442-8903-b50abba068aa | euclidTeam/external_libcxx | test/std/algorithms/alg.sorting/alg.min.max/max_element.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// Iter
// max_element(Iter first, Iter last);
#include <algorithm>
#include <random>
#include <cassert>
#include "test_iterators.h"
std::mt19937 randomness;
template <class Iter>
void
test(Iter first, Iter last... | TEST | 0.945146 | 6.369077 |
518362f9-5119-4873-8ed9-32a502cca324 | SHOBHA-0502/linkedlistbesic | reverseoflinlkedlist.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
void printReverse(Node*head){
Node*temp = head;
if(temp == NULL){
return ;
}
printReverse(head->next);
cout<<head->data<<endl;
}
Node *t... | ALGO | 0.99942 | 4.935773 |
c4359ec8-ceb4-4a27-9bf5-e2a386c9e1f1 | goodstudyqaq/ACM | train/2023-08-02/A.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "copypaste/debug.h"
#else
#define debug(...) 42
#endif
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
struct fast_ios {
fast_ios() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
... | ALGO | 0.999894 | 5.153325 |
6e70d0a7-28d7-4de6-a111-103ac2c15799 | a00012025/Online_Judge_Code | TIOJ/1086.cpp | #include<bits/stdc++.h>
#define LL long long
using namespace std;
LL frac[20],C[20][20] ;
main()
{
frac[0]=1LL ;
for(int i=1;i<20;i++) frac[i]=frac[i-1]*i ;
for(int i=1;i<20;i++) for(int j=0;j<=i;j++)
C[i][j]= (j==0||j==i) ? 1 : C[i-1][j]+C[i-1][j-1] ;
int n ;
while(scanf("%d",&n)==1 && n)... | ALGO | 0.999897 | 3.744398 |
e3e859fb-e9d5-494e-ad1f-ff3eb598d829 | StyletX/Anycubic-Chiron-Marlin-bugfix-2.1.x | buildroot/share/PlatformIO/variants/MARLIN_F446VE/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Pin number
const PinName digitalPin[] = {
PA_0, //D0 //A7
PA_1, //D1 //A8
PA_2, //D2 //A9
PA_3, //D3 //A0
PA_4, //D4 //A1
PA_5, //D5 //A10
PA_6, //D6 //A11
PA_7, //D7 //A12
PA_8, //D8
PA_9, //D9
PA_10, ... | CONFIG | 0.902652 | 3.647584 |
0d26271f-61a8-4109-941b-9f8ec6d3758f | heliy/oj | bailian/pku_algo/0201genealogical.cpp | #include<iostream>
#include<cstdio>
#include<vector>
#define N 101
using namespace std;
bool isVisited[N];
int ins[N];
int n;
vector<vector<int> > graph;
int result[N];
void printins(){
int i;
cout << endl;
cout << "Ins: ";
for(i = 0; i < n; i++){
cout << ins[i] << " ";
}
cout << endl;
cout << "Ou... | ALGO | 0.999957 | 3.928152 |
829665eb-e8e7-4e0b-bbfe-2c215838f693 | ng2quan2/Flutter_UI | animal_plant_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.998912 | 6.785645 |
1c6bdde1-6482-4aec-8e07-0a8674ed93a5 | istiaqueahmedarik/CP_RESOURCE | B_Friendly_Arrays.cpp | /*******************************************
@b |I|s|t|i|a|q|u|e| |A|h|m|e|d| |A|r|i|k|
********************************************/
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
void _... | ALGO | 0.999989 | 5.177807 |
17f52644-3564-4ea0-964d-2920548e20de | raincross7/code-similarity | codes/train_code/problem431/problem431_492.cpp | #include <iostream>
#include <map>
std::pair<int, int> FibonacciPair(int Index)
{
if(Index == 0) return std::make_pair(0, 1);
if(Index == 1) return std::make_pair(1, 1);
std::pair<int, int> Prev = FibonacciPair(Index - 1);
return std::make_pair(Prev.second, Prev.first + Prev.second);
}
int FibonacciNumber(int Ind... | ALGO | 0.999789 | 5.103997 |
2e54a2ce-303f-41ee-b8cc-e5f5569d7814 | ishandutta2007/codeforces | peltorator/normal/923/A.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <queue>
#include <unordered_set>
#include <complex>
#include <unordered_map>
#include <bitset>
#include <ctime>
#include <cassert>
#define sz(a) (int... | ALGO | 0.999841 | 4.291402 |
333a24e1-182e-4e64-b542-bdb0b0f9ecce | utukaule/DSA | LB live DSA/2 Basic of programming-2/HW/areaOfCircleFun.cpp | #include<iostream>
using namespace std;
float areaOfCircle(float pi, int r){
float total = pi * (r*r);
return total;
}
int main(){
float pi = 3.14;
int r;
cout<<"enter the radius of circle: "<< endl;
cin>>r;
float result = areaOfCircle(pi, r);
cout<<"area of circle is : "<<result;
... | ALGO | 0.996367 | 3.985641 |
bedd8576-8100-4591-9577-964a4565e50b | gzhwanghub/cplusplus-primer | ch8/pra8_12_twotemps.cpp | #include <iostream>
template <typename T> // original template
void Swap(T &a, T &b);
template <typename T> // new template
void Swap(T *a, T *b, int n);
void Show(int a[]);
const int Lim = 8;
int main(){
using namespace std;
int i = 10, j = 20;
cout << "i, j = " << i << ", " << j << ".\n";
cout << ... | ALGO | 0.995727 | 5.427403 |
a6bf18c2-d231-45bc-b95b-6950c6838ba1 | Kaarti22/Solutions_DSA_CP | Binary Search/painters_partition_problem.cpp | /*
Link: https://www.naukri.com/code360/problems/painter-s-partition-problem_1089557?utm_source=striver&utm_medium=website&utm_campaign=a_zcoursetuf&leftPanelTabValue=PROBLEM
Given an array/list of length ‘n’, where the array/list represents the boards and each element of the given array/list represents the length of ... | ALGO | 0.999904 | 5.581536 |
94b4af36-ff90-4404-972c-5ed73fdf6928 | kunaldoliya90/Codeforces-ProblemSet | 677A/solution.cpp | /*
Vanya and his friends are walking along the fence of height h and they do not want the guard to notice them. In order to achieve this the height of each of the friends should not exceed h. If the height of some person is greater than h he can bend down and then he surely won't be noticed by the guard. The height of... | ALGO | 0.999959 | 4.897054 |
8e1df872-1d35-4453-80ed-6350160c678a | Chaoba/LeetCodeJava | c++/122.cpp | /**
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times).
Note: You may not engage in multiple transactions at the same ti... | ALGO | 0.999636 | 5.543771 |
dac46c60-2720-4d59-ae0f-98afae8ab9a3 | llukito/leetCode | 2696-minimum-string-length-after-removing-substrings/2696-minimum-string-length-after-removing-substrings.cpp | class Solution {
public:
int minLength(string s) {
while(true){
string curr;
bool b = true;
for(int i=0; i<s.length(); i++){
if(i<s.length()-1 && ((s[i] == 'A' && s[i+1] == 'B') || (s[i] == 'C' && s[i+1] == 'D'))){
b = false;
... | ALGO | 0.999506 | 5.386989 |
588ad55e-9643-4fa4-9e18-701ef91119a1 | QMrpy/competitive-programming | CodeChef/SEGPROD.cpp |
// Product on the segment by modulo
// https://www.codechef.com/NOV17/problems/SEGPROD
// Solution using disjoint sparse table
// https://discuss.codechef.com/questions/117696/tutorial-disjoint-sparse-table
// O(N log N) for construction
// O(1) per query
// Overall O(N log N + Q)
#include <bits/stdc++.h>
using name... | ALGO | 0.999928 | 4.320533 |
90722958-fd10-4bd1-916f-ba310d29bfb7 | jjeff-han/leetcode | eg030-039/cpp039_combinationSum.cpp |
#include<vector>
class Solution {
public:
vector<vector<int>> combinationSum(vector<int>& candidates, int target) {
vector<vector<int>> res;
vector<int> out;
combinationSumDFS(candidates, target, 0, out, res);
return res;
}
void combinationSumDFS(vector<int>& candidates, in... | ALGO | 0.999979 | 6.620059 |
6ec1451c-418c-4f67-b715-c993ed42ab63 | shihoyu060507/USACO | 1158.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
queue<int>q;
for(int i=1;i<=n;i++)q.push(i);
cout << "<";
while(q.size()>1){
for(int i=1;i<k;i++){
int tmp = q.front();
q.pop();
q.push(tmp);
}
cout << q.front() << ", ";
q.pop();... | ALGO | 0.999979 | 3.262771 |
53d16fca-3f63-47d3-9a5c-77c5082e467c | MrLazYT/CPP-Basics | lessons/lesson_4/Projects/Project2/FileName.cpp | #include <iostream>
using namespace std;
/*
* Pokupec' prydbav tovaru na sumu S grn
* znyžka na pokupky v marketi stanovyt'
* jakščo suma 500 - 1000 - 1%
* 1000 - 3000 - 3%
* 3000 - 10000 - 5%
* > 10000 - 7%
* sklasty proĝramu jaka povidomljaje rozmir znyžky i sumu do oplaty
*/
void main()
{
cout << "Jaka suma pokup... | ALGO | 0.892892 | 3.832983 |
f6d2f20a-3c52-4bcb-9925-9b795becb5e9 | TerryKingston/schoolbloc | project_implementation/flask_app/angr-z3-angr/src/tactic/smtlogics/quant_tactics.cpp | #include"tactical.h"
#include"simplify_tactic.h"
#include"propagate_values_tactic.h"
#include"solve_eqs_tactic.h"
#include"elim_uncnstr_tactic.h"
#include"qe_tactic.h"
#include"qe_sat_tactic.h"
#include"ctx_simplify_tactic.h"
#include"smt_tactic.h"
static tactic * mk_quant_preprocessor(ast_manager & m, bool disable_ga... | ALGO | 0.998692 | 5.956791 |
226739ff-2fed-4494-b7bd-a85e4fcca42d | San123san/leetcode-cpp | Median in a row-wise sorted Matrix.cpp | // User function template for C++
class Solution {
public:
int upperBound(vector<int> &arr, int x, int n){
int low = 0;
int high = n - 1;
int ans = n;
while(low <= high){
int mid = (low + high) / 2;
if(arr[mid] > x){
ans = mid;
... | ALGO | 0.999986 | 5.369438 |
eb601b51-7294-4304-a037-11a58df20362 | noveeda/solved_BOJ_problems | 문제/5622.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string call;
int sum = 0, i;
int arr[26] = {3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7 ,8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10};
cin >> call;
for (i = 0; i < call.length(); i++) {
sum += arr[call[i] - 'A'];
... | ALGO | 0.999503 | 3.983595 |
6a7c3564-d207-4602-a16b-55bcb55e23ec | Radhesh-Sarma/Competitive-Coding | atcoder/abc156/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define MOD 1000000007
int32_t main()
{
int n,k;
cin >> n >> k;
int ans = (int)(log(n) / log(k));
ans++;
cout << ans ;
} | ALGO | 0.999796 | 3.658843 |
71547fac-fe5d-456d-bea3-7e975a7109b0 | lovesosas/UCM-CSE30 | Lab_03/searchArray.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
//declare variables
bool statement = true;
int sizeOfArray;
int userKeyNumber;
int counter = 0;
//output and input
cout << "Enter size of array: " << endl;
cin >> sizeOfArray;
int array[sizeOfArray];
//handles out of bounds ... | ALGO | 0.996226 | 4.819583 |
1f46f065-5524-49be-ae66-9a977e274dda | Misantonio/deep_learning | opencv/opencv/samples/cpp/fitellipse.cpp | /********************************************************************************
*
*
* This program is demonstration for ellipse fitting. Program finds
* contours and approximate it by ellipses using three methods.
* 1: OpenCV's original method fitEllipse which implements Fitzgibbon 1995 method.
* 2: The App... | ALGO | 0.998814 | 6.213858 |
f7ef9d06-3bfd-4de1-8dd4-31328653852e | LasFo/aoc21 | 08.cpp | #include "bits/stdc++.h"
#include "atcoder/dsu.hpp"
using namespace std;
using namespace atcoder;
using _int = int;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define REP(n) FOR(__i, n)
#define int long long
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vvi vector<vector<int>>... | ALGO | 0.998683 | 4.385111 |
7c3d7073-9088-4999-b63e-c071c583a62a | TheGamerSpheal/Tarefas_LPR | Tarefas_LPR/Aula5/Exercicio1/Media.cpp | #include <iostream>
using namespace std;
int main() {
int quantidade, numero, soma_pares = 0, contador_pares = 0, contador = 0;
cout << "Digite a quantidade de números: ";
cin >> quantidade;
while (contador < quantidade) {
cout << "Digite o " << (contador + 1) << "º número: ";
... | ALGO | 0.996559 | 6.014318 |
6d981475-f959-4a31-9b2f-d8b4098b27e7 | codebroker19/Cpp | gcdexample.cpp | #include <iostream>
using namespace std;
//main Program
int findGCD(int n1, int n2)
{
int gcd;
for(int i=1; i <= n1 && i <= n2; i++)
{
if(n1%i==0 && n2%i==0)
gcd = i;
}
return gcd;
}
int main()
{
int num1,den1;
cout << "Enter numerator and denominator of first number: ";
//use... | ALGO | 0.999641 | 5.186479 |
d85f5af6-a8bb-4a02-8d24-aecff0f0929c | YanjieHe/Algorithms | Design_and_Analaysis_of_Algorithms/Prim_MST.cpp | #include "Prim_MST.hpp"
#include <queue>
#include <vector>
#include <limits>
#include <iostream>
#include <tuple>
using std::cout;
using std::endl;
void PrintVector(const std::vector<int> &vec)
{
cout << "parent: ";
for (int i = 0; i < vec.size(); i++)
{
if (vec.at(i) != -1)
{
... | ALGO | 0.999883 | 5.126255 |
b552c234-ae37-4314-9629-b664e7201a1b | mc-cat-tty/llvm-17.0.6-compilers | llvm/lib/CodeGen/CallBrPrepare.cpp | #include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#... | TOOL | 0.984254 | 7.943523 |
8c595d80-f570-48eb-a222-49e365f9639e | ve257/ipk-exercises2 | Test/IPK/uebungen/Zettel02/Zettel02_A2.cpp | #include <iostream>
int iterative(int q, int n);
int main(int argc, char** argv)
{
std::cout << "hello world!" << std::endl;
return 0;
};
| ALGO | 0.992959 | 3.731044 |
cb43d9a7-7342-4ef0-bab2-ec8e24b20e88 | SKLCS/JobDu | caoshen/1513.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main() {
int T;
while (scanf("%d", &T) != EOF) {
while (T--) {
int n, count = 0;
scanf("%d", &n);
while (n) {
n &= n - 1;
++count;
}
printf("%d\n", count);
}
}
return 0;
} | ALGO | 0.999665 | 4.425617 |
3733f9b2-5cf1-4e13-8c76-df1524c12962 | amandahsieh/Object_Oriented_Programming | Assignments/Assignment01/OOP_HW01_NET2019_202202_Template_Student/00_StudentWork/00_SimpleInteractiveSystem/mySystem_StudentRecordManager.cpp | //
// Instructor: Sai-Keung Wong
// Email: <EMAIL>
// <EMAIL>
//
// National Yang Ming Chiao Tung University, Taiwan
// Computer Science
// Date: 2022/03/24
//
#include "mySystem_StudentRecordManager.h"
#include <iostream>
using namespace std;
STUDENT_RECORD_MANAGER::STUDENT_RECORD_MANAGER( )
{
mNumStudents = 0;
}... | TOOL | 0.8554 | 4.97174 |
c862445c-90d5-4811-a578-cb60e016d816 | Dung34/addCourse | 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.9988 | 6.76073 |
cf62498b-8726-4709-9f77-94e9478396c6 | hiennguyen9874/ass1-dsa | dbLib.cpp | #include "dbLib.h"
#include <time.h>
#include <fstream>
#include <string>
#include <iostream>
#include <sstream>
#include <cmath>
#define pi 3.14159265358979323846
#define earthRadiusKm 6371.0
using namespace std;
struct DataEvent
{
L1Item<NinjaInfo_t> *p;
char id[ID_MAX_LENGTH];
L1Item<NinjaInfo_t> * TheFirst_M... | TOOL | 0.901203 | 3.38967 |
bf9381e2-64d2-4d7f-b1fa-2b0f56fdd389 | shujaathk/algoassignment2 | P166091_qasim/q2.cpp | // A Dynamic Programming solution for cut wire problem
#include<stdio.h>
#include<limits.h>
// A utility function to get the maximum of two integers
int max(int a, int b) { return (a > b)? a : b;}
//cutrod funtion starts here
int cutwire(int price[], int n)
{
int val[n+1];
val[0] = 0;
int i, j;
for (i = 1;... | ALGO | 0.999978 | 5.011181 |
a5385b69-0e17-4be8-a34e-da466f21773d | gim-largerepo/including-investment-59GB | src/plan.cpp | Bring store morning pass relate.
Western someone instead long.
Both hand lawyer product these carry more.
Floor respond building edge investment practice.
Suggest me know.
Drive at too coach.
Every often hair what need.
Later summer dream once fish record.
Heart unit short court year attorney little.
Yet hotel half vot... | TOOL | 0.94598 | 3.905426 |
2ac3670b-7d42-49eb-8ac3-ff6a365929c7 | TranBaLoi/DSA_PTIT | ChuTrinhEULERTrongDoThiCoHuong.cpp | #include<bits/stdc++.h>
using namespace std;
int indeg[1005], outdeg[1005];
int V, E;
vector<int> a[1005];
void solve()
{
for(int i = 1; i <= V; i++)
{
outdeg[i] = a[i].size();
for(int v : a[i])
indeg[v]++;
}
bool flag = true;
for(int i = 1; i <= V; i++)
{
... | ALGO | 0.999801 | 4.435147 |
16c5dc0b-ac7b-4f39-8933-ee4f9331dbbc | swadheen01/CF-Solutions | A_Shohag_Loves_Mod.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pie 2*(acos(0.0))
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define pb push_back
#define endl "\n"
#define lcm(a,b) (a*b)/(__gcd<ll>(a,b))
#define mod 1000000007
#define srt(v) sort(v.begin(),v.end())
#define rsrt(... | ALGO | 0.999729 | 4.532244 |
ddf12d58-db92-4a9f-b900-2174efa7e336 | Masters-Akt/CS_codes | codeforces_sol/A-The_New_Year_Meeting_Friends.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
void akt(){
int x[3];
for(int i=0;i<3;i++) cin>>x[i];
sort(x,x+3);
cout<<x[2]-x[0];
}
signed main() {
// your code goes here
std::ios::sync_with_stdio(false);
cin.tie(NULL);
int t=1;
//cin>>t;
while(t--){
akt();
}
}
| ALGO | 0.999854 | 4.019163 |
510d7582-8899-4d6c-99ff-3225c65873e9 | Puhinsky/Arduino-Motor-PID | ForwardTrajectory.cpp | //
//
//
#include "ForwardTrajectory.h"
#include "Trajectory.h"
#include "Robot.h"
ForwardTrajectory::ForwardTrajectory(Robot* robot, float relativeVelocity, float distance) {
this->robot = robot;
this->relativeVelocity = relativeVelocity;
this->distance = distance;
}
void ForwardTrajectory::run() {
robot->mo... | TOOL | 0.978634 | 4.841958 |
fd926a2a-3cb7-4d40-9af6-48a37fb95fb0 | phananhle1009/BSTs-Project- | usecase.cpp | //=================================
// Phan Anh Le
// usecase.cpp
// March 2024
// This file contains the solution for the hexidecimal problem.
//=================================
#include "bst.h"
//========================================================
// Create_BST
// Creates a BST from a csv file with the first ... | ALGO | 0.965639 | 6.786608 |
c9d493af-192f-4e0b-b514-9ba307e19085 | weeebdev/contests | watermelon.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
for (int i = 2; i < n; i+=2) {
if ( (n-2)%2==0) {
cout << "YES";
return 0;
}
}
cout << "NO";
return 0;
}
| ALGO | 0.999941 | 3.935391 |
2402eefe-40fb-413f-8daf-5aee471be38b | surajmate007/700_Topicwise_DSA_Solved_Problems | 11_Heap/Extra_01_Construct_Target_Array_With_Multiple_Sums.cpp | // Using Priority queue.
// Revise frequently.
class Solution {
public:
bool isPossible(vector<int>& target) {
//Priority queue for storing all the nums in taget in decreasing order.
priority_queue<int> pq;
long long sum = 0; //for storing total sum
for(auto num : target){... | ALGO | 0.999957 | 5.591514 |
a1c8b076-13a3-4b25-af0e-c535e2d171b8 | ange-yaghi/simple-2d-constraint-solver | src/system_state.cpp | #include "../include/system_state.h"
#include "../include/utilities.h"
#include <assert.h>
#include <cstring>
#include <cmath>
atg_scs::SystemState::SystemState() {
indexMap = nullptr;
a_theta = nullptr;
v_theta = nullptr;
theta = nullptr;
a_x = nullptr;
a_y = nullptr;
v_x = nullptr;
... | ALGO | 0.94764 | 4.929403 |
73f9b712-e2fc-42ed-8423-9018f7be87b2 | ProfitBaseCoin/Profitbase | src/rest.cpp | #include "chain.h"
#include "primitives/block.h"
#include "primitives/transaction.h"
#include "main.h"
#include "httpserver.h"
#include "rpc/server.h"
#include "streams.h"
#include "sync.h"
#include "txmempool.h"
#include "utilstrencodings.h"
#include "version.h"
#include <boost/algorithm/string.hpp>
#include <boost/d... | WEB | 0.937212 | 4.890437 |
6225bbb1-86a9-447e-b447-7ab30d84f9c4 | aditya109/git-osp-for-beginners | Programming/C++/MergeSortedArray/MergeSortedArrays.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> merge(vector<int> a, vector<int> b, int m, int n)
{
vector<int> res;
res.resize(m + n);
int i = 0, j = 0, k = 0;
while (i < m && j < n)
{
(a[i] <= b[j]) ? res[k++] = a[i++] : res[k++] = b[j++];
}
while (i < ... | ALGO | 0.999965 | 4.270137 |
b51bc747-0f67-4975-b431-f3d090d16796 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7365_10.cpp | #include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
double a, b, l;
inline int sgn(double x) {
if (fabs(x) < 1e-12) return 0;
return x < 0 ? -1 : 1;
}
inline double sqr(double x) { return x * x; }
inline double f(double x) {
double y = sqrt(sqr(l) - sqr(x));
return fabs(y * a + x * b - x... | ALGO | 0.999965 | 3.394004 |
bd8ee5cf-4774-4635-8047-a2d4b5fca9b4 | meekhumor/C-Assignment | Pattern Printing 2/Q2.cpp | // Print the following pattern
// Input: n = 4
// Output:
// A
// A B C
// A B C D E
// A B C D E F G
#include <bits/stdc++.h>
using namespace std;
int main()
{
system("cls");
int n;
cout << "Enter n : ";
cin >> n;
for (int i = 1; i <= n; i++){
for (int j = 1; j <= n-i; j++){
... | ALGO | 0.999599 | 4.793693 |
63478f52-83ff-4ef3-ba6d-b4902bd63358 | LittleYang0531/CQ-NOIP-2021 | CQ-0114/variance/variance.cpp | #include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn=10001;
vector<int> q[900000];
int n,a[maxn],ans=0x3f3f3f3f;
long long npp=0;
int cafen(){
int he=0,sum=0;
for(int i=1;i<=n;i++)
{
sum+=a[i]*a[i];
he+=a[i];
}
return sum*n-he*he;
}
void dfs(){
for(int i=npp;i>=1;i--)
{... | ALGO | 0.999902 | 3.474261 |
3a6be487-d47e-4459-a33c-dc83dcdabf49 | DevaishiT/DSA4-Algorithms-Strings | week 2/bwmatching.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int lettertoindex (char letter)
{
switch (letter)
{
case '$': return 0; break;
case 'A': return 1; break;
case 'C': return 2; break;
case 'G': retur... | ALGO | 0.999488 | 5.363643 |
5c8b06ad-899c-4855-a785-e8f760dbc910 | ZackDriscoll/Binary-Tree-Final | Binary Tree Final/Binary Tree Final/Source.cpp | #include <iostream>
#include <malloc.h>
#include "Node.h";
#include "BinaryTree.h";
using namespace std;
//Create an array of random ints
int myNum[8];
//Main Function
int main()
{
//Instantiate the tree with set data
struct node* root = NULL;
//Assign random values to the array until it is full
for... | ALGO | 0.998611 | 4.733306 |
f14c365a-5b5a-4457-9c1c-b0db6ed29d80 | joshualass/CP | Solutions/Contests/AC/ABC331/D331.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const ll MOD = 1e9 + 7;
//implementation practice 2d prefix sum
ll getArea(ll r1, ll c1, ll r2, ll c2, vector<vector<ll>> &prefixes) { //r1, c2 exclusive, r2, c2 inclusive
return prefixes[r2][c2] - prefixes[r2][c1] - prefi... | ALGO | 0.999836 | 5.314765 |
838a2406-aabe-46a8-ad5d-a64d0dc92b3c | daa233/learning-notes | programming/programming-and-algorithms-pku/3-c++/Week8/AlgorithmSampleFind.cpp | /**
* @file: AlgorithmSampleFind.cpp
* @description: 算法示例 find()
* @input:
* @output:
*
* @author: Du Ang
* @date: Aug. 29th, 2017
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char const *argv[]) {
int array[10] = {10, 20, 30, 40};
vector<int> ... | ALGO | 0.975129 | 3.210004 |
87f7b388-5517-4bf7-a989-66478c592cf0 | ishandutta2007/codeforces | kostia244/normal/1200/F.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC target ("avx2,tune=native")
#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define __V vector
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define oit o... | ALGO | 0.999954 | 3.803035 |
0634f58d-8c29-4a58-9157-52bec4d29ef0 | Avinash-choubey-4719/BACKTRACKING_cpp | Sudoku.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 9
#define UNASSIGNED 0
bool checkGrid(int grid[N][N], int &i, int &j);
bool inRow(int grid[N][N], int row, int n);
bool inCol(int grid[N][N], int col, int n);
bool inBox(int grid[N][N], int n, int row, int col);
bool isSafe(int grid[N][N], int row, int col, int n)... | ALGO | 0.999737 | 6.327072 |
505ff470-402c-4e2c-b950-929e6e9991a8 | masayukisobe/atcoder | abc/348/A/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
for (int i=0; i<n; i++) {
if ((i+1)%3==0) {
cout << "x";
} else {
cout << "o";
}
}
cout << endl;
return 0;
}
| ALGO | 0.999649 | 3.832178 |
fa5377fb-9d46-4750-b13a-ed5f9a24b488 | Kleenelan/magma_gpublas | src/zgetrs_gpu.cpp | /*
-- MAGMA (version 2.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date
@precisions normal z -> s d c
*/
#include "magma_internal.h"
/***************************************************************************//**
Purpose
... | ALGO | 0.992041 | 6.932801 |
6c91d27b-6160-4bbd-8bf3-1345f0f0ff0b | anthony-chaudhary/sdc-p10-mpc-linux | src/Eigen-3.3/doc/examples/function_taking_ref.cpp | #include <iostream>
#include <Eigen/SVD>
using namespace Eigen;
using namespace std;
float inv_cond(const Ref<const MatrixXf>& a)
{
const VectorXf sing_vals = a.jacobiSvd().singularValues();
return sing_vals(sing_vals.size()-1) / sing_vals(0);
}
int main()
{
Matrix4f m = Matrix4f::Random();
cout << "matrix m:... | ALGO | 0.9997 | 5.283265 |
a56ee195-9808-47ea-a78d-71b99b34d58f | geosteffanov/up-2016-2017 | week08/solutions/task2.cpp | #include <iostream>
#include <cstring>
using namespace std;
//функци¤, ко¤то провер¤ва дали дадена буква е гласна
//не забрав¤ме и главните гласни букви
bool isVowel(char a){
return a=='a'||
a=='e'||
a=='i'||
a=='o'||
a=='u'||
a=='y'||
a=='A'||
... | ALGO | 0.999047 | 4.428016 |
88ac9c6a-0707-432c-87d5-30d4af6f7661 | eliffkkurt/Code_Practice | HackerRank/HackerRank - C++ (1-30)/8. Arrays Introduction.cpp |
# Arrays Introduction
# https://www.hackerrank.com/challenges/arrays-introduction/problem
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n;
... | ALGO | 0.999693 | 4.64095 |
b16feb5f-c061-4238-8bb6-b70d1a3dbe0a | ishandutta2007/codeforces | acrush/normal/1479/B2.cpp | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <bits/stdc++.h>
using namespace std;
#define POW2(X) (1<<(X))
#define CKBIT(S,X) (((S)&POW2(X))!=0)
const double pi=acos(-1.0);
const double eps=1e-11;
template<class T> inline void ckmin(T &a,T b){ a=min(a,b); }
template<class T> inline void ckmax(T &a... | ALGO | 0.999828 | 3.930202 |
12638882-512d-4a8a-bbef-6d71b434e7bb | ishandutta2007/codeforces | crasysky/normal/1340/C.cpp | #include <bits/stdc++.h>
#define rep(i,l,r) for (int i=l,i##end=r;i<=i##end;++i)
#define per(i,r,l) for (int i=r,i##end=l;i>=i##end;--i)
#define ll long long
#define pr pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define pb push_back
using namespace std;
const int N=1e4+4,S=1e7+1e6+7,INF=1e9;
... | ALGO | 0.999693 | 3.190982 |
2f385a10-5832-488f-9926-95abc7423a9a | xuantungbrian/Algorithm-Data-structure-intro | pa1/pa1/chain_given.cpp |
#include "chain.h"
#include <string>
/* no-argument constructor */
Chain::Chain() : length_(0) {
head_ = new Node();
head_->next = head_;
}
/* Most useful constructor. requires your
* implementation of Block and insertBack.
* Builds a chain out of the blocks in the
* given image. The blocks we create
* ha... | TOOL | 0.9069 | 3.972254 |
5c6fcb71-fcd1-4a07-b4b8-11972b39a58d | drshn-k/LeetCode-Problems | 1425-constrained-subsequence-sum/1425-constrained-subsequence-sum.cpp | class Solution {
public:
int constrainedSubsetSum(vector<int>& nums, int k) {
vector<int> dp {nums[0]};
deque<int> decrease {nums[0]};
int res = nums[0];
for (int i=1; i<nums.size(); i++) {
if (i > k && decrease[0] == dp[i - k - 1])
decrease.pop... | ALGO | 0.999936 | 5.955928 |
9997f39d-198c-4d67-ba4e-dcb4b247dc88 | Azunn19/NguyenVanTuanNam_HN-ENG-KS24B_C_Session12 | Session12-Ex02.cpp | #include<stdio.h>
void InMang(int arr[], int Length) {
printf("Cac phan tu trong mang: ");
for (int i = 0; i < Length; i++) {
printf("%d ", arr[i]);
}
}
int main(){
int arr[] = {1, 2, 3, 4, 5};
int Length = sizeof(arr) / sizeof(arr[0]);
InMang(arr, Length);
return 0;
}
| ALGO | 0.988684 | 3.130354 |
1544afd5-b41a-408e-8397-5ece8830211c | anujeet98/DSA | codingblocks/BitManipulation/clear_bit_inRange.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int i;
cin>>i;
int j;
cin>>j;
//clear bit in range [j,i) i not include
//will need mask 11111000111 0s in range part
//to get we need 2 mask as intermediate to get final mask
int maskA=(~0);
maskA=maskA<<j;
//maskA = 111100000 0 till jt... | ALGO | 0.999898 | 3.162991 |
39fc2016-ff19-4454-b035-e44e8c793109 | hilariousabhishek/CPP-DSA | string/Palindrome_LowerCase.cpp | //char array palindrome ignoring case sensitivity
#include <iostream>
using namespace std;
//getting string length
int stringLength(char a[]){
int count =0;
for(int i=0; a[i]!='\0'; i++){
count++;
}
return count;
}
//Check string palindrome
bool check_string_palindrome(char name[],int length){
... | ALGO | 0.938184 | 4.73395 |
01656882-05d3-4d38-a6e5-b246b83af807 | Annie1911/fluter_widget_list | 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.998756 | 6.772262 |
1065bada-3c04-4984-980a-59a49b1978f0 | michaelgoldendev/angle-evolution | src/densstat.cpp | /*
* File: maintpd.cpp
* Author: Eduardo
*
* Created on November 20, 2015, 11:38 PM
*/
#include <stdio.h>
#include <cstdlib>
#include <armadillo>
#include <iostream>
using namespace std;
// Declaration
arma::vec DensStatMWNOU(arma::mat x, arma::vec mu, arma::vec alpha, arma::vec sigma, int maxK, double etrun... | ALGO | 0.999876 | 5.705531 |
0bfc5aa3-9fe7-4e78-a485-48bc3d3848c9 | shubhampanchmukh/DSA_450_ARRAYS | 29_ARRAYS.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, y = 0;
cin >> n;
int a[n], l[n], r[n], ma, mi;
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
ma = l[0] = a[0];
mi = r[n - 1] = a[n - 1];
for (int i = 1; i < n; i++)
{
if (a[i] > ma)
... | ALGO | 0.999976 | 4.690652 |
3e0ee693-c81d-45ba-9041-0a43860f08db | A01798012/Problems | Random/1847B.cpp | #include <bits/stdc++.h>
#define fst first
#define snd second
#define fore(i, a, b) for (int i = a, ThxDem = b; i < ThxDem; ++i)
#define pb push_back
#define ALL(s) s.begin(), s.end()
#define SZ(s) int(s.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
#define MAXN 100000
#define debug(x) c... | ALGO | 0.99915 | 4.985856 |
f63e1783-57d5-44e3-8f6e-37dff3e53083 | sahil-kumar-yadav/DSA | 01_Array/1D Array/find-missing.cpp | #include<iostream>
using namespace std;
void findMissingByXOR(int arr[],int n){
int ans = 0;
for(int i = 0;i<n;i++){
ans ^= arr[i];
}
cout<<ans;
for(int i = 1;i<n;i++){
ans ^= i;
}
cout<<ans;
}
int main(){
int arr[] = {1,3,5,3,4};
int n = 5;
findMissingByXOR(a... | ALGO | 0.999949 | 3.892758 |
22cacb91-5151-47f9-9074-2f40f895901a | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_12402_5.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a[200005], ans;
int32_t main() {
ios_base ::sync_with_stdio(0);
cin.tie();
cout.tie();
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i] ^= a[i - 1];
}
if (a[n] == 0) {
cout << -1;
return 0;
}
int i = 1, j = 0;
while (i <=... | ALGO | 0.999959 | 3.982271 |
66869da0-b819-4ccf-b768-11a7a65844ce | rohitpatilpr/DSA | Stack/Min Cost to Make String Valid.cpp | #include <bits/stdc++.h>
int findMinimumCost(string str) {
stack<int> s;
if(str.length()%2!=0){
return -1;
}
for(int i=0; i<str.length(); i++){
char ch=str[i];
if(ch=='{'){
s.push(ch);
}
else{
if(!s.empty() && s.top()=='{'){
s.pop();
}
else{
s.pu... | ALGO | 0.998556 | 5.069948 |
ab090a76-16e8-4742-ae76-674010ad9efe | raincross7/code-similarity | codes/train_code/problem361/problem361_441.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b){
if(a > b){
a = b;
return true;
}
return false;
}
template<class T> in... | ALGO | 0.999905 | 3.469204 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.