uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e79df67f-cb74-4044-a8f9-6d442ae4656f | redoy1102/Phitron-CP-Course | Completed/2 - Introduction to C++ for DSA/Module 3 - Class & Object/_7Descsort.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int s;
cin >> s;
int num[s];
for (int i = 0; i < s; i++)
{
cin >> num[i];
}
sort(num, num + 5, greater<int>());
for (int i = 0; i < s; i++)
{
cout<< num[i]<<" ";
}
} | ALGO | 0.999942 | 3.326501 |
cb40f85b-4e60-46ef-83bf-cc253db4e0c1 | Harsh0512-0ps/cpp_assignment. | Assignment1/Practical/Q46.cpp | // Write a C++ program to calculate the sum of digits of a given number using a while loop.
#include<iostream>
using namespace std;
int main(){
int n , sum = 0 ;
cout<<"Enter the numbbr n :- ";
cin>>n;
while(n >0){
int rem = n%10;
sum += rem;
n /= 10;
}
cout<<sum;
retur... | ALGO | 0.99988 | 4.400039 |
20ddab7f-d859-4ddb-b2a8-7abe9f7a1ea1 | Hardyy00/Codeforces | 1300-rating/inflation.cpp | #include <bits/stdc++.h>
using namespace std;
long long bs(long long sum, long long pi, vector<long long> &v, long long k){
long long low = 0;
long long high = 1e13;
long long ans = 0;
while(low <= high){
long long mid = high + (low - high)/2;
if((1.0 * pi /(sum + mid)) <= ((1.0 * ... | ALGO | 0.999906 | 3.97659 |
0bce562f-848b-484d-b394-299099588467 | Hacdess/Introduction-To-Programming | Week04/Baitap8.cpp | #include "Baitap8.h"
long long ComputeProductSquareOrEvenNumbers(int n)
{
if (n < 1)
return -1;
long long product = 1;
for (int i = 1; i <= n; ++i)
if (i % 2 == 0 || IsSquareNumber(i))
product *= i;
return product;
}
| ALGO | 0.999833 | 4.962743 |
20815c10-3b3a-4f91-aeb3-e1186e35ffaf | anush-hambardzumyan/Visual_Compiler_Task1 | parser.cpp | #include "tokenizing.hpp"
#include "writeToFiles.hpp"
void type_finder(std::vector<std::string>& each_dec, variable& each_var);
void var_and_val_finder(std::vector<std::string>& each_dec, variable& each_var);
void parsing()
{
std::vector<std::vector<std::string>> test = lines_and_tokens();
for(int i = 0; i < ... | TOOL | 0.863837 | 3.495909 |
cd363df7-5218-48c9-ae9c-fb45c9eebc17 | sajibreadd/Competitive-Programming-Algorithms | My Library/New Stuff/Biconnected Components/Online Bridge.cpp | // https://www.codechef.com/ENFE2019/problems/HTST9/
// add edges one by one
// output the total number of bridges after adding each edge
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+5;
int n, bridges, m;
int bcc[N], comp[N], link[N], sz[N], vis[N];
int current = 0;
void init(... | ALGO | 0.999877 | 5.740305 |
a5400567-3c49-4016-93c1-0e76bea51aa6 | ArifurLimon88/My-Code-Book- | Deal with big number by string/Division.cpp | #include <bits/stdc++.h>
#define LL long long int
using namespace std;
string strdiv(string s, LL n)
{
LL i, flg = 0, sum = 0, t;
string ans;
for(i=0; i<s.size(); i++)
{
sum = sum * 10 + (s[i]-'0');
t = sum / n;
if(t == 0 && flg == 0)
{
continue;
}
... | ALGO | 0.999859 | 4.468174 |
5be4172c-fa7f-404d-8de6-24ca0c878cee | 2070super/c- | 搜索二叉树/搜索二叉树/main.cpp | #include"BinarySearchTree.h"
#include<iostream>
int main()
{
BsTree<int> t;
int a[] = { 5,3,4,1,7,8,2,6,0,9 };
for (auto e : a)
{
t.insert(e);
}
t.InOrder();
t.erase(3);
std::cout << std::endl;
t.InOrder();
} | ALGO | 0.999828 | 4.56343 |
49e53f15-a320-4af1-b045-4ab0dbc653b0 | shinobisoft/android_frameworks_av | media/libstagefright/codecs/mp3dec/src/pvmp3_polyphase_filter_window.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_polyphase_filter_window.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
--------... | ALGO | 0.986984 | 4.613303 |
498a9fbb-c372-49e7-8e13-259517d18fc3 | Kkalsi99/LeetCode | 239_sliding_window_max/other.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> maxSlidingWindow(vector<int> &nums, int k)
{
if (nums.empty() || k == 1)
return nums;
int n = nums.size();
vector<int> ans;
deque<int> dq;
dq.push_back(nums[0]);
for (int i = 1; i < k; i++)
{
while (!dq.empty() && ... | ALGO | 0.999985 | 5.516715 |
92ba3f4b-ffac-48a3-9412-209302c1feff | Nilay-Patel-5/CPP-Programming | Pr04.1.cpp | /*A team of engineers was tasked with developing a program to calculate and manage the areas of multiple circles for a design project. To achieve this,
they devised a solution using a structured, object-oriented approach. At the foundation of their solution was a base class that represented a generic
shape, responsible... | ALGO | 0.998794 | 7.181139 |
944c39b8-c116-45a6-99fe-49b278a1a50d | lunw1024/OI | atcoder/abc139/e.cpp | #include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <queue>
using namespace std;
const int MAXN = 1001;
int N, indegree[MAXN][MAXN] = {0};
vector<pair<int, int>> edges[MAXN][MAXN];
int solve()
{
int out = 0;
queue<pair<int, int>> que[2];
for (int i = 1; i <= N - 1; i++)
... | ALGO | 0.999733 | 3.973458 |
69ba1543-e877-48ed-8458-5b01dab1804a | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_11793_17.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
;
double n, R, r;
cin >> n >> R >> r;
if (r > R) {
cout << "NO\n";
exit(0);
} else if (2 * r > R) {
cout << ((n == 1) ? "YES\n" : "NO\n");
exit(0);
}
double sinThetaHalf = r /... | ALGO | 0.999688 | 3.677197 |
630d2608-b583-470f-b34c-de0319794456 | yamidevs/ARAP | extern/eigen3/bench/sparse_lu.cpp |
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out
#define EIGEN_SUPERLU_SUPPORT
#define EIGEN_UMFPACK_SUPPORT
#include <Eigen/Sparse>
#define NOGMM
#define NOMTL
#ifndef SIZE
#define SIZE 10
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifnd... | ALGO | 0.997652 | 4.187482 |
eb20234a-7458-4993-a88d-63af8e339302 | vusec/stickytags | llvm-project/libc/src/math/generic/frexp.cpp | #include "src/math/frexp.h"
#include "src/__support/FPUtil/ManipulationFunctions.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(double, frexp, (double x, int *exp)) {
return fputil::frexp(x, *exp);
}
} // namespace __llvm_libc
| ALGO | 0.879391 | 4.820682 |
301611c3-cf29-4623-8fce-890b9bd58d56 | ManamritSingh/DSA_LinkedList_Problems | Easy/Linked List in Zig-Zag fashion/linked-list-in-zig-zag-fashion.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void print(Node *root)
{
Node *temp = root;
while(temp!=NULL)
{
cout<<temp->data<<" ";
temp=temp->next;
}
}
// } Driver C... | ALGO | 0.999931 | 5.375022 |
0b41f192-3d7b-40dc-9695-73dda8277591 | ivan100sic/master-thesis | cpp/sarray-slow.cpp | vector<int> sarray_slow(const string& s) {
int n = s.size();
vector<int> p(n);
iota(p.begin(), p.end(), 0);
sort(p.begin(), p.end(), suffix_cmp(s));
return p;
}
| ALGO | 0.992971 | 4.087703 |
f30671b5-147f-45bc-8f10-726706692c79 | mariancosmin17/op1 | tema 11 lab 9/lab9/lab9/lab9.cpp | #include <cstdio>
#include <tuple>
template <typename K, typename V>
class Map {
private:
struct Node {
K key;
V value;
Node* next;
int index;
Node(K k, V v, Node* n, int i) : key(k), value(v), next(n), index(i) {}
};
Node* head;
int size;
Node* find(const ... | TOOL | 0.901616 | 4.999712 |
6db506a0-45be-4e09-bfd7-a8a95bea704b | sidvisw/CodingBlocksCompetitiveProgramming | SegmentTreesLazyPropagation/RangeSumQueries.cpp | #include <bits/stdc++.h>
using namespace std;
/*-------------------------IMPORTANT #DEFINES---------------------------*/
#define endl '\n'
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define vi vector<int>
#define... | ALGO | 0.999799 | 5.394844 |
69852414-85b0-449a-8afe-fd4898573529 | WiseCoder24/leetcode-questions | 2 September to 14 September/minSumOfFourDigits.cpp | // 2160. Minimum Sum of Four Digit Number After Splitting Digits
// Easy
// You are given a positive integer num consisting of exactly four digits. Split num into two new integers new1 and new2 by using the digits found in num. Leading zeros are allowed in new1 and new2, and all the digits found in num must be used.
... | ALGO | 0.99869 | 6.359185 |
58d4fd05-f35b-4ac5-99ca-41676b572c8e | bayashi-cl/procon-submission | codeforces/1647/D/149306809.cpp | #ifndef LOCAL
#define NDEBUG
#endif
#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include... | ALGO | 0.999835 | 5.375843 |
8aa15367-7b4e-4fe6-884d-4d6d092e7245 | tonya0703/laba_4.6 | laba_4.6.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
double P, S;
int n, k;
P = 1;
n = 1;
while (n <= 20)
{
S = 0;
k = n;
while (k <= 20)
{
S += k;
k++;
}
P *= (n * n + S * S) / (n + 1);
n++;
}
cout << P << endl;
P = 1;
n = 1;
do
{
S = 0;
k = n;
do
{
S += k... | ALGO | 0.999188 | 3.35871 |
0a3906f8-2f44-4c74-b268-bbf53921d75f | tomisaking/Sweep | Sweep/main.cpp | #include <iostream>
#include <fstream>
#include "string.h"
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
#include <time.h>
#include <algorithm>
#include <cmath>
#include "Functions.h"
using namespace std;
////////////////////////////////////////////////... | ALGO | 0.896201 | 3.17219 |
73d94377-e78f-4a1f-bd5f-b9966babda8d | canispeakchinese/cpp | interview/intersity_segment.cpp | #include <iostream>
#include <limits.h>
#include <map>
#include <sstream>
#include <vector>
using namespace std;
typedef long long ll;
class Node {
public:
Node() = delete;
Node(ll position, ll value, Node *prev, Node *next) : position(position), value(value), prev(prev), next(next) {}
Node *prev, *ne... | ALGO | 0.995661 | 4.330517 |
626c4a01-3fcf-4166-a748-cc9fcfdb86fb | arya-oss/CNS-CS402 | SubstitutionCipher/playfair.cpp |
/**
* Title: Playfair Cipher
*
* Author: Rajmani Arya
* Date: 31 Aug 2016
*
* 'j' character is removed from text and box
*/
#include <iostream>
#include <string>
#include <stdlib.h>
#include <algorithm>
using namespace std;
const string key="monarchy";
char poly[5][5];
map<char, pair<int, int> > look;
... | ALGO | 0.999923 | 3.581127 |
d11767cb-38ca-4998-a5d0-816618bd8c25 | adityarai2109/DSA | 24_Binary_Search/AdityaVerma/11_min_abs_diff.cpp | #include <bits/stdc++.h>
class Solution1
{
public:
vector<int> nums = {1, 3, 8, 10, 15};
int ceil(vector<int> &nums, int t)
{
int ans = -1;
int n = nums.size();
int s = 0, e = n - 1;
while (s <= e)
{
int m = s + (e - s) / 2;
if (nums[m] == t)
... | ALGO | 0.999941 | 5.36627 |
4cc5519d-44db-477b-9af9-03ece8599438 | tt1m0n/technical_task | src/ParallelIfstreamRecursive.cpp | #include "../include/ParallelIfstreamRecursive.hpp"
#include "../include/helpers.hpp"
#include "../include/defaults.hpp"
#include <string>
#include <iostream>
#include <fstream>
#include <unordered_set>
#include <future>
std::unordered_set<std::string> RecoursiveRountine(const std::string& filename, uint64_t start, u... | TOOL | 0.940387 | 5.800273 |
c6867beb-339a-4a42-bddf-4a0d130dde89 | DrErickson/CS301_Bootcamp_Topics | Pointers/Pointers_Ex_comparison_issue.cpp | #include <iostream>
using namespace std;
int main()
{
int* p1, *p2;
p1 = new int;
*p1 = 42;
cout << "We declared pointers p1 and p2, and set *p1 to 42" << endl;
cout << "setting pointer p2 = p1 gives:" << endl;
p2 = p1;
cout << "\n*p1 = " << *p1 << endl;
cout << "*p2 = " << *p2 << end... | TOOL | 0.97432 | 4.078744 |
9ca291c5-724c-431b-b769-8bed778221dd | xq-ankit/LeetCode_Base | 0150-evaluate-reverse-polish-notation/0150-evaluate-reverse-polish-notation.cpp | class Solution {
public:
int cal(char ch, int t1, int t2) {
switch(ch) {
case '+':
return t2 + t1;
case '-':
return t2 - t1;
case '*':
return t2 * t1;
case '/':
return t2 / t1;
}
return 0;
}
int evalRPN(vector<string>& s) {
... | ALGO | 0.999935 | 6.120739 |
ec4eac8d-93b0-4bbb-99b9-15ff92d5f12d | gourabsingha1/LeetCode-and-GFG-Problems | 2108-find-first-palindromic-string-in-the-array/2108-find-first-palindromic-string-in-the-array.cpp | class Solution {
public:
// **** Palindrome or not ****
bool isPal(string s, int start, int end){
while(start <= end){
if(s[start++] != s[end--]){
return 0;
}
}
return 1;
}
string firstPalindrome(vector<string>& words) {
for(au... | ALGO | 0.999916 | 6.399001 |
1bbb2069-3495-4f74-92c8-be714fd0d352 | ishandutta2007/codeforces | papa3/normal/1033/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define mod 1000000007ll
#define INF 1000000000000000000ll11
struct algo {
int a, b;
algo() {
cin >> a >> b;
if( a-b != 1 ) {
cout << "NO\n";
return;
}
a += b... | ALGO | 0.999876 | 4.703112 |
56a608c7-7e02-4a6d-a306-0f2d088483e1 | cppascalinux/atcoder | arc113/b/b.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
int qpow(int a,int b,int mod)
{
a%=mod;
int ans=1;
for(;b;b>>=1,a=(ll)a*a%mod)
if(b&1)
ans=(ll)ans*a%mod;
return ans;
}
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
int r2=0,r5=0;
r2=a%2... | ALGO | 0.999985 | 3.897893 |
914a79b1-530c-4abf-9d11-971d5c59c1a2 | PietroGhg/tesi-archivio | libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy.pass.cpp | // <algorithm>
// template<InputIterator InIter, typename OutIter, class T>
// requires OutputIterator<OutIter, InIter::reference>
// && OutputIterator<OutIter, const T&>
// && HasEqualTo<InIter::value_type, T>
// constexpr OutIter // constexpr after C++17
// replace_copy(InIter first, InIte... | TEST | 0.969646 | 6.633842 |
e7a9e4c1-18a7-47d9-887e-5dc0e882a070 | ishandutta2007/codeforces | vladprog/normal/313/B.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
char c[100001];
scanf("%s",c);
string s=c;
int n=s.length();
int a[n];
a[0]=0;
for(int i=1;i<=n;i++)
a[i]=a[i-1]+(s[i]==s[i-1]);
int m;
scanf("%d",&m);
for(int i=0;i<m;i++)
{
int l,r;
scanf("%... | ALGO | 0.999972 | 3.99438 |
4187df76-e601-4e00-b351-2d56d6c58281 | bsmvictor/Algorithms-II | Moodle/LIST-União.cpp | #include <iostream>
#include <list>
using namespace std;
int main()
{
list<int> lista; // ponteiro de lista
list<int> lista1; // ponteiro de lista
list<int> lista2; // ponteiro de lista
list<int>::iterator p; // iterador para lista
list<int>::iterator o; // iterador para lista
in... | ALGO | 0.999954 | 3.615538 |
96baf68e-a016-4e37-a90b-e5427998bbc8 | mterada1228/atcoder | atcoder_begginer_contests/ABC282/b/b.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> S;
for (int i = 0; i < n; ++i) {
string s;
cin >> s;
S.push_back(s);
}
int cnt = 0;
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n; ++j) {
vector<int> arr(m, 0);
... | ALGO | 0.999979 | 4.928712 |
e9162090-56ca-4aa0-a0f2-7cce5a48bf7d | pappubishwas/GeeksForGeeks | spiral.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
#define MAX 1000
// } Driver Code Ends
class Solution
{
public:
/*You are required to complete this method*/
int findK(int a[MAX][MAX],int m,int n,int t)
{
// Your code goes here.
// Your code goes here.
int i, k = 0, l ... | ALGO | 0.999858 | 4.837142 |
e3278289-2dc7-415a-b54a-6958c058208c | roguexsubmarine/Learning_cpp | 63_sets.cpp | //data structure (contains collection of elements)
//insert, count, erase,
//find - return position (pointer to element)
#include <bits/stdc++.h>
using namespace std;
int main(){
set<int> s;
//insert
s.insert(3);
s.insert(5);
s.insert(2);
for(auto x: s){
cout << x << ' ';
}
... | ALGO | 0.932227 | 4.56996 |
bced220c-85c3-4eb1-b6a7-c4a75f04f952 | thamidtuhin74/30daysInteview | week1/1.Plus Minus.cpp | #include<stdio.h>
int main(){
int n,i,plus=0,minus=0,zero = 0;
scanf("%d",&n);
int arr[n];
for(i=0;i<n;i++){
scanf("%d",&arr[i]);
}
for(i=0;i<n;i++){
if(arr[i]>=1 || arr[i]<0){
if(arr[i]>=1){
plus++;
// printf("%d \n",plus);
... | ALGO | 0.999591 | 3.220474 |
ce0756f6-aaf8-4cfa-b393-5d362b4c327c | Woog222/JONGMANBOOK-PS | EDITORWARS.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <tuple>
#include <queue>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <list>
#include <stack>
#include <assert.h>
#include <string>
#include <map>
#include <set>
#include <iterator>
#include <cstdlib>
#include <ctime>
#include <climi... | ALGO | 0.999705 | 4.820484 |
29dcd6a0-8b0c-4c2a-a5f6-71fc0ea0cfe5 | FachrulRivaldy/JobFinderApps | 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.998693 | 6.797273 |
d203dda3-3460-482d-a551-d69f0eeee6e0 | Angel-Concha-Layme/computer-science-UNSA | Analisis y Diseño de Algoritmos/Laboratorio 8/Square.cpp | #ifndef SQUARE_H
#define SQUARE_H
class Square{
private:
int matrix[14][14];
int get_num_square_base(int i);
void propagate(int index);
int calculateAnswer(int i, int n);
public:
Square();
int get_num_square(int i, int j);
};
Square::Square(){
for (int i = 0; i < 14; i++){
for (int... | ALGO | 0.999546 | 3.906571 |
0fe3a868-f10b-43cb-9709-4591ca1e37df | JunHossain/Competitive-Programming | Codeforces/Team.cpp | #include <iostream>
using namespace std;
int main()
{
int n; // amount of questions
bool pa; // petya's ans
bool va; // vasya's ans
bool ta; // tonaya's ans
int can_do = 0, right_ans = 0;
cin >> n;
while (n--)
{
cin >> pa >> va >> ta;
if (pa == true)
can... | ALGO | 0.999657 | 4.218841 |
902018fc-c91c-40b8-8df0-330cae457f77 | akbtech17/dsa | Other/Nagarro Bootcamp/38-Lecture-QPS-Arrays,Bitmasking,Lists/2-DegreeOfAnArray.cpp | // 2-DegreeOfAnArray.cpp
// Given a non-empty array of non-negative integers nums,
// the degree of this array is defined as the maximum frequency
// of any one of its elements.
// Your task is to find the smallest possible length of
// a (contiguous) subarray of nums, that has the same degree as nums.
// Brutefo... | ALGO | 0.999969 | 5.855395 |
ef9fd24b-bc2d-4e3e-b876-72b4ceae038b | mendesbarreto/mega-man-runner | MegamanRunner/cocos2d/cocos/math/Vec2.cpp | #include "math/Vec2.h"
#include "math/MathUtil.h"
#include "base/ccMacros.h"
NS_CC_MATH_BEGIN
// returns true if segment A-B intersects with segment C-D. S->E is the overlap part
bool isOneDimensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E)
{
float ABmin = std::min(A, B);
float AB... | TOOL | 0.970056 | 7.039902 |
bd04a711-91c0-4f85-bd4d-440f9a9fd511 | deepsamanta/Competitive-programming-solutions | A_Is_your_horseshoe_on_the_other_hoof_.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll arr[4], sum = 0;
for (int i = 0; i < 4; i++)
{
cin >> arr[i];
}
sort(arr, arr + 4);
for (int i = 0; i < 4 - 1; i++)
{
if (arr[i] == arr[i + 1])
{
sum++;
}
}
... | ALGO | 0.999785 | 4.120782 |
2e8b9976-b011-496a-be36-f0282df5f4a8 | vivek-30/cp-and-dsa-zone | CodeChef/Starters/Starters11/g.cpp | #include <bits/stdc++.h>
using namespace std;
#define null NULL
#define endl "\n"
#define inf INT_MAX
#define minf INT_MIN
#define mod 1000000007
#define ll long long int
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,string> pis;
typedef pair<string,int> psi;
typedef pair<string,string> pss;
typ... | ALGO | 0.999907 | 3.276001 |
4721ee0a-29d8-49bd-b2dd-500c92af68ab | saurabhjn76/Competitive-Coding | CodeChef/Beginner/MISSp.cpp | #include "bits/stdc++.h"
using namespace std;
# define MOD 1000000007
# define GETCHAR getchar_unlocked
typedef long long ll;
inline ll readllInt() {
ll n = 0;
char c;
while (1){
c=GETCHAR();
if(c=='\n'||c==' ') break;
n = n * 10 + c - '0';
}
return n;
}
inline int readInt()... | ALGO | 0.999907 | 3.337284 |
f4fc5ba5-1e5f-4697-9878-d184d55949f8 | dnx04/cp | archives/cses/Introductory Problems/Chessboard_and_Queens.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef local
#include "lib/prettyprint.hpp"
#endif
vector<vector<int>> board(8, vector<int>(8));
int ans = 0;
void apply(int x, int y, int val) {
for (int k = 0; k < 8; ++k) {
if (board[x][k] != -1) board[x][k] += val;
if (board[k][y] != -1) board[k][y] += val... | ALGO | 0.999663 | 4.438225 |
3db74187-b259-4517-ba53-c12aee7bb2dc | hrishiprojects/Leetcode | inorderPreorder.cpp | class Solution {
public:
TreeNode* buildTree(vector<int>& preorder, int preStart, int preEnd,
vector<int>& inorder, int inStart, int inEnd, map<int, int>& inMap){
if(preStart > preEnd || inStart > inEnd){
return NULL;
}
Tr... | ALGO | 0.999986 | 6.452988 |
1bd796b6-8d6d-4be7-adb5-fc7bc3750f9f | ishandutta2007/codeforces | somethingnew/normal/1647/F.cpp | #include <iostream>
#include "cmath"
#include "string"
#include "vector"
#include "set"
#include "algorithm"
#include "map"
#include "climits"
#include "queue"
#include "array"
#include "numeric"
#include "random"
using namespace std;
#define all(x) x.begin(), x.end()
struct segtree {
vector<int> tree;
int sz;
... | ALGO | 0.999977 | 4.163032 |
2b8e44ea-2689-4e1c-b4ff-e7829e32d582 | Origogi/flutter-ui-challenge-samsungpay | 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.998859 | 6.785645 |
297c5d9d-7fb8-4948-8df7-c89acddd82b6 | Jontte/algopruju | src/suffix_array_test.cpp | #include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
#include <string>
#include <cassert>
#include "suffix_array.hh"
vector<int> get_suffix_array_naive(string s) {
vector<string> suffixes;
for (int i = 0; i < s.size(); i++)
suffixes.push_back(s.substr(i));
sort(suffixes.begin(), suff... | ALGO | 0.990221 | 4.640517 |
3f9c6a5a-be3e-483b-9e48-2536a7f81b0f | makio93/competitive-othersites | TopCoder/SRM/srm813/Q1/main0.cpp | // 本番WA
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i=0; i<(int)(n); ++(i))
#define rep3(i, m, n) for (int i=(m); (i)<(int)(n); ++(i))
#define repr(i, n) for (int i=(int)(n)-1; (i)>=0; --(i))
#define rep3r(i, m, n) for (int i=(int)(n)-1; (i)>=(int)(m); --(i))
#defin... | ALGO | 0.999974 | 3.940314 |
ff863c70-0fe3-4212-a3b9-ace4a9f47005 | mojyack/keyremap | src/uinput.cpp | #include <cstring>
#include <filesystem>
#include <fcntl.h>
#include <linux/uinput.h>
#include "macros/unwrap.hpp"
#include "uinput.hpp"
#include "util/fd.hpp"
namespace {
template <size_t bits>
constexpr auto bits_to_bytes = (bits - 1) / 8 + 1;
template <int event, size_t max>
auto get_uinput_device_event_bits(con... | TOOL | 0.885297 | 7.231219 |
ff2417c3-f1b6-4f52-9b47-c5dff2624e15 | Bisenteju3822/HACKERN2-PROJECT | root.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int i=1;
while(i<n/2){
if(i*i==n){
cout<<i;
break;
} i++;
}
}
| ALGO | 0.999958 | 3.572516 |
e82c6ff8-2c5b-4a92-8752-22d047fb021d | Fraunhofer-AISEC/softboundcets-llvm-project | clang-tools-extra/clang-query/QueryParser.cpp | #include "QueryParser.h"
#include "Query.h"
#include "QuerySession.h"
#include "clang/ASTMatchers/Dynamic/Parser.h"
#include "clang/Basic/CharInfo.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include <set>
using namespace llvm;
using namespace clang::ast_matchers::dynamic;
namespace clang {
... | TOOL | 0.942043 | 4.031905 |
9890d1e3-828a-4d04-8759-19a998d95502 | ishandutta2007/codeforces | gshgsh/normal/1548/A.cpp | #include<iostream>
#include<vector>
#include<cstdio>
using namespace std;
#define For(i,l,r) for(int i=l;i<=r;i++)
#define MAXN 200001
int N,M,Q,out[MAXN];
int get(){int x=0;char c=getchar();while(c<'0'||c>'9')c=getchar();while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();return x;}
int main()
{
N=get(),M=get();For(i,1,M){... | ALGO | 0.999734 | 3.713934 |
c7f108c1-7069-442b-80e3-6fe776155e1e | cortictechnology/eye_tracking_experiment | few_shot_gaze/eos/3rdparty/eigen/doc/examples/DenseBase_template_int_middleCols.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl;
return 0;
}
| ALGO | 0.937495 | 3.154174 |
465aa218-9e73-46af-9224-a38c90e1966a | naimulcsx/online-judge-solutions | Codeforces/218A - Mountain Scenery.cpp | #include <iostream>
using namespace std;
int main() {
int n, k, len;
cin >> n >> k;
len = 2 * n + 1;
int arr[len];
for (int i = 0; i < len; i++)
cin >> arr[i];
int i = 0, temp;
while( k != 0 && i < len ) {
if ( (i + 1) % 2 == 0 ) {
temp = arr[i] - ... | ALGO | 0.999998 | 3.482871 |
b9d94b7b-4028-45f9-9af0-ad7afc230648 | Abhisek-07/Component_Example | 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.998809 | 6.763549 |
3e0ed9fe-b570-4307-bde0-55cb81162eb7 | yagocasasnovas/cursoAnimacion | t2m1/include/eigen/doc/examples/tut_arithmetic_dot_cross.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
Vector3d v(1,2,3);
Vector3d w(0,1,2);
cout << "Dot product: " << v.dot(w) << endl;
double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar
cout << "Dot product via a matrix product... | ALGO | 0.999443 | 4.042919 |
3dceb5fd-a55d-40c9-b885-0833df84feb6 | riis/qgcbranding | qgroundcontrol/libs/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.972668 | 6.117427 |
1a9b314d-627d-4497-a14b-c6349e8ed8d0 | Nandu0786b/DSA | Graph/96_Prim's MST.cpp | // Prim's MST
// https://www.codingninjas.com/codestudio/problems/prim-s-mst_1095633?leftPanelTab=0
//Pick non visited minimum value
//Now updated in the mst that it's visited
//Now check it's adj neighbour and if they not visited and their weight is < key weight then update parent and weight
//In the end return pare... | ALGO | 0.999979 | 5.375815 |
619947b3-4c13-4818-a28a-ddeea6177250 | darchr/dram-cache-model | src/systemc/tests/systemc/misc/sim_tests/biquad/biquad2/delay_line.cpp | /*****************************************************************************
delay_line.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*************************************************************************... | ALGO | 0.955554 | 5.930281 |
8b336f08-3035-4011-86d1-dba12377a170 | nn-firc/CSGO | mathlib/sparse_convolution_noise.cpp | #include <math.h>
#include "basetypes.h"
#ifndef _PS3
#include <memory.h>
#endif
#include "tier0/dbg.h"
#include "mathlib/mathlib.h"
#include "mathlib/vector.h"
#include "mathlib/noise.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
// generate high quality noise based upon ... | ALGO | 0.99805 | 3.095589 |
74e3f060-69d9-4c0f-a413-cc5536926888 | cmcamdy/leetcode | src/cmcandy/C_Language_Answers/_0455.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace ::std;
class Solution
{
public:
int findContentChildren(vector<int> &g, vector<int> &s)
{
//排序
sort(g.begin(), g.end());
sort(s.begin(), s.end());
//从贪心的角度考虑,每次满足胃口最小的孩子可以满足最多的孩子
int sum = 0;
... | ALGO | 0.999869 | 5.249499 |
d0d636ca-753e-421e-af51-1b58adde9b8a | SamuelMaged90/Asyut_Sheets | Week2/F.cpp | #include <iostream>
using namespace std;
int main()
{
int number ;
cin>>number;
for(int j=1; j<=12; j++)
{
cout<<number<<" * "<<j<<" = "<<number*j<<endl;
}
return 0;
}
| ALGO | 0.999703 | 3.733777 |
003b5218-7cf4-45c6-9f7c-02b23f4174ab | ashish0kumar/AoC-2024 | days/24-Crossed-Wires/part1.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
map<string, int> value;
for (int i = 0; i < 90; i++)
{
char s[7];
cin >> s;
int d;
cin >> d;
value[string(s, s + 3)] = d;
}
char a[5], op[5], b[5], c[5];
vector<vector<string>> ops;
while (c... | ALGO | 0.999771 | 4.043322 |
287871d0-4a77-4659-884c-97bb5e3b3257 | Kinotijoan/Object-Oriented-Programming | CPP/patterns.cpp | #include <iostream>
using namespace std;
int main(void)
{
int i;
int j;
int n = 10;
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{
cout<<j<<" ";
}
cout<<endl;
}
return(0);
} | ALGO | 0.999807 | 3.904359 |
26143b11-89af-4b1c-89ef-ee7b688706bf | ltrbless/CG_HW_Hierarchicl_Z_Buffer | src/HierarchicalZBuffer.cpp | #include"HierarchicalZBuffer.h"
HZBuffer::HZBuffer()
{
}
HZBuffer::HZBuffer(int width, int height, Vector4unchar nkcolor) : Render(width, height, nkcolor)
{
this->deepbuffertree_ = new ftree();
this->deepbuffer_ = new double[width * height];
for(int i = 0; i < height; i++)
{
for(int j = 0; j ... | ALGO | 0.963649 | 3.29867 |
ef0f43c0-5c35-4dfc-8622-34f103d9e212 | helomair/Program1-HW | 第三周/3-8.cpp | #include<iostream>
using namespace std;
int main()
{
//ios_base::sync_with_stdio(false);
//cin.tie(0);
int a,b,c,D;
cin>>a>>b>>c;
D=b*b-4*a*c;
if(D==0)
cout<<1;
else
cout<<0;
return 0;
}
| ALGO | 0.999969 | 3.635513 |
a9f31e78-a6fa-441f-a476-cf942c1273fa | sqaz91819/mahw | GA/GA.cpp | #include <iostream>
#include <iomanip>
#include <random>
#include <chrono>
#include <fstream>
#include <list>
#include <cmath>
#include "mylib.h"
#include "myList.h"
#include "test.h"
using namespace std;
namespace GA
{
class GA
{
private:
struct children
{
myList Ca;
... | ALGO | 0.999734 | 4.906208 |
cabcf822-86ae-4452-b097-af109354c7f3 | jingtaozhang18/algorithm-exercises | code-interview/第4章 递归和动态规划/4-最长公共子串.cpp | #include<bits/stdc++.h>
using namespace std;
int dp[5000][5000];
int main(void){
string str_a,str_b;
cin>>str_a>>str_b;
int len_a=str_a.size(),len_b=str_b.size(),i,j;
if(!len_a||!len_b){cout<<-1<<endl; return 0;}
int ans_i=0, ans_j=0;
for(i=0;i<len_a;++i){
for(j=0;j<len_b;++j){
if(str_a[i]==str_b... | ALGO | 0.99998 | 3.770028 |
60eaca06-21f9-44d4-824f-d0bc4e44a871 | lemn09/DSA-CN | 001-DSA/013 Binary Search Trees/Assignment/007. Print Nodes at a distance k from node.cpp | void printNodesAtDepthK(BinaryTreeNode<int> *root, int k){
if(root == NULL){
return;
}
if(k == 0){
cout<<root->data<<endl;
}
string output+= 48 + root->data;
printNodesAtDepthK(root->left, k - root->data);
printNodesAtDepthK(root->right, k - root->data);
}
void nod... | ALGO | 0.999959 | 5.53918 |
7c387bcd-ea2e-44c0-8096-8223671ccea3 | hexu1985/MiniGraph.For.Cpp | samples/weight/sample_prim_mst3.cpp | /** \example weight/sample_prim_mst3.cpp
* This is an example of how to use the PrimMST3 class.
*/
#include <vector>
#include "mini_graph.hpp"
using namespace std;
using namespace mini_graph::weight;
int main()
{
int vertexNumber = 8;
vector<Edge> edges = {
{0,6, .51},
{0,1, .32},
... | ALGO | 0.999407 | 5.047962 |
38e69ba0-6755-498d-be56-20dc2523b6c3 | ChaddJones22/Towers-of-Hanoi-with-5-pegs | Towers of Honai/Main.cpp | //Towers of Honai up to 5 disks wih 5 pegs
#include <time.h>
#include <iostream>
#include <string>
using namespace std;
//prototype for funtion call
void TowersOfHanoi(int, string, string, string, string, string);
int main()
{
//Title of Program
cout << "Tower of Hanoi Program using n discs and 5 pegs." << endl <<... | ALGO | 0.998276 | 6.119715 |
df4edc01-e8a9-4fd8-b6cd-22844e3a6426 | tringholm/Discrete_Riemannian_Gradient_Optimization | DTI denoising/MVIRT-master/include/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,1,2,3;
//add v to each row of m
mat.rowwise() += v.transpose();
std::cout << "Broadcasting result: " << std::... | ALGO | 0.998883 | 4.296038 |
ba673abb-75ce-45a3-89a3-1581f219aef4 | pkini2002/Linkedlist-Solutions | LLInsertion.cpp | /*Structure of the linked list node is as
struct Node {
int data;
struct Node * next;
Node(int x) {
data = x;
next = NULL;
}
}; */
class Solution{
public:
//Function to insert a node at the beginning of the linked list.
Node *insertAtBegining(Node *head, int x) {
// Your code here
... | ALGO | 0.999376 | 5.585876 |
b1e2eb6d-e48b-4397-8202-aa8633c1873a | iamrakib087/IST | Weekend contest 2/H.cpp | #include<iostream>
using namespace std;
int main(){
int t,a,b,c;
cin>>t;
while(t--){
cin>>a>>b>>c;
if(a+b==c || b+c==a || c+a==b){cout<<"YES"<<endl;}
else if(a==b && c%2==0){cout<<"YES"<<endl;}
else if(a==c && b%2==0){cout<<"YES"<<endl;}
else if (b==c && a%2==0){cout<<"YES"<<endl;... | ALGO | 0.999907 | 4.003597 |
a08f8131-7b4d-4914-8ded-077a680cbbe7 | NirajanHub/e_commerce_flutter | 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.998859 | 6.785645 |
4f868a99-aa04-46dd-b695-f54c2d47c432 | lucascmartinez/DCA1202-Avaliacao02A | poligono.cpp | #include "poligono.h"
#include <iostream>
#include "ponto.h"
using namespace std;
/* @brief Construtor da classe polígono. Ele não realiza nada.
*/
Poligono::Poligono()
{
}
/* @brief Função pública para armazenar a quantidade de vértices desejados para y;
* @param A quantidade de vértices desejados.
*/
void Po... | ALGO | 0.86273 | 4.635546 |
40ddc6a0-e619-4928-8d21-1bfde5659baa | HieuKVN/CPlusPlus | ! TU ON TAP/SNTNHOHONN/SNTNHOHONN.CPP | #include <bits/stdc++.h>
#define nmax 100000000
using namespace std;
long long f[nmax];
void sang(long long u)
{
long long j;
for (long long i = 0; i <= u; i++)
{
f[i] = 1;
}
f[0] = f[1] = 0;
for (long long i = 2; i * i <= u; i++)
{
if (f[i])
{
for (j = i ... | ALGO | 0.999895 | 4.678645 |
5ede11ed-4493-4d13-8e4b-55ddc634683e | yutaroyamanaka/SimpleDB | src/indexing/btreeleaf.cpp | #include "indexing/btreeleaf.hpp"
namespace indexing {
BTreeLeaf::BTreeLeaf() {
}
BTreeLeaf::BTreeLeaf(tx::Transaction* transaction, file::BlockId& blk, const record::Layout& layout, const scan::Constant& searchkey)
: transaction_(transaction), layout_(layout), searchkey_(searchkey) {
contents_ = BTPa... | TOOL | 0.873826 | 5.939024 |
59ee1617-d1bc-4e16-9da0-1e647ab7f92b | PRANAVJARANDE/Leetcode-Solutions | easy/Take Gifts From the Richest Pile.cpp | class Solution {
public:
long long pickGifts(vector<int>& a, int k) {
priority_queue<int> q1;
long long s=0;
for(int x:a)
{
q1.push(x);
s+=x;
}
while(k--)
{
int tp=q1.top();
q1.pop();
s-=tp;
... | ALGO | 0.999947 | 4.830628 |
064f097e-3c67-494c-afa8-34d8cef52251 | Kbansheen/DSA-cpp | arrays/array_rotate_left_1place.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> rotateArray(vector<int>& arr, int n) {
int temp = arr[0];
for(int i = 0; i<n-1; i++)
{
arr[i] = arr[i+1];
}
arr[n-1] = temp;
return arr;
}
| ALGO | 0.999832 | 5.174893 |
81732a9e-60fb-4d55-b0fd-841d490c5ae2 | ombrecube/NuggetMine | VS2010/Buckland_Chapter7 to 10_Raven/goals/Goal_NegotiateDoor.cpp | #include "Goal_NegotiateDoor.h"
#include "..\Raven_Bot.h"
#include "..\Raven_Game.h"
#include "../navigation/Raven_PathPlanner.h"
#include "Goal_MoveToPosition.h"
#include "Goal_TraverseEdge.h"
#include "debug/DebugConsole.h"
//---------------------------- ctor -------------------------------------------
//---------... | ALGO | 0.972431 | 5.647134 |
b4070274-4af1-4513-a93f-041cd987f173 | paldad111/til-study | problem-solvings/beak-09613/main.cpp | #include <iostream>
using namespace std;
int T;
int V[100+1];
int gcd(int a, int b)
{
int v1, v2;
v1 = max(a, b);
v2 = min(a, b);
if (v2 == 0)
return 0;
if (v1 % v2 == 0)
return v2;
return gcd(v2, v1 % v2);
}
int main(void)
{
int i, j, N, t;
cin.tie(0);
ios::sync_with_stdio(false);
cin >> T;
f... | ALGO | 0.999855 | 4.25757 |
78dde252-6ba9-4de1-b197-6eea0f94c1a6 | IEIAuto/AutoDRRT | src/autodrrt.core/common/object_recognition_utils/src/predicted_path_utils.cpp | #include "object_recognition_utils/predicted_path_utils.hpp"
#include "interpolation/linear_interpolation.hpp"
#include "interpolation/spherical_linear_interpolation.hpp"
#include "interpolation/spline_interpolation.hpp"
#include <algorithm>
namespace object_recognition_utils
{
boost::optional<geometry_msgs::msg::Po... | ALGO | 0.9823 | 6.901133 |
d5aeb7f6-5aa7-4044-b00b-46d33b2853c4 | rubemkalebe/DCMST | src/Util.cpp | #include "Util.h"
bool comp(const Edge &e1, const Edge &e2) {
return e1.getCost() < e2.getCost();
}
| ALGO | 0.990027 | 3.719092 |
975f82dc-337b-4eb6-85e4-628f38e6e355 | onkarbartakke/DSA-Marathon | Arrays/Min_num_of_operations_to_make_arr_continous.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int minOperations(vector<int> &A)
{
int N = A.size(), ans = N, j = 0;
sort(begin(A), end(A));
A.erase(unique(begin(A), end(A)), end(A)); // only keep unique elements
int M = A.size();
for (int i = 0;... | ALGO | 0.999932 | 5.64679 |
53b979a5-8b55-400d-aab7-bde00de33f41 | mhnm-r/competitiveProgramming | CPP/Champaigne/m-table.cpp | #include <iostream>
using namespace std;
int main(){
int a=10;
int b=2;
printf("This is the multiplication table : from 1 to 10 multiplied by 10 \n");
printf("1 X 10 = ");
cout<< 1*10<<endl;
printf("2 X 10 = ");
cout<< 2*10<<endl;
printf("3 X 10 = ");
cout<< 3*10<<endl;
printf("4 X 10 ... | ALGO | 0.976103 | 3.194788 |
62ed33d9-a83b-482e-a3e2-97fdb43d0a36 | raincross7/code-similarity | codes/train_code/problem435/problem435_317.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int index = 1;
for (int i=0; i<n; i++) {
int in;
cin >> in;
if(in == index){
index++;
}
}
if(index == 1){
cout << -1 << endl;
return 0;
}
int ans = n + 1 - index;
cout << ans << endl;
}
| ALGO | 0.999922 | 3.412924 |
a0c5ae2c-e3ca-4a15-9d00-d5ceaae61f86 | mustafabawani/Implementing-Least-Distance-Algorithm-for-Search-Engine | SLL.cpp | #include <iostream>
#include "SLL.h"
#include "globalfunctions.h"
using namespace std;
SLL::SLL()
{
head=NULL;
tail=NULL;
}
void SLL::insert(string word,string pos,string synonym)
{
listNode * temp=new listNode(word,pos,synonym);
if(head==NULL && tail==NULL)
{
head=temp;
tail=tem... | TOOL | 0.991471 | 3.026283 |
e6ba1bf7-ec3e-412f-a571-dc5f46607439 | firstfan119/first_fan-s-code-on-luogu | C++/LuoGu1198.cpp | #include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
using namespace std;
#define root 1, m, 1
#define lson l, mid, rt << 1
#define rson mid + 1, r, rt << 1 | 1
int m, d, q[12345678], t;
void build(int l, int r, int rt)
{
q[rt] = -214783647;
if (l == r)... | ALGO | 0.999852 | 3.529217 |
a5fcf09c-d99e-4879-87b1-7152710c95e9 | Suraj-Dhankad2025/-6companies30daysChallenge | Medium/Number following a pattern/number-following-a-pattern.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
void rev(string &s,int i,int j){
while(i<j){
swap(s[i],s[j]);
j--;
i++;
}
return;
}
string printMinNumberForPattern(string s){
... | ALGO | 0.999222 | 6.705512 |
8d18dd3e-10d8-445d-b9ab-bf5893f1a965 | whorishi/6Companies30days | 11. (1392) Longest Happy Prefix - Leetcode.cpp | /*
A string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself).
Given a string s, return the longest happy prefix of s. Return an empty string "" if no such prefix exists.
*/
class Solution {
public:
string longestPrefix(string s) {
int index=-1;
long long ... | ALGO | 0.999982 | 5.794004 |
084c7d24-f252-498e-8f50-d9fd59e1dcd4 | manavithorve/CPP | practice/06-problems/spy.cpp | /*Spy Number is when sum and product of it's digit is same*/
#include<iostream>
using namespace std;
int main(){
int n, rem, sum=0, prod = 1;
cout<<"Number: ";
cin>>n;
while(n!=0)
{
rem = n % 10; //remainder
if (rem == 0)
{
continue;
}
n... | ALGO | 0.99978 | 3.782846 |
813d1afc-39a1-4f7a-8156-ae2db3a16535 | vijaykumar0710/Leetcode | 2308-divide-array-into-equal-pairs/2308-divide-array-into-equal-pairs.cpp | class Solution {
public:
bool divideArray(vector<int>& nums) {
bitset<501> parity;
for (int x : nums) {
parity.flip(x);
}
return parity.count() == 0;
}
}; | ALGO | 0.999839 | 5.604438 |
9bb1e492-15f6-48de-9a8b-71e9c3300876 | TaeYongHwang/HyHIT | Taeyong/백준/14889.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N;
vector<vector<int>> ability;
//־ Ϳ
int sumOfAbility(vector<int>& v) {
int sum = 0;
for (int i = 0; i < v.size(); i++) {
for (int j = 0; j < v.size(); j++) {
int idx1 = v[i];
int idx2 = v[j];
sum += ability[idx1][i... | ALGO | 0.999984 | 4.163999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.