uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b925b7b9-2636-4b1f-9d47-8883686d4039 | Tomusss/AISD_3SEM | lista1/kody/heapSort.cpp | #include <iostream>
#include <random>
using namespace std;
int porownania = 0;
int przypisania = 0;
int left(int i){
return 2 * i + 1;
}
int right(int i){
return 2 * i + 2;
}
void heapify(float A[], int n, int i){
int largest;
int l = left(i);
int r = right(i);
przypisania += 3;
... | ALGO | 0.999566 | 4.22582 |
8bc41e85-8f22-4e1a-9f1f-61ea43d85e2b | GouravShDev/DS_Practise | C++/LinkedList/CircularLinkedList.cpp | #include <iostream>
using namespace std;
template <class T>
class Node
{
public:
T data;
Node *next;
Node(T value)
{
data = value;
next = NULL;
}
};
template <class T>
class CircularLinkedList
{
Node<T> *head = NULL;
public:
void insert(T value)
{
Node<T> *nod... | ALGO | 0.999735 | 5.032581 |
99cd69f4-239c-4edd-a02a-51c171bc42f9 | wisdompeak/LeetCode | String/2261.K-Divisible-Elements-Subarrays/2261.K-Divisible-Elements-Subarrays_v1.cpp | class Solution {
public:
int countDistinct(vector<int>& nums, int k, int p)
{
int ret = 0;
for (int len=1; len<=nums.size(); len++)
{
set<vector<int>>Set;
vector<int>arr;
int count = 0;
for (int i=0; i<nums.size(); i+... | ALGO | 0.999763 | 4.767876 |
ef4b94f7-6e57-4ae1-b946-c9e72af7448f | Michael-Santoro/UProj4 | pid_controller/pid_controller.cpp | /**********************************************
* Self-Driving Car Nano-degree - Udacity
* Created on: December 11, 2020
* Author: Mathilde Badoual
**********************************************/
#include "pid_controller.h"
#include <vector>
#include <iostream>
#include <math.h>
#include <boost/algorithm/cl... | ALGO | 0.99647 | 5.889137 |
132b9d86-7409-453e-af08-9b43c2726d42 | ufz/ogs | MeshLib/Utils/transformMeshToNodePartitionedMesh.cpp | #include "transformMeshToNodePartitionedMesh.h"
#include <mpi.h>
#include <numeric>
#include <range/v3/algorithm/count_if.hpp>
#include <range/v3/numeric.hpp>
#include <range/v3/range/conversion.hpp>
#include <range/v3/view/enumerate.hpp>
#include <range/v3/view/indirect.hpp>
#include <range/v3/view/map.hpp>
#include... | ALGO | 0.994799 | 7.036562 |
a4a64218-3918-43d8-ba80-d214b87cc11e | likethestarsF/Backjun-Saves | Class_3/11403.cpp | // 240306 2 #11403
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
class Route_finder {
vector<vector<bool>> graph;
int N; // number of Vertex
public:
Route_finder(int &n) {
graph.resize(n, vector<bool>(n));
N = n;
}
void input(int &row) {
for (i... | ALGO | 0.999883 | 4.596917 |
8ec73acd-a936-45db-b745-d36113e4b0f6 | sarvex/leetcode-lisp | lcof2/剑指 Offer II 082. 含有重复元素集合的组合/Solution.cpp | class Solution {
public:
vector<int> candidates;
vector<vector<int>> ans;
vector<int> t;
int target;
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
sort(candidates.begin(), candidates.end());
this->candidates = candidates;
this->target = target;
... | ALGO | 0.999985 | 6.421481 |
3bfa82f4-b567-4fd6-8493-0d2814d9b091 | Fraunhofer-AISEC/softboundcets-llvm-project | llvm/unittests/Transforms/Utils/SSAUpdaterBulkTest.cpp | #include "llvm/Transforms/Utils/SSAUpdaterBulk.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "gtest/gtest.h"
using namespace llv... | TEST | 0.900771 | 7.954065 |
e3ddcc46-2a1d-4df9-bfa4-c113248f55c8 | Livinfly/AlgorithmPromble_Code | AtCoder/2023/abc309/f.cpp | #pragma GCC optimize(2)
#include <bits/stdc++.h>
#define fi first
#define se second
#define mkp(x, y) make_pair((x), (y))
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
struct Node {
int a, b, c;
};
const int N = 2e5+10, INF = 2e9;
int n, nn, k;
N... | ALGO | 0.999996 | 4.811835 |
6be6ad24-16ee-4fa2-9974-0f9f6cf47df2 | UtsavDonda07/CP | Water_Filling.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long int t, i, n;
cin >> t;
while (t--)
{
int b1, b2, b3;
cin >> b1 >> b2 >> b3;
if (b1 + b2 + b3 >= 2)
cout << "Not now" << endl;
else
cout << "Water filling time" << endl;
}
... | ALGO | 0.933467 | 3.605671 |
184d916e-be6f-43e4-8eb8-d74f0978c6ae | HPC-AI-Team/lammps-fugaku-threadpool-sc23 | src/PTM/ptm_canonical_coloured.cpp | // clang-format off
#include <cstring>
#include <climits>
#include <algorithm>
#include "ptm_graph_tools.h"
#include "ptm_constants.h"
namespace ptm {
static bool weinberg_coloured(int num_nodes, int num_edges, int8_t common[PTM_MAX_NBRS][PTM_MAX_NBRS], int8_t* colours, int8_t* best_code, int8_t* canonical_labelling... | ALGO | 0.988013 | 6.461162 |
a74271c2-1fad-4ec7-8963-902bdacc7312 | wkqls0829/codingprac | baekjun/star/seven_star.cpp | #include <iostream>
using namespace std;
int main(void)
{
int N;
std::cin >> N;
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N-i-1; ++j) {
cout << " ";
}
for(int j = 0; j < 2*i+1; ++j){
cout << "*";
}
cout << "\n";
}
for (int i =... | ALGO | 0.999903 | 3.862246 |
5872f61b-dab6-41c7-9a57-5f6445f6cc25 | kbcgang/kbc | KBB TIME/C++/OnlineJudges/Codeforces/CONTEST/DIV2/21-6-2025/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
#define kien long long
#define JAV main
// Hàm tính a^b mod MOD bằng phương pháp bình phương và nhân
kien power(kien base, kien exp) {
kien res = 1;
base %= MOD;
while (exp > 0) {
if (exp % 2 == 1) res = (res * base) % MOD;
... | ALGO | 0.999815 | 4.856784 |
bf311342-5421-4dea-b86f-1fa8c04358f6 | thuyduong7/BT02 | Bai1.cpp | #include <iostream>
#include <cmath>
using namespace std;
bool checkPrime(int x){
if (x < 2) return 0;
else for (int i = 2; i < sqrt(x); i++){
if (x % i == 0) return 0;
}
return 1;
}
int main()
{
int n;
cin >> n;
if (checkPrime) cout << "yes";
else cout << "no";
return 0;
}
| ALGO | 0.999931 | 4.635602 |
4c21dc97-6374-4eb0-ace7-5f0d5c85327c | renhaofan/Source-Archive | OpenCV/opencv_contrib-3.4.5/modules/surface_matching/samples/ppf_load_match.cpp | #include "opencv2/surface_matching.hpp"
#include <iostream>
#include "opencv2/surface_matching/ppf_helpers.hpp"
#include "opencv2/core/utility.hpp"
using namespace std;
using namespace cv;
using namespace ppf_match_3d;
static void help(const string& errorMessage)
{
cout << "Program init error : "<< errorMessage <... | ALGO | 0.966283 | 5.509631 |
4a08612d-82b6-4768-aed1-a210dcf13691 | DieBaheit/KNN-2 | main.cpp | /* Exercise 2 in Artificial Neural Networks
Please find @task markers throughout this file, x_factory.cpp and
y_factory.cpp to help fit your solution to the exercise into these code
templates. Compilation of this code in its delivery state is futile.
After the exercise has been corrected you might find furthe... | ALGO | 0.998907 | 6.098028 |
cd2fa47f-c27a-48b3-970d-7c4e893479c6 | Hissane/Competitive-Programming | Cses/MissingNumber.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, m;
int arr[200005] = {0};
cin >> n;
for(int i = 1; i < n; i++){
cin >> m;
arr[m] = 1;
}
for(int i = 1; i < n+1; i++){
if(arr[i] == 0){
cout << i << " ";
}
}
return 0;
} | ALGO | 0.999955 | 3.435894 |
7db4adb0-1893-4a48-b0a9-6d6cfa7016b3 | Sampurankishoresrivastava/DSA | leetcode/228. Summary Ranges.cpp | class Solution {
public:
vector<string> summaryRanges(vector<int>& nums) {
vector<string> r;
for (auto p(0), q(0); q<size(nums); ++q)
if (q+1==size(nums) || nums[q+1]!=nums[q]+1)
{
r.emplace_back( p!=q ? to_string(nums[p])+"->"+to_string(nums[q]) : to_string(nums[p]) );
p=q+1;
}
return r;
... | ALGO | 0.999951 | 6.389113 |
ee71dc7f-ab1e-4b13-b91b-f2aff1cacef5 | Neaj-Morshad-101/CP-Code-Templates-and-Resources | Notes and Resources/kactl-main/stress-tests/number-theory/CRT.cpp | #include "../utilities/template.h"
#include "../../content/number-theory/CRT.h"
ll rmod(ll a, ll b) { return (a % b + b) % b; }
std::mt19937_64 rng(2);
ll randExp() {
int e = rand() % 63; // 64
return uniform_int_distribution<ll>(0, (ll)((1ULL << e) - 1))(rng);
}
int main(int argc, char** argv) {
rep(it,0,10000... | TEST | 0.999639 | 3.23514 |
c3f83542-bf82-4ea6-90ee-4a13aba30cb5 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6210_7.cpp | #include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
long long mod1 = 1e9 + 7;
const int maxL = 22;
const int maxn = 1e5 + 100;
const int baze = 330;
int data[2][4 * maxn + 10];
void add(int seg, int pos, int val, int st = 0, int en = maxn, int id = 1) {
data[seg][id] = max(data[seg][id], val);
if (en -... | ALGO | 0.999978 | 4.372323 |
2cec3d6e-8b4a-41cf-8e1a-f78b03789eb4 | daybreaktc/test | VSC++/dfs_1.cpp | #include<iostream>
#include<vector>
using namespace std;
const int MAXV = 1000;
const int INF = 100000000;
//用邻接矩阵实现DFS
//n为顶点数,MAXV为最大顶点数,如果顶点i已经被访问,那么vis[i]=true.
int n,G[MAXV][MAXV];
bool vis[MAXV] = {false};
void DFS(int u,int depth){
vis[u] = true;
for(int v = 0;v < n;v++){
if(vis[v] == false && G[... | ALGO | 0.999606 | 4.234179 |
654510a1-0181-4a50-8146-dd97a10b7a3e | wureny/Algorithm | cf/#855B.cpp | #include<iostream>
#include<cstring>
using namespace std;
typedef long long ll;
const int N=100;
void solution(ll n, ll k);
int main()
{
ios::sync_with_stdio(false);
ll time;
cin>>time;
while(time--)
{
ll n;
ll k;
cin>>n>>k;
solution(n,k);
}
}
bool isLower(char ch... | ALGO | 0.999969 | 3.664565 |
74037cb8-c9e5-4631-9a2c-5ed5564628df | GuacheSuede/MSSubmission1234567890 | submission/rsi/boost_1_69_0/libs/fiber/src/numa/algo/work_stealing.cpp | #include "boost/fiber/numa/algo/work_stealing.hpp"
#include <cmath>
#include <random>
#include <boost/assert.hpp>
#include <boost/context/detail/prefetch.hpp>
#include "boost/fiber/detail/thread_barrier.hpp"
#include "boost/fiber/type.hpp"
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace b... | TOOL | 0.887323 | 5.439977 |
5cb79861-3c5a-437c-a2ae-097fc07190c2 | albertollamas-GII/ED | PRACTICAS/PRACTICA 5/arboles 2/abb/usoabb3.cpp | #include <iostream>
#include <ABB.h>
using namespace std;
// El programa lee de la entrada estndar dos conjuntos de enteros (nmero de
// elementos ms los elementos a continuacin). Los inserta en dos rboles
// Binarios de Bsqueda. Los lista y finalmente los une para obtener el
// resultado de la unin de ambos conju... | ALGO | 0.999149 | 4.504534 |
c8496dfd-d0f8-4539-8cb2-6c9dea61ceaf | MZhumabek/leetcode | easy/Roman_to_Integer.cpp | class Solution {
public:
int check_value(char check){
switch(check){
case 'I': return 1;
case 'V': return 5;
case 'X': return 10;
case 'L': return 50;
case 'C': return 100;
case 'D': return 500;
case 'M': return 1000;
... | ALGO | 0.999881 | 5.997059 |
e24e6037-1771-4130-a8dd-e283bbcb703d | 0xYashwanth/dsa-learning | hashing/countDistinct.cpp | #include <bits/stdc++.h>
using namespace std;
int countDistinct(int arr[], int n)
{
unordered_set<int> s;
for (int i = 0; i < n; i++)
s.insert(arr[i]);
return s.size();
}
int main()
{
int arr[] = {15, 16, 27, 27, 28, 15};
int n = sizeof(arr) / sizeof(arr[0]);
cout << countDistinct(arr ... | ALGO | 0.999438 | 4.672585 |
dd9fe315-e1f0-47d0-a0bf-f90ded4e4dd8 | CristinaCristescu/ParEGO_Eigen | ParEGO/Throw_Least_Fit/ParEGOIteration9/ParEGOIteration9.cpp | /****************************************************************
The Pareto Efficient Global Optimization Algorithm: ParEGO
(C) Joshua Knowles, October 2004. <EMAIL>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Fre... | ALGO | 0.999983 | 6.884155 |
79ef1b35-ac84-4280-a766-e1ff0c31329a | danskcarvalho/rolltheball | Source/Libs/Box2D/Dynamics/Contacts/b2CircleContact.cpp | #include <Box2D/Dynamics/Contacts/b2CircleContact.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Collision/b2TimeOfImpact.h>
#include <new>
using namespace std;
b2Contact* b2CircleConta... | ALGO | 0.961553 | 6.887669 |
adfd3823-33c1-4d28-ba0c-b495884b63c4 | Akash-YS05/A2Z-Sheet-Practise | Basic Mathematical Probs/reverseDigits.cpp | #include <iostream>
#include <cmath>
int reverseNum(int n) {
int rev = 0, temp;
while(n > 0) {
temp = n % 10;
rev = (rev * 10) + temp;
n /= 10;
}
return rev;
}
int main() {
int num, res;
std::cout << "Num: ";
std::cin >> num;
res = reverseNum(num);
std::cou... | ALGO | 0.997203 | 5.499727 |
d474f219-7538-4348-aec5-6a8ac84a6032 | quyifei23/gem5-for-CXL | gem5/src/systemc/tests/systemc/misc/user_guide/chpt11.4/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999167 | 4.597202 |
85f66381-35af-4b76-a8d6-6f632ce8e45a | LJP-TW/VectorMatrixCalculator | Project1/Project1/DataManager.cpp | #include"DataManager.h"
#include <stack>
using System::String;
using namespace System::Collections::Generic;
using std::stack;
DataManager::DataManager()
{
}
bool DataManager::LoadVectorData()
{
std::fstream fin;
//}ɮסAǤJopenƪѼƦӡA}_ɮצW١A}ɮתҦѼ(ostd::ios::inŪ(J)A)
fin.open(FileName, std::ios::in);
//ŪѦ^false
if (... | TOOL | 0.965913 | 3.550636 |
bcc109cf-113a-45a4-b842-e74deb5cf8e2 | Ejlonn/Assignments | 1st semester/week2/1.cpp | #include <stdio.h>
int main(){
int midterm,final,makeup;
float note1,note2;
printf("Not Hesaplama programina hosgeldiniz.\n");
printf("Gecme notu 60'dir.\n");
printf("Vize notunun %%40'i Final notunuzun %%60i hesaplanir.");
printf("\nVize notunuzu giriniz: ");
scanf("%d",&midterm);
... | TOOL | 0.993333 | 3.168319 |
a4ca0429-7c8c-4c52-a648-e75863f6b6aa | vlxcoin/veloxcoin | src/kernel.cpp | #include <boost/assign/list_of.hpp>
#include "kernel.h"
#include "txdb.h"
using namespace std;
typedef std::map<int, unsigned int> MapModifierCheckpoints;
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
boost::assign::map_l... | ALGO | 0.990791 | 5.833631 |
3fab53fe-29c1-4e73-bc6b-e3b25a5594c0 | joysarker39/ACM-Library | DS/BIT/BIT 1D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 100000
struct FenwickTree {
vector<int> bit; // binary indexed tree
int n;
FenwickTree(int n) {
this->n = n;
bit.clear();
bit.assign(n, 0);
}
int prefix_sum(int r) {
int res = 0;
... | ALGO | 0.999535 | 4.301489 |
9ec37e41-f83b-4a2d-baec-e63682413a18 | tiom4eg/corn_phild | segtree.cpp | template <typename T, typename U>
struct segtree {
vector <T> t;
vector <U> u;
int R;
void pull(int v) { t[v] = t[2 * v] + t[2 * v + 1]; }
void push(int v) {
t[2 * v] += u[v], t[2 * v + 1] += u[v];
u[2 * v] += u[v], u[2 * v + 1] += u[v];
u[v] = U();
}
void upd(int q... | ALGO | 0.999878 | 6.105229 |
1c15485a-2b9d-44d7-966a-94704b6a382f | byungwook-min/Algorithm | BOJ/3197 - 백조의 호수.cpp | //
// 3197 - 백조의 호수.cpp
// Cpp
//
// Created by 민병욱 on 2022/02/18.
//
#include <iostream>
#include <queue>
using namespace std;
#define FASTIO ios::sync_with_stdio(0); cin.tie(0);
#define X first
#define Y second
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
string board[1501];
bool vis1[1501][1501];
bool ... | ALGO | 0.999805 | 4.116468 |
b736642e-e15c-4f26-b39d-471490d3e3c4 | geekzzz/IntroToAlgorithm_CPP | LeetCodePractice/top 100/22. Generate Parentheses/Generate Parentheses.cpp | class Solution {
public:
vector<string> generateParenthesis(int n) {
vector<string> v;
if (n == 0)
return v;
addPar(v, "", n, 0);
return v;
}
void addPar(vector<string> &v, string s, int n, int m)
{
if (n == 0 && m == 0)
{
v.push_back(s);
return;
}
/*
עﲻд
if (n > 0)
{
s += '(';
ad... | ALGO | 0.99997 | 5.920781 |
e580d784-11c5-4204-96a1-4e2b8956398c | janiceHuuu/112-2-computer-programming | CH10/CH10-4.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
void add(int,int,int &);
void sub(int,int,int &);
void mult(int,int,int &);
int main() {
int n,a,b,answer;
char x;
void (*p)(int,int,int &);
cin>>n;
for(int i=0;i<n;i++){
cin>>a>>x>>b;
if(x==42){
p=&mult;
}
else if(x==43){... | ALGO | 0.996604 | 3.819932 |
b3abf653-c2a9-4b8b-a626-52134a1d3bec | ishandutta2007/codeforces | wsyhb/normal/1287/A.cpp | #include<bits/stdc++.h>
using namespace std;
const int max_k=100+5;
char s[max_k];
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int k;
scanf("%d%s",&k,s+1);
int ans=0;
for(int i=1;i<=k;++i)
{
if(s[i]=='A')
{
int j=i;
while(j+1<=k&&s[j+1]=='P')
++j;
ans=max(ans,j-i);
i=j;
... | ALGO | 0.999015 | 3.445821 |
f0658b44-ac02-42be-bf6f-f5ddb5a46e51 | vscalcione/cpp_projects | recursion/quozient.cpp | #include <iostream>
#include <cstdlib>
#include <math.h>
using namespace std;
int x,numero1,numero2;
int quoziente(int numero1,int numero2);
main(){
system("color 1F");
cout<<"Quoziente con funzione ricorsiva "<<endl;
cout<<"Inserire primo valore: ";
cin>>numero1;
cout<<"Inserire secondo valore: ";
cin>>numero2;
... | ALGO | 0.998086 | 4.339465 |
74fcd7a6-776d-4b74-811c-f7cb7efc8b88 | Marcux777/Programacao_Competitiva | Beecrowd/Organizar/BEE1211.CPP | #include <iostream>
#include <string>
#include <vector>
#include <unordered_set>
#include <algorithm>
using namespace std;
struct telephone
{
string phone;
};
bool compare(const telephone &a, const telephone &b)
{
return a.phone < b.phone;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nul... | ALGO | 0.999247 | 4.618721 |
8203b988-936f-488a-9ffe-607a9a831b9b | vincenzopalazzo/Competitive-Programming-and-Contests-VP-Solution | UpdateTheArray/src/MainSite.cpp | //
// Created by vincent on 10/17/20.
//
#include <iostream>
#include <vector>
using namespace std;
template<typename T>
struct update {
int start;
int end;
T value;
update(int start, int anEnd, T value) : start(start), end(anEnd), value(value) {}
};
template<class T>
class BTreeIndex {
private:
... | ALGO | 0.999376 | 5.306221 |
41836248-3ff2-4dd8-afa7-85011cc40c3c | godswan/Algorithm_swany | level2/190621_전화번호 목록_BH.cpp | #include <string>
#include <vector>
using namespace std;
bool solution(vector<string> phone_book) {
for (int i = 0; i <phone_book.size(); i++)
{
for (int j = 0; j < phone_book.size(); j++)
{
if (i == j)
continue;
if (phone_book[i].size() <= phone_book[j].size())
{
if (phone_book[i] == phone_bo... | ALGO | 0.999833 | 4.924958 |
ec277721-0cde-493a-8e7d-0a8d7c566a0e | raquibul-islam/Competitive_Programming | Codeforces/Odd.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
int n,even=0,x;
cin>>n;
for(int i=1; i<=2*n; i++)
{
cin>>x;
if(x%2)
even++;
}
if(even==n)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
int main()
{
int t=1;
cin>>t;
while(t--)
solve ();
... | ALGO | 0.999075 | 4.503434 |
e9fc6ba6-b6eb-4d4e-82f1-d58303fad1fd | shubham691438/coding-Problems | F_Greetings.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 1000000
#define mod LLONG_MAX
#define endl "\n"
#define ff first
#define ss second
#define w(t) ll t; cin >> t; while(t--)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(a) (a).begin(), (a).end()
... | ALGO | 0.999843 | 4.745764 |
85a6add2-afe0-4293-a39e-856471c69e83 | sahil32/DataStructureandAlgorithm | mockvita/maximizeexpresseion.cpp | #include<limits.h>
#include<stdio.h>
int max(int x,int y)
{
return x>y?x:y;
}
void Display(int *a,int n)
{
for(int i=0;i<n;i++)
printf("%d\t",a[i]);
printf("\n");
}
int MaximizeExpression(int *A,int n)
{
int first[n+1]={INT_MIN};
int second[n]={INT_MIN};
int third[n-1]={INT_MIN};
int fourth[n-2]={INT_MIN};
... | ALGO | 0.999936 | 3.542887 |
e9e92b93-6ad1-47cb-867c-03e7c79b2270 | PPL-IIITA/ppl-assignment-bd96 | q3_inheritance/q6.cpp | #include <bits/stdc++.h>
#include "couples.hpp"
#include "h_c.hpp"
#include "Input.hpp"
using namespace std;
int main()
{
srand(time(NULL));
int calendar[31];
int l = 0;
for( l = 0; l < 31; l++) {
calendar[l] = rand()%2;
}
Input I;
boy B[10005];
girl G[10005];
gift_alloc caller;
int cb = 0, cg = 0, countc =... | ALGO | 0.998158 | 3.009043 |
32eefb93-6678-4db1-b81e-4991de6130ec | rayko04/EveythingCpp | oop/class/simple/q6b.cpp | /*
Question 6 Write a program that declare a class Student with five data members to
store five subject mark of student. Class also includes three member function for
input marks, Sum() to calculate and return the sum of five subject and Avg()
to calculate and return the average marks of five subject.
... | TOOL | 0.938738 | 5.052197 |
3bba39b8-1463-4dca-b7b6-10c46f97ad38 | ljw523054441/UE5SourceCodeLearning | Engine/Source/ThirdParty/Intel/ISPC/ispc-1.17.0/examples/cpu/volume_rendering/volume.cpp | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#define NOMINMAX
#pragma warning(disable : 4244)
#pragma warning(disable : 4305)
#endif
#include "../../common/timing.h"
#include "volume_ispc.h"
#include <algorithm>
#include <cstdlib>
#include <stdio.h>
using namespace ispc;
extern void volume_serial(float density[], ... | ALGO | 0.935675 | 5.299896 |
120ce6db-249e-4adf-8579-dcd99149430d | Shubham-js/Codes | longest_palindromic_subsequence.cpp | // class Solution {
// public:
// int dp[1001][1001];
// int longest(string s, int i, string x, int j)
// {
// if (i == s.length() or j == x.length())
// {
// return 0;
// }
// if (s[i] == x[j])
// {
// return dp[i][j] = longest(s, i + 1, x, j ... | ALGO | 0.999742 | 5.420727 |
25b0c15e-5386-42b6-bd97-0e5241981130 | giahuy215/codeforces-solving | ProblemA/problem1369A.cpp | /*
Author : Nguyen Duc Gia Huy
*/
/*
https://codeforces.com/problemset/problem/1369/A
A. FashionabLee
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output
Lee is going to fashionably decorate his house for a party, using some regular convex p... | ALGO | 0.999549 | 5.146325 |
da3af246-df3e-4f5a-ac62-d728772e547f | pratikroy311/DS-and-Algo-codes | LeetcodeAprilCodingChallenge/11DiameterOfBinaryTree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int heightTree(TreeNode* root)
{
if(!root)return 0;
return max(heightTree(r... | ALGO | 0.999895 | 6.621018 |
69892ea8-f8d3-47b4-bd27-0e4f29355d49 | yashikajotwani12/DataStructures_Algorithms | hashing/phonebook.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
unordered_map<string , vector<string>>phonebook;
phonebook["yashika"].push_back("9100019");
phonebook["yashika"].push_back("9100016");
phonebook["yashika"].push_back("9100013");
phonebook["yashika"].push_back("9100014");
phonebook["kajal... | ALGO | 0.993266 | 4.885221 |
034a3143-6948-4f09-ab8f-69210512fc52 | chakitg/cp_solutions | gfg-potd/Implement Atoi.cpp |
Given a string, s, the objective is to convert it into integer format without utilizing any built-in functions. If the conversion is not feasible, the function should return -1.
Note: Conversion is feasible only if all characters in the string are numeric or if its first character is '-' and rest are numeric.
Exampl... | ALGO | 0.998846 | 5.777588 |
b5adcfad-e4ec-430f-910f-f0de8d43fbe4 | colinlee1999/uva | week7/820_Internet_Bandwidth.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
#define INT_MIN (1<<31)
#define INT_MAX (~INT_MIN)
#define UNREACHABLE (INT_MAX>>2... | ALGO | 0.999675 | 3.735817 |
27c325a3-85c7-401f-89fc-baa27f58c9da | aasimtaif/mohd_asim_taifullah-2020bit069 | 8.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
cout << "String" << endl;
cin >> s;
int n = s.length();
for (int i = 0; i < n / 2; i++)
{
if (s[i] != s[n - 1 - i])
{
cout << "given string isnt palindrome " << endl;
return 0;
... | ALGO | 0.999678 | 4.140412 |
03261b0c-96b3-45bd-8fb7-10c358bbda7c | MohilKadakia/competitive_programming_club | 2022/DMOJ/1_-_Spavanac.cpp | // https://dmoj.ca/problem/coci09c7p1
#include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if(b < 45) {
a -= 1;
}
if(a < 0) {
a = 24 + a;
}
b = (b + 15)%60;
cout << a << " " << b;
} | ALGO | 0.998889 | 4.666743 |
93dacedd-c679-4295-94cc-cd420df4137f | sparsh1119/LeetCode | Factorial - GFG/factorial.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long int factorial(int N){
//code here
if(N==0|| N==1)
return 1;
return N * factorial(N-1);
}
};
//{ Driver Code Starts.
int main()
{
int t;
... | ALGO | 0.99992 | 6.464829 |
76c483f6-04c5-4efe-a5a4-376ad14c2081 | luongdung52hz/student_management_c- | OneDrive/Máy tính/Dev-Cpp/Test3.cpp | #include <iostream>
using namespace std;
void Nhap(int n[], int k){
for (int i = 1; i <= k; i++){
cout << "Nhap phan tu thu " << i << ": ";
cin >> n[i];
}
}
void Xuat(int n[], int k){
for (int i = 1; i <= k; i++){
cout << n[i] << " ";
}
cout << endl;
}
int Timx(int n[], in... | ALGO | 0.998807 | 3.684165 |
4481e8aa-f09a-4fe5-94a3-ccd2225418d3 | ktran050/Portfolio | plusplus/csCourseWork/cs12_assignment/assignment3/ex1/mainTemp.cpp | #include <iostream>
#include <string>
using namespace std;
class Date{
unsigned day;
unsigned month;
string monthName;
unsigned year;
bool isLeap(int);
unsigned daysPerMonth(unsigned, unsigned);
unsigned number(const string &) const;
string number(unsigned) const;
public:... | TOOL | 0.89098 | 3.695983 |
36c2725e-1fba-49e7-a020-bdcf2034eefd | Jichao-Peng/PL_SLAM | mrpt/libs/slam/src/slam/CRejectionSamplingRangeOnlyLocalization.cpp | #include "slam-precomp.h" // Precompiled headers
#include <mrpt/slam/CRejectionSamplingRangeOnlyLocalization.h>
#include <mrpt/obs/CObservationBeaconRanges.h>
#include <mrpt/maps/CLandmark.h>
#include <mrpt/maps/CLandmarksMap.h>
#include <mrpt/math/utils.h>
using namespace mrpt::utils;
using namespace mrpt::math;
u... | ALGO | 0.987235 | 7.023503 |
fd72da61-8866-4114-9fc0-49678b0bc9f4 | Manisha152/GFG23 | greedy_algorithm/easy_problem/4e.cpp | ERROR: type should be string, got "\nhttps://practice.geeksforgeeks.org/problems/lemonade-change/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=lemonade-change\n\n//youtube channel==Deepak Joshi \n\nclass Solution {\n public:\n bool lemonadeChange(int n, vector<int> &a) {\n\n int countfive=0;\n int countten=0;\n \n for(int i=0;i<n;i++) {\n \n if(a[i]==5)\n countfive++;\n \n else if(a[i]==10){\n \n if(countfive>=1){\n countfive--;\n countten++;\n }\n else\n return false;\n }\n \n else\n {\n if(countfive>=1 && countten>=1)\n {\n countfive--;\n countten--;\n }\n else if(countfive>=3){\n countfive-=3;\n }\n \n else\n return false;\n \n }\n }\n \n return true;\n\n } \n};" | ALGO | 0.999829 | 5.802382 |
850b5981-ec19-4c20-8199-8d1476ba2ab7 | kobuz/pa2020 | r5/C-dag.cpp | #include <iostream>
using namespace std;
int main() {
std::ios::sync_with_stdio(false);
long long k;
cin >> k;
long long pow = 1;
int base = 0, root = 1;
while(pow < k) {
++base;
pow <<= 1;
}
if(pow > k) {
--base;
pow >>= 1;
}
int last_node = 2 * ... | ALGO | 0.999947 | 3.945943 |
91a4d49a-ee28-4075-84a1-60f8b15cbb36 | hasitpbhatt/CP-library | SegmentTree.cpp | template <typename T>
void build(vector<T>& segTree, vector<T>& array, int node, int lower, int upper) {
if(lower>upper)
return;
if(lower == upper) {
segTree[node] = array[lower];
}
int mid = (lower+upper)/2;
build(segTree,array,2*node,lower,mid);
build(segTree,array,2*node+1,mid+1,upper);
T sum = segTree[2... | ALGO | 0.999776 | 5.305588 |
a6fb52e9-8d82-44d3-bc62-a57a1672b477 | truonghienminh/Full-House | cp/sl342.cpp | #include <bits/stdc++.h>
using namespace std;
#define NMAX 10001
void FASTINPUT(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
typedef long long ll;
typedef unsigned long long ull;
long long n;
void inp(){
cin >> n;
}
void dec2bin(long long a){
stack<int> st;
while (a > 0){
st.push(a % 2);
a /= 2;... | ALGO | 0.999596 | 5.106683 |
81b7505e-3eff-4ca3-bbc7-e7135d0ba71e | apjv05/LeetCode | Problems/Stack/0901_OnlineStockSpan.cpp | class StockSpanner {
public:
stack<pair<int,int>> st; //price, span
StockSpanner() {}
int next(int price) {
int span = 1;
//while there is still previous days && our current price is > all the previous prices
while(!st.empty() && st.top().first <= price) {
//add the... | ALGO | 0.997375 | 6.244168 |
8cc7f4db-ae29-4702-a71e-8beceac3f62d | rikuTanide/atcoder_endeavor | abc058/arc071_a.cpp | #include <bits/stdc++.h>
#include <cmath>
//using namespace boost::multiprecision;
using namespace std;
typedef long long ll;
//typedef unsigned long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
typedef p... | ALGO | 0.999982 | 4.183728 |
3220d7c7-667c-46d3-a3ef-da7243c11391 | navneetk2001/CPP_Programs | Geeks for Geeks/Problem of the Day GFG/134. Longest subarray with sum divisible by K_GFG.cpp | // Given an array containing N integers and a positive integer K, find the length of the longest sub array with sum of the elements divisible by the given value K.
// Example 1:
// Input:
// A[] = {2, 7, 6, 1, 4, 5}
// K = 3
// Output: 4
// Explanation:The subarray is {7, 6, 1, 4} with sum 18, which is divisible by 3.... | ALGO | 0.999873 | 6.155375 |
551757a3-3051-4de2-bcd0-7bc6376945a1 | samfubuki/striver-cp-problems | Bit Manipulation/littlegirlandmaximumxor.cpp | #include<bits/stdc++.h>
using namespace std;
long long all_ones(int n)
{
return (1LL << (n + 1)) - 1;
}
int main()
{
long long int left,right;
cin>>left>>right;
if(left==right)
{
cout<<"0"<<endl;
return 0;
}
int largest_unequal_bit_position;
for(int i=0; left>0 || right>0... | ALGO | 0.999946 | 3.743232 |
8c528ee3-c193-42eb-bc77-37b32b04c83d | jlimbert1999/toktik | 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 |
bad5134a-b1a9-4f70-a759-15d43640f194 | viddya673/DSA-solutions-medium | Graphs/bellmanFord.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
/* Function to implement Bellman Ford
* edges: vector of vectors which represents the graph
* S: source vertex to start traversing graph with
* V: number of vertices
*/
vector<int> bellman_ford(int V, v... | ALGO | 0.999889 | 4.933365 |
d96438ec-8982-4191-9c2b-18f730550afe | kkw-11/Problem_Solving | C++를 이용한 창의적 문제 해결/25. 석차 구하기.cpp | ////25. 석차 구하기
//#include <stdio.h>
//#include <stdlib.h>
//
//int main() {
// //freopen("input.txt", "rt", stdin);
// int n, cnt = 0;
// scanf("%d", &n);
// int* p1 = (int*)malloc(sizeof(int) * n);
// int* p2 = (int*)malloc(sizeof(int) * n);
//
// //점수배열과, 등수표시 배열값 입력
// //등수표시 배열은 초기값 1로 설정
// for (int i = 0; i < n; ... | ALGO | 0.999988 | 3.799088 |
c8acfbff-b24e-474a-b10b-ac47948dad2d | ssk4988/Coding | UCFPT/learn/strings2/oop.cpp | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = a; i < (b); ++i)
struct Node {
int nxt[26];
int suff = 0;
int cnt = 0;
vi id;
};
const int MAX_N = 4e6;
Node t[MAX_N];
int curnodes = 2;
int create() {
return cur... | ALGO | 0.999916 | 4.249206 |
b6a60033-5c7f-4517-b774-7bcd18a236b5 | humayoonrafei/structureWork | Group 11 RecursionNumSum/RecursionNumSum.cpp | #include <iostream>
using namespace std;
void ConvertToString(string x, int* p);
int AddNumber(int* p, int x);
void Display();
int main(){Display();return 0;}
void ConvertToString(string x, int* p)
{
for (int i = 0; i < x.length(); i++)
{
int a = x[i] - '0';
p[i] = a;
}
}
int AddNumber(i... | ALGO | 0.999518 | 4.208029 |
d811ba51-d033-4703-ae62-2fa9d7551194 | dian-yu-luo/dian-cli | src/ime-dian-d/main.cpp |
#include <Shlwapi.h>
#include <WinUser.h>
#include <Windows.h> // Windows API 核心函数和数据类型。
#include <filesystem>
#include <fstream>
#include <iostream>
#include <nlohmann/json.hpp>
#include <oleacc.h> // MSAA(Microsoft Active Accessibility)API。
#include <psapi.h>
#include <set>
#include <string>
#include <tchar.h> // TC... | TOOL | 0.90807 | 4.739257 |
dfc7f4b7-5623-4cc0-91a5-a7f49abf0c99 | rla1wo23/Jaehyun_PS | baekjoon/2146.cpp | #include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
int N;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int board[105][105];
int island[105][105];
bool vis[105][105];
int around(int x, int y) {
if (x > 0 && board[x - 1][y]) {
return island[x - 1][y];
}
if (y > 0 && board[x]... | ALGO | 0.999869 | 4.877794 |
b55b8648-f0db-46dc-a026-e85a3c0fe204 | oilcode/DragonBonesDemo_CPP | demo_cocos2dx/cocos2d/cocos/math/CCAffineTransform.cpp | #include "math/CCAffineTransform.h"
#include <algorithm>
#include <math.h>
using namespace std;
NS_CC_BEGIN
AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty)
{
AffineTransform t;
t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty;
return t;
}
Vec2 __CCPoint... | TOOL | 0.895723 | 6.373181 |
8d88e726-d866-46a3-b6a5-8a460e12931b | intellistream/CANDOR-Benchmark | thirdparty/faiss/benchs/bench_6bit_codec.cpp | #include <omp.h>
#include <cstdio>
#include <benchmark/benchmark.h>
#include <faiss/impl/ScalarQuantizer.h>
#include <faiss/utils/distances.h>
#include <faiss/utils/random.h>
#include <faiss/utils/utils.h>
using namespace faiss;
static void bench(benchmark::State& state) {
int d = 128;
int n = 2000;
std... | TEST | 0.987002 | 5.901552 |
7e67afc3-5f95-4ea5-bec6-fa95a5b2b291 | levil221/Optymalizacja-Kombinatoryczna | job-shop/populacja.cpp | #include "populacja.hpp"
#include <assert.h>
populacja::populacja()
{
najlepszeRozwiazanie = false;
}
populacja::populacja(const populacja &do_skopiowania)//konstrunktor kopiujacy
{
instancja *nowy = new instancja(do_skopiowania.insta);
insta = *nowy;
ilewpopulacji = do_skopiowania.ilewpopulacji;
najlepszeRozwia... | ALGO | 0.938986 | 3.808334 |
d9facc0a-796b-4854-bd8b-27e0bb460bcf | zcwu/Data-Structure-SJTU | 1207_ferry.cpp | #include <iostream>
#include "stdio.h"
//#include <iomanip>
using namespace std;
class Queue{
private:
struct node {
int time;
node *next;
node (const int w, node *n = NULL)
{
time = w;
next = n;
}
node(): next(NULL) {}
~node() {}
... | ALGO | 0.999431 | 3.670253 |
7956fec0-de30-4076-a58b-5ac45f6444e4 | Abhay-140/DSA-solution-in-cpp | Array/trapRainWater.cpp | /*
Q : Trapping Rain Water
link : https://leetcode.com/problems/trapping-rain-water/description/
*/
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
//brute force
int trap(vector<int> &height)
{
vector<int> arr;
int count = 0, n = height.size(), ans = 0;
... | ALGO | 0.999908 | 6.689582 |
63f2bbe8-cca5-4421-befc-60bdb9f96615 | thisisaman408/DSA | DSAinC++/Lecture03/divisibleby5.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter a number : " << endl;
cin >> n;
if (n >= 0)
{
if (n % 5 == 0)
{
cout << "Yes! it is divisible by 5" << endl;
}
else
{
cout << "It is not divisible by 5";
... | ALGO | 0.988289 | 3.432681 |
a66b3fca-94c8-4608-b186-ccd36b3cd1ee | gshri2311/Challenge-your-friend-Oops | lead.cpp |
void heapify(viewdetails arr[], int n, int i)
{
int largest = i; // Initialize largest as root
int l = 2*i + 1; // left = 2*i + 1
int r = 2*i + 2; // right = 2*i + 2
// If left child is larger than root
if (l < n && arr[l] > arr[largest])
largest = l;
// If right child is larger than largest so far
if (r < ... | ALGO | 0.998812 | 3.446424 |
e70b8208-f403-4db8-8f1d-b11944c2f3dc | dev-aiden/problem-solving | boj/11726_2.cpp | #include <iostream>
using namespace std;
int d[1003];
int main(void) {
ios_base::sync_with_stdio(false);
int n; cin >> n;
d[0] = d[1] = 1;
for (int i = 2; i <= n; ++i) {
d[i] = d[i - 2] + d[i - 1];
d[i] %= 10007;
}
cout << d[n] << "\n";
return 0;
}
| ALGO | 0.999969 | 4.509756 |
fb9dadb7-a869-4a18-ad4a-45e9f4db1333 | CuuvuivevaSoixam/code | CodePTIT - DSA/DSA07027 - PHẦN TỬ BÊN PHẢI ĐẦU TIÊN LỚN HƠN.cpp | // https://code.ptit.edu.vn/student/question/DSA07027
// PHẦN TỬ BÊN PHẢI ĐẦU TIÊN LỚN HƠN
#include <bits/stdc++.h>
using namespace std;
void testCase() {
int n; cin >> n;
vector<int> a(n), r(n);
for (int &i : a) cin >> i;
stack<int> st;
for (int i = n - 1; i >= 0; --i) {
while (!st.empty(... | ALGO | 0.999919 | 5.595148 |
db3fdc0c-5a83-4106-94ee-3673f89057e8 | devanshV18/DSA | accenture/leapYear.cpp | #include<iostream>
using namespace std;
int main(){
int year;
cin >> year;
if(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)){
cout << year << " is a leap year.";
}
else{
cout << year << " is not a leap year";
}
} | ALGO | 0.999972 | 3.879533 |
971075f3-17d7-48d6-8dd9-6963225f9642 | alexandraback/datacollection | solutions_5652388522229760_1/C++/KenjiH/A.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vect... | ALGO | 0.998079 | 5.135036 |
948e4897-12d3-4df1-b9c8-6c5858c65abe | wyf2552/leetcode | 081-search-in-rotated-sorted-array-2.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
已知存在一个按非降序排列的整数数组 nums ,数组中的值不必互不相同。
在传递给函数之前,nums 在预先未知的某个下标 k(0 <= k < nums.length)上进行了 旋转 ,使数组变为 [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]](下标 从 0 开始 计数)。例如, [0,1,2,4,4,4,5,6,6,7] 在下标 5 处经旋转后可能变为 [4,5,6,6,7,0,1,2,4,4] 。
给你 旋转后... | ALGO | 0.999994 | 6.217857 |
9f194ed1-4217-417d-83e3-4442051a1be8 | Gavin-GMC/ECFC-release | _pdata/numerical/CEC2013_L/F7.cpp | #include "F7.h"
#include <stdio.h>
namespace CEC13L
{
F7::F7() :Benchmarks() {
Ovector = NULL;
minX = -100;
maxX = 100;
ID = 7;
s_size = 7;
anotherz = new double[dimension];
}
F7::~F7() {
delete[] Ovector;
delete[] Pvector;
delete[] a... | ALGO | 0.993826 | 3.79 |
bb351123-02d6-4bb0-bad4-2356f4ffb1c2 | mohitverma13/DSA_Questions | InsertGCDinLL.cpp | #include <iostream>
#include <vector>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode* next) : val(x), next(next) {}
};
class Solution {
p... | ALGO | 0.999971 | 6.902159 |
0f32ae1d-23bf-4781-84c2-a3a5bec661fe | Avdhesh-Varshney/CPMasterLog | CodeChef/Practice-Problem/HAPPYSTR.cpp | // Chef and Happy String
// Problem Code - HAPPYSTR
// https://www.codechef.com/problems/HAPPYSTR
// Solution:
#include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin >> t;
while(t--) {
string s;
int count = 0, flag = 0;
cin >> s;
for(int... | ALGO | 0.999979 | 4.941469 |
ad29f802-109e-4ac1-8c9d-6d8be09301b9 | rashedcs/Online-Judge | GeeksforGeeks/Check if a number is power of another number.cpp | /*
Given two positive numbers x and y, check if y is a power of x or not.
Input:
First line contains an integer, the number of test cases 'T'.
Each test case should contain two positive numbers x and y.
Output:
Print 1 if y is a power of x, else print 0.
Constraints:
1<=T<=30
1<=x<=1000
1<=y<=100000000
Example:
I... | ALGO | 0.99986 | 5.381806 |
e50db02a-1e55-46a1-8f57-e1063b6f8718 | pradeep8892/C_CPP-projects | linked_list_cpp_store_nth_position/main.cpp | #include <stdio.h>
struct Node{
int data;
struct Node* next;
};
Node* head;
void PrintList(){
Node* temp = head;
printf("\n printing list \n");
while(temp != NULL){
printf(" %d", temp->data);
temp = temp->next;
}
}
void insert(int value, int pos)
{
Node* temp1 = new N... | ALGO | 0.998499 | 3.820191 |
8e6f3a64-2218-463f-bc47-af203dac67a7 | poojaasinghhh/DSA-PRACTICE | Easy/Pass by Reference and Value/pass-by-reference-and-value.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
vector<int> passedBy(int a, int &b) {
// code here
vector<int> neww={a+1,b+2};
return neww;
}
};
//{ Dri... | ALGO | 0.998962 | 5.662673 |
56566f2b-c389-41df-8146-9814b5cfaca9 | ishandutta2007/codeforces | natofp/normal/1250/N.cpp | #include <iostream>
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll a,b; cin>>a>>b;
ll ile=1;
int t=1;
while(1)
{
if(t%2==1)
{
if(ile>a)
{
cout<<"Vladik";
return 0;
}
... | ALGO | 0.999985 | 3.233775 |
aeef08c4-0e06-4d55-be08-d1a06e358e16 | rakibul-wdp/phitron | XPSC/problem-solutions/week-10/day-4/C_Berpizza.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int q;
cin >> q;
set<pair<int, int>> s1, s2;
map<int, set<int>> mm;
int index = 1;
for (int i = 1; i <= q; i++)
{
int type;
cin >> type;
if (type == 1)
{
int m;
cin >> m;
s1.insert({index, m});
s2.insert... | ALGO | 0.999614 | 3.966597 |
f4fa8da2-19f1-419a-8754-ef5e4cfaf9bd | Anantadhirya/LeetCode | 2461-maximum-sum-of-distinct-subarrays-with-length-k/2461-maximum-sum-of-distinct-subarrays-with-length-k.cpp | class Solution {
public:
long long maximumSubarraySum(vector<int>& nums, int k) {
ios_base::sync_with_stdio(false); cin.tie(0);
long long ans = 0, sm = 0;
vector<int> cnt(1e5+1, 0);
int n = nums.size(), unique = 0;
for(int i = 0; i < k; i++) {
if(cnt[nums[i]]++ ==... | ALGO | 0.999942 | 5.43424 |
70bad120-fe28-4b88-a6bc-c84019be77f6 | prakharmishra2002/Leet-Code-POTD-Solutions | March 2025/15.cpp | class Solution {
public:
int minCapability(vector<int>& nums, int k) {
// Store the maximum nums value in maxReward.
int minReward = 1, maxReward = *max_element(nums.begin(), nums.end()),
totalHouses = nums.size();
// Use binary search to find the minimum reward possible.
... | ALGO | 0.999986 | 6.038942 |
b43a46d2-0b06-48e8-b5bd-39a0d3b5d3a5 | ishandutta2007/codeforces | risujiroh/normal/383/E.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define DEBUG(...)
#endif
template <class T> void fzt(vector<T>& a) {
int n = __lg(a.size());
assert((int)a.size() == 1 << n);
for (int i = 0; i < n; ++i)
for (int bt = 0; bt < 1 << n; ++bt)
if (bt >> i & 1) {
... | ALGO | 0.999948 | 5.133114 |
092c4a1a-62a4-447e-ab8b-c53b337acec6 | YGYtl/PAT_Advanced_Level | 1091 Acute Stroke (30分).cpp | #include<bits/stdc++.h>
using namespace std;
int m, n, l, t;
const int maxn1 = 1500;
const int maxn2 = 150;
const int maxn3 = 100;
int X[10] = {1, -1, 0, 0, 0, 0};
int Y[10] = {0, 0, -1, 1, 0, 0};
int Z[10] = {0, 0, 0, 0, 1, -1};
int G[maxn1][maxn2][maxn3];
bool vis[maxn1][maxn2][maxn3];
struct node{
int x, y, z;
};
i... | ALGO | 0.999943 | 3.151504 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.