uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d3eac60a-24de-4503-a0f5-d4735e45c842 | MahirSez/problem-solving | codeforces/1343/F.cpp | #include <bits/stdc++.h>
#define ll long long int
#define uu first
#define vv second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define INF 1e9
#define fastRead ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const int MAX = 300;
se... | ALGO | 0.999907 | 4.093345 |
267e3b4b-cdff-47a8-b38d-230bcaac809a | lmalano/Algoritmos | Algoritmos y Estructuras de Datos - Nazzi/Parciales/Parcial 3/algo/Dijkstra.cpp | #include <iostream>
using namespace std;
#include "ListaAdyacencia.cpp"
#define Size 20
#include <fstream>
#include "conjuntos.cpp"
class graph{
private:
Lista listaAdyacencia[Size];
void Djikstra2(int inicial,int [Size],int [Size]);
public:
graph(){};
... | ALGO | 0.98533 | 3.521118 |
0164b9e7-166b-4070-a7ca-5374d7d2c509 | Praneet2003/Cpp-LPU | Vector/copy_if_Function.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool odd(int n){
if(n%2!=0){
return true;
}else{
return false;
}
}
int main(){
vector<int> a = {1,2,3,4,5,6,7,8,9,5,10,5,6,3,5,9};
vector<int> b(a.size(),-1);//initializing all elements of vector with -1
... | ALGO | 0.999323 | 3.848257 |
44384728-fcff-4424-a3e4-b158d734b807 | andeb/competitive-programming | spoj/MINHOCA.cpp | #include <algorithm>
#include <iostream>
#include <list>
#include <stdio.h>
#include <string.h>
using namespace std;
int main() {
//freopen("input.txt", "rt", stdin);
std::ios::sync_with_stdio(false);
int m, n;
scanf("%d %d", &m, &n);
int r, s, t = 0;
int array[n];
std::fill_n(array, n, 0);
for (int i = 0;... | ALGO | 0.999944 | 3.277821 |
778484e0-2dab-48b4-b2ec-9d5a177ecb7f | yuluohuatan/Contours2Bezier | 3rdparty/eigen-3.3.9/lapack/eigenvalues.cpp | #include "lapack_common.h"
#include <Eigen/Eigenvalues>
// computes eigen values and vectors of a general N-by-N matrix A
EIGEN_LAPACK_FUNC(syev,(char *jobz, char *uplo, int* n, Scalar* a, int *lda, Scalar* w, Scalar* /*work*/, int* lwork, int *info))
{
// TODO exploit the work buffer
bool query_size = *lwork==-1;... | ALGO | 0.99283 | 4.671507 |
d5c05724-d867-4eab-a53a-b88acd0a4c23 | alxvkn/oaip | para-9/2.cpp | #include <iostream>
int main (int argc, char *argv[]) {
int arr[16];
for (unsigned i = 0; i < 16; i++) {
arr[i] = i * 2 + 1;
}
for (unsigned i = 0; i < 16; i++) {
std::cout << arr[15 - i] << std::endl;
}
return 0;
}
| ALGO | 0.990321 | 3.881715 |
865d9e2b-ec89-48c2-828f-6f9a95d7914d | aninxya07/Striver-a2z-sheet | Linked List/Singly LL/intersectionPoint.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node* prev;
// Constructor
Node(int data1, Node* next1 = nullptr, Node* prev1 = nullptr) {
data = data1;
next = next1;
prev = prev1;
}
};
Node* Arr2LL(const vec... | ALGO | 0.999922 | 5.523044 |
e68a542e-7281-4be4-9872-560ccda96fb6 | nqdat2002/Data-Structures-and-Algorithms | Cay Nhi Phan/DSA11028 - ĐỘ CAO CỦA CÂY.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> p;
typedef vector<vector<int> > vt;
typedef vector<pair<int, int> > vp;
const ll mod = 1e9 + 7;
const int oo = 1e6 + 7;
#define f first
#define s second
#define pb push_... | ALGO | 0.999786 | 5.311275 |
69d59aa7-0b80-4af2-b572-58c25a8d72d3 | joao29a/pro-grammers | URI/1297.cpp | #include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <float.h>
#include <cmath>
#define BUF_SIZE 10240
char *buffer;
double doFunction(int* p,int* q, int k,double x){
printf("aki\n");
double pRes =0;
double qRes =0;
for(int i = 0; i < k; i++){
pRes += p[i]*pow(x,i);
print... | ALGO | 0.994873 | 3.090544 |
c67d3fbb-8537-478f-b27d-f3486e821392 | DraSoGo/Competitive_Programming | Contest/0053_Preparation.cpp | #include <bits/stdc++.h>
using namespace std;
long long sz = 1002,md = 1000000007;
long long A[1002][1002];
int main()
{
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
memset(A,0,sizeof(A));
for (long long i = 1; i < sz; i++)
{
A[1][i] = i;
}
for (long long i = 2; i < sz; i++)
... | ALGO | 0.999961 | 3.995098 |
d902797a-7b85-48a2-ab89-a00c29fdde1b | RajVerma97/c- | demo.cpp | #include <iostream>
using namespace std;
struct Student
{
int id;
string name;
int rollNo;
};
class Demo {
private:
int *ptr;
int *arr;
public:
Demo(){
ptr=new int(10);
arr= new int[5];
for(int i=0;i<5;i++)
{
arr[i]=i;
... | ALGO | 0.944631 | 4.377532 |
2d838b70-f7f7-40f7-a821-03d954f6a5aa | ivorymood/ALGORITHM | PROGRAMMERS/LEVEL_02/Q42586_ver2.cpp | //https://programmers.co.kr/learn/courses/30/lessons/42586
//ɰ
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> progresses, vector<int> speeds) {
vector<int> answer;
int day; // ۾ Ϸῡ ɸ ð
int max_day = 0; // ɶ ٷ ϴ ð
... | ALGO | 0.99983 | 4.810875 |
70f26334-24b4-449a-92bc-5e294aa42f22 | Certseeds/CS203_DSAA_template | algorithm/stack/leetcode_321.cpp | #include "leetcode_321_test.hpp"
#include <stack>
namespace leetcode_321 {
using std::stack;
int32_t compare(const vector<int32_t> &fst, size_t fst_size, const vector<int32_t> &snd, size_t snd_size) {
if (fst.size() < snd.size()) {
return -1;
} else if (fst.size() > snd.size()) {
return 1;
... | ALGO | 0.999957 | 5.042233 |
170dfa4a-ee36-4a78-a72d-bc1edef46d38 | 3xiaoxin/Raft-KV-Storage | example/raftCoreExample/raftKvDB.cpp | //
// Created by swx on 23-12-28.
//
#include <iostream>
#include "raft.h"
// #include "kvServer.h"
#include <kvServer.h>
#include <unistd.h>
#include <iostream>
#include <random>
void ShowArgsHelp();
int main(int argc, char **argv) {
//////////////////////////////////读取命令参数:节点数量、写入raft节点节点信息到哪个文件
if (argc < 2) {... | CONFIG | 0.880166 | 3.701987 |
fbf82d06-6a3a-4f6b-be2f-3b035dd6f843 | Karishma13883/operating-system | premptive priority scheduling.cpp | #include <stdio.h>
void swap(int *a,int *b)
{
int temp=*a;
*a=*b;
*b=temp;
}
int main()
{
int n;
printf("Enter Number of Processes: ");
scanf("%d",&n);
int burst[n],priority[n],index[n];
for(int i=0;i<n;i++)
{
printf("Enter Burst Time and Priority Value for Process %d: ",i+1... | ALGO | 0.999995 | 3.766009 |
34424aac-a60f-4284-b9b4-1010ece06769 | malaksayour/hslam_ros2 | src/FSLAM/Thirdparty/opencv-3.4.6/modules/calib3d/src/homography_decomp.cpp | #include "precomp.hpp"
#include <memory>
namespace cv
{
namespace HomographyDecomposition
{
//struct to hold solutions of homography decomposition
typedef struct _CameraMotion {
cv::Matx33d R; //!< rotation matrix
cv::Vec3d n; //!< normal of the plane the camera is looking at
cv::Vec3d t; //!< translatio... | ALGO | 0.999849 | 6.207589 |
8d4a4c31-1c6e-4e2b-b720-43fadd44411f | ishandutta2007/codeforces | lhic/normal/773/A.cpp | #include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <queue>
#include <functional>
#define mp make_pair
#define pb push_back
typedef long long l... | ALGO | 0.999659 | 3.847208 |
e5b74bdb-4043-475f-9fdc-751a01e4e707 | sk10salman/PLACEMENT_ALL_TOPICS_DATA_STRUCTURE_AND_ALGO | IMP/k_distance_from1to1.cpp | bool kLengthApart(vector<int>& nums, int k) {
int j=-1;
int n=nums.size();
for(int i=0;i<nums.size();i++)
{
if(nums[i]==1)
{ j=i;
break;}
}
if(j==-1||j==n-1)
return true;
int l=j;
for(int i=j+1;i<n;i++)
... | ALGO | 0.99995 | 5.416821 |
23d35bc4-79fb-45b7-82a1-a95fdc00c39b | Shyam0169/hactoberfest-template | Data Structures/Priority queues/maxPriorityQueue.cpp | /*
Code : Max Priority Queue
Implement the class for Max Priority Queue which includes following functions -
1. getSize -
Return the size of priority queue i.e. number of elements present in the priority queue.
2. isEmpty -
Check if priority queue is empty or not. Return true or false accordingly.
3. insert -
Given an ... | ALGO | 0.99975 | 4.874146 |
be8a2fb4-9bee-44a9-8db3-04e479f1cfe0 | arthurbourquin/PRG1_General | 09-Tableaux/cd.cpp | #include <iostream>
#include <vector>
using namespace std;
using Matrix2D = vector<vector<int>>;
Matrix2D cadre_diagonale(int n) {
Matrix2D result(n, vector<int>(n, 0));
for(int i = 0; i < n; ++i) {
for(int j = 0; j < n; ++j) {
if(i == 0 || i == n -1 || j == 0 || j == n -1 || i == j) {
... | ALGO | 0.99935 | 4.239933 |
0b5637e1-8fe1-4fa3-9db9-f6edc4e20e45 | ishandutta2007/codeforces | gepardo/normal/629/D.cpp | /*-------------------( alex256 )--------------------\
| Contest: Codeforces Round 343 (Div. 2) |
| Task: D |
| Date: 20. 02. 2016 |
\--------------------------------------------------*/
// Includes
#include <algorithm>
#include <cmath>
... | ALGO | 0.999001 | 3.668152 |
44484897-e3bd-42b0-ba71-025607e5ee77 | M0hamedIbrahim1/Problem-Solving-With-C- | Math - Geometry/Z. Geometry Test.cpp | // link : https://codeforces.com/group/MWSDmqGsZm/contest/223338/problem/Z
// author : @Mohamed Ibrahim
#include<bits/stdc++.h>
using namespace std;
int main(){
long long r,s;
cin>>r>>s;
r *=2;
if(s>=r){
cout<<"Square";
}
else if(r>sqrt(2*pow(s,2))){
cout<<"Circle";
}
else{
cout<<"Complex";
}
}
| ALGO | 0.99922 | 3.725014 |
42286207-5fde-4944-89c9-ff41e53b7d32 | rupayn/DSA-WITH-C-AND-CPP | cpp/08_ASCII.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main (){
int number=-128;
while(number<=129){
cout<<number<<" :"<<(char)number<<endl;
number++;
}
return 0;
} | TOOL | 0.937323 | 3.007866 |
97fc5f44-0018-4f3b-9cc6-08f1b49d81cc | ttnhathuy313/cp-career | Codeforces/GYM/101741/TaskF.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair <int, int> ii;
long long Rand(long long l, long long h)
{
return l + ((long long)rand() * (RAND_MAX + 1) * (RAND_MAX + 1) * (RAND_MAX + 1) +
(long long)rand() * (RAND_MAX + 1) * (RAND_MAX + 1) +
(long ... | ALGO | 0.999981 | 3.827515 |
c3a1099c-fb9a-4f65-b586-6e52f8ea7c19 | thais-alves-carvalho/highs-epe | src/lp_data/Highs.cpp | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the HiGHS linear optimization suite */
/* */
/* ... | TOOL | 0.906028 | 7.479759 |
59ef9ce6-38ac-4207-b6a8-900f6a787ab0 | devgupta18/DSA-Practise | outputQues.cpp | #include<iostream>
using namespace std;
int main() {
cout<<"Enter a character: ";
char ch;
cin>>ch;
if(ch >= 65 && ch <= 90) {
cout<<"This is uppercase."<<endl;
}
else if(ch >= 97 && ch <= 122) {
cout<<"This is lowercase"<<endl;
}
else if(ch >= 48 && ch <= 57) {
c... | TOOL | 0.901349 | 3.639727 |
236ccd81-4193-4ff7-8112-b3b758da2d5a | Pranay-Badole/Data-Structures | Graphs/Disjoint Set/Disjoint Set using quick union.cpp | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define all(x) (x).begin(),(x).end()
#define uniq(v) (v).erase(u... | ALGO | 0.994791 | 5.065066 |
a78a2a7b-bedd-4172-bd76-7c6649c9e20e | manav-yb/LeetCode | Segment Tree/MaxEventsCanBeAttended.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <cmath>
#include <math.h>
#include <unordered_set>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repR(i,a,b) for(int i=a;i>=b;i--)
#define ll long long
#define pb push_back
#def... | ALGO | 0.999948 | 4.215447 |
779a9f22-6222-4b73-bb43-833ef01c8c95 | TaRun1369/LEETCODE_GFG | 49-group-anagrams/group-anagrams.cpp | class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
unordered_map<string, vector<string>> mp;
for(auto it : strs){
string sortedStr = it;
sort(sortedStr.begin(), sortedStr.end()); // Sort the string
mp[sortedStr].push_back(it);
... | ALGO | 0.999998 | 6.654363 |
4ff077c7-3e25-487f-ac1f-7d1c37c61e8c | thegamer1907/Code_Analysis | contest/1542588937.cpp | #include<bits/stdc++.h>
#define db double
using namespace std;
int h,m,s,p1,in1,p2,in2;
db pos[233];
int where(int x){
x%=12;
db t=(db)360*x/12;
for (int i=1;i<3;i++){
if (pos[i]<t&&t<pos[i+1]) return i;
}
return 3;
}
int main(){
cin>>h>>m>>s>>p1>>p2;
h%=12;
pos[1]=(db)360*s/60;
pos[2]=(db)3... | ALGO | 0.999918 | 3.146617 |
2274d28b-f1bf-4b8c-ab06-79b90959f85a | satyajit-patel/NOTES | pulkitChhabra/unacademyCodes/DSA/Recursion and Dynamic Programming 29-Jun-2021/L11 - Dynamic Programming_ Problems Discussion - I/Queries for Number of Palindromes.cpp | // https://codeforces.com/problemset/problem/245/H
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define mt ... | ALGO | 0.999791 | 4.784526 |
dfda1429-2884-4f2c-b1a3-258f094bfa80 | LineageOS-Awful-UL/android_frameworks_av | media/module/codecs/amrnb/enc/src/spreproc.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/spreproc.c
Functions: subframePreProc
Date: 02/06/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template used to PV c... | ALGO | 0.990615 | 6.815972 |
d7fc3ceb-7722-45d7-ae0d-53b04485e1e3 | purple-jwl/atcoder | src/panasonic2020/C.cpp | #include <bits/stdc++.h>
#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define un... | ALGO | 0.999969 | 3.847134 |
024b25cb-de06-4512-b7d9-13d6bc512897 | OpenDigitalTwin-Dev/FENGSim | toolkit/Geometry/cgal/auxiliary/gdb/test.cpp | #include <CGAL/Simple_cartesian.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h>
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
#include <CGAL/Circular_kernel_2.h>
#include <CGAL/Filtered_kernel.h>
typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::Cartesian<double> K2;
typedef CGAL::Simple_cartesian<CGA... | TEST | 0.914812 | 4.387167 |
054fb9ce-2bb5-455e-ac70-bcd86345187d | Manan007224/street-coding | icpc_qualifiers2018/u.cpp |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin>>n;
vector<int> v {2,3,5};
for(int i=7;i<=n;i+=2){
int val = sqrt(i) + 1;
bool worked=true;
for(int j=1;j<v.size();j++){
if(i%v[j]==0){
worked=false;
break;
}
if(v[j]>val) break;
}
if(worked) v.push_back(i);
}
int ... | ALGO | 0.999876 | 3.859168 |
8430a578-72d2-454c-87c2-46f4c598c4f1 | chai2010/opencv | opencv110/cvaux/src/cvlmeds.cpp | #include "_cvaux.h"
#include "_cvvm.h"
#include <stdlib.h>
#define Sgn(x) ( (x)<0 ? -1:1 ) /* Sgn(0) = 1 ! */
/*===========================================================================*/
CvStatus
icvLMedS( int *points1, int *points2, int numPoints, CvMatrix3 * fundamentalMatrix )
{
int sample, j... | ALGO | 0.999832 | 4.151855 |
3adbe559-b1e6-4d23-b0ec-86fa8203767d | linmuadido/tailless | src/algo/test/sort.cpp | #include "algo/sort.h"
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include "helper/profiling.h"
using namespace leo;
const static size_t SZ = 1<<26;
#define INIT_TEST(type) \
do { std::vector<type> v(SZ),v2(SZ);uint64_t xor_key = 0;for(auto& x:v) xor_key ^= x=rand(); \
const char* TEST_... | TEST | 0.996098 | 4.989438 |
e8940c33-6399-4b5e-b612-af3073b9022a | MehediHasan-75/code | C_Iroha_Loves_Strings_ABC_Edition.cpp |
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define prnt(x) for(auto &it: x)cout<<it<<" ";cout<<"\n";
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
typedef long long ll;
typedef vector<ll> vll;
const ll N = 2e5 + ... | ALGO | 0.99997 | 4.32232 |
2c16d843-ae45-4952-a508-8d067fbaaf12 | ishandutta2007/codeforces | igor_kudryashov/normal/183/D.cpp | #pragma comment(linker, "/stack:64000000")
#define _CRT_SECURE_NO_DEPRECATE
#define _USE_MATH_DEFINES
#include <algorithm>
#include <iostream>
#include <fstream>
#include <cassert>
#include <iomanip>
#include <utility>
#include <cstring>
#include <complex>
#include <cstdlib>
#include <bitset>
#include <cstdio>
#includ... | ALGO | 0.999906 | 3.4879 |
871ea84f-676a-4f1d-8484-6c85ba935c48 | Mohamed-Hossam/Problem-Solving | codeforces/311-A/311-A-14094993.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,k;cin>>n>>k;
if(n*(n-1)/2<=k)return(cout<<"no solution\n",0);
for(int i=1;i<=n;++i)cout<<0<<" "<<i<<endl;
} | ALGO | 0.999962 | 3.053078 |
281580ea-51f3-4e27-9f9a-6fc040508e4b | iamkaniska/DSA | loop_2/rev.cpp | // print odd numbers in 1 to 100;
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter Numbers: ";
cin>>n;
for (int i=1;i<=n;i++)
{
// if (i%2!=0)
// {
// cout<<i<<endl;
// }
if (i%2!=0)
{
cout<<i<<endl;
... | ALGO | 0.993916 | 3.478269 |
56b33c90-606a-45c4-bf4c-fe3907908c8c | chunyang-wen/leetcode | CombinationSumII.cpp | class Solution {
private:
vector<vector<int> >res;
public:
vector<vector<int> > combinationSum2(vector<int> &candidates, int target) {
sort(candidates.begin(), candidates.end());
vector<int> tmpres;
helper(candidates, 0, target, tmpres, 0);
return res;
}
//从数组candid... | ALGO | 0.999968 | 5.994665 |
6ea24f13-e833-4c61-ab3d-600f7a48c62c | yopio/aoj | 0506.cpp | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
string s;
string int_to_string(int number){
stringstream ss;
ss << number;
return ss.str();
}
string string_change(void){
int S = s.size();
string RS = "";
for( int i = 0 ; i < S ; i++ ){
int cnt = 0;
for( int j = i... | ALGO | 0.999953 | 3.970869 |
d5c7d0cf-0800-452d-baaa-ce1ad7aa5e64 | kagasan/atcoder | NAIST/NAIST1008/1.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
const ll ... | ALGO | 0.999519 | 3.83743 |
fb6d1908-45c6-49f2-b6bf-195e670a2272 | JohanSmet/aoc_2021 | 02/cpp/part1.cpp | #include <charconv>
#include <iostream>
#include <string>
using namespace std;
int main() {
string input;
int pos = 0;
int depth = 0;
while (getline(cin, input)) {
auto value_start = input.find(' ') + 1;
int value = 0;
from_chars(input.c_str() + value_start, input.c_str() + input.size(), value);
if (i... | ALGO | 0.999185 | 5.510876 |
30c0e66a-cc8e-4b12-8997-16200538cf90 | sage26Ayano/competitive-programming | codeforces/A_Rewards.cpp | #include <bits/stdc++.h>
using namespace std;
#define speedio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tlp int tc; cin >> tc; while (tc--)
#define rep(i, a, b) for(int i = a; i < b; ++i)
#define sp ' '
#define nl '\n'
#define newline cout << '\n'
#define ll long long int
#define vi vector <int>
#defin... | ALGO | 0.998791 | 3.872062 |
98c27dbd-f0b0-4d26-b645-c70ff59cc676 | seunghye218/problem-solving | 프로그래머스/2/42747. H-Index/H-Index.cpp | #include <vector>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <iostream>
using namespace std;
int solution(vector<int> citations) {
int above, below, size = citations.size(), h = 0;
while (true) {
above = 0, below = 0;
for (int i = 0; i < size; ++i) {
i... | ALGO | 0.999879 | 5.817539 |
ad0eded3-6c25-48a2-923a-01a6c9d2fdde | GarageGames/Qt | qt-5/qtwebengine/src/3rdparty/chromium/third_party/skia/src/opts/SkXfermode_opts_arm_neon.cpp | #include "SkXfermode.h"
#include "SkXfermode_proccoeff.h"
#include "SkColorPriv.h"
#include <arm_neon.h>
#include "SkColor_opts_neon.h"
#include "SkXfermode_opts_arm_neon.h"
#define SkAlphaMulAlpha(a, b) SkMulDiv255Round(a, b)
////////////////////////////////////////////////////////////////////////////////
// NEON... | TOOL | 0.979452 | 7.131587 |
8ec46e69-e8e8-4ddb-9267-c9fe7b6cc957 | luislaguardia/Leet-Codes | Convert Sorted Array to Binary Search Tree/Solution.cpp | class Solution {
public:
TreeNode* sortedArrayToBST(vector<int>& nums) {
return buildBST(nums, 0, nums.size() - 1);
}
private:
TreeNode* buildBST(vector<int>& nums, int left, int right) {
if (left > right) return nullptr;
int mid = left + (right - left) / 2;
TreeNode* n... | ALGO | 0.999997 | 7.226787 |
fc3334c7-0e6c-415e-9cf1-95c3eb2d0049 | ardiansa22/BiodataDart | 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 |
c5db98c1-b4a3-431d-870b-e625223b3d7a | IIvexII/CS | OOP-CS304/Theory/012.pointers_swap.cpp | // write down a program that reads two objects and swaps them using pointers.
#include <iostream>
using namespace std;
class Student{
public:
string name;
Student(){}
Student(string n) : name(n) {}
};
int main(){
Student s1("Zafeer"), s2("Hafeez"), sTmp;
Student *ptr1 = new Stud... | ALGO | 0.993613 | 4.642313 |
1f37f8b0-1254-4c91-90eb-f4acaa516dd8 | SKYSCRAPERS1999/CS184-Smoke-Simulation | ext/nanogui/ext/eigen/doc/special_examples/Tutorial_sparse_example.cpp | #include <Eigen/Sparse>
#include <vector>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void buildProblem(std::vector<T>& coefficients, Eigen::VectorXd& b, int n);
void saveAsBitmap(const Eigen::VectorXd& x, int n, const char* file... | ALGO | 0.996144 | 5.464163 |
82affdb3-bbc4-43dc-892c-4168c1674b7a | Rohan2309/dsa450 | striver/trie/maxXorArr.cpp | /*
421. Maximum XOR of Two Numbers in an Array
Medium
3714
313
Add to List
Share
Given an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n.
Example 1:
Input: nums = [3,10,5,25,2,8]
Output: 28
Explanation: The maximum result is 5 XOR 25 = 28.
Example 2:
Input: nums = [1... | ALGO | 0.999993 | 5.896377 |
68b082fd-9168-411b-9578-e13270179580 | iliazintchenko/spin_glass_solver | src/sa_solver.cpp | #include "sa_solver.hpp"
#include <chrono>
#include <random>
sa_solver::sa_solver(const hamiltonian_type& H)
: N_(H.size())
{
H_ = std::make_shared<hamiltonian_type>(H);
}
result sa_solver::run(
const double beta0
, const double beta1
, const std::size_t... | ALGO | 0.999951 | 6.004776 |
08a36ee0-1c72-4882-8065-661ae356748d | Nercury/experiment-key-escape | key-space/CentroidBoxManager.cpp | #include "CentroidBoxManager.h"
#include <key-math/Quaternion.h>
#include "PointBox.h"
using namespace std;
using namespace key::space;
CentroidBoxManager::CentroidBoxManager(uint64_t seed, int32_t subdivisionCount, float scale) : noise(seed), subdivisionCount(subdivisionCount) {
Quaternionf qHeading(Vector3f(0.71f... | ALGO | 0.878282 | 6.124017 |
5838bccb-1f2a-42fc-b500-469574bf4831 | SHREY247/didactic-umbrella | Arrays/Sorting/SortColors(Leetcode75).cpp | /*
Given an array nums with n objects colored red, white, or blue,
sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.
We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively.
You must solve this problem without usi... | ALGO | 0.999986 | 6.43338 |
daa38d6e-7704-46d7-900c-6f284f664276 | velazqua/competitive-programming | online-judges/UVa/784/784.cpp | /* Alex Velazquez
* Start: Sun Apr 22 16:28:24 EDT 2012
* End : Sun Apr 22 16:34:07 EDT 2012
*/
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#i... | ALGO | 0.999742 | 3.37801 |
f3c0206b-bda7-4cf9-898a-f31a56e21d98 | HONGYANGGAN/leetcode | solution/0400-0499/0490.The Maze/Solution2.cpp | class Solution {
public:
bool hasPath(vector<vector<int>>& maze, vector<int>& start, vector<int>& destination) {
int m = maze.size();
int n = maze[0].size();
queue<vector<int>> q{{start}};
vector<vector<bool>> vis(m, vector<bool>(n));
vis[start[0]][start[1]] = true;
v... | ALGO | 0.999946 | 6.030533 |
dbc6627b-ad01-4d50-8d6d-5107be707131 | SovietPower/My-OI-ACM | 网络流/最大流 最小割/洛谷.3254.圆桌问题(最大流ISAP).cpp | #include <cstdio>
#include <cctype>
#include <algorithm>
#define gc() getchar()
//#define gc() (SS==TT&&(TT=(SS=IN)+fread(IN,1,MAXIN,stdin),SS==TT)?EOF:*SS++)
const int N=450,M=5e4+5,INF=0x3f3f3f3f,MAXIN=1e5;
int n,m,src,des,H[N],cur[N],Enum,nxt[M<<1],fr[M<<1],to[M<<1],cap[M<<1],q[N],lev[N],num[N],pre[N];
//char IN[MA... | ALGO | 0.999846 | 3.21695 |
d397c18b-3818-496c-925c-bb9ba7ac141a | Vjannu0711/C-PlusPlus-Projects | FizzBuzz_ConditionalsIntro.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int user_input_num;
cout << "Please enter a positive integer." << endl;
cin >> user_input_num;
if (user_input_num > 0) { /* if number is positive */
if ((user_input_num % 3 == 0) && (user_input_num % 5 == 0)) { /* if number is d... | TOOL | 0.999472 | 4.149374 |
dc4301a0-c4bf-4ebe-a914-6778e7c27fe4 | ishandutta2007/codeforces | alexandr_ts/normal/698/A.cpp | #include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = 2e5 + 10;
const int M = 301;
const int INF = 2e9 + 10;
const int MOD = 1e9 ... | ALGO | 0.99983 | 3.74006 |
06e445ec-043a-46b5-b4c4-738c1b36575b | nis44/DSA | 789-kth-largest-element-in-a-stream/kth-largest-element-in-a-stream.cpp | class KthLargest {
public:
priority_queue<int, vector<int>, greater<int>> pq;
int k;
KthLargest(int k, vector<int>& nums) {
this -> k = k;
for(auto it: nums) {
pq.push(it);
if(pq.size() > k) pq.pop();
}
}
int add(int val) {
pq.push(val);... | ALGO | 0.999963 | 5.832606 |
b6dddf5a-4422-40ca-9426-482718c469e2 | kkpan11/apple-llvm-project | libcxx/src/hash.cpp | #include <__hash_table>
#include <algorithm>
#include <stdexcept>
#include <type_traits>
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wtautological-constant-out-of-range-compare")
_LIBCPP_BEGIN_NAMESPACE_STD
namespace {
// handle all next_prime(i) for i in [1, 210), special case 0
const unsigned small_primes[] = {
0, 2... | ALGO | 0.999204 | 6.92995 |
a664d798-d5a1-436a-95c4-f32dbd430e2a | ishandutta2007/codeforces | lzr_010506/normal/1558/C.cpp | #include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define il inline
#define db double
#define ls rt << 1
#define rs rt << 1 | 1
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define X first
#define Y second
#define pcc pair<char, char>
#define vi vector<int>
#define vl ... | ALGO | 0.999924 | 3.769734 |
08aa707c-753a-45d8-ab73-f8f17cae967a | RiisDev/Roblox-Executor-Sources | 2023 Sources/Roblox UWP API V1 - Github/Luau-Core/source/lnumprint.cpp | #include "lcommon.h"
#include <string.h>
#ifdef _MSC_VER
#include <intrin.h>
#endif
// This work is based on:
// Raffaello Giulietti. The Schubfach way to render doubles. 2021
// https://drive.google.com/file/d/1IEeATSVnEE6TkrHlCYNY2GjaraBjOT4f/edit
// The code uses the notation from the paper for local variables w... | TOOL | 0.979002 | 6.769249 |
a1acd4ec-663e-475d-894f-e802b0538702 | Dhruv-bansal15/DSA-1 | L16/Questions/pairs_pallindrome_formed.cpp | // We have a list of strings named W. find no of pairs of (i,j) s.t 0<=i<j<=n-1
// and W[i] + W[j] can be rearranged to form a pallindrome
// above we did concatenation to be precize
#include <iostream>
#include <cstdio>
#include <stack>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#incl... | ALGO | 0.999955 | 4.288191 |
0011bdb5-33d7-4d25-aae0-10977ecf016f | sainisajal147/Problem_solving | .cbp/pair_problem/main.cpp | #include <iostream>
#include<math.h>
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool issq(int n)
{
int x=pow(n,1/2);
int y=pow(n,1/3);
cout<<x<<y;
return n==x*x || n==y*y*y;
}
int main() {
int t;
cin >> t; // Reading input from STDIN
while(t--)
{
int ans=0,n;
... | ALGO | 0.998927 | 4.544179 |
26747dd3-447e-4db1-8cda-d7d55a1d34c4 | Rudra2637/DSA-Questions | Queue/Stream First Non-repeating.cpp | #include<bits/stdc++.h>
using namespace std;
string FirstNonRepeating(string &s) {
// Code here
unordered_map<char,int>m;
queue<int>q;
string temp;
for(int i=0;i<s.size();i++){
m[s[i]]++;
q.push(s[i]);
while(!q.empty()){
... | ALGO | 0.999944 | 4.440322 |
3d1fb9f9-f0b6-43b0-a3d4-8d4aa40e71e7 | 3dv-casia/clmap | third-party/PlaneDetection/eigen3/doc/examples/class_VectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived>
segmentFromRange(MatrixBase<Derived>& v, int start, int end)
{
return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
}
template<typename Derived>
const Eigen::Vec... | TOOL | 0.963951 | 4.383477 |
44941dc7-8c24-4e45-b1c5-c51b739c2e96 | shadab375/important-interview-questions | dynamic programming/MCM dp/partition-array-for-maximum-sum.cpp | #include <bits/stdc++.h>
using namespace std;
//RECURSION + MEMOIZATION
class Solution {
public:
int f(int i, int k, vector<int>& arr, vector<int>& dp) {
int n = arr.size();
if (dp[i] != -1) return dp[i];
if (i == n) return 0;
int len = 0, maxi = INT_MIN, maxAns = INT_MIN;
... | ALGO | 0.999924 | 5.522947 |
21fc8275-035d-4fcd-ae30-86f39e0f6b35 | hbasriuzun/My-Codes | Compatitive Programming/Question solution/Leetcode/1807.Evaluate_the_Bracket_Pairs_of_String.cpp | #include <bits/stdc++.h>
#include <iostream>
#define endl "\n"
const int N = 1e5+5;
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef push_back pb;
string evaluate(string s, vector<vector<string>>& knowledge) {
map<string,string> mp;
for(int i = 0; i < knowledge.size(); i++){... | ALGO | 0.999917 | 4.093168 |
86ccec64-0ef3-4c61-b30b-62bd5b3b286a | checkoutb/LeetCodeCCpp | ge500/LT0506_Relative_Ranks.cpp |
#include "../header/myheader.h"
class LT0506
{
public:
// details
// vector<pair>代替2个vector。
// sort(pairs.begin(), pairs.end(), [&](const pair& a, const pair& b)->bool{
// return a.first > b.first;
// });
// priority_queue< pair<int, int> > dd;
// discuss
// for(int i=0; i<nums.size(); ++... | ALGO | 0.999929 | 5.555445 |
36bec426-23fa-4166-be25-2b140462e129 | Sarthak1322/DSA_Codes | Revise/30.cpp | /*
1234554321
1234**4321
123****321
12******21
1********1
print the above pattern*/
#include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
for (int i = n; i >= 1; i--) {
for (int j = 1; j <= i; j++) {
cout << j;
}
for (int k =... | ALGO | 0.999718 | 3.432152 |
0b38787c-ab8e-41da-b91d-e17c38676303 | pavelKomiss121/search_trees | 2301KomissarovPElr3Time.cpp | #include <algorithm>
#include <iostream>
#include <windows.h>
#include <conio.h>
#include <vector>
#include <time.h>
#include <chrono>
#include <ctime>
#define LANGUAGE 1251
using namespace std;
const int lengthMas = 100000;
using namespace std::chrono;
int m = 1 + rand() % lengthMas;
enum Color
{
black,
red
};
en... | ALGO | 0.997591 | 3.450725 |
2f1a0343-5f4f-41de-a424-8e86139b4a0c | ishandutta2007/codeforces | a-soul_bella/normal/1654/E.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
int a[100005],s[100005];
const int B=612,qwq=100000/B+1;
const int MAXN=100005;
const int mod=100003;
const int BASE=22637261;
struct HASH{
struct Edge{
int val;
signed cnt,nxt;
}e[MAXN];
signed head[mod],cnt = 0;
inline int insert(int x){
x ... | ALGO | 0.99988 | 3.836239 |
0167651a-05aa-4608-aa80-37ebc78d997b | Divyanshu9794/LeetcodePotd | k largest elements - GFG/k-largest-elements.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
vector<int> kLargest(int arr[], int n, int k) {
// code here
priority_queue<int, vector<int>> pq;
for(int i=0; i<n; i++){
pq.push(ar... | ALGO | 0.999974 | 5.784245 |
6783cd2b-32cb-48f3-bf27-9578f3d8bb46 | AhmedMZaher/CP | A. Sereja and Dima.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
#include <cstdlib>
#include <cctype>
#include<string>
int main()
{
int n;
cin>>n;
int first=0,last=n-1,sereja=0,dima=0,mx;
bool is_sereja=true; // as Sereja state game
int arr[1000];
for(int i=0;i<n;i++){
cin>>arr[i];
... | ALGO | 0.999941 | 3.515364 |
a8983abf-9f3e-40e0-bd76-81fafe4a6321 | random-aosp-stuff/android_external_libcxx | src/algorithm.cpp | #include "algorithm"
#include "random"
#include "mutex"
_LIBCPP_BEGIN_NAMESPACE_STD
template void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
template void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
template void __sort<__less<signed char>&, signed char*>(signed char*, si... | ALGO | 0.999527 | 5.632583 |
5cc422cc-4bef-4416-a075-3bfb5316feab | hitesh103/CodeForces_Solutions | A_Theatre_Square.cpp | #include <iostream>
using namespace std;
int main() {
long long n, m, a;
cin >> n >> m >> a;
// Calculate the number of flagstones needed for the rows and columns separately
long long rows = (n + a - 1) / a;
long long columns = (m + a - 1) / a;
// Multiply the number of rows and columns to g... | ALGO | 0.998452 | 3.853411 |
abcc73e1-4575-4daf-8b9d-6872da7c0a4a | siangsiang/lab3 | haha.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <fstream>
using namespace std;
int main()
{
ifstream inFile("file.in", ios::in);
int n,k;
inFile >>n;
vector<int> v1(n);
for(k=0; k<n; ++k)
{
inFile>>v1.at(k);
}
sort(v1.begin(),v1.end());
reverse(v1.begin(),v1.end());
cout<< v1.at... | ALGO | 0.999724 | 3.444705 |
a923c97c-db6b-450a-a5c4-0dc26ba90348 | KVSchandra/LeetCode | 3080-split-array-into-maximum-number-of-subarrays/split-array-into-maximum-number-of-subarrays.cpp | class Solution {
public:
int maxSubarrays(vector<int>& nums) {
int x = nums[0];
for(int i = 1; i<nums.size(); i++) {
x &= nums[i];
}
if(x) return 1;
int mini = INT_MAX;
int count = 0;
for(auto val : nums) {
mini &= val;
if(m... | ALGO | 0.999989 | 6.054676 |
db77abad-dc63-4cfc-aaf3-c6ce77eef7d9 | TengFeiyang01/Algorithm | bishi/4-23美团外包/a.cpp | #include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using i64 = long long;
void solve() {
int n, m, k, s = 0;
std::cin >> n >> m >> k;
std::vector<int> a(m), oddmx(m), evenmx(m), oddmn(m, inf), evenmn(m, inf);
for (int i = 0; i < m; ++i) {
int odd = 0, even = 0;
for (int j = 0; j < k... | ALGO | 0.999872 | 4.403904 |
264af374-ac18-445c-818c-af2beb2ef9e9 | shravan-das/DAA-LAB-QUESTIONS-SHRAVANDAS | DAA LAB QUESTIONS AND TUTORIALS_SHRAVANDAS/WEEK7/q2.cpp | #include<bits/stdc++.h>
using namespace std;
struct node {
int u;
int v;
int wt;
node(int first, int second, int weight) {
u = first;
v = second;
wt = weight;
}
};
bool comp(node a, node b) {
return a.wt < b.wt;
}
int findPar(int u, vector<int> &parent) {
if(u== p... | ALGO | 0.999995 | 4.545306 |
03a5d186-9f7f-46a3-b6e0-76dc70483b35 | DavidSantosDeveloper/Estrutura-de-Dados-I | aula 01/main.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
int contar_numero_de_caracteres_de_uma_lista_char(char lista[]) {
int numero_de_caracteres_de_uma_lista_char = 0;
while (lista[numero_de_caracteres_de_uma_lista_char] != '\0') {
numero_de_caracteres_de_uma_lista_char++;
}
return numero_de_caracte... | ALGO | 0.9971 | 3.527324 |
b9a73db9-3d88-43ff-9000-c09bd87f33b1 | Bostrix/FSL-lesions | miscmaths/utils/armawrap/tests/newmat/tmt7.cpp |
//#define WANT_STREAM
#include "include.h"
#include "newmat.h"
#include "tmt.h"
#ifdef use_namespace
using namespace NEWMAT;
#endif
/**************************** test program ******************************/
void trymat7()
{
// cout << "\nSeventh test of Matrix package\n";
Tracer et("Seventh test of Matrix p... | TEST | 0.879596 | 3.703396 |
7d8cb2f6-d793-4431-80ac-a58033ea9e34 | AdityaTomar016/Questions | Job Sequencing Problem - GFG/job-sequencing-problem.cpp | //{ Driver Code Starts
// Program to find the maximum profit job sequence from a given array
// of jobs with deadlines and profits
#include<bits/stdc++.h>
using namespace std;
// A structure to represent a job
struct Job
{
int id; // Job Id
int dead; // Deadline of job
int profit; // Profit if job... | ALGO | 0.999954 | 5.843222 |
b4b2b01f-df18-40c9-8db4-e9a0f903a554 | fanes-setiawan/python-backend-practices | venv/lib/python3.12/site-packages/greenlet/PyModule.cpp | #ifndef PY_MODULE_CPP
#define PY_MODULE_CPP
#include "greenlet_internal.hpp"
#include "TGreenletGlobals.cpp"
#include "TMainGreenlet.cpp"
#include "TThreadStateDestroy.cpp"
using greenlet::LockGuard;
using greenlet::ThreadState;
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored... | TOOL | 0.853976 | 7.002011 |
0a9fa52c-bc79-420f-8ef3-8807f481c76b | Yashwanth-Ramamurthi/TopoDistMF-v.1 | OGDF/src/ogdf/labeling/ELabelPosSimple.cpp | /*
* $Revision: 2552 $
*
* last checkin:
* $Author: gutwenger $
* $Date: 2012-07-05 16:45:20 +0200 (Thu, 05 Jul 2012) $
***************************************************************/
#include <ogdf/labeling/ELabelPosSimple.h>
namespace ogdf {
ELabelPosSimple::ELabelPosSimple() :
m_absolut(true),
m_marg... | TOOL | 0.987348 | 4.507048 |
f5888c52-ec2a-49dc-8966-ac3859de6388 | likewind1993/leetcode | solutions/0712.minimum-ascii-delete-sum-for-two-strings/minimum-ascii-delete-sum-for-two-strings.cpp | class Solution {
public:
int minimumDeleteSum(string s1, string s2)
{
int n = s1.size(), m = s2.size();
vector<vector<int>> dp(n+1, vector<int>(m+1, 0));
for (int i = 1; i <= m; i++) dp[0][i] = dp[0][i-1] + s2[i - 1];
for (int i = 1; i <= n; i++)
{
dp[i][0] =... | ALGO | 0.999991 | 6.213239 |
49d9f4a0-45bf-4edc-b1d3-09064e2267fb | Srijansarkar17/Cpp-Important-Questions-Placement- | flyodstriangle.cpp | 1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
#include <iostream>
using namespace std;
int main(){
int count{1};
int n;
cout << "Enter the number of rows: ";
cin >> n;
for(int i=1; i<=n; i++){
for(int j=1;j<=i;j++){
cout << count << " ";
count++;
}
cout << ... | ALGO | 0.999003 | 3.930036 |
233f7c82-96e2-40e6-8d2b-f1657bb913f0 | peremichka256/GPOLabs | OOPLab1/Task_1.1.5.8.cpp | #include "Lab1_Tasks.h"
int* ReadArray(int count)
{
int* values = new int[count];
for (int i = 0; i < count; i++)
{
cin >> values[i];
}
return values;
}
int CountPositiveValues(int* values, int count)
{
int result = 0;
for (int i = 0; i < count; i++)
{
if (values[i] > 0)
{
result++;
}
}
return res... | ALGO | 0.997612 | 3.948501 |
b470b8f0-882e-4caa-97c4-7a6a9d708094 | gecitemre/metu-homeworks | ceng213/pa1/Student_Evaluate/mains/linkedlist_testcase_4.cpp | #include <iostream>
#include "LinkedList.h"
//#include "../LinkedList.h"
template <class T>
void checkIfCircular(LinkedList<T> *llist) {
std::cout << "-> Checking if the linked list is circular?" << std::endl;
if (llist == NULL || llist->isEmpty()) {
std::cout << "yes. it is circular." << std::endl;
... | TEST | 0.86432 | 4.931403 |
83184e09-685f-41b9-8b02-cb03ca947845 | Mahfuzul-Islam55/Data-Structure-Algorithm | LinkedList/insertAtBeginningInlinkedList.cpp | #include<bits/stdc++.h>
using namespace std;
typedef struct node Node;
struct node
{
int data;
Node *next;
};
Node *head;
Node *createNode(int item,Node *next)
{
Node *newNode=(Node*)malloc(sizeof(Node));
if(newNode==NULL){
printf("Error! Could not make New Node!\n");
exit(1);
}
... | ALGO | 0.991649 | 3.205173 |
58588133-33e7-4d18-a2a6-31869ff7ec37 | yeonsssu26/object-oriented-programming | Lab09/응용3.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void make_arr(int* arr, int size); // 迭Լ
void print_arr(int* arr, int size); // 迭Լ
bool check_dup(int* arr, int size); // ߺ˻Լ
int main() {
int num, size;
while (true) {
cout << "please enter a number : ";
cin >> num;
if (num < 2) {
... | ALGO | 0.977311 | 4.000911 |
13863708-93c8-4b1d-879c-64ea63a0926a | zeroplusone/AlgorithmPractice | Leetcode/1886. Determine Whether Matrix Can Be Obtained By Rotation.cpp | class Solution {
public:
bool findRotation(vector<vector<int>>& mat, vector<vector<int>>& target) {
bool is_rotate=compare(mat, target);
for(int i=0;i<3&&!is_rotate;++i) {
rotate(mat);
is_rotate=compare(mat, target);
}
return is_rotate;
}
bool co... | ALGO | 0.999974 | 6.099383 |
f6755cc4-a1fc-4dc3-b8b3-be9df9710ea1 | Vanaub22/LeetCode-2024 | 0165-compare-version-numbers/0165-compare-version-numbers.cpp | class Solution {
public:
int compareVersion(string& v1, string& v2) {
int i=0,j=0,l1=v1.length(),l2=v2.length();
while(true) {
long long int r1=0,r2=0;
while(i<l1 && v1[i]!='.') {
r1=r1*10+v1[i]-'0';
i++;
}
while(j<l2 &&... | ALGO | 0.999329 | 5.121071 |
6f3c449d-a65c-420f-9a0e-21ab28c02a6d | raincross7/code-similarity | codes/train_code/problem463/problem463_199.cpp | #include <iostream>
#include <string>
using namespace std;
int main(void)
{
string line;
getline(cin, line);
line.append(line);
string search;
getline(cin, search);
if (line.find(search) != string::npos)
{
cout << "Yes" << endl;
}
else
{
cout << "No" << endl;
... | ALGO | 0.99985 | 4.628265 |
c03ec3fa-a5d1-4d66-a435-2e0ba3334bdc | jhwest1/newtrend-teamnote | flow/global-min-cut/final.cpp | // 0-based, O(V^3), undirected graph
// call init() first, add_edge(u, v, w), then call solve()
// gets global min cut of given graph
// cut[v] = {0, 1} which side the vertex belongs to
const int SV = 505;
typedef int T;
const T INF = numeric_limits<T>::max();
int n;
T g[SV][SV];
vector<int> cut;
void init(int _n) {
... | ALGO | 0.999648 | 4.322512 |
b6d34193-9722-4b2a-aebb-671aac99f71f | kdy0324n/Algorihtm | 종만북/06~12-알고리즘 설계 패러다임/06장-무식하게 풀기/보글게임(BOGGLE).cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<string.h>
using namespace std;
char arr[6][6];
int chk[6][6][11];
int n = 5;
bool flag = false;
int dy[] = { -1,0,1,1,1,0,-1,-1 };
int dx[] = { 1,1,1,0,-1,-1,-1,0 };
void rec(int y, int x, string a, string b) {
if (a.size() >= b.size()) {
fla... | ALGO | 0.999953 | 4.571227 |
47efbb30-62ec-4d83-9b47-2ddf69f8f177 | c0smic-Lab/external_libcxx | test/std/algorithms/alg.modifying.operations/alg.rotate/rotate.pass.cpp | // <algorithm>
// template<ShuffleIterator Iter>
// Iter
// rotate(Iter first, Iter middle, Iter last);
#include <algorithm>
#include <cassert>
#include <memory>
#include "test_macros.h"
#include "test_iterators.h"
template <class Iter>
void
test()
{
int ia[] = {0};
const int sa = static_cast<int>(sizeo... | TEST | 0.884278 | 6.727272 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.