uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
25c8288f-fb56-40a4-a214-c2db896c9b7e | jallohab/Data-Structure | hw/extra/main.cpp | #include <iostream>
int cache[500];
long fibo(int n)
{
if (n == 1 || n == 2)
return 1;
if (cache[n] != 0)
{
std::cout << "Cache hit! @ " << n << std::endl;
return cache[n];
}
cache[n] = fibo(n - 1) + fibo(n - 2);
return cache[n];
}
int main() {
std::cout << ... | ALGO | 0.999139 | 5.42244 |
f857b2a7-3a03-44ad-bfd9-95f14a95fc94 | Sthopeless/MarlinFirmware-old- | Marlin/src/libs/crc16.cpp | #include "crc16.h"
void crc16(uint16_t *crc, const void * const data, uint16_t cnt) {
uint8_t *ptr = (uint8_t *)data;
while (cnt--) {
*crc = (uint16_t)(*crc ^ (uint16_t)(((uint16_t)*ptr++) << 8));
for (uint8_t i = 0; i < 8; i++)
*crc = (uint16_t)((*crc & 0x8000) ? ((uint16_t)(*crc << 1) ^ 0x1021) : (... | ALGO | 0.997264 | 4.764662 |
151d5ec1-0fb4-4756-9207-24535d019b8e | Turma01-TIC18/PI-P005 | exercicio3-h.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int a,b,c;
string resposta;
cout << "Digite o primeiro número inteiro: ";
cin >> a;
cout << "Digite o segundo número inteiro: ";
cin >> b;
cout << "----------------------------------" << endl;
(a % b == 0) ? (cout... | ALGO | 0.996264 | 4.792863 |
d7e61220-9fa0-41d4-930e-12333fb90cc4 | powzix/ooz | bitknit.cpp | #include "stdafx.h"
struct BitknitLiteral {
uint16 lookup[512 + 4];
uint16 a[300 + 1];
uint16 freq[300];
uint32 adapt_interval;
};
struct BitknitDistanceLsb {
uint16 lookup[64 + 4];
uint16 a[40 + 1];
uint16 freq[40];
uint32 adapt_interval;
};
struct BitknitDistanceBits {
uint16 lookup[64 + 4];
ui... | ALGO | 0.999787 | 4.615559 |
d2e67079-23eb-43f6-aab6-c1356abeb66a | Naoltolesa/programming-1 | chapter 3 quiz(Q3).cpp | #include <stdio.h>
int main(void)
{
int num1, num2, num3;
printf("Enter three numbers: ");
scanf("%d %d %d", &num1, &num2, &num3);
if (num1 > num2 && num1 > num3)
printf("%d is the greatest number.\n", num1);
else if (num2 > num1 && num2 > num3)
printf("%d is the greatest number.... | ALGO | 0.999524 | 4.218569 |
cdc54f58-f3c3-4d14-a794-e9b490e4b916 | razzasid/Cpp | 02 C++ Siddharth Beginners coding sheet/Day_20_Recursion_Factorial.cpp | #include <iostream>
using namespace std;
int factorial(int);
int main()
{
int n;
cout << "Enter a Positive integer: ";
cin >> n;
cout << "Factorial of " << n << " = " << factorial(n);
return 0;
}
int factorial(int n)
{
if (n != 0)
return n * factorial(n - 1);
else
return... | ALGO | 0.998875 | 3.974595 |
594f4cbb-6ce2-4b0d-beca-8799360c4599 | randlem/Class-Work | cs442/project.orig/project2/src/LocalRNG.cpp | #include <iostream>
//using namespace std;
#include "LocalRNG.h"
// Constructor
LocalRNG::LocalRNG()
{
mti = N+1;
initByArray();
}
// initializes mt[N] with a seed
void LocalRNG::seedRand(unsigned long s)
{
mt[0]= s & 0xffffffffUL;
for (mti=1; mti<N; mti++)
{
mt[mti]=(1812433253UL * (mt[... | TOOL | 0.992247 | 4.848878 |
21729896-2177-49de-800f-7b599bb22de6 | Helyos96/Redle | dep/cryptopp/donna_32.cpp | // donna_32.cpp - written and placed in public domain by Jeffrey Walton
// Crypto++ specific implementation wrapped around Andrew
// Moon's public domain curve25519-donna and ed25519-donna,
// https://github.com/floodyberry/curve25519-donna and
// https://gith... | ALGO | 0.990862 | 7.380957 |
500a9033-a40a-46fb-a80b-536202e3f7e8 | priyanshu1208/Codechef- | 0-1000/TESTAVG.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int a, b, c;
cin >> a >> b >> c;
if((a+b)/2 >=35 && (c+b)/2 >=35 && (a+c)/2 >=35)
cout<<"Pass"<<endl;
else
cout<<"Fail"<<endl;
}
return 0;
} | ALGO | 0.999261 | 3.860803 |
ea1af6a9-26aa-4b99-9b6a-03084dcedfa0 | Randowlh/Project_ACM_2021 | code/competition/Codeforces Round #711/2.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma optimize(2)
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
const int inf = 0x7FFFFFFF;
typedef long long ll;
typedef double db;
typedef long double ld;
template<class T>inline v... | ALGO | 0.999978 | 4.170795 |
7eb3c559-3ee9-440c-9769-9c1f9af21ce7 | luisaribe/programacao-competitiva | Estrutura de Dados/1122Substringpt2.cpp | #include <bits/stdc++.h>
using namespace std;
int main (){
int tam, atual=1, duplinhas=0, ans;
scanf("%d", &tam);
vector <int> v (tam);
vector <int> numeros (10, 0);
vector <int> maiores (tam);
for(int i=0; i<tam; i++){
scanf("%d", &v[i]);
numeros[v[i]]++;
if(i>0 &&... | ALGO | 0.999851 | 3.76171 |
7cde34e2-9666-4e95-8e4f-6c996c7645e4 | Iwaide/AtCoder | APG4b/C_all_green_answer.cpp | #include <bits/stdc++.h>
using namespace std;
int MinPro(vector<int> &p, vector<int> &c, vector<bool> com, int n, int &d, int &g) {
if (n == d) {
int score = 0;
int nSolve = 0;
for (int i = 0; i < d; i++) {
if (com.at(i)) {
score += p.at(i) * 100 * (i+1);
... | ALGO | 0.99954 | 4.02915 |
6f8c89d1-9ca6-42c7-8eec-ed484cd11170 | cobrabytes/cobrax | src/eccryptoverify.cpp | #include "eccryptoverify.h"
namespace
{
int CompareBigEndian(const unsigned char* c1, size_t c1len, const unsigned char* c2, size_t c2len)
{
while (c1len > c2len) {
if (*c1)
return 1;
c1++;
c1len--;
}
while (c2len > c1len) {
if (*c2)
return -1;
... | ALGO | 0.934527 | 6.139459 |
ae3333a3-4859-448f-af2b-fa8b96f3aef0 | SumitM28/Cpp | 04_Star/04_star.cpp | /*
1
2
1 2 3
1 2 3 4
*/
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
for (int i = 1; i <=n; i++)
{
int val=i;
for (int j = 1; j <=i; j++)
{
cout<<val<<" ";
val+=1;
}
cout<<endl;
}
} | ALGO | 0.999949 | 4.111582 |
68921453-2ce2-4018-afe7-97dede020f1f | rndyyprsty/Praktikum-Struktur-Data | MODUL 8 - Queue/unguided1.cpp | #include <iostream>
using namespace std;
struct Node {
string data;
Node* next;
Node(string d) : data(d), next(nullptr) {}
};
class Queue {
private:
Node* front;
Node* rear;
int size;
public:
Queue() : front(nullptr), rear(nullptr), size(0) {}
~Queue() {
clear... | ALGO | 0.996483 | 5.486597 |
6a5a311d-94f1-4e66-b7b9-f3c2baf37e28 | Brikaa/problem-solving | contests/assignment-2-number-theory/b/main.cpp | #include <cstdio>
#include <unordered_map>
std::unordered_map<int, int> memo;
const int N = 1e5 + 5;
bool primes[N + 3];
int g(int x)
{
if (x == 1)
return 1;
else if (x == 2)
return 2;
else if (x == 0 || primes[x])
return 0;
else if (memo.find(x) != memo.end())
return memo[x];
else
{
i... | ALGO | 0.999987 | 5.371086 |
0842308e-9beb-43f1-a071-ec630e74c236 | ajsmilutin/ftn_solo_control | src/types/friction_cone.cpp | #include <ftn_solo_control/types/friction_cone.h>
#include <iostream>
#include <Eigen/Dense>
#include <math.h>
namespace ftn_solo_control {
size_t FrictionCone::total_cones_ = 0;
SimpleConvexCone::SimpleConvexCone(size_t num_sides, ConstRefVector3d vector,
double start_angle,
... | TOOL | 0.92332 | 6.268616 |
12504fe9-9319-46bf-bc00-00eab2f683de | kastur/artificial_birds | bullet/Extras/sph/fluids/fluid_system.cpp | #include <conio.h>
#ifdef _MSC_VER
#include <gl/glut.h>
#else
#include <GL/glut.h>
#endif
#include "common_defs.h"
#include "mtime.h"
#include "fluid_system.h"
#ifdef BUILD_CUDA
#include "fluid_system_host.cuh"
#endif
#define EPSILON 0.00001f //for collision detection
FluidSystem::FluidSystem ()
{
}
void F... | TOOL | 0.942196 | 3.575395 |
a1b29e0c-ecd7-4578-9521-62995ad97ad1 | Ocupuc/shape_calc_f | 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 |
f829bedf-acf4-4695-a80f-5444c50f6a17 | satyam-7318/Striver_SDE_Sheet_2022 | Day7 Linked List/Max consecutive 1's.cpp | https://leetcode.com/problems/max-consecutive-ones/
class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int cnt = 0;
int maxi = INT_MIN;
int i = 0;
int n = nums.size();
while(i<n){
if(nums[i]==1)
... | ALGO | 0.999889 | 6.328676 |
bc266d06-4b6f-4575-bc40-ac92ad721ca2 | SamSweet04/PP1 | PPCourse/f.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, sum = 0;
cin >> n;
set <int> s;
for(int i = 0; i < n; i++){
int x;
cin >> x;
s.insert(x);
}
for(set<int> :: iterator it = s.begin();it != s.end();it++){
cout << *it << " ";
}
} | ALGO | 0.999724 | 3.806563 |
c5bc7ed1-3b97-49ed-b050-e3c5715b1451 | stamcenter/llvm-zeno | llvm/lib/Transforms/Utils/LoopUnroll.cpp | #include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/ilist_iterator.h"
... | ALGO | 0.951553 | 5.028754 |
1c54dc56-8ba3-4b82-bfb2-c4cf31195106 | Fahim-2001/Problem-Solving | Codeforce/A Problems/381A.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#define FAST_IO (ios_base::sync_with_stdio(false), cin.tie(NULL));
#define ll long long
#define ull unsigned long long
#define pl cout <<
#define el << endl
#define nl cout << endl
#define ff first
#define ss second
#define in insert
#define pb pus... | ALGO | 0.999958 | 3.579112 |
c927e49d-96b7-488e-a1a0-650f1e4d7eac | poorvaditya18/Interview-Problems | stacks/LC[856]-ScoreOfParentheses.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int scoreOfParentheses(string s) {
stack<int> stk; // to have the record of "("
for(int i=0;i<s.length();i++)
{
if(s[i]== '(')
{
// if it is openning bracket
... | ALGO | 0.999428 | 4.635206 |
39a4e3dc-d15c-43e7-867b-cbf819a81b32 | 6Farkas9/LeetCode100 | First_Time/1_hash/t2/main.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
vector<string> strs1{"eat", "tea", "tan", "ate", "nat", "bat"};
vector<string> strs2{""};
class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
unordered_map<string,int... | ALGO | 0.999987 | 5.633918 |
61826640-a13d-43aa-b457-2ffad15e42b7 | ntrntr/leetcode | leetcode_cpp/leetcode/Multiply Strings.cpp | #include <vector>
#include <iostream>
#include <string.h>
#include <algorithm>
#include <string>
#include <map>
using namespace std;
class Solution {
public:
string multiply(string num1, string num2) {
const int n = num1.size();
const int m = num2.size();
if (n < m)
{
return multiply(num2, num1);
}
vect... | ALGO | 0.999967 | 4.820005 |
e73aa24b-d738-4805-87a2-a8dfa6b57dac | 1804054Miraz/Codeforces-solutions | A. Learning Languages.cpp | //Bismillahir Rahmanir Rahim
//Allahumma Rabbi Jhidni Elma
///A lot of mistakes is happened without understanding questions clearly.\
Please,make sure that understand question clearly.Think from every possible output.\
Make different algorithm to answer the question.Don't think that you have tried all possible ways.\
T... | ALGO | 0.999375 | 3.695357 |
4e18bba5-953a-4f55-a237-2e03b360b483 | johnleungck/Spotify-Device | lib/lvgl/src/libs/thorvg/tvgSwImage.cpp | #include "../../lv_conf_internal.h"
#if LV_USE_THORVG_INTERNAL
#include "tvgMath.h"
#include "tvgSwCommon.h"
/************************************************************************/
/* Internal Class Implementation */
/**********************************************************... | ALGO | 0.922468 | 6.741437 |
cdf97482-4b01-422d-9214-51cf5b2fe8cc | KanchanD112/Data-Structure | Program498.cpp | #include<iostream>
using namespace std;
class Array
{
private:
int * Arr;
int iSize;
public:
Array(int X) // Parametrised Constructor
{
iSize = X;
Arr = new int[iSize];
}
~Array() // Destructor
{
... | ALGO | 0.992291 | 4.606154 |
33ab757a-8a7a-4617-af1f-cead5b75efd4 | MarcosSobrinho/CarND-Path-Planning-Project | src/Eigen-3.3/bench/geometry.cpp |
#include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 8
#endif
typedef SCALAR Scalar;
typedef NumTraits<Scalar>::Real RealScalar;
typedef Matrix<RealScalar,Dynamic,Dynamic> A;
type... | ALGO | 0.941071 | 5.941502 |
50a0bbf2-7280-444a-b240-c13c67bab05f | kennent/for_scsc_code_save2 | atcoder/ABC360/e.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using pii = pair<int, int>;
ll nn, kk;
modint998244353 n, k, r, b, w;
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
} | ALGO | 0.999088 | 3.834191 |
0b9c4554-7e9a-4c45-a08c-a47aa96809a9 | Superjie13/mmdeploy_multi_input | csrc/mmdeploy/operation/cpu/permute.cpp | #include "mmdeploy/operation/vision.h"
#include "mmdeploy/utils/opencv/opencv_utils.h"
namespace mmdeploy::operation::cpu {
class PermuteImpl : public Permute {
public:
explicit PermuteImpl() {}
Result<void> apply(const Tensor& src, Tensor& dst, const std::vector<int>& axes) override {
int ndim = src.shape(... | ALGO | 0.896355 | 7.789307 |
627a4474-33d9-49ab-9cf6-e6242c811c55 | marksverdhei/studies-portfolio | IfiS2021/IN4200/weekly/week3/Exercise3.cpp | #include <iostream>
#include <chrono>
#include <math.h>
using namespace std::chrono;
/*
The standard C math library function
double pow(double x, double y)
returns x raised to the power of y, that is x
y.
This function is very general,
but notoriously slow to execute on a computer.
Please write a special implementati... | TEST | 0.992243 | 6.175906 |
87d07e2b-01ff-4d83-9cec-aa9e9ae69813 | Charly52830/Practice | ICPC2020/TercerFecha/C.cpp | #include <math.h>
#include <string.h>
#include <algorithm>
#include <cassert>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <iostream>
#define FASTIO cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define forn... | ALGO | 0.99981 | 3.986997 |
ccb80492-415d-414a-8df0-b47bdf8aa4c2 | team3hailong/SPOJ-PTIT | PTIT122D/newbie_0_1.cpp | #include <iostream>
#include <map>
using namespace std;
int main (){
int t; cin >> t;
while(t--){
string c; cin >> c; map<char, int> mp; int sum=0;
for(int i=0; i<c.size(); ++i){
int tmp=0, res=1;
if(c[i]=='+'&&(c[i+1]=='-'||isalpha(c[i+1]))){
res=1; i++;
}
else if(c[i]=='-'&&(c[i+1]=='+'||isalp... | ALGO | 0.999545 | 3.813811 |
32355686-d21c-46cb-9431-757e7a18270d | ou-real/finch | src/maze_block_modifier_digest.cpp | #include <finch/maze_block_modifier_digest.hpp>
#include <vector>
#include <cstdlib>
#include <iostream>
#include <tuple>
using namespace finch;
using namespace std;
static void mark(const matrix2<uint16_t> &maze, uint16_t r, uint16_t c, matrix2<uint16_t> &marker)
{
if(marker.at(r, c) == 1U) return;
marker.at(... | ALGO | 0.997618 | 5.721518 |
f3ea8983-e1c8-49bb-95b7-c23e48c72260 | jalenfran/blockchainvoting | src/logic/blockchain.cpp | #include "../../include/logic/hashing.h"
#include "../../include/logic/utilities.h"
#include "../../include/logic/VotingCounter.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <fstream>
#include <iostream>
#include <thread>
#include <atomic>
void mineBlock(Block *blockPtr){
... | ALGO | 0.944372 | 5.176534 |
29c98d3d-c420-4260-b878-de90dfc8b6c0 | aospSX/platform_frameworks_av | media/libstagefright/codecs/amrnb/enc/src/set_sign.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "set_sign.h"
#include "basic_op.h"
#include "inv_sqrt.h"
#include "cnst.h"
/*----------------------------------------------------------------... | ALGO | 0.999931 | 5.871158 |
8ba07745-e949-40c6-85ff-e85f5dc5b440 | MachuEngine/AWS-EC2-llama.cpp | llama.cpp/examples/cvector-generator/cvector-generator.cpp | #include "arg.h"
#include "common.h"
#include "llama.h"
#include "ggml.h"
#include "pca.hpp"
#include "mean.hpp"
#ifdef GGML_USE_CUDA
#include "ggml-cuda.h"
#endif
#ifdef GGML_USE_METAL
#include "ggml-metal.h"
#endif
#include <algorithm>
#include <climits>
#include <cstdio>
#include <cstring>
#include <fstream>
#inc... | DATA | 0.969575 | 6.190619 |
76b1e286-0626-4b67-8717-0ae30497c764 | akash-kumar-biswas/Numerical-Methods | GaussAndGaussJordanElimination.cpp | #include<bits/stdc++.h>
using namespace std;
void printMatrix(vector<vector<double>> matrix){
for(auto row: matrix){
for(auto val: row){
cout<<val<<" ";
}
cout<<"\n";
}
}
vector<double> row_ech(vector<vector<double>> A){
int n = A.size();
vector<double> result(n);
... | ALGO | 0.999994 | 5.087366 |
390b7db4-ec14-4e9e-becc-6c6082711d9a | GaisaiYuno/OI-Record-exe-deleted | Grade 8-9/G9S2/codeforces/000cf april fools day/F.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
int main(){
string s;getline(cin,s);int n=s.length();
int ans=0,tmp=0,i,j,flag=1;
for(i=0;i<n;i++){
cout<<i<<ends<<tmp<<ends<<ans<<endl;
if(s[i]=='+'||s[i]=='-'){
ans+=tmp*flag;
if(s[i]=='+')... | ALGO | 0.999979 | 3.583443 |
c331ba91-74c6-41ca-afc7-35bfdb6035df | zeffirkins/skillbox-study | Task_32_5_1_Info_about_film/nlohmann_json/test/thirdparty/Fuzzer/test/AbsNegAndConstantTest.cpp | // abs(x) < 0 and y == Const puzzle.
#include <cstring>
#include <cstdint>
#include <cstdlib>
#include <cstddef>
#include <cstdio>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size < 8) return 0;
int x;
unsigned y;
memcpy(&x, Data, sizeof(x));
memcpy(&y, Data + sizeof(x), siz... | ALGO | 0.936769 | 4.959648 |
d107c0a8-cee2-4aa4-b869-e234bc6da27c | Cx330-502/llvm_compiler | cpp/Compiler.cpp | //
// Created by 周霄 on 2023/9/28.
//
#include <algorithm>
#include "../lib/LLVM_Generator.h"
Compiler::Compiler(const std::string &infile_path, const std::string &outfile_path,
const std::string &errorfile_path, const std::string &llvmfile_path) {
this->lexer = new Lexer(infile_path, outfile_pa... | TOOL | 0.934094 | 4.589397 |
39ae2f10-f0cb-4092-b896-04151c8f7e16 | ibrahim1118/LeetCode-Solutions | 0564-find-the-closest-palindrome/0564-find-the-closest-palindrome.cpp |
class Solution {
public:
long getpalindrome(long left,bool even){
long res=left;
if(!even)
left/=10;
while(left>0){
res=(res*10)+(left%10);
left/=10;
}
return res;
}
string nearestPalindromic(string n) {
int ind=n.size()/2;
... | ALGO | 0.999957 | 6.35715 |
d0e8ece3-3c1f-48db-92cd-e317da4de706 | AHoltermann/Offlinehfsel_test | Src/ReturnEfficiency.cpp | #include "EfficiencyWrite.h"
#include "EfficiencyCounting.h"
#include "EventSelection.h"
#include "EfficiencyResults.h"
#include <TFile.h>
#include <TTree.h>
#include <iostream>
#include <vector>
using namespace std;
EfficiencyResults ReturnEfficiency_root(const char* inFilename){
TFile* file = TFile::Open(inFile... | DATA | 0.88997 | 4.576737 |
f45612f6-c558-4c30-9768-c17a447e1e1e | ishandutta2007/codeforces | zjjws/normal/1493/B.cpp | #include <queue>
#include <vector>
#include <string>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define LL long long
using namespace std;
inline LL rin()
{
LL s=0;
bool bj=false;
char c=getchar();
for(;(c>'9'||c<'0')&&c!='-';c=getchar());
if(c=='-')bj=true,c=getchar();
for(;c>='... | ALGO | 0.999344 | 3.710879 |
81e44f63-c9f2-46a4-b00e-ac462fea5b77 | VadimFarutin/SPbAU | open_cl/lab1/main.cpp | #pragma comment(lib, "OpenCL.lib")
#define __CL_ENABLE_EXCEPTIONS
#include <CL/cl.h>
#include "cl.hpp"
#include <vector>
#include <fstream>
#include <iostream>
#include <iterator>
#include <iomanip>
#include <algorithm>
#include <cmath>
int main() {
std::freopen("input.txt", "r", stdin);
std::freopen("output.... | ALGO | 0.999922 | 3.836382 |
73dd0683-de87-4719-aa81-3fd6260fb1a2 | pvnsumanth/LeetCode | 0098-validate-binary-search-tree/0098-validate-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999894 | 6.398319 |
6936688a-25f1-4960-90b7-b3032b27f818 | xxioachou/ACM | contest/2024牛客五一集训派对day5/C.cpp | #include <bits/stdc++.h>
#define x first
#define y second
#define sz(x) ((int)x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int inf = 0x3f3f3f3f;
const ll INF = 1e18;
void solve() {
int n, m;
cin >> n >> m;
int sz = n * m - 1;
cout << (sz & 1 ? "YES\n" : "NO\n");
}
int ma... | ALGO | 0.999538 | 3.182931 |
fd5d97b6-5215-4201-a9b9-b19167fef41d | dujingyao/Yao | 算法学习/acwing/蓝桥杯集训/第四讲/错误票据.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=1e5+10,INF=0x3f3f3f3f;
int a[N];
int main(){
int n;
cin>>n;
int minv=INF,maxv=-INF;
int tp;
while(cin>>tp){//直接读到文件结尾结束
if(tp<minv) minv=tp;
if(tp>maxv) maxv=tp;
a[tp]++;
}
int ans1=0,ans2=0;
for(int... | ALGO | 0.999927 | 3.84092 |
74282a0d-6b20-4e99-b3f9-d0ec5454ddb2 | ishandutta2007/codeforces | nantf/normal/1175/A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int maxn=100010;
#define MP make_pair
#define PB push_back
#define lson o<<1,l,mid
#define rson o<<1|1,mid+1,r
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define ROF(i,a,b) for(int i=(a);i>=(b);i--)
#define MEM(x,v) me... | ALGO | 0.999802 | 3.653229 |
230c9633-e25d-4f18-abda-349cc1c0f7d8 | Enjiro/ACM-ICPC-Notebook | Codes/Data Structure/Cartesian Tree/cartesian_tree_hash.cpp | const int NC=1e+5;
ull aux[NC];
void precalc(ull k)//prime k
{
aux[0]=1LL;
for(int i=1; i<NC; i++)
aux[i]=aux[i-1]*k;
}
class hnode
{
public:
ull v;
int s;
hnode(){};
hnode(ull _v, int _s)
{
v=_v; s=_s;
}
hnode operator +(const hnode &foo) const
{
return hnode(v+(foo.v*aux[s]), s+foo.s);
}
};
//srand(... | ALGO | 0.999675 | 3.785698 |
01a502e7-cd38-48d1-91e3-0391b9f026bf | durgeshkk/Codeforces-Contests | Practice/Rangewise/800/1614A.cpp | #include <bits/stdc++.h>
#include <deque>
#define ll long long int
using namespace std;
void solve()
{
ll n;
cin >> n;
ll l, r, k;
cin >> l >> r >> k;
vector<ll> v;
for (ll i = 0; i < n; i++)
{
ll ele;
cin >> ele;
v.push_back(abs(ele));
}
sort(v.begin(),... | ALGO | 0.999943 | 4.493446 |
c9bdcf3b-b5b0-40a7-9544-c9925ff1a37e | rokibio1107/ue4 | Engine/Source/ThirdParty/PhysX3/PhysX_3.4/Source/SceneQuery/src/SqExtendedBucketPruner.cpp | #include "SqExtendedBucketPruner.h"
#include "SqAABBTree.h"
#include "SqPrunerMergeData.h"
#include "SqAABBTreeQuery.h"
#include "GuBounds.h"
#include "CmBitMap.h"
using namespace physx;
using namespace Sq;
using namespace Gu;
using namespace Ps;
#define NB_OBJECTS_PER_NODE 4
////////////////////////////////////////... | TOOL | 0.877556 | 6.465457 |
9620a8f4-5d66-41dd-9ea3-8d15a301beb9 | liuq901/code | Ural/ur_1446.cpp | #include <cstdio>
#include <vector>
#include <string>
#include <map>
using namespace std;
const string name[4]={"Slytherin","Hufflepuff","Gryffindor","Ravenclaw"};
char buf[100000];
char s[1010][1010];
map <string,int> M;
vector <int> a[4];
int main()
{
int n;
scanf("%d",&n);
gets(buf);
for (int i=0;i<4... | ALGO | 0.999263 | 3.433985 |
0900bbe3-007c-498f-823b-78951c073ca8 | heiseish/Competitive-Programming | kattis/rockpaperscissors/rockpaperscissors.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
int main() {
int n;
while(scanf("%d", &n),n) {
vector<ii> s(n, {0, 0});
int k;
cin >> k;
int g = k * n * (n - 1) / 2;
while (g--) {
int p1, p2;
string h1, h2;
cin >> p1 >> h1 >> p2 >> h2;
if (h1 != h2) {
if (h1 == "pape... | ALGO | 0.999458 | 3.874653 |
fbed8534-5f92-47cc-8b53-f9e4dd3a7f84 | Kethavath9199/LeetCode | Graph/PathWithMaximumProbability.cpp | typedef pair<int, double> pid;
#define f first
#define s second
#define mp make_pair
#define pb push_back
class Solution {
public:
struct MaxHeapNode{
int v;
double dist;
MaxHeapNode(int v, double dist){
this->v = v;
this->dist = dist;
}
};
struct M... | ALGO | 0.999929 | 4.539872 |
54450371-40cb-41df-9037-d90fce66c8de | EshaThakur88/_STL_practice | sort.cpp | #include <bits/stdc++.h>
using namespace std;
//inbuilt sort consist of heap sort, insertion sort and quick sort.
//O(nlog(n))
int main(int argc, const char** argv) {
int N;
cin>>N;
vector<int> vec(N);
while(N--)
{
int value;
cin>>value;
vec.push_back(value);
}
... | ALGO | 0.999803 | 4.904102 |
b4005b6a-550b-4134-bdec-7619289ff123 | Lali67/Cpp_Snippet | 04-Bjarne Stroustrup-Programming Using Cpp/Chapter25/Chapter25/chapter.25.5.6-1.cpp |
//
// This is example code from Chapter 25.5.6 "An Example: Simple encryption" of
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#include "std_lib_facilities.h"
//------------------------------------------------------------------------------
void encipher(
const unsigned long *con... | ALGO | 0.999691 | 5.395411 |
4739b316-8231-4844-8fbb-2b4da5a3a9d8 | ob22a/Leetcode | 46-permutations/permutations.cpp | class Solution {
public:
void backtrack(vector<int> nums,vector<bool> seen,vector<int> res,vector<vector<int>>& sol){
if(res.size()==nums.size()){
sol.push_back(res);
return;
}
for(int i=0;i<nums.size();++i){
if(seen[i]) continue;
seen[i]=true;... | ALGO | 0.999999 | 6.358727 |
0eef67fd-77e8-46c8-b132-0493b57d089d | jash459/Today | Striver/4. Binary Search/8. Search Element in a Rotated Sorted Array.cpp | // Link : https://takeuforward.org/data-structure/search-element-in-a-rotated-sorted-array/
// video : https://www.youtube.com/watch?v=5qGrJbHhqFs&list=PLgUwDviBIf0pMFMWuuvDNMAkoQFi-h0ZF&index=5
/*
1. Brute :
#include <bits/stdc++.h>
using namespace std;
int search(vector<int>& arr, int n, int k) {
for (int i ... | ALGO | 0.999983 | 6.016513 |
5e763efc-f468-49c9-9533-aeff670eecf1 | viplov/implementation-basic-algoes | bubble.cpp | #include<iostream>
using namespace std;
int main()
{
int n,m;
cout<<"enter elments in array ";
cin>>n;
int ar[n];
for (int i=0;i<n;i++)
cin>>ar[i];
for (int i=0;i<n;i++)
{
for(int j=0;j<n-i-1;j++)
{
if(ar[j]>ar[j+1]) {
m=ar[j];
... | ALGO | 0.999765 | 3.740997 |
75c42bdb-9d19-43dd-9a87-ad2610038b6e | kjmikkel/LonelyRunner | src/C++/main_test.cpp | #include "Prime_Number.h"
#include "Geometric.h"
#include "Numerical.h"
#include "data_structure.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <sys/time.h>
#include <sstream>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <stddef.h>
#incl... | TEST | 0.862393 | 5.183086 |
da60491d-d941-4920-84e2-8895a0ea18bd | Jackminingmax/inventory-system | InventorySystemProject_update/InventorySystemProject_update/Categories.cpp | // Jack Maxwell
// 11/20/2024
// Implementation for the Categories Class.
// Stores categories in an AVL tree
#include "Categories.h"
using namespace std;
// Assignment operator
AVL& AVL::operator=(const AVL& rhs)
{
// Don't self-assign, make sure the two root nodes are different.
if (this->root != rhs.root)
... | ALGO | 0.967174 | 6.186991 |
1e494d7b-5183-4e9f-bf79-bbe0730dc644 | swapnilKadam-10/cpp | assign1/multiplication.cpp | // Write a C++ program to generate multiplication table.
#include<iostream>
using namespace std;
int main()
{
int no;
int sum=0;
cout<<"Enter the number to print the multiplication table";
cin>>no;
cout<<"multiplication table"<<endl;
for(int i=i;i<=no;i++)
{ sum=no*i;
cout<<no<<"*"<<i<<" = "<<sum... | ALGO | 0.999222 | 4.047193 |
4d400b1b-d3cf-4d29-bccd-e250fe264b62 | Macw07/Macw07 | OLC/Day02-Exe/T3140-数的计算.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int n, total;
void recursion(int step, int number, long long crt){
total += 1;
for (int i=1; i<=number/2; i++){
recursion(step+1, i, pow(10, step)*i + crt);
}
return ;
}
int main(){
cin >> n;
recursion(1, n... | ALGO | 0.999639 | 4.027358 |
2c55a035-400a-4700-bb08-de9a2cd0f43c | vinayak0505/Data-Structures | Couples Holding Hands.cpp | #include "vector"
using namespace std;
class Solution {
int solve(vector<vector<int>>& row,int a){
if(row[a].front() == a) return 0;
int par = -1;
int count = 0;
int b;
while(row[a].front() != a){
if(row[a].front() == par){
b = row[a].back();
... | ALGO | 0.999942 | 5.055928 |
014dd07c-f212-4dad-a6cc-73fa9eac42d7 | Danila51/contests_2020_1 | контесты/контест 2/1.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
string a, b, c;
cin >> a >> b;
c = "";
int as = a.size();
int bs = b.size();
if (as > bs) {
swap(as,bs);
swap(a, b);
}
int d = 0;
int j = bs - 1;
for (int i = as - 1; i >=0; --i){
int temp = int(a[i] - '0') + int(b[j]- '0') + d;
... | ALGO | 0.999994 | 4.177674 |
c9a10467-7e9f-4dc1-8c21-0b7d39e7dbe6 | andialexandrescu/FundamentalAlgorithms_Lab | distante_drumuri_minime/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <limits>
using namespace std;
ifstream fin("graf.in");
ofstream fout("graf.out");
// bfs pentru a determina distantele minime de la un set de noduri de control la toate celelalte noduri dintr-un graf neorientat
int n, m;
void BFS(ve... | ALGO | 0.999794 | 4.440074 |
65e44b96-44e2-4ea8-8304-58691adad9ed | VecoMr/competitive_programming | Online_Judge/11742 - Social Constraints/main.cpp | #include <algorithm>
#include <iostream>
#include <vector>
bool is_possible(std::vector<std::vector<int> > v, std::vector<int> people)
{
std::vector<int> tmp;
for (int i = 0; i < people.size(); i++)
tmp.push_back(0);
for (int i = 0; i < people.size(); i++)
tmp[people[i]] = i;
for (int i... | ALGO | 0.999828 | 4.533911 |
2afe4efb-1296-4f43-87be-83a87afe4b73 | yw228/Piano_APP | Yiqi/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.998605 | 6.76073 |
de71bfe2-f503-4ae1-b593-44a7e10deb11 | surajshende247/dsa-september | 2) LinkedList/3)MiddleElementNaive.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node *next;
Node()
{
this->next = NULL;
}
};
void findMiddle(Node *node)
{
Node *temp = node;
int count=0;
while(node!=NULL)
{
count++;
//cout<<node->data<<", ";
node... | ALGO | 0.996444 | 5.218502 |
2c917099-6476-43ca-bb95-d685ad5109f7 | lamphanviet/competitive-programming | uva-online-judge/accepted-solutions/1203 - Argus.cpp | //============================================================================
// Author : LAM PHAN VIET - <EMAIL>
// Problem Name : 1203 - Argus
// Time Limit : .000s
// Description :
//============================================================================
#include <algorithm>
#include <bitset>
#includ... | ALGO | 0.999107 | 3.453279 |
c96e830f-874f-4bf4-9642-39ced227767f | RealityRipple/UXP | media/libsoundtouch/src/InterpolateLinear.cpp | #include <assert.h>
#include <stdlib.h>
#include "InterpolateLinear.h"
using namespace soundtouch;
//////////////////////////////////////////////////////////////////////////////
//
// InterpolateLinearInteger - integer arithmetic implementation
//
/// fixed-point interpolation routine precision
#define SCALE 655... | ALGO | 0.96381 | 6.384697 |
aa0ce754-d20a-469e-baa1-3934fcdeeeb7 | Ebeed-cs/Mastering-4-critical-SKILLS-using-CPP-17 | 07-Loops/Medium to Hard Level/Find all quadruples - 2.cpp | #include<iostream>
using namespace std;
/*
Find all quadruples
● Count how many (a, b, c, d) with following property:
○ 1 <= (a, b, c, d) <= 200
○ a + b = c + d
● Code it once using 4 loops
○ How much time does it take!
● Code it once using 3 loops only
*/
int main() {
int count = 0;
for (int... | ALGO | 0.999645 | 4.065248 |
58cd4b7f-dc9b-458c-b797-6bb93a23a40e | than0112/learning_hub | codewar/8kyu/problem 69/69-2.cpp | #include <iostream>
#include <vector>
#include <string>
#include <numeric> // 引入 numeric 以便未來使用
#include <limits> // 用於暫停功能
using namespace std;
/**
* @brief 將一個單字陣列組合成一個用空格分隔的句子。
* @param words 包含多個單字的向量。
* @return std::string 組合後且格式正確的句子。
*/
std::string smash(const std::vector<std::string>& words)
{
// 1... | TOOL | 0.994677 | 6.659906 |
f3391bc1-99f0-4ae1-8c36-bb0b2d380e2d | mario86123/DSMGA-II-experiments | sat.cpp | #include <iostream>
#include <iomanip>
#include <cstring>
#include <fstream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include "sat.h"
using namespace std;
double evaluateSAT(int *x, SATinstance *inst) {
double f=0;
bool b=false;
for(vector<int>::iterator it = inst->fve... | ALGO | 0.997994 | 3.661483 |
bf7c585f-500b-4dfd-8b2b-d27771c3c8ee | MX-RESEARCH/MX-Firmware-Buddy-5.1.2 | lib/Marlin/Marlin/src/libs/vector_3.cpp | #include "../inc/MarlinConfig.h"
#if ABL_PLANAR || ENABLED(AUTO_BED_LEVELING_UBL)
#include "vector_3.h"
#include <math.h>
/**
* vector_3
*/
vector_3 vector_3::cross(const vector_3 &left, const vector_3 &right) {
const xyz_float_t &lv = left, &rv = right;
return vector_3(lv.y * rv.z - lv.z * rv.y, // YZ... | TOOL | 0.891109 | 6.999084 |
b497b1fa-71b5-474c-ac44-6bc39460c68f | SallamRady/Problem-Solving | codeforces/Assuit-ICPC/sheet-1/r.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
#include <bitset>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <climits>
#include <stack>
#include <vector>
#include <deque>
#include <queue>
#include <unordered_set>
#define endl "\n"
#define ll long long
#define fast ... | ALGO | 0.995075 | 3.849713 |
b0d5bb47-49a9-4afb-983f-b6cd7988b725 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt4/Codenet/p02238/650489539/response_9.cpp | #include <iostream>
#include <vector>
using namespace std;
#define WHITE 0
#define GRAY 1
#define BLACK 2
vector<vector<int>> G;
vector<int> color, d, f;
int n, t;
void search_loop(int i) {
d[i] = ++t;
color[i] = GRAY;
for (int next = 1; next <= n; ++next) {
if (G[i][next] > 0 && color[next] == WHITE) {
... | ALGO | 0.999379 | 3.631506 |
4f5dab2f-b730-4c78-b037-46c64e1691d8 | tdelev/softversko-inzenerstvo | src/av4/multi_set.cpp | #include <iostream>
#include <set>
#include <iterator>
using namespace std;
int main() {
/*type of the collection:
*-duplicates allowed
*-elements are integral values
*-descending order
*/
typedef multiset<int, greater<int> > IntSet;
IntSet coll1; // empty multiset container
//insert elements in random ord... | ALGO | 0.994399 | 5.016661 |
91521edc-b49b-4651-be9b-c4418634c353 | vishusharmaX/100DaysofCodeChallenge | Easy/Finding middle element in a linked list/finding-middle-element-in-a-linked-list.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void printList(Node* node)
{
while (node != NULL) {
cout << node->data <<" ";
... | ALGO | 0.999885 | 6.173341 |
e1f31e9d-2ab1-4297-a8c8-9945cf146894 | shakilahamedriaz/cf_here | CF round 992 div2/b.cpp | #include <iostream>
#include <cmath>
using namespace std;
void solve() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
// Calculate the minimum number of operations of the first type needed
int operations = ceil(static_cast<double>(n) / 3);
cout << operations << e... | ALGO | 0.999942 | 5.033109 |
4a0b6aba-fe83-42a8-b68e-ef8703c57dca | hotuanan/codeforces | Snowball/main.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int b_w, b_h;
int x_w, x_h;
int y_w, y_h;
cin >> b_w >> b_h >> x_w >> x_h >> y_w >> y_h;
while(b_h != 0) {
b_w += b_h;
if(b_h == x_h) b_w = max(0, b_w - x_w);
else if(b_h == y_h) b_w = max(0, b_w - y_w);
... | ALGO | 0.962017 | 3.302274 |
049ed0af-39ca-4f34-b4d1-3d7fd1d3dc6c | Lactorias/Terra | src/ant.cpp | #include "../includes/simulation/ant/ant.hpp"
#include "../includes/simulation/ant/trail.hpp"
#include <cmath>
auto Ant::update(const float DT) -> void {
update_position(DT);
trail_time_elapsed += DT;
if (trail_time_elapsed >= 0.33f) {
trails.add(Trail(position.x, position.y));
trail_time_... | ALGO | 0.987037 | 5.937916 |
2bb77ab0-1baa-43cf-a0e1-54173a838a98 | epiglottiss/algorithm_SP | 2W/Maze.cpp | #include<stdio.h>
#include <vector>
#include <queue>
#include <time.h>
using namespace std;
#define SIZE 1001
#define ROAD -1
#define WALL -2
const int direction[2][4] = { {0,1,0,-1},{1,0,-1,0} };
class Maze {
int board[SIZE][SIZE];
vector<vector<int>> matrix;
public:
bool InitializeMaze() {
//̷ Ȧ
if (SIZE &... | ALGO | 0.999661 | 3.405848 |
3cf08dc9-a982-4134-8a47-afcc70382016 | datomusic/duo-firmware | libraries/FastLED/noise.cpp | #define FASTLED_INTERNAL
#include "FastLED.h"
FASTLED_NAMESPACE_BEGIN
#define P(x) FL_PGM_READ_BYTE_NEAR(p + x)
FL_PROGMEM static uint8_t const p[] = { 151,160,137,91,90,15,
131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,... | ALGO | 0.993281 | 6.179043 |
a6c279c4-e2da-4fd4-a83e-20edab4aa2fc | rubayet-ashib/XPSC | Week 4/Day 3/M_NASA.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;
vector<int> all_palindromes;
void fastIO()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
// void store_palindrome()
// {
// for (int i = 0; i < (1 << 15); i++)
// {
// string s1 = to_string(i);
// ... | ALGO | 0.999904 | 4.954689 |
b7eccf6b-e154-4745-9887-4891c735441e | Priyanshi662/DSA | 07-Graph/08-maze.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
bool bfs(vector<vector<int>> &maze ,int x,int y,int dx,int dy)
{
int row[4]={-1,1,0,0};
int col[4]={0,0,-1,1};
queue<pair<int,int>> q;
int n=maze.size();
int m=maze[0].size();
vector<vector<bool>> vis(n,vector<bool> (m,... | ALGO | 0.999837 | 4.872175 |
ba64e85a-f725-4cbf-8244-e0fe8dabade8 | JASIM16027/Data-Structure-Aglorithm | dynamic_programming/Grid_problem/TrianglePathSumSOP.cpp | #include<bits/stdc++.h>
using namespace std;
int minimumPathSum(int n, vector<vector<int>>&triangle){
vector<int>front(n,0),cur(n,0);
for(int j = 0;j<n;j++) front[j] = triangle[n-1][j];
for(int i=n-2;i>=0;i--){
for(int j=i;j>=0;j--){
int down = triangle[i][j]+front[j];
int d... | ALGO | 0.999986 | 5.061287 |
bfb9e871-e0c1-42cb-801d-7e24795787fd | sunilkumarswami/LeetCode-Pratice | 0721-accounts-merge/0721-accounts-merge.cpp | class DisjointSet{
public:
vector<int> rank,par;
DisjointSet(int n){
rank.resize(n+1,0);
par.resize(n+1);
for(int i=0;i<n;i++){
rank[i]=0;
par[i]=i;
}
}
void unionByRank(int u,int v){
u=findPar(u),v=findPar(v);
if(u==v) ret... | ALGO | 0.999986 | 5.955921 |
50cd092c-a696-40f1-825e-a3582dc64292 | fruitTheory/Sudoku | src/main.cpp | #include "sudoku.hpp"
#include "sudoku_utility.hpp"
#include "sudoku_zones.hpp"
#include "sudoku_solve.hpp"
#include <cstdlib>
int main(){
Sudoku sudoku;
int row_iter = 0;
bool running = true;
while(running){
row_algorithm(row_iter);
sudoku.push_cycle();
++row_iter;
b... | ALGO | 0.984147 | 5.085455 |
1cb199b9-579e-47fd-a38f-2ac527bec6fc | wide777/AtCoder | ABC/ABC148/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
int main() {
int a, b;
cin >> a >> b;
if(a != 1 && b != 1) {
cout << 1 << endl;
} else if(a != 2 && b != 2) {
cout << 2 << endl;
} else {
cout << 3 << endl... | ALGO | 0.999658 | 3.384526 |
86bf0dc1-0a95-42d7-bc82-710afee88338 | adithya-m08/MarlinTarantula-EasyConfig-2.0.x | Marlin/src/libs/heatshrink/heatshrink_decoder.cpp | #include "../../inc/MarlinConfigPre.h"
#if ENABLED(BINARY_FILE_TRANSFER)
/**
* libs/heatshrink/heatshrink_decoder.cpp
*/
#include "heatshrink_decoder.h"
#include <stdlib.h>
#include <string.h>
#pragma GCC optimize ("O3")
/* States for the polling state machine. */
typedef enum {
HSDS_TAG_BIT, /* ... | ALGO | 0.923562 | 4.981967 |
61ca5d7c-a210-459f-87c4-ab1edbc622b2 | cxxzhang/qt6_5_for_xp | qtbase/src/3rdparty/sha1/sha1.cpp | #include <QtCore/qendian.h>
#ifdef Q_CC_MSVC
# include <stdlib.h>
#endif
QT_BEGIN_NAMESPACE
// Test Vectors (from FIPS PUB 180-1)
//
// SHA1("abc") =
// A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
//
// SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") =
// 84983E44 1C3BD26E BAAE4AA1 F95... | ALGO | 0.940684 | 6.95892 |
25bb5f04-2d81-412b-a4d4-926655e743e5 | OpenXRay/xray-oxr-merge | 1.5.06 with 1.0007rc1/3rd party/crypto/xr_sha.cpp | #include "xr_sha.h"
#include <openssl/sha.h>
namespace crypto
{
xr_sha256::xr_sha256()
{
m_sha_ctx = xr_new<SHA_CTX>();
}
xr_sha256::~xr_sha256()
{
xr_delete (m_sha_ctx);
}
void xr_sha256::start_calculate (u8 const * data, u32 data_size)
{
SHA_Init (m_sha_ctx);
ZeroMemory (m_result, sizeof(m_result));
VER... | TOOL | 0.974696 | 6.472627 |
5f97442e-ab29-45a0-bf29-c6e3a0a167b1 | FPSG-UIUC/Pandora | simulator/src/systemc/tests/systemc/misc/user_guide/chpt3.1/fsmr.cpp | /*****************************************************************************
fsmr.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.998558 | 4.888353 |
8f950dfd-f638-4ab5-9bf1-4b13a0ff64f6 | Dheerendra22/D.S.A_in_C_Plus_Plus | Tree.cpp | #include<iostream>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int val){
data = val;
left = NULL;
right = NULL;
}
void preorder(){
if(this != NULL){
cout<<" "<<data<<" ";
left->preorder();
right->preorder... | ALGO | 0.999746 | 4.851965 |
2269e2ce-2374-4c1b-b4fa-7bef9ec0e65d | Kunallion/LeetCode | 0041-first-missing-positive/0041-first-missing-positive.cpp | class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
for(int i=0 ; i<nums.size() ; i++)
{
while(nums[i]>0 && nums[i]<=nums.size() && nums[nums[i]-1]!=nums[i])
swap(nums[nums[i]-1], nums[i]);
}
for(int i=0 ; i<nums.size() ; i++)
{... | ALGO | 0.999971 | 4.954978 |
7544a373-90a4-4da4-93d0-9e3c5699a7a6 | gangjune/CodeTree | 241125/두 정수에 대한 연산값/operational-values-for-two-integers.cpp | #include <iostream>
using namespace std;
void f(int &a, int &b){
if(a > b){
a += 25;
b *= 2;
}
else{
a *= 2;
b += 25;
}
}
int main() {
int a, b;
cin >> a >> b;
f(a, b);
cout << a << " " << b;
return 0;
} | ALGO | 0.99971 | 3.746021 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.