uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
cb839b91-4d09-46b6-ba4c-11d104339517 | ritikshukla29/dsa-experiments-all | 8_SizeOfTree.cpp | // A recursive C++ program to
// calculate the size of the tree
#include <bits/stdc++.h>
using namespace std;
/* A binary tree node has data, pointer to left child
and a pointer to right child */
class node
{
public:
int data;
node *left;
node *right;
};
/* Helper function that allocates a new node with the... | ALGO | 0.999831 | 6.600129 |
9e654ef4-4e0b-4b8c-9916-695a2ad6e373 | MikelBarajas38/Grindset | rpc/2024/rpc24_02/B.cpp | #include <bits/stdc++.h>
using namespace std;
using pi = pair<int, int>;
using vi = vector<int>;
using vpi = vector<pair<int, int>>;
int main() {
long double n;
cin >> n;
long long attacks = ceill(log2l(n)) + 1ll;
cout << attacks << "\n";
return 0;
} | ALGO | 0.99972 | 4.636723 |
22f423fd-2c6c-4eed-9d16-37928e422295 | kingxdlol/Sample-programs | Turbo-Cpp/Fibonacci-Series_theprinekumar.cpp | //Program Objective: Print Fibonacci Series
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a=0, b=1, c=0, limit;
cout<<"Upto How many term ? ";
cin>>limit;
cout<<"Fibonacci Series : "<<a<<" "<<b<<" ";
c=a+b;
limit=limit-2;
while(limit)
{
cout<<c<<" ";
a=b;
b=c;
c=a+b;
limit--;
}
getch();
}
| ALGO | 0.999893 | 3.413792 |
b00db3e1-13b3-4d9a-a940-4f67dc508199 | stalker5217/problem-solving | BAEKJOON/15726.cpp | #define DEBUG 0
#define LOG(string) cout << string
#include <iostream>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int a, b, c;
cin >> a >> b >> c;
long long case1 = (long long)a * b / c;
long long case2 = (long long)a * c / b;
long long answer = (case1 > case2... | ALGO | 0.999952 | 3.945718 |
afdbb325-28e1-4f0b-a7da-f8553d9491a6 | capnmav77/Core-Programming | STL/DSA/Stack/Asteroid Collision.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=7isfomHzzno
Company Tags : Uber, lyft
Leetcode Link : https://leetcode.com/problems/asteroid-collision/
*/
//Using a stack<int> (T.C : O(n))
class Solution {
public:
vector<int> asteroidCollision(vector<int>& ... | ALGO | 0.999969 | 6.014071 |
38dc0c62-a9b2-4248-b658-71d0a77e6525 | Digital2Slave/KopfJBU | KopfJBU/JBU.cpp | #include "head.h"
#include "function.h"
extern double Imagescale;
extern int height,width;
extern int s_height,s_width;
inline double SpatialGauss(double x1, double y1, int x2, int y2, double sigma, double mu = 0.0)
{
double dis = pow(x1 - x2, 2) + pow(y1 - y2, 2) - mu;
return exp(-1.0 * dis / (2 * sigma * ... | ALGO | 0.997313 | 4.410792 |
7c775d6a-3c91-413e-ab67-b4e3ddec2c4a | suttonpd/srsran_project_temp | lib/phy/upper/channel_processors/pdcch_modulator_impl.cpp | #include "pdcch_modulator_impl.h"
#include "srsran/phy/support/re_pattern.h"
#include "srsran/phy/support/resource_grid_mapper.h"
#include "srsran/ran/precoding/precoding_codebooks.h"
#include "srsran/srsvec/bit.h"
#include "srsran/srsvec/sc_prod.h"
using namespace srsran;
void pdcch_modulator_impl::scramble(span<uin... | ALGO | 0.95239 | 6.39336 |
446cf3fe-d639-4407-9f98-fea51c5ef4f3 | Field-OS/external_rsync | simd-checksum-x86_64.cpp | /*
* Optimization target for get_checksum1() was the Intel Atom D2700, the
* slowest CPU in the test set and the most likely to be CPU limited during
* transfers. The combination of intrinsics was chosen specifically for the
* most gain on that CPU, other combinations were occasionally slightly
* faster on the oth... | ALGO | 0.922318 | 5.70661 |
bc91238d-1a12-4b54-b191-13123d7fe015 | 0owangjingo0/WZU-OJ | shujujiegou (2023-2024)/Test 8/3125 hafumanbianma.cpp | #include <queue>
#include <stdio.h>
#include <vector>
#include <functional>
using namespace std;
typedef struct HTNode
{
int value;
int weight;
HTNode * lchild;
HTNode * rchild;
int depth;
bool operator < (const HTNode &a)const
{
return weight < a.weight||(weight==a.weight&&value <... | ALGO | 0.999954 | 3.854507 |
a664e920-1007-4259-9aa8-bd4ff41aa178 | joydip007x/CompetitiveCodeArchive | CodeChef/TRIP2/21589828_WA_0ms_0kB.cpp | #include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define nikal_laura ios::sync_with_stdio(false); cin.tie(nullptr);cout.tie(nullptr);
#define sc(c) scanf("%d",&c);
ll a[100000+20],n;
ll balof2(ll x){
if(x==1) return 2;
if(x==2) return 1;
... | ALGO | 0.999937 | 3.135611 |
18799af2-974a-46a4-95dc-1b67614e2c49 | 1119-2916/competitive-programming | atcoder/agc/017/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb ... | ALGO | 0.999973 | 4.249343 |
7af971ef-8592-4734-bf83-97eebf0b63d8 | itsVaibhavSharma/DSA-cpp | Stacks/balancingParenthesis.cpp | #include <iostream>
using namespace std;
struct node
{
char data;
node *next;
} *tos = NULL;
void push(char ch)
{
node *p = new node;
p->data = ch;
if (tos == NULL)
{
p->next = NULL;
}
else
{
p->next = tos;
}
tos = p;
}
void pop()
{
if (tos == NULL)
... | ALGO | 0.993972 | 4.586092 |
33ae055f-6c6f-46b4-8025-a75b5087ed05 | Mr-Python-in-China/LuoguProblem | Luogu_CF_1678_B_2.cpp | #include <bits/extc++.h>
using namespace std;
namespace pbds = __gnu_pbds;
istream &fin = cin;
ostream &fout = cout;
using ui = unsigned int;
using uli = unsigned long long int;
using li = long long int;
int main(void) {
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
size_t T;
fin >> T;
while... | ALGO | 0.999936 | 3.894821 |
a063a26d-8537-4492-bff1-a0b2aa047891 | yanjiangdi/Design-algorithms-to-solve-problems | 最小长方形.cpp | #include<iostream>
#include<vector>
#include<limits.h>
using namespace std;
int main()
{
while(true)
{
int a,b;
int count = 0;
int xmax = INT_MIN;
int xmin = INT_MAX;
int ymax =INT_MIN;
int ymin = INT_MAX;
while(cin>>a>>b,a!=0||b!=0)
{
... | ALGO | 0.999375 | 3.341073 |
eb955685-9fac-451f-b879-f95c3e98cde2 | gaki2/Solve | 백준/ex10989/ex10989.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N;
vector<int> set(10001, 0);
int main(void)
{
scanf("%d",&N);
int num;
for (int i = 0; i < N; i++)
{
scanf("%d", &num);
set[num]++;
}
for (int i = 1; i < 10001; i++)
{
while (set[i] != 0)
{
printf("%d\n", i);
... | ALGO | 0.999882 | 3.756972 |
0475b736-012e-48a4-be95-243b1e86277a | zhaoyu775885/FCEMS | src/FastBEM.cpp | #include "FastBEM.h"
#include <algorithm>
#include "Math/ChebItp.h"
#include "h2lib/eigensolvers.h"
#include "h2lib/factorizations.h"
#include <chrono>
#include <queue>
typedef std::chrono::high_resolution_clock Clock;
#define TST_HMATRIX_ERROR 0
#define USE_ACA 0
#define USE_HCA 1
#define USE_FULL_ACA 0
#define USE_... | ALGO | 0.999459 | 3.819333 |
e63cc615-f02a-405d-8f03-ec09af55ae6a | chingyshan/for_tyomka | task_2/main.cpp | #include <iostream>
int recursion (int n1, int n2){
if (n1==0){
return n2+1;
}
if (n2==0 && n1>0){
return recursion(n1-1,1);
}
return recursion(n1-1,recursion(n1,n2-1));
}
int main(){
int num1=2;
int num2=3;
std::cout<<recursion(num1,num2)<<std::endl;
return 0;
}
| ALGO | 0.999868 | 4.854254 |
5539295e-fc25-471e-b67f-111641e9fbad | harsh1504660/DSA-prep | 2D_Array/BinarySearch.cpp | #include<iostream>
#include<vector>
using namespace std;
bool BinarySearch(vector<vector<int>> arr,int target)
{
int row = arr.size();
int col = arr[0].size();
int start =0;
int end = (row*col) - 1;
int mid = start + (end-start)/2;
while (start<=end){
int element = arr[mid/col][mid%col... | ALGO | 0.999911 | 4.922182 |
32269a14-fe33-4fee-8666-2e79d47307d5 | awe-srush/Neetcode150-srushti | group-anagrams.cpp | #include <iostream>
#include <map>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
vector<string> strs = {"eat", "tea", "tan", "ate", "nat", "bat"};
unordered_map<string, vector<string>> anagrams;
for (auto str : strs)
{
string key = str;
sort(k... | ALGO | 0.999842 | 5.000731 |
1e27a113-2bea-4a5e-b1f8-454b12a6949f | panzg123/leetcode | Summary_Ranges.cpp | //Summary Ranges,2ms
vector<string> summaryRanges(vector<int>& nums)
{
vector<string> result;
int begin = nums[0];
int end = nums[0];
if (nums.size() == 0)
return result;
if (nums.size() == 1)
{
result.push_back(to_string(begin));
return result;
}
for (size_t i = 1; i < nums.siz... | ALGO | 0.999517 | 6.041933 |
ff6b0657-9f58-4249-91f2-abed00851331 | richard-vock/pcl_compress | src/jpeg2000.cpp | #include <jpeg2000.hpp>
#include <openjpeg-2.1/openjpeg.h>
namespace pcl_compress {
opj_image_t*
convert_for_jpeg2000(const image_t& img) {
opj_image_cmptparm_t cmptparm[4];
int numcomps = 3;
memset(&cmptparm[0], 0, (size_t)numcomps * sizeof(opj_image_cmptparm_t));
OPJ_COLOR_SPACE color_space = OPJ_C... | DATA | 0.895067 | 6.810701 |
2ad8f71b-70e2-4ccd-bdd7-9f5d14c17586 | squatboy/problemsolving | 백준/2386.cpp | #include <iostream>
#include <algorithm>
#pragma warning(disable:4996)
#include <vector>
using namespace std;
int main(int argc, const char * argv[]){
ios_base::sync_with_stdio(false);
cin.tie(0);
while(1)
{
string str;
getline(cin, str);
if(str[0] == '#')
... | ALGO | 0.998612 | 3.566994 |
d5fdc040-df7c-4e10-b583-050a979caa17 | sanjanap1703/leetcode | my-folder/problems/kids_with_the_greatest_number_of_candies/solution.cpp | class Solution {
public:
vector<bool> kidsWithCandies(vector<int>& candies, int extraCandies) {
vector<bool> v;
int max=candies[0];
for(int i=1;i<candies.size();i++)
{
if(candies[i]>max)
{
max=candies[i];
}
}
for(int ... | ALGO | 0.999964 | 6.076811 |
567e1b63-0b93-465c-a363-14637c3e69d4 | Deepakvrma14/Practice-web-dev-and-dsa | DSA Practice/Lecture061 Queue Interview Questions/reverseQueue.cpp | queue<int> rev(queue<int> q)
{
stack<int> s;
while(!q.empty()) {
int element = q.front();
q.pop();
s.push(element);
}
while(!s.empty()) {
int element = s.top();
s.pop();
q.push(element);
}
return q;
} | ALGO | 0.999339 | 4.628142 |
939319b1-68df-4cda-84c9-2a30b2c10f6e | Jairo-Roke/ardupilot_4_4 | Blimp/commands.cpp | #include "Blimp.h"
// checks if we should update ahrs/RTL home position from the EKF
void Blimp::update_home_from_EKF()
{
// exit immediately if home already set
if (ahrs.home_is_set()) {
return;
}
// special logic if home is set in-flight
if (motors->armed()) {
set_home_to_current... | TOOL | 0.968191 | 7.101614 |
29f58181-c0bb-48d5-ae19-e0472523d991 | vudinhan2525/DSA-UIT | Bai thuc hanh 3/Bai 1.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'quickSort' function below.
*
* The function is expected to return an INTEGER_ARRAY.
* The function accepts INTEGER_ARRAY arr as parameter.
*/
vector... | ALGO | 0.999948 | 5.547892 |
f89ffe3f-426a-49e5-84c2-7a79c1e4e581 | dhirajpatil2346/compitative | cf 1700/berryjam.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define endl "\n"
void solve()
{
int n;
cin >> n;
vector<int> left(n);
vector<int> right(n);
for (auto &val : left)
{
cin >> val;
if (val == 2)
val = -1;
}
for (auto &val : right)
{
... | ALGO | 0.99992 | 3.551096 |
7f9910ca-08ba-4e40-b7ac-0b116d902454 | MonsterCT2k3/staff_management | 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 |
5ca981df-9135-424d-8dd2-c6ba78f737e9 | zznyjidi/programming_cpp_course | c14/c14_hw.cpp | #include <iostream>
#include <string>
using namespace std;
int GCD3(int numA, int numB, int numC) {
if (numA < 0) numA -= numA * 2;
if (numB < 0) numB -= numB * 2;
if (numC < 0) numC -= numC * 2;
int gcd = 1;
for (int i = 1; i <= min(min(numA, numB), numC); i++) {
if(numA % i == 0 && numB %... | TOOL | 0.939718 | 3.744612 |
09a30ba7-3e69-4949-85b1-1dd5b29ad2a3 | aamirhannan/AZPremiumB3 | classroom.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
const int MOD = 1e9 + 7;
const int INF = LLONG_MAX >> 1;
bool check(int x, vector<int>&nums, int k)
{
int new_seat_assigned = 1;
int prev_seat_left = nums[0];
for (int i = 1; i < nums.size(); i++)
{
if (nums[i] <= prev_seat_... | ALGO | 0.999976 | 5.257135 |
858931c3-9630-4d3b-8461-d3c949cc67cc | yashwani78/DSA | PP/M2/1.Arrays_and_dynamic_arrays/1.Precomputation/prefix_min.cpp | #include <iostream>
#include <climits>
#include <algorithm>
using namespace std;
int main(){
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++){
cin >> arr[i];
}
int prefix_min[n];
// int minimum = INT_MAX;
// for (int i = 0; i < n; i++){
// if (arr[i] < minimum)
... | ALGO | 0.999673 | 3.544561 |
2f35653d-95ee-4230-b2be-a83540a17709 | ishandutta2007/codeforces | juve45/normal/154/B.cpp | #include <bits/stdc++.h>
#define st first
#define nd second
using namespace std;
void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prn... | ALGO | 0.999947 | 3.839194 |
5d843d33-8366-4ad8-8aa3-963d2bf66e17 | hirakuuuu/kyopro | others/ACPC2025day1/l.cpp | #include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define inr(l, x, r) (l <= x && x < r)
#define ll long long
#define ld long double
// using mint = modint1000000007;
// u... | ALGO | 0.999903 | 5.125796 |
774915d9-4800-4076-8f08-09bd2d15797b | J0hann3/Piscine_CPP | Module09/ex01/RPN.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* RPN.cpp :+: :+: :+: ... | TOOL | 0.988541 | 4.555663 |
5e4e9bdb-310a-4c74-a63f-16c966bc15b9 | yasser-eddouche/friviaa | 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 |
f1485289-70dc-4902-b235-b2ffb5d3d945 | golfrumors/CodeForces | 0001-0099/43/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n; cin >> n;
map<string, int> s;
string t;
for(int i = 0; i < n; ++i)
{
cin >> t;
s[t]++;
}
string w;
int m = 0;
for(auto& p : s)
{
if(p.second > m)
{
m = p.second;
w = p.first;
}
}
cout <... | ALGO | 0.999754 | 4.108745 |
1e442e91-bcd9-46d9-b5e8-40dfb95b1ce6 | heduenas/codeforces | codeforces_276/a.cpp | #include <stdio.h>
#include <algorithm>
#include <iostream>
#include <utility>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
#include <set>
#include <list>
#include <sstream>
#include <time.h>
#include <stdlib.h>
#include <ctype... | ALGO | 0.999723 | 3.818655 |
db8b042b-66ce-4901-b504-834d19a6963e | LuisAlbOR/Udemy | Python/proyectos/opencv-4.x/3rdparty/carotene/src/sub.cpp | #include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
template <typename T, typename WT>
struct SubWrap
{
typedef T type;
void operator() (const typename internal::VecTraits<T>::vec128 & v_src0,
const typename internal::VecTraits<T>::v... | ALGO | 0.989908 | 6.165411 |
4a5c771d-5f70-4b83-b3b3-a77dd46a8db7 | ManpreetKhinda/CP_2Darrays | max1rectangle.cpp | #include <iostream>
#include <cmath>
#include <stack>
#include <string>
#include <stdlib.h>
#include <unordered_set>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <algorithm>
#include <queue>
using namespace std;
#define R 4
#define C 4
int maxHist(int row[]){
stack<int> result;
... | ALGO | 0.999362 | 4.090012 |
71df03c4-9386-4a8e-b3de-0a6cfa8a53a4 | StableSteady/AdventOfCode2023-CompileTime | Day1Puzzle1/Day1Puzzle1.cpp | #include <iostream>
#include <ranges>
#include <string_view>
constexpr std::string_view input = R"(1abc2
pqr3stu8vwx
a1b2c3d4e5f
treb7uchet)";
constexpr bool isDigit(const char c) {
return c <= '9' and c >= '0';
}
constexpr auto digit = [](const char c) { return isDigit(c); };
constexpr auto toInt = [](const cha... | ALGO | 0.999297 | 6.896639 |
b1058e4c-8348-4ace-9f53-b72a33d8de25 | ishandutta2007/codeforces | chasedeath/normal/1492/D.cpp | #include<bits/stdc++.h>
using namespace std;
int a,b,k;
char s[1000010];
int main() {
scanf("%d%d%d",&a,&b,&k);
if(a==0) {
if(k) puts("No");
else {
puts("Yes");
for(int i=1;i<=b;++i) putchar('1');
puts("");
for(int i=1;i<=b;++i) putchar('1');
}
return 0;
}
if(b==1) {
if(k) puts("No");
else... | ALGO | 0.999988 | 3.147581 |
2579aa6b-91f1-4b6c-84b9-ef6f811cf853 | sarvex/leetcode-racket | lcci/16.14.Best Line/Solution.cpp | class Solution {
public:
vector<int> bestLine(vector<vector<int>>& points) {
int n = points.size();
int mx = 0;
pair<int, int> ans = {0, 0};
for (int i = 0; i < n; ++i) {
int x1 = points[i][0], y1 = points[i][1];
unordered_map<string, vector<pair<int, int>>> c... | ALGO | 0.999987 | 5.648745 |
dfb480c0-aa59-4de6-8df3-45932a3e74af | tayu0110/atcoder | abc/abc150b.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
using ll ... | ALGO | 0.99973 | 3.698428 |
dc118efb-7b2e-4415-9734-066d0cadab9d | Ch-Lokesh/cp_practice | cf_129.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define int long long
#pragma region Debugger
void __print(int x)
{
cerr << x;
}
void __print(long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr <<... | ALGO | 0.999969 | 4.547983 |
1d5df0c4-9451-4e64-b88b-bc6950e18569 | MetalPotato24/Problem-Solving | CF/1700A.cpp | #define ll long long
#define pi acos(-1.0)
#define Go "\n"
#define Afor(i,a,b) for( i=a;i<b;i++)
#define GCD __gcd
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tt int t ; cin >> t ; while(t--)
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_w... | ALGO | 0.999971 | 3.667575 |
ce1ed357-195e-4522-a973-7de00be554db | ManojaD2004/cpp-pratice | good_lookback_prgs/advance/adapt1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
// A function to check if a number is even
bool IsEven(int x) { return x % 2 == 0; }
int main()
{
std::vector<int> nums{1, 2, 3, 4, 5};
// Using the std::not1() adaptor to negate the result of IsEven function
auto isOdd = st... | ALGO | 0.997606 | 6.665622 |
346c74ed-6d1c-4065-9834-cb9de5f1c296 | dependon/durian-ocr | 3rdparty/opencv-4.5.4/modules/ml/src/em.cpp | #include "precomp.hpp"
namespace cv
{
namespace ml
{
const double minEigenValue = DBL_EPSILON;
class CV_EXPORTS EMImpl CV_FINAL : public EM
{
public:
int nclusters;
int covMatType;
TermCriteria termCrit;
inline TermCriteria getTermCriteria() const CV_OVERRIDE { return termCrit; }
inline void se... | ALGO | 0.996723 | 6.519388 |
0ca377e2-25fc-47a0-a791-90f2f7102f02 | CodingWizard07/DSA | practice/double_pointer.cpp | #include<iostream>
using namespace std;
int main()
{
int value = 5;
int *ptr = &value;
int **ptr1 = &ptr;
cout<<"OK"<<endl;
// printing address
/*cout<<"Printing value address: "<< ptr<<endl;
cout<<"Printing value address: "<< &ptr<<endl;
cout<<"Printing value address: "<< *ptr1<<endl;
... | TOOL | 0.99851 | 3.667603 |
fa447659-f00c-4ff3-91ed-4c94b8f395ea | loyinglin/Codeforces | 1339/A /Codeforces/main.cpp | /************************** 题解 **********************
[题目链接](http://codeforces.com/contest/1339/problem/A)
**题目大意:**
给出一个图形,下面是n=1、2、3、4的时候:
现在需要把上面的图形染色,由若干个菱形组成;
问,有多少种染色方法?
**输入:**
第一行,整数𝑡表示有t个样例数量 (1≤𝑡≤1000)
接下来每个样例一行,整数𝑛 (1≤𝑛≤10^9).
**输出:**
每个样例一行,染色的方法数量。
**Examples**
**input**
2
2
1
**... | ALGO | 0.999927 | 4.653107 |
08f10231-213c-4066-b146-7b9dd2d1950c | kravets-anastasya/Education | first half 2/14 lesson/Static array.cpp | // Кравец Анастасия Сергеевна
/*Написать функцию, которая получает указатель
на статический массив и его размер. Функция распределяет положительные, отрицательные и нулевые элементы
в отдельные динамические массивы.*/
#include <iostream>
#include <clocale>
#include <stdlib.h>
#include "../../Working with array creati... | TOOL | 0.989395 | 3.848701 |
83fa5c7f-1d30-4326-b550-9807058f2f69 | Ghlxavier/Algoritmo | Meus cods/23.10/F3.cpp | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
float calcr(float d){
int r = d/2;
return r;
}
float calca(float a){
float r, area;
r=pow(r,2);
area = PI * r;
return area;
}
int main (){
float d;
printf("Defina o valor do diametro: ");
scanf("%f", &d);
calc... | ALGO | 0.998644 | 3.566068 |
74bc556d-11e0-4926-a23c-1ee9134c15cd | ankit0049/C-plushplush-programs | selectionSort.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for(int i= 0; i < n; i++)
{
cin >> arr[i];
}
for(int i=1; i<n; i++)
{
int op=i;
for(int j =i+1; j <n; j++)
{
if(arr[j]< arr[op])
{
... | ALGO | 0.999995 | 3.947275 |
7986a914-adae-4af4-aea0-7d40011d0b38 | chaturvediabhay24/GeekforGeeks-and-Interviewbit | inorder preorder se bst ib.cpp |
int find(vector<int> &in, int val, int start, int end){
for(int i=start;i<=end;i++){
if(in[i]==val){
return i;
}
}
return -1;
}
TreeNode* func(vector<int> &p, vector<int> &in, int start, int end, int &pp){
if(start>end) return NULL;
TreeNode* t=new TreeNode(p[pp]);
... | ALGO | 0.999995 | 5.889351 |
7b8c4f32-1e0f-436e-947e-ec11e707da6c | BinomialSheep/Competitive | AtcoderContest/ABC314/E2.cpp | #pragma region header
#include <bits/stdc++.h>
// デバッグ用マクロ:https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
using namespace std;
using ll = long long;
using vi = vector<int>... | ALGO | 0.999454 | 4.667488 |
b2fe9b2b-824c-42f9-9139-dd9bab9834f5 | Kuldeepagrahari/Programming-DSA-Shell-BashScripting-OOPS | CP/CSES/introductory/permutationString.cpp | #include <bits/stdc++.h>
using namespace std;
#define Yes cout << "YES\n"
#define No cout << "NO\n"
#define all(v) v.begin(), v.end()
#define vi vector<int>
#define vii vector<vector<int>>
#define vpii vector<pair<int, int>>
#define mii map<int, int>
#define msi map<string, int>
#define umap unordered_map
#define pb p... | ALGO | 0.999963 | 3.912068 |
e3b0ae70-848c-4dd8-87f7-4ee9883cc42a | Md-Salih/My-First-Language | Check if a String is a Valid Email Address.cpp | #include <iostream>
#include <regex>
bool isValidEmail(const std::string& email) {
std::regex pattern("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$");
return std::regex_match(email, pattern);
}
int main() {
std::string email = "<EMAIL>";
if (isValidEmail(email)) {
std::cout << email << " ... | TOOL | 0.988819 | 6.252959 |
14d3e3b6-63db-4f1d-b36a-8da21b33ade2 | ashishc534/Codeforces | Black Square.cpp | #include<bits/stdc++.h>
using namespace std;
void input()
{
int a1,a2,a3,a4;
cin>>a1>>a2>>a3>>a4;
int ans=0;
string s;
cin>>s;
for(int i=0;s[i];i++)
{
switch(s[i])
{
case '1': ans+=a1;
break;
case '2': ans+=a2;
break... | ALGO | 0.994837 | 3.842864 |
1a09441e-5c5e-4b3d-b07d-02d03cbdf12f | MnSakibOvi/competitive-programming | codeforces/D. Permutation Transformation.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
int n,k;
cin>>n;
int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
}
int main()
{
int t;
cin>>t;
while(t--)
{
solve();
}
}
| ALGO | 0.999355 | 3.600667 |
4ce527ff-6fc6-4c55-8b19-2d6ca45d76f3 | Ramanagamani1/Striver-Sde-Sheet-Challenge | Tries/MaximumXOR.cpp | #include<bits/stdc++.h>
struct Node {
Node *links[2];
bool containsKey(int bit) {
return links[bit]!=NULL;
}
Node *get(int bit) {
return links[bit];
}
void put(int bit,Node *node){
links[bit] = node;
}
};
class Trie {
private : Node *root;
publ... | ALGO | 0.999972 | 5.377281 |
ff521366-096b-408a-98d8-ef8484e2e446 | imabhinav-am/Competetive-Programming | hr_rk2.cpp | /*
Author : Abhinav
Modified : 17-02-2018 02:27:30 AM
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
#define faster ios_base::sync_with_stdio(false);cin.tie(0);
const ll mod = 1e9+7;
int main(){
faster;
ll n;
cin >> n;
vector< pair <int,int> > v(n);
... | ALGO | 0.999996 | 3.995459 |
8edb213b-43a9-437c-9d39-023dd7813760 | ZhZhuang/demo_cpp_basic | LeetCode-Hot-100/array/setZeroes.cpp | //
// Created by Administrator on 2024/1/10.
//
//73. 矩阵置零
#include <vector>
using namespace std;
class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int row = matrix.size();
int col = matrix[0].size();
vector<bool> use1(row),use2(col);
for(int i=0;i<row;i++){
... | ALGO | 0.995129 | 5.400855 |
eac220c1-9ba0-451c-85a8-e4deb2c72727 | chrisdembia/coin | Bonmin/Ipopt/contrib/sIPOPT/AmplSolver/SensAmplTNLP.cpp | #include "SensAmplTNLP.hpp"
#include "SensUtils.hpp"
#include "IpDenseVector.hpp"
#include "IpIteratesVector.hpp"
#include "IpBlas.hpp"
#include "IpIpoptData.hpp"
/* AMPL includes */
#include "asl.h"
#include "asl_pfgh.h"
#include "getstub.h"
namespace Ipopt
{
#if COIN_IPOPT_VERBOSITY > 0
static const Index dbg_ver... | TOOL | 0.931104 | 6.12208 |
d475943d-d704-4960-8305-ebc09131ba6e | flutter-lego/sa_battery_plus_listener_lego | 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 |
af51e3d1-ef51-41a2-a530-824db74ded40 | ke511081177/LeetcodeBucket | 1249-minimum-remove-to-make-valid-parentheses/1249-minimum-remove-to-make-valid-parentheses.cpp | class Solution {
public:
string minRemoveToMakeValid(string s) {
stack<int> st;
int len =s.size();
string res = "";
for(int i = 0; i < len; i++){
if(s[i] == '(')
st.push(i);
else if(s[i] == ')' ){
... | ALGO | 0.999759 | 5.358871 |
d0b1ea8e-c554-435a-97f4-de701ef69ed0 | mejibyte/competitive_programming | Maratones competidas/Circuito Colombiano/Diciembre 3, 2011/b.cpp | using namespace std;
#include <algorithm>
#include <iostream>
#include <iterator>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <stack>
#i... | ALGO | 0.999941 | 3.158393 |
23e8dbcb-cc9c-4306-9aff-efec53f479e8 | sarvex/leetcode-assembly | solution/0700-0799/0756.Pyramid Transition Matrix/Solution.cpp | class Solution {
public:
int f[7][7];
unordered_map<string, bool> dp;
bool pyramidTransition(string bottom, vector<string>& allowed) {
memset(f, 0, sizeof f);
for (auto& s : allowed) {
int a = s[0] - 'A', b = s[1] - 'A';
f[a][b] |= 1 << (s[2] - 'A');
}
... | ALGO | 0.999902 | 5.587098 |
6e019c3e-a953-4db7-bc9b-70ecc3b88d91 | fiterV/Solutions | How Many Squares[11C].cpp | #include <stdio.h>
char a[251][251];
int n,m,cnt,ans;
const int dx[9]={0,0,1,0,-1,1,1,-1,-1},dy[9]={0,1,0,-1,0,1,-1,1,-1};
void dfs(int x,int y)
{
int i;
a[x][y]='2';
cnt++;
for (i=1;i<=8;i++)
{
int ox=x+dx[i],oy=y+dy[i];
if (ox>0&&ox<=n&&oy>0&&oy<=m&&a[ox][oy]=='1')
dfs(x+dx[i],y+dy[i]);
}
}
bool check(in... | ALGO | 0.999319 | 4.152079 |
07ecef36-fce2-46f7-a190-41e715f2f542 | truongconghiep/SFND-Camera-TrackingImageFeatures | cornerness_harris/cornerness_harris.cpp | #include <iostream>
#include <numeric>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/features2d.hpp>
using namespace std;
void cornernessHarris()
{
// load image from file
cv::Mat img;
img = cv::imread("../images/img1.png");
cv::cvtColor(im... | ALGO | 0.99657 | 6.501778 |
1b45e8fe-d1d4-4952-b6fe-a355254a0276 | Pharap/StealthGame | Stealth/src/Utilities.cpp | #include "Utilities.h"
bool Utilities::moveForward(Entity & entity, const World & world)
{
switch(entity.direction)
{
case Direction::North:
return moveNorth(entity, world);
case Direction::East:
return moveEast(entity, world);
case Direction::South:
return moveSouth(entity, world);
case Direction::... | TOOL | 0.941169 | 6.267777 |
6c044f31-3104-4bff-8c36-7c242a7477da | ArsenyPogosov/olympiad_programs | cses.fi/Required Substring.cpp | #include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
const long long p = 1e9 + 7;
long long n, alf = 'z' - 'a' + 1;
string s;
vector<long long> pi;
void preffunc()
{
pi.resize(n);
pi[0] = 0;
for (long long i = 1; i < n; ++i)
{
pi[i] = pi[i - 1];
while (pi[i] > 0 && s[pi[i]] != s[i]) pi[i] ... | ALGO | 0.999982 | 5.78029 |
15eacab3-7b73-4bd3-b928-dfca24c2985c | mrlanu/flutter_roguelike | 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 |
0bb18b8e-bab4-415e-a8e9-3119240f2240 | alexandraback/datacollection | solutions_6377668744314880_1/C++/hyeonguk/c2.cpp | #include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <limits>
#include <functional>
using namespace std;
long long cross(pair<int, int> o, pair<int, int> a, pair<int, int> b)
{
return ((long long)a.first - o.first) * ((long long)b.second - o.second) - ((long long)a.second - o.second) * (... | ALGO | 0.999911 | 4.462605 |
fad4fc3c-7092-4ccc-b912-14752aae4837 | pashmentov96/MaxFlow | PushRelabelFlowWorker.cpp | #include "PushRelabelFlowWorker.hpp"
void PushRelabelFlowWorker::push(int from, int to, long long delta) {
extra[to] += delta;
extra[from] -= delta;
network->push(from, to, delta);
}
bool PushRelabelFlowWorker::canPush(int from, int to) {
return height[from] == height[to] + 1;
}
void PushRelabelFlowWorker::initP... | ALGO | 0.999665 | 5.461454 |
19d5183b-2a61-4b90-b4b6-565fe2781b35 | HyuriMaciel/Access-control | facedetec/main.cpp | //////////////////////////////////////////////////////////////////////////////////////
// OnlineFaceRec.cpp, by Shervin Emami (www.shervinemami.info) on 30th Dec 2011.
// Online Face Recognition from a camera using Eigenfaces.
//////////////////////////////////////////////////////////////////////////////////////
//
// ... | DATA | 0.875215 | 3.384039 |
692259f5-6737-4417-b781-8468a571cd06 | Jackarain/avhttp | boost/libs/bimap/example/population_bimap.cpp | // VC++ 8.0 warns on usage of certain Standard Library and API functions that
// can be cause buffer overruns or other possible security issues if misused.
// See https://web.archive.org/web/20071014014301/http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/default.aspx
// But the wording of the warning is mis... | TOOL | 0.979037 | 5.76458 |
7d42c380-2ec0-42ba-878b-225342b4d6ad | shashwatw/DSA | maths/LC1137-Nth-tribonacci-number.cpp | //^ https://leetcode.com/problems/n-th-tribonacci-number/description/
class Solution
{
public:
int tribonacci(int n)
{
if (n == 0)
return 0;
if (n == 1)
return 1;
if (n == 2)
return 1;
long long a = 0, b = 1, c = 1; // Use long long instead o... | ALGO | 0.999953 | 6.26785 |
accf3000-a55f-4460-9106-ea792e70f91a | imteekay/algorithms | competitive-programming/uri/password_validator.cpp | // https://www.urionlinejudge.com.br/judge/en/problems/view/2253
#include <iostream>
#include <string>
using namespace std;
bool validateString(string s) {
string alphabetUppercase = "ABCDEFGHIJKLMNOPQRSTUVXWYZ";
string alphabetLowercase = "abcdefghijklmnopqrstuvxwyz";
string numbers = "0123456789";
bool hasUppe... | TOOL | 0.942822 | 5.073015 |
b9e1bd44-e41a-4379-b4d9-c385a231bc34 | lge88/OpenSees | SRC/analysis/handler/PenaltyConstraintHandler.cpp | // $Revision: 1.6 $
// $Date: 2005-11-29 22:04:40 $
// $Source: /usr/local/cvs/OpenSees/SRC/analysis/handler/PenaltyConstraintHandler.cpp,v $
// Written: fmk
// Created: May 1998
// Revision: A
//
// What: "@(#) PenaltyConstraintHandler.C, revA"
#include <PenaltyConstraintHandler.h>
#include <stdlib.h>
#include <An... | ALGO | 0.986326 | 5.902858 |
19ec9375-5afa-4f9c-abfe-e2b481d2f827 | prince2520/Data-Structure-and-Algorithm | Binary Tree/bfs_traversal_1.cpp | #include <iostream>
#include <queue>
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int d){
data = d;
left = NULL;
right = NULL;
}
};
node* buildTree(){
int d;
cin >> d;
if(d == -1){
return NULL;
}
node *root = new node(d);
root->left = buildTree();
root->righ... | ALGO | 0.999948 | 4.679972 |
999c584b-d8dd-481a-a82a-16c3452c310f | Trimbex/Interview-Questions | cpp/Sliding Window/Maximum_Average_Subarray_I.cpp | class Solution {
public:
double findMaxAverage(vector<int>& nums, int k) {
double maxSum = 0;
double sum = 0;
for(int i = 0 ; i < k ; i++)
{
sum += nums[i];
}
maxSum = sum;
for(int i = k ; i < nums.size() ; i++)
{
su... | ALGO | 0.999846 | 6.339617 |
3e387d9f-ae55-42cc-ab35-0cade6d4e715 | sarvex/leetcode-c | solution/2200-2299/2202.Maximize the Topmost Element After K Moves/Solution.cpp | class Solution {
public:
int maximumTop(vector<int>& nums, int k) {
if (k == 0) return nums[0];
int n = nums.size();
if (n == 1) {
if (k % 2) return -1;
return nums[0];
}
int ans = -1;
for (int i = 0; i < min(k - 1, n); ++i) ans = max(ans, nums... | ALGO | 0.999983 | 5.681477 |
f4856b61-6e17-474b-9b9b-23fe66aa29ff | mridul-sehgal/cpp_dsa | Learning/linked list/add2_Numbers_Given_As_LL.cpp | // class Solution
// {
// private:
// Node *reverse(Node *head)
// {
// Node *curr = head;
// Node *prev = NULL;
// Node *next = NULL;
// while (curr != NULL)
// {
// next = curr->next;
// curr->next = prev;
// prev = curr;
// ... | ALGO | 0.999922 | 5.456774 |
98c44d30-b119-48ae-b7e2-f6221cfc8923 | ANI-IN/leetcode | 1631-path-with-minimum-effort/1631-path-with-minimum-effort.cpp | class Solution {
public:
int minimumEffortPath(vector<vector<int>>& heights) {
int ans=0;
int n=heights.size();
int m=heights[0].size();
vector<vector<int>> grid(n,vector<int>(m,1e9));
priority_queue<pair<int,pair<int,int>>, vector<pair<int,pair<int,int>>>,g... | ALGO | 0.999989 | 6.008683 |
f60e9442-edee-4f52-a65f-8767ece08bcd | shayanh/algorithms | lis.cpp | int c[MAXN], a[MAXN];
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i ++) cin >> a[i];
for (int i = 0; i <= n; i ++) c[i] = 1e9;
int ans = 0;
for (int i = 0; i < n; i ++) {
int l = 0, r = i + 1;
while (r - l > 1) {
int mid = (l + r) / 2;
if (c[mid] <= a[i]) l = mid;
else r = mid;
}
ans ... | ALGO | 0.999985 | 4.24339 |
d746b938-af64-43b6-a6e5-848eccdacd60 | Catalogo81/UrbanTaxi | users_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.998493 | 6.76073 |
2b66c74d-c3d4-4575-a724-14e7a621fbf2 | haejin315/baekjoon | baekjoon3(for문)/baekjoon3-13(10951_A+B-4).cpp | // baekjoon4-2(10951_반복입력합).cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include <iostream>
int main()
{
std::cin.tie(NULL);
std::cin.sync_with_stdio(false);
int A, B;
while (1) {
std::cin >> A >> B;
if (std::cin.eof()) { break; }
std::cout << A + B << "\n";
... | ALGO | 0.998049 | 6.348362 |
c099301e-81ec-492c-a3b2-ce0e537ecaf2 | FFGGSSJJ/CS225-gf9 | Assignments/Assignment_1/Q4/listD/dlist.cpp | //
// dlist.cpp
//
//
// Created by KD on 16.01.21.
//
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include "dlist.h"
using std::cout;
using std::cin;
template<class T> void DList<T>::bubblesort(void)
{
int length = numitems;
bool sorted = false;
while (sorted != true)
{
int ... | ALGO | 0.99843 | 4.145812 |
5aeffec6-1e00-4d5a-a10a-9c1174b2181a | Sadat-09/Codeforces | C_Removal_of_Unattractive_Pairs.cpp |
#include <bits/stdc++.h>
#define IO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
typedef long long int ll;
typedef long double LD;
#define w(t) \
int t; \
cin >> t; \
while (t--) \
{ \
so... | ALGO | 0.99995 | 4.595773 |
2cd434fd-dc2b-41b8-b340-5b0f70e97cc5 | aqshanto/C | SiSirProblem/Pattern9.cpp | #include<stdio.h>
int main(){
int a,n;
scanf("%d",&a);
n=(a+1)/2;
for(int i=1;i<=n;i++){
for(int j=1;j<=(i-1);j++){
printf(" ");
}
for(int j=1;j<=(a-(2*(i-1)));j++){
printf("@");
}
printf("\n");
}
int m=a-n;
for(int i=1;i<=m;i+... | ALGO | 0.999819 | 3.151459 |
ee93f45a-7e08-497b-b7fb-4b454eda43e8 | Farid4hmed/-CrackYourInternship | Greedy Algorithms/minDeletions.cpp | class Solution {
public:
int minDeletions(string s) {
int count[26] = {0};
for(char ch: s){
count[ch - 'a']++;
}
vector<int> arr;
for(int i=0; i<26; i++)if(count[i] != 0)arr.push_back(count[i]);
sort(arr.begin(), arr.end());
unordered_map<... | ALGO | 0.999972 | 5.780886 |
77f6dea4-0232-4439-b32d-9585b6ac362c | chu-siang/problem_solve | questionNHDK/D_searching/CF978F.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN = 2e5+5;
ll e = 1;
struct Nd{
int num,d = 0,sum,mentor = 0;
}nd[MAXN];
bool cmp_1(Nd a,Nd b){
return a.sum < b.sum;
}
bool cmp_2(Nd a,Nd b){
return a.num < b.num;
}
int main(){
ll n,k;
cin >> n >> k;
for(int i ... | ALGO | 0.999997 | 3.43276 |
ea1c1d65-c824-4a2a-b5a0-092d1c66aa1b | ishandutta2007/codeforces | waynetuinfor/normal/958/C3.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5, maxp = 100 + 5;
const int inf = 1e9;
int a[maxn], s[maxn];
int dp[2][maxn], t[maxp];
int main() {
int n, k, p; scanf("%d %d %d", &n, &k, &p);
for (int i = 1; i <= n; ++i) scanf("%d", a + i), s[i] = (s[i - 1] + a[i]) % p;
if (n <= k * ... | ALGO | 0.999996 | 3.480882 |
2fc5ab44-6118-4934-bee5-179c50abc28f | NaimurRahmanNishat/data_structure | C++/Pointer/adding_two.cpp | // Adding 2 number in pointer.
#include<iostream>
using namespace std;
int main(){
int x = 5; // initilize the value of x is 5.
int y = 7; // initilize the value of x is 5.
int *p1, *p2; // initilize the pointer.
p1 = &x; // x address store the pointer(... | ALGO | 0.995271 | 4.433123 |
cd6040f8-b1ad-4353-b6bd-2cbb8f9f2088 | daerong/Algorithm_Practice | baekjoon/Daeseong/19237_U.cpp | //Solution
//- ־ ̵Ű ùķ̼
//- ä븦 turn Ͽ update ٿ.
//- Ǯ ؿ κ ־.
//- 1. ֺ ڱ ä밡 ִ.
//- 1.1. ֱ ̵ ƴ,
//- 1.2. ̵ ִ .
//- Ǯ̴ .
//- 1. Ǯ̿ ʿ Ѵ.
//- 1.1. N : N x N ũ
//- 1.2. M :
//- 1.3. K : duration
//- 1.4. shark 迭 ´.
//- 1.4.1. index
//- 1.4.2. ̵
//- 1.4.3. ǥ (x, y)
//- 1.4.4. ̵ 켱
//- 1.5. map 迭 ... | ALGO | 0.999881 | 4.513402 |
d0d589a2-11f1-4197-ab97-bd528dbdff28 | kitturpriya/Data-Structures-and-Algorithms | Algorithms/BFS.cpp | #include<iostream>
using namespace std;
int top=-1;
int queue[10]={};
int n,e;
int nodes[10];
int edges[10][10];
void enqueue(int x)
{
top+=1;
queue[top]=x;
}
int dequeue()
{
int ele=queue[0];
for(int i=0;i<top;i++)
{
queue[i]=queue[i+1];
}
top--; ... | ALGO | 0.999981 | 4.162727 |
42567303-e3df-40fd-bdca-9a39d2f4a860 | fjarcticfox/blender | source/blender/freestyle/intern/geometry/Bezier.cpp | /** \file
* \ingroup freestyle
* \brief Class to define a Bezier curve of order 4.
*/
#include "Bezier.h"
#include "FitCurve.h"
using namespace std;
namespace Freestyle {
BezierCurveSegment::~BezierCurveSegment() = default;
void BezierCurveSegment::AddControlPoint(const Vec2d &iPoint)
{
_ControlPolygon.push_b... | ALGO | 0.994971 | 6.833117 |
3aef256a-686f-487d-8c79-3b79f01080fb | vedanth2001/Leetcode-Submissions | 1185-find-in-mountain-array/1185-find-in-mountain-array.cpp | /**
* // This is the MountainArray's API interface.
* // You should not implement it, or speculate about its implementation
* class MountainArray {
* public:
* int get(int index);
* int length();
* };
*/
class Solution {
public:
int findPeak(MountainArray &mountainArr, int low, int high){
... | ALGO | 0.999992 | 6.248952 |
dd2bb43f-0e10-4fb9-96f9-e4bf32c70ec2 | rishabh9935/LeetCode | 0 - 1 Knapsack Problem - GFG/0-1-knapsack-problem.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to return max value that can be put in knapsack of capacity W.
int knapSack(int W, int wt[], int val[], int n)
{
int t[n+1][W+1];
for(int i=0;i<n+1;i++){
... | ALGO | 0.999998 | 5.59887 |
6cf2484a-4f7e-4fba-9f8b-fa358156f4c2 | stdstring/leetcode | Algorithms/Tasks.2001.2500/2116.CheckIfParenthesesStringCanBeValid/solution.cpp | #include <stack>
#include <string>
#include "gtest/gtest.h"
namespace
{
class Solution
{
public:
[[nodiscard]] bool canBeValid(std::string const &s, std::string const &locked) const
{
if ((s.size() % 2) != 0 )
return false;
std::stack<size_t> unlockedChars;
std::stack<size... | ALGO | 0.979185 | 6.636918 |
3f37f9d0-be65-42e4-a08d-a97705865a5a | Cellul4r/Comp_Programming | Codeforces/1360E-Polygon.cpp | #include<bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void ... | ALGO | 0.999866 | 4.862305 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.