uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
8085ec5c-8e5f-4aea-a299-7813b9950ce9 | SHIVANSHSHARMA26/Hacker-Rank-Solutions-CCC-Traning- | file65.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
string a,b;
cin>>a>>b;
if(a.size() < b.size()) {
string temp = a;
a = b;
... | ALGO | 0.999991 | 4.149784 |
98624036-ede1-454b-850e-31758f36b233 | kot0ffskiy/growthpath | Algorithms/6-th contest/H_solution.cpp | #include <algorithm>
#include <iostream>
#include <set>
#include <vector>
int64_t timer = 0;
std::vector<int64_t> tin;
std::vector<int64_t> ret;
std::set<int64_t> answer;
void DFS(std::vector<std::set<int64_t>>& graph, std::vector<bool>& used,
int64_t parent, int64_t current) {
if (used[current]) {
ret... | ALGO | 0.999696 | 4.635256 |
b8ce7403-8596-490c-bb7c-c40dc0da8a50 | MackinnonBuck/Box2D.CSharp | src/Box2DWrapper/b2_collision_wrap.cpp | #include "pch.h"
#include "verify.h"
#include "b2_collision_wrap.h"
/*
* Top-level functions
*/
void b2GetPointStates_wrap(b2PointState* state1, b2PointState* state2, b2Manifold* manifold1, b2Manifold* manifold2)
{
b2GetPointStates(state1, state2, manifold1, manifold2);
}
/*
* b2Manifold
*/
b2ManifoldPoint*... | TOOL | 0.898816 | 7.196362 |
260d3306-9208-4e34-b810-648fb41a051e | novakoki/PAT | 1008.cpp | #include <iostream>
using namespace std;
int main() {
int total, n;
int cur = 0, sum = 0;
while (cin >> total) {
while(total--) {
cin >> n;
if (n - cur > 0) {
sum += 6 * (n - cur);
}
else if (n - cur < 0) {
sum += 4 * (cur - n);
}
sum += 5;
cur = n;
... | ALGO | 0.999599 | 4.146153 |
0c8d17c5-d981-41eb-92ef-851e38811574 | cunbidun/competitive_programming | archive/Codeforces - Ozon Tech Challenge 2020 (Div.1 + Div.2, Rated, T-shirts + prizes!)/B. Kuroni and Simple Strings/solution.cpp | #include <bits/stdc++.h>
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define rf(i, a, b) for (int(i) = (a); (i) <= (b); (i)++)
#define rb(i, b, a) for (int(i) = (b); (i) >= (a); (i)--)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, ... | ALGO | 0.998156 | 3.363147 |
f09c553e-b7a5-4919-aa42-654b80f57d78 | adamap/code-test2 | 336palindromePairs.cpp | //
//
//
//Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + words[j] is a palindrome.
//
//Example 1:
// Given words = ["bat", "tab", "cat"]
// Return [[0, 1], [1, 0]]
// The palindromes are ["battab", "tabbat"]
//... | ALGO | 0.998262 | 6.244007 |
44f88121-4e24-47b4-8924-51d31a167313 | abhishekchandra2522k/CPPrograms | hackerrank/Beautiful_Triplets.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'beautifulTriplets' function below.
*
* The function is expected to return an INTEGER.
* The function accepts following parameters:
* 1. INTEGER d
*... | ALGO | 0.999833 | 5.626485 |
ce3f38e7-0062-42cc-8d03-f2a87ca49130 | ankitraj311/1_Month_HackerRank | 1_Plus_Minus.cpp |
//need to add header file for cout //#include <iomanip>
void plusMinus(vector<int> arr) {
int countP=0,countN=0,countZ=0, array_size=arr.size();
for(int i=0;i<array_size;i++)
{
if(arr[i]>0)
countP++;
if(arr[i]<0)
countN++;
if(arr[i]==0)
count... | ALGO | 0.999263 | 4.118425 |
e8212365-0f16-4f22-bc0c-ca16037a3e23 | miank108/CompetitiveProgramming | CodingNinjas/SquaringASortedArray/SquaringASortedArray.cpp | // SquaringASortedArray.cpp
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector < int > sqsorted(vector < int >& arr) {
// Write your code here.
for (int i = 0; i < arr.size(); i++) {
arr[i] = arr[i] * arr[i];
}
sort(arr.begin(), arr.end());
return ar... | ALGO | 0.99987 | 5.305373 |
fe88f466-e64e-4d25-832a-9f95cfdfe88d | den4ick800/lab09 | solver_application/equation.cpp | #include <iostream>
#include "formatter_ex.h"
#include "solver.h"
int main()
{
float a = 0;
float b = 0;
float c = 0;
std::cin >> a >> b >> c;
float x1 = 0;
float x2 = 0;
try
{
solve(a, b, c, x1, x2);
formatter(std::cout, "x1 = " + std::to_string(x1));
forma... | ALGO | 0.999707 | 4.502134 |
2cc868d3-65ae-4a35-b1e1-3aead1fb9370 | REEF3D/REEF3D | src/limo3.cpp | #include"limo3.h"
#include"lexer.h"
#include"fdm.h"
limo3::limo3 (lexer *p) : delta(p->DXM), radius (0.1), eps(1.0e-9*p->DXM)
{
}
limo3::~limo3()
{
}
double limo3::iphi(field& b,int n1, int n2, int q1, int q2)
{
d1 = b(i+n1,j,k)-b(i+n2,j,k);
d2 = b(i+q1,j,k)-b(i+q2,j,k);
r=d1/(fabs(d2)>1.0e-10?d2:1.0e20);
... | ALGO | 0.999803 | 3.477706 |
f4d37365-e7d6-4469-a64c-f9dbf81727be | RPL-CS-UCL/gs_localization | gaussian_splatting/submodules/diff-gaussian-rasterization/third_party/glm/test/core/core_func_integer_find_msb.cpp | #include <glm/glm.hpp>
#include <cstdio>
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#define LE 1 // 1 for little-endian, 0 for big-endian.
int pop(unsigned x) {
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0... | ALGO | 0.998496 | 3.60046 |
727718ff-03d7-4b42-b5cb-008bd7a79597 | clubzip/hdcpp20 | DAY2/04_example1.cpp | #include <iostream>
#include <algorithm>
#include <concepts>
#include <vector>
template<typename InputIter, typename T>
InputIter find(InputIter first, InputIter last, const T& value)
{
std::cout << " " << std::endl;
return first;
}
// Ʒ ó ߾ ϴµ..
// ᱹ ø մϴ.
// => error.
// => , find ̸ Ҽ , find_if ߽ϴ.
templat... | ALGO | 0.993351 | 5.392001 |
501af9fa-cab2-4d34-b11d-b15e47cf1516 | sanshar/Block | newmat10/tmt8.cpp |
//#define WANT_STREAM
#include "include.h"
#include "newmatap.h"
#include "tmt.h"
#ifdef use_namespace
using namespace NEWMAT;
#endif
// **************************** test program ******************************
void Transposer(const GenericMatrix& GM1, GenericMatrix&GM2)
{ GM2 = GM1.t(); }
// this is a routin... | ALGO | 0.946672 | 5.021385 |
8155f956-6030-4084-a6b1-7e9ca3981397 | hasheem7203/OOP_Spring25 | lab_08/Task5.cpp | #include <iostream>
using namespace std;
class MatrixHandler;
class Matrix {
private:
int a, b, c, d;
public:
Matrix(int valA = 0, int valB = 0, int valC = 0, int valD = 0) {
a = valA;
b = valB;
c = valC;
d = valD;
}
Matrix operator+(const Matrix& other) const {
... | ALGO | 0.998802 | 5.403569 |
ca56b5b0-9492-492a-97ba-a8030c64d7a5 | MainFrameKuznetSov/LeetCode | 906-walking-robot-simulation/walking-robot-simulation.cpp | class Solution {
public:
int robotSim(vector<int>& commands, vector<vector<int>>& obstacles) {
set<vector<int>>s;
for(auto x:obstacles)
s.insert(x);
vector<int>dir(4);
for(int i=0;i<4;++i)
dir[i]=i;
int startX=0,startY=0,direction=dir[0],ans=0;
... | ALGO | 0.999897 | 5.202823 |
091a9aad-4207-422c-8d11-4d766b03e69d | itsme-swe/DSA-25_PW_Cplusplus | 11_Strings/QuestionsOnStrings/2_UpdateEvenPositionsToChar/Solution.cpp | #include <iostream>
using namespace std;
int main()
{
string str = "Toyota";
for (int i = 0; i < str[i] != '\0'; i++)
{
if (i % 2 == 0)
{
str[i] = 's';
}
}
cout << str << endl;
return 0;
} | TOOL | 0.978391 | 3.448493 |
5ec9074d-0620-4f3a-a31b-40bd6c7249c1 | jagleeso/openmm | plugins/cpupme/src/CpuPmeKernels.cpp | #ifdef WIN32
#define _USE_MATH_DEFINES // Needed to get M_PI
#endif
#include "CpuPmeKernels.h"
#include "SimTKOpenMMRealType.h"
#include "openmm/internal/hardware.h"
#include "openmm/internal/vectorize.h"
#include <cmath>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <cstdlib>
using namespace O... | ALGO | 0.999908 | 6.069304 |
7925abb6-43cc-425c-9a32-f8e1f6eb5b02 | ygh3rn/sharp | tests/benchmark_sharp_gs.cpp | #include <mcl/bn.hpp>
#include <iostream>
#include <chrono>
#include <vector>
#include <iomanip>
#include <random>
#include <cmath>
#include "sharp_gs.h"
#include "pedersen.h"
#include "three_squares.h"
using namespace mcl;
using namespace std;
using namespace std::chrono;
class SharpGSBenchmark {
private:
mt199... | TEST | 0.986596 | 7.828087 |
b48bc2ec-20a2-4fd5-809b-0d3c42befd4f | ishandutta2007/codeforces | lichenkoh/normal/193/C.cpp | #include "bits/stdc++.h"
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
const int MOD=1000000007;
#define endl "\n"
#define fst first
#define snd second
const int UNDEF = -1;
const ll INF=1e18;
template<typename T> inline bool chkmax(T &a... | ALGO | 0.999968 | 3.50382 |
d19076d9-0ede-4100-a5f7-7065ee942e80 | raincross7/code-similarity | codes/train_code/problem403/problem403_459.cpp | #include <bits/stdc++.h>
#define pb push_back
#define Int int64_t
using namespace std;
const Int M=(Int)(1e9+7);
inline Int mmul(Int a,Int b){if(a>=M)a=a%M;if(b>=M)b=b%M;if(a*b>=M)return(a*b)%M;return(a*b);}
inline Int madd(Int a, Int b){if(a>=M)a=a%M;if(b>=M)b=b%M;if(a+b>=M)return(a+b)%M;return(a+b);}
int main()
{
... | ALGO | 0.999912 | 4.097463 |
f345ac40-0d90-4efd-992e-708ac34c389b | ishandutta2007/codeforces | aidos/normal/351/A.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <ctime>
#include <bitset>
#include <unordered_map>
#define pb push_back
#define ll long long
#define mp make_pair
#define f first
#d... | ALGO | 0.999422 | 3.041994 |
4f6f961c-7bec-46e5-b3ed-300a55c2e2a5 | sumit18cs/InterviewBit_Solution | Binary search/Painter's Partition Problem.cpp | int Solution::paint(int paint, int x, vector<int> &v) {
long long int l,r,m,n=v.size(),s,b,i,ans;
l=*max_element(v.begin(),v.end());
r=1e9;
while(l<=r){
m=(l+r)/2;
s=v[0]; b=1;
for(i=1;i<n;i++){
if(s+v[i]>m){
b++;
s=v[i];
}
... | ALGO | 0.999774 | 4.249067 |
7680ed57-4c21-436a-af38-9f837727468b | deezzz/Flashcoin-wallets | QT_wallets/flashcoin-1.1.2-src/src/rpcmining.cpp | #include "amount.h"
#include "chainparams.h"
#include "core_io.h"
#include "init.h"
#include "net.h"
#include "main.h"
#include "pow.h"
#include "rpcserver.h"
#include "util.h"
#ifdef ENABLE_WALLET
#include "db.h"
#include "wallet.h"
#endif
#include <stdint.h>
#include <boost/assign/list_of.hpp>
#include "json/json_... | ALGO | 0.967053 | 6.306393 |
86900694-2fd3-40e2-af16-9bbdfb686ada | HellerZheng/eigen | unsupported/doc/examples/SYCL/CwiseMul.cpp | #include <iostream>
#define EIGEN_USE_SYCL
#include <unsupported/Eigen/CXX11/Tensor>
using Eigen::array;
using Eigen::SyclDevice;
using Eigen::Tensor;
using Eigen::TensorMap;
int main()
{
using DataType = float;
using IndexType = int64_t;
constexpr auto DataLayout = Eigen::RowMajor;
auto devices = Eigen::get... | ALGO | 0.919437 | 4.980069 |
e34db709-1e6c-4633-a96d-76f03f5b2009 | striezel-stash/octochess | hash.cpp | #include "hash.hpp"
#include <string.h>
#include <iostream>
struct entry {
uint64_t v;
uint64_t key;
} PACKED;
uint64_t const bucket_entries = 4;
unsigned int const bucket_size = sizeof(entry) * bucket_entries;
hash::hash()
: size_()
, key_mask_()
, data_()
, init_size_()
{
}
hash::~hash()
{
aligned_free( d... | ALGO | 0.898811 | 6.438797 |
2a9e0d86-e427-4935-b126-1da3a7000584 | chandradeepkumar16/LeetCode-Ques | 2233-maximum-product-after-k-increments/2233-maximum-product-after-k-increments.cpp | class Solution {
public:
int maximumProduct(vector<int>& nums, int k) {
priority_queue<int, vector<int> ,greater<int>> pq;
long long int mod=1000000007,ans=1;
for(int i=0;i<nums.size();i++){
pq.push(nums[i]);
}
while(k--){
... | ALGO | 0.999989 | 5.490461 |
dce5ee5f-2c4d-47f8-bc43-d3aaf1fa44f2 | b14ckb3rry/Codeforces_Solved | B_Begginer_s_Zelda.cpp | //***********************************//
//* MD SIRAJUL ISLAM *//
//* github.com/b14ckb3rry *//
//***********************************//
#include <bits/stdc++.h>
using namespace std;
#define maru 0;
#ifdef ONLINE_JUDGE
#define debug(...) 101
#define debug_array(x, y) 101
#else
#include "blackBox... | ALGO | 0.999434 | 4.976698 |
4547f9e7-581f-4d38-a5bb-aebca46a2c38 | Alex-dicson/origin | lesson_9/task_1/main.cpp | #include <iostream>
class Fraction
{
private:
int numerator_;
int denominator_;
public:
Fraction(int numerator, int denominator)
{
numerator_ = numerator;
denominator_ = denominator;
}
bool operator==(const Fraction& right) const
{
if (double(numerator_ / denominator_) == double(right.numerator_ / right.... | TEST | 0.975408 | 5.682584 |
6a686e77-2c9f-4d1b-ab0b-398e46c6fc06 | ltrbless/CG_HW_Hierarchicl_Z_Buffer | extern/eigen/doc/examples/class_CwiseUnaryOp.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
// define a custom template unary functor
template<typename Scalar>
struct CwiseClampOp {
CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {}
const Scalar operator()(const Scalar& x) const { return x<m_... | ALGO | 0.946664 | 6.417363 |
e736f5db-f834-4b19-8111-bb84b6f80c2a | lvirgili/programming_challenges | spojbr/spojJSEDEX.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a, l, p;
cin >> a >> l >> p;
if (n <= a && n <= l && n <= p) cout << "S\n";
else cout << "N\n";
return 0;
}
| ALGO | 0.999904 | 3.604642 |
2c5acbaf-cdbd-499b-af3e-55a203a2fc85 | aravintharaj1997/cpp-file-handling | base 32/base32f.cpp | #include<iostream>
#include<stdlib.h>
#include<algorithm>
#include<limits.h>
#include<fstream>
using namespace std;
char b32[]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V'};
string base32(int n)
{
string b32n,btemp,temp;
int i;
char ... | ALGO | 0.981605 | 3.887963 |
1ef9dcb1-509f-45b9-a4b8-b9d1bbdcb563 | rozumden/fmo-cpp-demo | fmo/algorithm.cpp | #include <fmo/algorithm.hpp>
#include <map>
namespace fmo {
Algorithm::Config::Config()
: name("taxonomy-v1"),
diff(),
//
iouThreshold(0.5f),
maxGapX(0.020f),
minGapY(0.046f),
maxImageHeight(300),
minStripHeight(2),
minStripsIn... | CONFIG | 0.941881 | 6.495808 |
36179450-9118-451b-8696-59a2ac51ad42 | HMKRL/uva-online-judge | 11408.cpp | #include<cstdio>
#include<vector>
#define MAX 5000000
using namespace std;
bool is_prime[MAX];
bool is_DP[MAX];
bool not_DP[MAX];
vector<int> Prime;
vector<int>::iterator it;
bool DP(int n)
{
int sum = 0;
if(is_DP[n]) return true;
if(not_DP[n]) return false;
for(it = Prime.begin();it != Prime.end() && n >= *it;it... | ALGO | 0.999665 | 3.514843 |
e4f5d116-a159-4142-8fb2-2dd527ab98a5 | juniorandrade1/Competitive-Programming | Codeforces/SWERC2014/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair< ll, ll > ii;
typedef vector< ll > vi;
typedef vector< ii > vii;
#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq prior... | ALGO | 0.999702 | 4.122526 |
97c5ad17-2053-4997-aaa3-df4eb294bc66 | Sdcoder123/ASSIGN_1_ON_ALGO | Question 8/MoM.cpp | #include<bits/stdc++.h>
using namespace std;
void insertion_sort(short arr[], int initial, int final)
{
for (int i = initial; i <= final; i++)
{
int value = arr[i];
int pos = i - 1;
while (pos >= initial && arr[pos] > value)
{
arr[pos + 1] = arr[pos];
pos... | ALGO | 0.999288 | 5.193646 |
0025e440-fd45-411b-a8eb-b150c78a4f10 | mishraadarsh602/DSA | p4-factorial.cpp | #include <iostream>
using namespace std;
int main(){
int num,mul=1;
cout<<"Enter a number: ";
cin>>num;
for(int i=1;i<=num;i++){
mul = mul *i;
}
cout<<"Factorial of" <<num<< " is : "<<mul<<endl;
return 0;
} | ALGO | 0.998094 | 3.518968 |
ac6108bb-e898-4601-a832-308b67ad091d | SolveGuys/AlgorithmStudy | Problems_Archives/77week/HAEUL99/14921.cpp | #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <limits.h>
using namespace std;
int n;
int arr[100002];
int comp[100002];
int main()
{
std::ios::sync_with_stdio(0);
std::cin.tie(0);
cin >> n;
fill(arr, arr+n, -1);
for(int i = 0; i < n; i++)
{
... | ALGO | 0.999997 | 3.760412 |
3b8f86c4-6808-43a9-a267-8613aeb2496c | nicolasugrinovic/multiphys | embodiedpose/models/humor/chamfer_distance/chamfer_distance.cpp | #include <torch/torch.h>
// CUDA forward declarations
int ChamferDistanceKernelLauncher(
const int b, const int n,
const float* xyz,
const int m,
const float* xyz2,
float* result,
int* result_i,
float* result2,
int* result2_i);
int ChamferDistanceGradKernelLauncher(
const int b, co... | DATA | 0.949184 | 7.393078 |
e6c0155d-c0e0-42aa-a838-d850f5d2a172 | Jeevan-kumar-Raj/InterviewBit-Topicwise-Solutions | Graphs/LargestDistanceBetweenNodesOfATree.cpp | int Solution::solve(vector<int> &A) {
vector<int> res1;
vector<int> res2;
res1.resize(A.size());
res2.resize(A.size());
for(int i=A.size()-1;i>0;i--){
if(res1[A[i]]<max(res1[i],res2[i])+1){
res2[A[i]]=max(res2[A[i]],res1[A[i]]);
res1[A[i]]=max(res1[i],res2[i])+1;
... | ALGO | 0.999932 | 4.935187 |
d5fecf88-bc1f-4068-b3ce-ec8d6d679538 | PromiMojumder38/Codeforces-Solutions | cf 1445A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
scanf("%d", &t);
while(t--)
{
int n, x;
scanf("%d %d", &n, &x);
int a[n], b[n], i;
for(i = 0; i < n; i++) scanf("%d", &a[i]);
for(i = 0; i < n; i++) scanf("%d", &b[i]);
sort(a, a+n);
sort(b, b+n, greater<int>());
/*for(i = 0;... | ALGO | 0.999931 | 3.45218 |
aba43b3e-48f1-4d9e-badf-ff1b9b92c787 | aprgproject/aprg | AprgAlgorithm/AprgAlgorithm/tst/AlgorithmTests/Sort/CountingSorter/CountingSorterUsingCountPerValue_unit.cpp | #include <Algorithm/Sort/CountingSorter/CountingSorterUsingCountPerValue.hpp>
#include <AlgorithmTests/Sort/Utilities/CommonTestsWithSorter.hpp>
#include <AlgorithmTests/Sort/Utilities/StabilityCheckObject.hpp>
#include <gtest/gtest.h>
#include <list>
using namespace alba::algorithm::CommonTestsWithSorter;
using nam... | TEST | 0.936139 | 7.351597 |
5d7dfccf-dbf9-4f69-b930-94b656360f48 | anktsverma/code-code | 338-counting-bits/338-counting-bits.cpp | class Solution {
public:
int cntBits(int n){
int count=0;
while(n){
count+=(1&n);
n>>=1;
}
return count;
}
vector<int> countBits(int n) {
vector<int>ans;
for(int i=0;i<=n;i++){
ans.push_back(cntBits(i));
}
re... | ALGO | 0.999977 | 5.774531 |
c4555503-4ec1-4c6f-bf59-d6b09f3d0d08 | ishandutta2007/codeforces | deemo/normal/9/C.cpp | #include<bits/stdc++.h>
using namespace std;
int get(int mask){
int ret = 0, cur = 1;
while (mask){
if (mask&1)
ret += cur;
cur *= 10;
mask>>=1;
}
return ret;
}
int main(){
int n; cin >> n;
int ans = 0;
for (int i = 1; i < 1<<10; i++)
if (get(i) <= n) ans++;
cout << ans << endl;
return 0;
} | ALGO | 0.999849 | 4.055888 |
172029ce-c199-488c-8538-0c8fd24818d7 | abdulrahman9901/LeetCode-solutions | Manually added/pascals-triangle/Compile Error/4-7-2024, 10_35_07 PM/Solution.cpp | // https://leetcode.com/problems/pascals-triangle
class Solution {
public:
vector<vector<int>> generate(int numRows) {
if(numRows == 1){
return
}
}
}; | ALGO | 0.999949 | 6.602735 |
eca4d944-9ca4-4ad7-9c23-4191c51a601d | Williamarvin/innonautics_moos_dev | moos-ivp/ivp/src/lib_behaviors/IvPContactBehavior.cpp | /*****************************************************************/
/* NAME: Michael Benjamin */
/* ORGN: Dept of Mechanical Engineering, MIT, Cambridge MA */
/* FILE: IvPContactBehavior.cpp */
/* DATE: Apr 3rd 2010 Separated/generalized f... | TOOL | 0.93022 | 6.8895 |
d6f9d072-0155-453d-a2f1-2051237ef116 | f-zyj/ACM | 按 OJ 分类/51Nod/f-51Nod-1277-字符串中的最大值/f-51Nod-1277-字符串中的最大值/main.cpp | #include <iostream>
#include <cstring>
using namespace std;
const int MAXN = 1e5 + 10;
char str[MAXN];
int len;
int nt[MAXN];
int res[MAXN];
void getNext()
{
nt[0] = -1;
int i = 0, j = -1;
while (i <= len)
{
if (j == -1 || str[i] == str[j])
{
nt[++i] = ++j;
}
... | ALGO | 0.999994 | 4.259235 |
53708c45-b21a-4e53-bb3e-d540d95deb5b | sLNbk3y/BI20I1-Andrey_Rusakov_LP | lab3/lab3/lab3.cpp | #include <iostream>
using namespace std;
/*
//Задача 1.
void func(int* a) {
*a = *a * 2;
}
int main()
{
setlocale(LC_ALL, "Russian");
int a = 0;
cout << "Введите число" << endl;
cin >> a;
func(&a);
cout << "Ваш ответ: " << a << endl;
return 0;
}
//Задача 2.
void func(int* a, int* b, int* c) {
*a = *a * 2;
... | ALGO | 0.999143 | 3.385339 |
d60c28f2-2b20-44c7-96d9-dafddb7f1d42 | senselabrobo/Prometheus_SLAM | pose_graph_backend/thirdparty/DBoW2/DBoW2/demoBRISK2.cpp | #include <iostream>
#include <vector>
// DBoW2
#include "DBoW2.h" // defines BRISKVocabulary
// OpenCV
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <brisk/brisk.h>
using namespace DBoW2;
using namespace DUtils;
using namespace std;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ... | TEST | 0.902089 | 5.942313 |
becf7943-1aa3-476a-b98e-eb8c7c268dc3 | am-chourasia/Leetcode-Practice-Solutions | 383-ransom-note/383-ransom-note.cpp | class Solution {
public:
bool canConstruct(const string& ransomNote, const string& magazine) {
unordered_map<char, int> freq;
for (char c : magazine)
freq[c] += 1;
for (char c : ransomNote)
freq[c] -= 1;
for (auto& [elem, count] : freq)
if (count ... | ALGO | 0.999726 | 6.441254 |
dfd4357c-0eb8-4ecc-9681-1b3b84a7f633 | ravi956/pepcoding-level1-in-cpp | Recursion and Backtracking/06_recursion_in_arrays/06_all_indices_of_array.cpp | #include <bits/stdc++.h>
using namespace std;
int sz = 0;
int *allIndices(int *arr, int x, int idx, int fsf, int n)
{
if (idx == n)
{
return new int[fsf];
}
if (arr[idx] == x)
{
sz++;
int *iarr = allIndices(arr, x, idx + 1, fsf + 1, n);
iarr[fsf] = idx;
retu... | ALGO | 0.999736 | 4.680518 |
7efad013-e2c8-4b60-821e-55888456f04f | Angadshagun/Problems-on-Cpp-loops---2 | reverse_integer.cpp | // Write a program to reverse a given integer number
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cout << "Enter the number " << endl;
cin >> n;
int ans = 0;
while ( n > 0){
int last_digit = n % 10;
ans = ans *10 + last_digit;
n /= 10;
}
cout ... | ALGO | 0.999699 | 4.900314 |
b3f3d2fe-1346-48f3-b871-ef8543fd9741 | hjiang13/LLMs-in-IR | processed_data/DecompiledResults_Human_x_164_O0/GPT4o_Human_x_164_O0_decompiled/CPP_96.cpp | ```cpp
#include <vector>
#include <iostream>
void count_up_to(std::vector<int>& vec, int n) {
vec.clear();
for (int i = 0; i < n; ++i) {
vec.push_back(i);
}
}
int main() {
std::vector<int> vec;
count_up_to(vec, 10);
for (int i : vec) {
std::cout << i << " ";
}
std::cout... | ALGO | 0.990378 | 5.665599 |
85727aaa-d5e8-4234-bc74-0269430757db | EricWang1hitsz/dwl_ros | src/utils/SplineInterpolation.cpp | #include <utils/SplineInterpolation.h>
namespace dwl
{
namespace math
{
Spline::Spline() : initial_time_(0.), duration_(0.)
{
}
Spline::Spline(const double& initial_time,
const double& duration,
const Point& start_p,
const Point& end_p) : initial_time_(initial_time), duration_(duration),
... | ALGO | 0.978788 | 6.488514 |
653acba9-379b-4c07-9c4a-37ec1af154d3 | PrathameshJadhav30/Top-100-Codes | Top 100 Codes/06-Advanced Codes related to Arrays/16-Find factorial of a Large Number/FindfactorialofaLargeNumber.cpp | #include <iostream>
#include <vector>
using namespace std;
// Multiply the number with the current factorial stored in result[]
void multiply(int x, vector<int> &result) {
int carry = 0;
for (int i = 0; i < result.size(); i++) {
int product = result[i] * x + carry;
result[i] = product % 10; ... | ALGO | 0.999932 | 5.866441 |
18210951-c51f-48f4-b5de-d28229b83a34 | ishandutta2007/codeforces | i_love_tigersugar/normal/509/E.cpp | #include<bits/stdc++.h>
#define MAX 500500
#define FOR(i,a,b) for (int i=(a),_b=(b);i<=_b;i=i+1)
#define REP(i,n) for (int i=0,_n=(n);i<_n;i=i+1)
using namespace std;
const string vowel="AEIOUY";
char a[MAX];
double sumInv[MAX],sum[MAX];
int n;
void process(void) {
scanf("%s",a+1);
n=strlen(a+1);
FOR(i,1,... | ALGO | 0.999447 | 3.627318 |
09d06f2a-212f-414e-b709-160cbc84e405 | raincross7/code-similarity | codes/train_code/problem247/problem247_65.cpp | #include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
ll N,M,H,W,K,Q,A,B,L,R;
string S, T;
const ll MOD =... | ALGO | 0.999922 | 3.231322 |
fa0378c4-ad3f-4c25-9656-bd3787f3da71 | mahmoud-40/Problem_Solving | CSES/Introductory Problems/Repetitions.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#pragma GCC target("avx,avx2,fma")
#define fast \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define dpp(arr, val) memset... | ALGO | 0.999763 | 4.444965 |
984c9082-60b5-40a5-85a0-4e61f9e929ef | JhalexR/Introductory_courses | C++/Unidad 1/Brochas y cerdas.cpp | #include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;
//funcion principal main
int main(void){
//declaracion de variables
int c=0;
double pu=0;
double v=0;
double t=0;
//condicionales anidadas para ingresar la informacion del pedido
cout<<"\nIntroduzca valor por unidad de las brochas... | TOOL | 0.905308 | 3.386549 |
7223fe62-157c-4282-ba61-6c33ee9f7253 | simrat43singh/Summer_Training_2024 | summer_training/HackerRank_/Seats_in_classroom.cpp | /*
Link: https://www.hackerrank.com/contests/miet2024/challenges/seats-in-a-classroomtheater
Problem Statement: Here, We need to write a code to find all the possible ways in which n people can occupy r number of seats in a classroom/theater.
N students are looking to find r seats in a classroom. Some of the seats are... | ALGO | 0.999972 | 5.306012 |
f5de2926-18aa-482c-af94-d1068937f41a | sakib-mustafa-ak/Tasks | ICPCmockC.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t, tc = 1;
cin>>t;
while(t--){
cout<<"Case "<<tc++<<": ";
vector<int> a(3);
for(int i = 0 ; i < 3 ; i++) cin>>a[i];
int sum = a[0]+a[1]+a[2];
sort(a.begin(),a.end());
int flag = 1;
if(sum<=9){
if(a[2]==6){
if(a[1]+a[0]==2||(a[1]==3&&... | ALGO | 0.99706 | 4.516417 |
165f2734-c850-40d3-9b66-d63f8570f185 | aditikhatri/sheet | 62-unique-paths/62-unique-paths.cpp | class Solution {
public:
int uniquePaths(int m, int n) {
if(m==0) return 0;
vector<vector<int>>dp(m,vector<int>(n,0));
dp[0][0]=1;
for(int i=1;i<m;i++){
dp[i][0]=1;
}
for(int j=1;j<n;j++){
dp[0][j]=1;
}
for(int i=1;i<m;i++){
... | ALGO | 0.999916 | 6.300566 |
691d5997-a906-4cbf-a6eb-58b2480dbbb5 | manikanta2901/ubuntu | .history/imp/cpp/Algorithm/BitManupulationBasics.cpp/basics_20210106185335.cpp | #include<bits/stdc++.h>
using namespace std;
int GetBit(int number,int position){
return (number & (1 << position)) != 0;
}
int SetBit(int number, int position){
return (number | (1 << position));
}
int main(){
int number,position;
cout << "Enter the number and position" << endl;
cin >> number >>... | ALGO | 0.99831 | 4.224123 |
b0021d98-d8f9-49a1-b864-a5de1773a174 | manu-sankar/cpp.Training | Class Work/day14/program1.cpp | #include<iostream>
using namespace std;
int main() {
int a, b, c;
//cout << "Enter a , b, c ";
cin >> a >> b >> c;
if (a > b) {
if (a > c) {
cout<<"a is greatest";
}
else {
cout<<"c is greatest";
}
}
else{
if (b > c) {
cout << "b is gretest";
}
else {
cout << "c is greatest";
}
}
ret... | ALGO | 0.999897 | 3.829161 |
b1506f47-bf59-4658-b503-29bfee6c7543 | sidvisw/CodingBlocksCompetitiveProgramming | GridBasedDP/GoldGrid.cpp | #include <bits/stdc++.h>
using namespace std;
/*-------------------------IMPORTANT #DEFINES---------------------------*/
#define endl '\n'
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define vi vector<int>
#define... | ALGO | 0.999898 | 4.085089 |
f4619d55-0cbb-4adb-a7e4-019f7862ccb5 | satishrdd/comp-coding | codeforces/545-E/545-E-24236433.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll int
#define ma1 300005
ll n,m;
long long dp[ma1];
int best_neighbour[ma1];
ll w[ma1];
vector<pair<ll,ll>> ve[ma1];
vector< pair<ll, ll> >::iterator its;
int main(int argc, char const *argv[])
{
/* code */
ll x,y,weight;
cin>>n>>m;
//memset(w,0,sizeof(w... | ALGO | 0.999987 | 4.00786 |
2893aa9f-de8a-4b1f-9b32-cf84187d1426 | xinchengxx/algorithm_contest | atcoder/AtCoder Beginner Contest 258/c.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
int n, q;
cin >> n >> q;
string str;
cin >> str;
i64 tot = 0;
// -tot;
for (int i = 1; i <= q; i++) {
int op, num;
cin >> op >> num;
if (op == 1) {
tot += num;
} else {
num--;
cout << str[((num - tot % n) + n) % n... | ALGO | 0.999947 | 4.098728 |
ed16c7d6-84f9-4556-a1f8-304367271138 | Dingshichun/Data_Structure | C++/代码随想录刷题/backTrack.cpp | #include"head.h"
// 回溯算法
// 回溯法也叫回溯搜索法,是一种搜索的方式。
// 回溯是递归的副产品,只要有递归,就有回溯。
// 回溯法的本质是穷举,并不高效,甚至是低效。最多做一些剪枝操作,使效率高一点点。
// 使用回溯法的原因是有些问题能暴力搜出来就不错了,撑死了再剪枝一下,还没有更高效的解法。
// 回溯法,一般可以解决如下几种问题:
// • 组合问题:N 个数里面按一定规则找出 k 个数的集合
// • 切割问题:一个字符串按一定规则有几种切割方式
// • 子集问题:一个 N 个数的集合里有多少符合条件的子集
// • 排列问题:N 个数按一定规则全排列,有几种排列方式
// • 棋盘问题:... | ALGO | 0.998511 | 3.598083 |
ffde8450-bb15-42e0-8c21-c399997b7dd4 | ChoiDW614/DataStructure | ListBaseStack/ListBaseStack/InfixToPostfixMain.cpp | #include <cstdio>
#include "InfixToPostfix.h"
int main()
{
char exp1[] = "1+2*3";
char exp2[] = "(1+2)*3";
char exp3[] = "((1-2)+3)*(5-2)";
ConvToRPNExp(exp1);
ConvToRPNExp(exp2);
ConvToRPNExp(exp3);
printf("%s \n", exp1);
printf("%s \n", exp2);
printf("%s \n", exp3);
return 0;
} | ALGO | 0.983245 | 4.061469 |
ceafac8e-8fb6-4be6-9d8a-3ff6b846efb1 | vrushalisambhajinikam/All-about-CPP-Journey | FUNCTION AND POINTER/library_function.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
cout<<sqrt(4);
cout<<cbrt(4)<<endl;
cout<<sqrt(15)<<endl;
cout<<cbrt(54)<<endl;
cout<<min(4,6)<<endl;
cout<<max(8,4)<<endl;
cout<<pow(2,4)<<endl;
}
| ALGO | 0.980062 | 3.446572 |
d23d9f98-e8c1-4117-b1a9-9c3f859d4ce5 | lsj0822/Problem_Solving | C++/solved.ac 랜덤마라톤/코스18(241002-241009)/B[S4]_5637.cpp | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
const string END = "E-N-D";
string ans = "", str;
bool isletter(char c) {
if (c >= 'a' && c <= 'z') return 1;
if (c >= 'A' && c <= 'Z') return 1;
if (c == '-') return 1;
return 0;
}
int main() {
while (1) {
cin >> str;
if (str == EN... | ALGO | 0.999292 | 3.562575 |
b59e6e1b-9451-4a58-81ca-a5b34f7062c4 | UnpureRationalist/myLeetcodeAnswer | 深搜/ACW-3695. 扩充序列.cpp | #include <bits/stdc++.h>
using namespace std;
int solve(long long n, long long k) {
if (n == 1) {
return 1;
}
long long mid = 1ll << (n - 1);
if (k == mid) {
return n;
}
if (k < mid) {
return solve(n - 1, k);
}
return solve(n - 1, k - mid);
}
int main() {
ios::sync_with_stdio(false);
l... | ALGO | 0.999977 | 5.246106 |
50036360-f590-403f-960a-e45308f4bb7b | Sujal3013/CP-practice | Maths/50A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int m,n;
cin>>m>>n;
if((m*n)==1){
cout<<0<<endl;
}
else{
cout<<m*n/2<<endl;
}
} | ALGO | 0.999804 | 3.394762 |
9bb0850f-0ce5-4722-a3f5-9ded11959283 | Devvarshney11/DSA-Question | Heaps/MergeTwoHeaps.cpp | #include <bits/stdc++.h>
using namespace std;
void heapify(vector<int> &heap,int i,int n)
{
int l = 2*i+1;
int r = 2*i+2;
int s = i;
if(l<n && heap[l]>heap[s])
{
s = l;
}
if(r<n && heap[r]>heap[s])
{
s = r;
}
if(s != i)
{
swap(heap[s],heap[i]);
... | ALGO | 0.999914 | 3.78503 |
71b22260-e2b5-42bd-9dab-3c790a8bc6a1 | lidianxiang/leetcode_cpp_python | 数组/48-旋转图像.cpp | /*
给定一个 n × n 的二维矩阵 matrix 表示一个图像。请你将图像顺时针旋转 90 度。
你必须在 原地 旋转图像,这意味着你需要直接修改输入的二维矩阵。请不要 使用另一个矩阵来旋转图像。
示例 1:
输入:matrix = [[1,2,3],[4,5,6],[7,8,9]]
输出:[[7,4,1],[8,5,2],[9,6,3]]
示例 2:
输入:matrix = [[5,1,9,11],[2,4,8,10],[13,3,6,7],[15,14,12,16]]
输出:[[15,13,2,5],[14,3,4,1],[12,6,8,9],[16,7,10,11]]
示例 3:
输入:matrix = [[1]... | ALGO | 0.999977 | 6.725654 |
5a09055f-560a-4b2b-9706-047294d4d1b8 | yildbs/algorithm | baekjoon19440.cpp | #include <stdio.h>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int T, N;
#if 0
scanf("%d", &T);
for(int t=0;t<T;t++){
scanf("%d", &N);
#else
for(int N=0;N<=60;N++){
printf("%d ", N);
#endif
int addh = N / 60;
int addt = ... | ALGO | 0.99509 | 3.177299 |
c6fd0c52-56d1-4ff2-8fad-a72f4666dcb0 | actium/codeforces | 1100/00/1103a.cpp | #include <iostream>
#include <string>
#include <vector>
void answer(const std::vector<std::pair<size_t, size_t>>& v)
{
for (const std::pair<size_t, size_t>& x : v)
std::cout << 1+x.first << ' ' << 1+x.second << '\n';
}
void solve(const std::string& s)
{
std::vector<std::pair<size_t, size_t>> p;
s... | ALGO | 0.999912 | 3.246959 |
bec14efa-46ba-451a-9901-b75946702195 | iaccepted/leetcode | 103.Binary Tree Zigzag Level Order Traversal.cpp |
/*************************************************************
Given a binary tree, return the zigzag level order traversal of its nodes' values.
(ie, from left to right, then right to left for the next level and alternate between).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ \
9 20
/ \
1... | ALGO | 0.999996 | 5.31806 |
0eb57398-564d-49f8-a694-24e4bbc7d353 | userahmedosman/level_one_algorithm_and_problem_solving_solutions | level_one_algorithm_and_problem_solving_solutions/a3.cpp | #include <iostream>
using namespace std;
enum enNumberType {Odd=1, Even=2};
int ReadNumber(){
int number;
cout << "Enter the number to check if even or odd: ";
cin >> number;
return number;
}
enNumberType CheckNumberType(int num){
int result = num%2;
if(result == 0){
return enNumberTy... | ALGO | 0.966979 | 4.35823 |
491b4818-494a-4a2e-b2da-0f86fdb2a069 | SPrashanth25618/Leetcode-problems | 2220-find-all-possible-recipes-from-given-supplies/find-all-possible-recipes-from-given-supplies.cpp | class Solution {
public:
vector<string> findAllRecipes(vector<string>& recipes, vector<vector<string>>& ingredients, vector<string>& supplies) {
int n = recipes.size();
vector<string> res;
unordered_set<string> st(begin(supplies), end(supplies));
vector<bool> cook(n, false);
... | ALGO | 0.999942 | 5.928999 |
c9b2b414-c60b-4612-9077-ba4ee308442e | vikas-kukreti/dsa-problems | algorithms/palindrom-string.cpp | #include <iostream>
using namespace std;
bool isPalindrome(char *str, int len) {
int i, j;
for(i = 0, j=len-1; i < j; i++, j--) {
if(str[i] != str[j]) {
return false;
}
}
return true;
}
int main(int argc, char const *argv[])
{
char str[] = "NAVAN";
cout << "NAVAN :... | ALGO | 0.996928 | 5.601945 |
372a147f-b601-4524-8ae6-1668954599bf | GhostXPrism/GhostPrism-Coin | src/timedata.cpp | #include "timedata.h"
#include "chainparams.h"
#include "guiinterface.h"
#include "netbase.h"
#include "sync.h"
#include "util.h"
#include "utilstrencodings.h"
static RecursiveMutex cs_nTimeOffset;
static int64_t nTimeOffset = 0;
/**
* "Never go to sea with two chronometers; take one or three."
* Our three time so... | TOOL | 0.915462 | 6.468771 |
3240d0dd-2fd0-4deb-8276-adcec27e4a63 | christopherc1331/CPPTraining | Section9 - Controlling Program Flow/ForLoop/main.cpp | #include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int main()
{
for (int i {0}; i <= 5; i++) {
cout << i << endl;
}
cout << endl << endl;
for (int i {0}; i <= 10; i+= 2) {
cout << i << endl;
}
cout << endl << endl;
for (int i {1}, j {5}; i <= 5... | TOOL | 0.852988 | 3.426268 |
239f39b0-da72-4af1-96ef-5dc9b5b57d0c | opencv/opencv | samples/cpp/ela.cpp | /**
@file ela.cpp
@author Alessandro de Oliveira Faria (A.K.A. CABELO)
@brief Error Level Analysis (ELA) permits identifying areas within an image that are at different compression levels. With JPEG images, the entire picture should be at roughly the same level. If a section of the image is at a significantly dif... | TOOL | 0.956995 | 5.366011 |
210c2ea1-c5dd-426e-84f2-1ff59054b933 | mjuraszek92/motion-detection | lib/motion/thread_auto.cpp | #include <opencv2\opencv.hpp>
#include <vector>
#include <deque>
#include <map>
#include <string>
#define NOMINMAX
#include <Windows.h>
#include <fstream>
#include <ctime>
#include <direct.h>
extern void motion_processing(std::deque<int> &motion, int offset, int beforeMotion, int pastMotion, int onesSize, int zerosSiz... | ALGO | 0.986002 | 4.162239 |
c669a3ad-1a1f-45f8-8351-5bb18e09307f | shreyanshiitb/Hackerrank | Algorithms/ConstructiveAlgorithms/lovely-triplets.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include<set>
#include<map>
using namespace std;
const int MAXN = 100000;
int v[MAXN], h[MAXN];
set<int> s;
map<int, int> m;
class FenwickTree
{
private:
long long tree[MAXN];
public:
FenwickTree()
{
memset(tree, 0, sizeof(tree));
}
... | ALGO | 0.999962 | 3.813848 |
09fbf9a2-0b19-4891-8422-dd4b109b3617 | Rserendipity/win_code_vs2022 | C/leetcode/2482. 行和列中一和零的差值/main.cpp | class Solution {
public:
vector<vector<int>> onesMinusZeros(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
vector<vector<int>> ans(grid);
vector<int> row(m, 0);
vector<int> col(n, 0);
for (int i = 0; i < m; i++) {
for (int j = 0;... | ALGO | 0.999977 | 5.90798 |
edd484e8-256e-4460-b649-14155dbddfb3 | VadimK128/LABA-2 | task4.0.cpp | #include <iostream>
using namespace std;
void P1();
void P2();
void P3();
void P4();
int main()
{
P1();
P2();
P3();
P4();
return 0;
}
void P1() {
int proiz1 = 1;
for (int i = 8; i <= 15; i++)
proiz1 *= i;
cout << proiz1 << endl;
}
void P2() {
int proiz2 = 1, a;
cin >> a... | ALGO | 0.999413 | 3.632352 |
3223052e-2d49-44c6-84f8-9114decb8b6e | gargakshit001/Coding_practice_questions | Arrays/minimum distance between two numbers.cpp | #include<iostream>
using namespace std;
int index(int a[], int n, int key)
{
for(int i=0;i<n;i++)
{
if(a[i]==key)
{
return i;
break;
}
}
return -1;
}
int minDist(int a[], int n, int x, int y)
{
int x1=index(a, n, x);
int x2=index(a, n, y);
in... | ALGO | 0.999845 | 4.954718 |
df563cff-d55f-4aa7-9194-7097251d602a | dong-minkim/algorithm | BOJ/알고리즘 연습/1939_중량제한(MST).cpp | #include<iostream>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
priority_queue<pair<int, pair<int, int>>> pq;
int parent[100001];
int find(int x) {
if (parent[x] == x) return x;
return parent[x] = find(parent[x]);
}
int main() {
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i... | ALGO | 0.999987 | 4.556243 |
8b68f87b-6ef5-46e1-a251-dae4c53d5ff5 | ksaveljev/UVa-online-judge | 10276.cpp | #include <iostream>
#include <cmath>
using namespace std;
#define pow2(i) (1<<i)
#define bit(i) (1<<i)
#define isOdd(i) (i&1)
#define isEven(i) (!(i&1))
#define sz(i) i.size()
#define REP(i, b, n) for (int i = b; i < n; i++)
#define REPI(i, b, n) for (int i = b; i <= n; i++)
#define rep(i, n) REP(i, 0, n)
#define repi... | ALGO | 0.999865 | 4.473653 |
846e1a5f-ea04-4145-b99d-68465a95d3c0 | oboril/gomoku-cpp | _old/fit_eval_table.cpp | #include <iostream>
#include "board.hpp"
#include "minimax.hpp"
#include "timer.hpp"
#include <random>
#include <vector>
#include "error_transform.hpp"
using namespace std;
double get_error(Board *board, const EvaluationTable *eval_table)
{
double e1 = (double)board->evaluate(eval_table);
int64_t iters = 0;
... | ALGO | 0.998813 | 5.821142 |
808c751d-ca19-4740-ad0f-4ae2bc21217b | LSR9966/DSA_QUESTIONS | FUNCTIONS/ARMSTRONG.cpp | #include<iostream>
#include<math.h>
using namespace std;
int armstrong(int num,int digit){
int n=num;
int ans=0,res;
while(n){
res=n%10;
n/=10;
ans=ans + pow(res,digit);
}
if(ans==num)
return 1;
else
return 0;
}
//TO COUNT THE NUMBER OF DIGITS...
int countdigit(i... | ALGO | 0.999976 | 4.808172 |
98ac7b80-d92e-4cc0-b9bb-3b1337b182fc | diyamtyagi123/DSA | bit_string.cpp | // C++ implementation of the approach
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod (ll)(1e9 + 7)
ll power(ll x, ll y, ll p) {
ll res = 1;
x = x % p;
while (y > 0) {
if (y & 1)
res = (res * x) % p;
y = y >> 1; // y = y/2
x = (x * x) % p;
}
return res;
}
ll ... | ALGO | 0.999908 | 5.478228 |
b662da70-2cac-47ac-9bb2-310719724e15 | ishandutta2007/codeforces | kevin114514/normal/1619/D.cpp | #include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (in... | ALGO | 0.999983 | 4.013508 |
7e456966-45e3-4fe4-aab1-69e79d41b691 | shubham7668/Leetcode | 1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts.cpp | class Solution {
private:
int solve(vector<int> &v,int n){
sort(v.begin(),v.end());
int diff=v[0];
for(int i=1;i<v.size();i++) diff=max(diff,v[i]-v[i-1]);
diff=max(diff,n-v.back());
return diff;
}
public:
int maxArea(int h, int w, vector<in... | ALGO | 0.999984 | 5.401379 |
d52e1336-d4d1-4861-bacc-815253d10c5e | muhammadumer8/muhammadumer8 | F21-9291/EXP 3.cpp | #include <iosTream>
using namespace std;
int main()
{
int num,power,ans=1;
cout <<"enter number :"<<endl;
cin >>num;
cout <<"enter power :"<<endl;
cin >>power;
for(int i=0;i<=power;i++)
{
ans=ans*num;
cout<<"power is"<<ans<<endl;
}
return 0;
}
| ALGO | 0.999734 | 4.011611 |
430e5338-018a-41de-b3d3-edc911105443 | isha141/LeetCode | 0215-kth-largest-element-in-an-array/0215-kth-largest-element-in-an-array.cpp | class Solution {
public:
int findKthLargest(vector<int>& nums, int k) {
priority_queue<int,vector<int>,greater<int>>pq;
for(auto itr: nums){
pq.push(itr);
if(pq.size()>k) pq.pop();
}
return pq.top();
}
}; | ALGO | 0.999822 | 5.129949 |
20bba2d9-a606-46ec-a1ad-925b1770c6fa | shakiliitju/Data-Structure-Lab | Code/Tree/binary-tree-3-nodes.cpp | #include<bits/stdc++.h>
using namespace std;
struct btree
{
int data;
btree *left=NULL;
btree *right=NULL;
};
class ShakilHossain
{
public:
void node(){
cout<<"Enter the three value: ";
int a,b,c;
cin>>a>>b>>c;
btree *p,*l,*r;
p=new btree;
l=new btree;
r=new btree;
... | ALGO | 0.993886 | 4.072087 |
d5e9db16-4c50-4501-8b83-93c4982ec902 | dhs347/Dream | Team_Training/09、XIX Open Cup GP of Peterhof/code/c.cpp | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define per(i, a, b) for(int i = (b) - 1; i >= (a); --i)
#define endl "\n"
#define pw(x) (1ll << (x))
#define all(a) a.begin(), a.end()
#define sz... | ALGO | 0.999906 | 3.697254 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.