uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
b08c73c7-6b18-4171-946f-a32d1c7b7304 | rayddteam/freebsd-pi | contrib/llvm/lib/CodeGen/PHIEliminationUtils.cpp | #include "PHIEliminationUtils.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/ADT/SmallPtrSet.h"
using namespace llvm;
// findCopyInsertPoint - Find a safe place in MBB to insert a copy from SrcReg
// when following t... | ALGO | 0.997383 | 7.638066 |
2ab0fb1a-49d2-473a-9cc4-bc98ea1f4edf | skyf0l/NanoTekSpice | src/Components/GateComponents/Nand.cpp | /*
** EPITECH PROJECT, 2021
** NAND
** File description:
** Nand class
*/
#include <Nand.hpp>
namespace nts
{
Nand::Nand(std::string name) : AComponent("nand", name)
{
ADD_PIN_IN(1); // in_1
ADD_PIN_IN(2); // in_2
ADD_PIN_OUT(3); // out
}
Nand::~Nand()
{
}
void ... | TOOL | 0.920078 | 5.800244 |
e7de6125-b284-4e3b-bf1c-5c13134e062b | ChhayankTyagi/Daily-Leetcode-Problems | 203-remove-linked-list-elements/remove-linked-list-elements.cpp | /**
* 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 {
public:
ListNode* removeEleme... | ALGO | 0.999944 | 5.621398 |
e5818986-76b4-4bde-a629-6e92308480a4 | nakib1948/Competitive-programming | A_Fancy_Fence.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(i=0;i<n;i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define debug cout<<"debug"<<endl;
int main()
{
///"In the name of Allah,most gracious and most merciful"///
ll t;
cin>>t... | ALGO | 0.999571 | 3.387674 |
100196ef-b8f3-460a-9580-510147915510 | suptaphilip/Algorithm | Lab 1/RandomNumber.cpp | #include<bits/stdc++.h>
using namespace std;
void Swap(int *x, int *y){
int temp=*x;
*x=*y;
*y=temp;
}
void printArray(int m[], int s){
for(int i=0;i<s;i++){
cout<<m[i]<<" ";
}
cout<<endl;
}
void bubbleSort(int A[],int n){
for(int k=0;k<n;k++){
for(int i=0;i<n;i++){
... | ALGO | 0.99948 | 4.286314 |
a29d0252-0915-4ebd-ad96-abe45d4ed497 | mariospapa90/UE4-HW-4.18 | Engine/Source/ThirdParty/PhysX/APEX_1.4/module/destructible/fracture/Core/CompoundCreatorBase.cpp | #include "RTdef.h"
#if RT_COMPILE
#include "CompoundCreatorBase.h"
#include <algorithm>
#include <PxAssert.h>
namespace nvidia
{
namespace fracture
{
namespace base
{
using namespace nvidia;
int CompoundCreator::tetFaceIds[4][3] = {{0,1,3},{1,2,3},{2,0,3},{0,2,1}};
int CompoundCreator::tetEdgeVerts[6][2] = {{0,1},{1... | TOOL | 0.982409 | 6.075818 |
ba5ae33f-4893-4478-889f-30c008ef5413 | SCTeaching-NBody/LabCourse_Template | src/labcourse/dummy.cpp | /**
* @author first_name1 last_name1
* @author first_name2 last_name2
* @author first_name3 last_name3
*/
#include "labcourse/dummy.hpp"
#include "mpi.h" // MPI_Comm_size, MPI_Comm_rank, MPI_Barrier, MPI_Bcast, MPI_Scatter, MPI_Gather
#include "omp.h" // omp_get_num_threads, omp_get_thread_num
#include <cstdde... | TOOL | 0.856331 | 4.821178 |
adfb593c-9950-4546-b0fa-d8e188c2d68d | DevMatrix1/dsa-practice | C++/Sejal/NextGreaterElement.cpp | // https://devsnest.in/lms?id=47&slug=next-greater-element
vector<int> solve(int n, vector<int> nums){
//CODE HERE
// code again
int i;
vector<int> ans(n, 0);
stack<int> st;
for (i = 2*n - 1; i >= 0; i--){
while (!st.empty() && st.top() <= nums[i % n])
st.pop();
if (!st.emp... | ALGO | 0.999982 | 4.762876 |
c237b981-da54-47cd-b4a2-2c623036812d | LeonardoCBoar/BoarMuscle | demo/main.cpp |
// builtin
#include <SDL_error.h>
#include <SDL_keycode.h>
#include <SDL_render.h>
#include <cstddef>
#include <ostream>
#include <vector>
#include <assert.h>
// extern
#include <SDL.h>
// local
#include "collisions.hpp"
#include "geometry.hpp"
#include "vector.hpp"
#include "graphical_manager.hpp"
const double ... | ALGO | 0.935503 | 5.574341 |
d21f0803-6af4-42bd-af01-90e65aa1244e | honeyspoon/flutter-ffi-test-sox | android/.cxx/cmake/debug/x86/third/sox/src/amr/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/qgain795.cpp | /*
------------------------------------------------------------------------------
Filename: qgain795.cpp
Functions: MR795_gain_code_quant3
MR795_gain_code_quant_mod
MR795_gain_quant
------------------------------------------------------------------------------
MODULE DESCRIPTION
----------... | ALGO | 0.999938 | 6.028234 |
e9a5a5dd-5164-4497-bfb9-195d1316860c | vinodpatildev/leetcode-problem-solving | problems solved/00296-lexicographically-smallest-equivalent-string.cpp | class Solution {
public:
string smallestEquivalentString(string s1, string s2, string baseStr) {
vector<int> char_groups(26,0);
unordered_map <int,char> group_min_char_map;
string res="";
for(int i=0; i<s1.size(); i++){
if(char_groups[s1[i]-'a'] == 0 && char_groups[s2[i]-... | ALGO | 0.999887 | 5.88155 |
576b775a-5206-422e-85b6-0da61812797a | the-baron123/algo-problems | K Frequent Elements.cpp | /*Given an integer array nums and an integer k, return the k most frequent elements within the array.*/
#include <iostream>
#include <vector>
#include <unordered_map>
static std::vector<int> topKFrequent(std::vector<int>& nums, int k)
{
std::vector<int> res;
std::unordered_map<int, int> Hash;
int n = nums.size(), i... | ALGO | 0.999946 | 5.698416 |
30069f9f-d2c6-41de-8416-50e8f6bfd4ee | therewibowo/Niomic-tugas-C- | tugas7.cpp | #include <iostream>
using namespace std;
int main(){
int x,z;
printf("Inputan nNilai x : ");
cin>>x;
printf("Inputan Nilai z : ");
cin>>z;
if(x % 2 ==0){
cout<<x << " genap dan"<<endl;
} else{
cout<<x<<" ganjil dan"<<endl;
}
if(z % 2 ==0){
cout<<z << " genap"<<endl;
} else{
cout<<z<<" ganjil... | ALGO | 0.995777 | 3.249857 |
f300a911-9bb0-478f-a535-168be31bd9a1 | yadavarchana123/LeetCode-Problems | 1822-sign-of-the-product-of-an-array/1822-sign-of-the-product-of-an-array.cpp | class Solution {
public:
int arraySign(vector<int>& nums) {
int zero = 0, neg = 0;
for(auto x : nums)
{
if(x == 0)
zero++;
if(x < 0)
neg++;
}
if(zero) return 0;
return neg % 2 ? -1 : 1;
}
}; | ALGO | 0.999987 | 5.588891 |
a4fa2162-f43f-4ec0-90fa-6814e014fba9 | ishandutta2007/codeforces | myungwoo/normal/319/D.cpp | #include <vector>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <c... | ALGO | 0.999998 | 3.292579 |
86b0fc9a-5f25-44b5-977f-9355ca4270ea | cmrohityadav/DSA-prac | STL/Map/13_unorderedMultimap.cpp | #include<iostream>
#include<unordered_map>
using namespace std;
int main()
{
unordered_multimap<string,int>fruitCnt;
fruitCnt.insert(make_pair("apple",10));
fruitCnt.insert(make_pair("mango",10));
fruitCnt.insert(make_pair("apple",9));
for(auto itr:fruitCnt){
cout<<itr.first<<" "<<itr.sec... | ALGO | 0.964286 | 4.750913 |
1c55ea2e-c396-4b73-a0f4-2693cbffb466 | EricDualc/imada | src/cryptopp/luc.cpp | // luc.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#include "luc.h"
#include "asn.h"
#include "sha.h"
#include "integer.h"
#include "nbtheory.h"
#include "algparam.h"
NAMESPACE_BEGIN(CryptoPP)
#if defined(CRYPTOPP_DEBUG) && !defined(CRYPTOPP_DOXYGEN_PROCESSING)
void LUC_TestInstantiatio... | ALGO | 0.98833 | 6.973131 |
c54bcf21-ac20-4a80-a105-879df84e1432 | mozilla/spiderweb | widget/windows/nsFilePicker.cpp | #include "nsFilePicker.h"
#include <shlobj.h>
#include <shlwapi.h>
#include <cderr.h>
#include "mozilla/mscom/EnsureMTA.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/WindowsVersion.h"
#include "nsReadableUtils.h"
#include "nsNetUtil.h"
#include "nsWindow.h"
#include "nsILoadContext.h"
#include "nsIServiceManage... | TOOL | 0.871712 | 6.818933 |
36fcb576-9056-4464-b989-7420cfeb4f72 | hash2403/CPP | radius_circle.cpp | #include<iostream>
using namespace std;
int main(){
float r,area;
cout<<"Enter radius";
cin>>r;
area=(float)22/7*r*r;
cout<<"Area is"<<area<<endl;
return 0;
}
| ALGO | 0.987984 | 3.360952 |
87e8b877-a569-4fe3-aeaa-eb17d4b15d12 | fiscalobject/ufo | src/script/sign.cpp | #include <script/sign.h>
#include <key.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <script/standard.h>
#include <uint256.h>
typedef std::vector<unsigned char> valtype;
MutableTransactionSignatureCreator::MutableTransactionSignatureCreator(const CMutableTransaction* txToIn, unsigned int... | TOOL | 0.913801 | 6.804442 |
3f3a2de2-d9d9-4829-976f-bdcd6d7704f9 | prashantpatil98/Applications | String (17).cpp | #include <iostream>
using namespace std;
int strrevX(char *str)
{
char *start = str;
char *end = str;
char temp;
while(*end != '\0')
{
end++;
}
end--;
while(start < end)
{
temp = *start;
*start = *end;
*end = temp;
start++;
end--;
}
}
int main()
{
int iRet =0;
char Arr[20];
cout<<"E... | ALGO | 0.983254 | 4.648646 |
5a0c0161-a151-4863-acd6-162043981f70 | amansaxena1/Competitive-Coding | Codeforces/B_The_Cake_Is_a_Lie.cpp | #include <bits/stdc++.h>
#define llint long long int
using namespace std;
void aman()
{
llint n, m, k;
vector<llint> v;
cin >> n >> m >> k;
if (k == (n - 1) + n * (m - 1) || k == (m - 1) + m * (n - 1))
{
cout << "YES"
<< "\n";
}
else
{
cout << "NO\n";
}
}... | ALGO | 0.999621 | 4.105446 |
10d962b6-aee0-4578-819a-f83a58ed9c3b | LukaFtk/CPP | Rock Paper Scissors.cpp |
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <time.h>
#include <string>
#include <windows.h>
#include <algorithm>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int main() {
int a; int round;
int PScore = 0, CScore = 0, Ties = 0;
string Name;
cout<<"Enter You... | ALGO | 0.97886 | 3.459019 |
0c15f0d8-0bd6-4767-8ed1-371bc3a5799f | raihanuldev/Problem-Solving | codeForces/C_Tear_It_Apart.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tcase;
cin>>tcase;
while(tcase--)
{
string s;
cin>>s;
int n = s.size();
int ans = INT_MAX;
for (int j = 'a'; j <= 'z'; j++) {
int c ... | ALGO | 0.999715 | 4.404535 |
27a9d859-044d-4d4d-913c-9c91fee0c7da | harsh70568/striver_sde_sheet_60_days | largest_BST_in_a_BT.cpp | /************************************************************
Following is the Binary Tree node structure
template <typename T>
class TreeNode {
public :
T data;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T data) {
this -> data = data;
... | ALGO | 0.999987 | 6.246257 |
64867579-38e6-4e38-8274-977f4ef39f73 | rafa95359/programacionCOmpetitiva | algoritmosG/l.cpp | #include <bits/stdc++.h>
using namespace std;
#define para(i,a,n) for(int i=a;i<n;i++)
typedef long long Long ;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
string home;
cin>>home;
map<string,int> llegada,salida;
para(i,0,n){
st... | ALGO | 0.999773 | 3.672215 |
3a2f6f43-3a12-43fa-8786-6c4a81f25c0c | raincross7/code-similarity | codes/train_code/problem253/problem253_500.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define... | ALGO | 0.999997 | 3.401041 |
7920bb80-71e6-4ca0-b0b8-3ecb7304ebaa | yousuff22/Cpp-Ques | Second Month/topKFrequentword.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<unordered_map>
using namespace std;
vector<string> topKFrequent(vector<string>& words, int k) {
priority_queue<pair<int,string>> maxx;
unordered_map<string,int> mpp;
vector<string> ans;
for(int i = 0; i<words.size(); i++) {
mpp[... | ALGO | 0.999998 | 5.477823 |
a9ee2f81-bb06-49f2-af95-d25d2e66e3f0 | Feterro/SuperMaxipali-Revivido | Progra 2 para uso/Servidor/grafodij.cpp | #include "grafodij.h"
void SubirNodoBodega(string pNombreArchivo)
{
ifstream in(pNombreArchivo);
if (in.is_open())
{
std::vector<std::string> content;
for (std::string line; std::getline(in, line); )
{
content.push_back(line);
}
in.close();
std::i... | ALGO | 0.995962 | 3.348534 |
e0330ba9-700e-49ff-aacf-afbdfe48b0d8 | 21A91A05C1/GeeksforGeeks | Easy/Armstrong Numbers/armstrong-numbers.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:
string armstrongNumber(int n) {
// code here
int s=0,m=n;
while(n>0)
{
int d=n%10;
... | ALGO | 0.999347 | 5.800758 |
e9d7e988-6ce3-4b63-a627-d0421cbdb884 | DVRodri8/Competitive-programs | OnlineJudgeUVa/C++/11xxx/11727 - Cost Cutting/main.cpp | #include <iostream>
using namespace std;
int mediano(int s1, int s2, int s3){
if(s1 > s2 && s2 > s3 || (s3 > s2 && s2 > s1)) return s2;
if(s2 > s1 && s1 > s3 || (s3 > s1 && s1 > s2)) return s1;
if(s1 > s3 && s3 > s2 || (s2 > s3 && s3 > s1)) return s3;
}
int main(){
int a, s1, s2, s3, cont;
cin >> a;
f... | ALGO | 0.999843 | 4.557336 |
526bdd77-d304-45bf-a4a4-45d3447d846c | shakshi306/cpp | sorting.cpp | #include<iostream>
drsing namespace std;|
int main(){
int n=5;
int i=0;
int a[]={5,6,4,7,3};
int it=0;
while(it<5)
{
int i=0;
while(i<n)
{
if(a[i]>a[i+1])
{
swap(a[i],a[i+1]);
}
i++;
}
it++;
}
for(int i=0; i<n;i++){
cout<<a[i]<<" ";
}
}
| ALGO | 0.999943 | 3.319648 |
84978b2a-632d-49bd-8bdb-f632553c7346 | apavlyuc/expert_system | src/Solver.cpp | #include "Solver.hpp"
#include <utility>
#include <iostream>
#include <algorithm>
namespace {
bool is_operation(char c)
{
return (c == '|' || c == '^' || c == '+' || c == '!');
}
int performe_operation(int a, int b, char operation)
{
switch (operation)
{
case '+':
{
if (a == -1 || b == -1)
{... | ALGO | 0.997987 | 4.105347 |
b73560d4-c475-4f5a-ad43-e64d9997a61a | jlcalvo/PathPlanning-CollisionAvoidance | Graph.cpp | //TFG Jos Luis Calvo Subir, Enero 2019
#include"Graph.h"
using namespace boost;
std::vector<Point2D> Graph::check_continuity(Point2D point, std::vector<Segment> segments) {
std::vector<Point2D> locator;
for (int i = 0; i < segments.size(); ++i) {
if ((point.x == segments[i].p0.x) && (point.y == segments[i].p... | ALGO | 0.998822 | 4.154709 |
3039834b-cbfd-4be9-a77f-c0d11321792a | ishandutta2007/codeforces | hollwoq_pelw/normal/1162/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, H, M;
cin >> N >> H >> M;
vector<int> house(N, H);
for (int i = 0; i < M; ++i) {
int L, R, B;
cin >> L >> R >> B;
for (int i = L - 1; i < R; ++i) {
house[i] = min(house[i], B);
}
}
int a... | ALGO | 0.998962 | 4.240012 |
f17e15ac-0bba-42b1-bada-e25c72dbe4a1 | snehabms2026/3tasks | game.cpp | #include<iostream>
using namespace std;
char square[10] = {'0','1','2','3','4','5','6','7','8','9','10'};
int gamewin()
{
if(square[1] == square[2] && square[2] == square[3])
{
return 1;
}
else if(square[4] == square[5] && square[5] == square[6])
{
return 1;
}
else if(square[... | ALGO | 0.999299 | 3.972945 |
c5872f9b-e996-404c-be65-edd2f8905bd7 | Choosen123/Pid-Ball | main.cpp | #include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
#include <opencv2/dnn.hpp>
#include <cmath>
// #include <core/providers/tensorrt/tensor_rt_provider_factory.h>
#include "/opt/onnxruntime/include/onnxruntime_cxx_api.h"
// #include "core/session/on"
#include "serialport/serialport.h"
#define ORINGIN_X... | TOOL | 0.934031 | 4.530806 |
7306667a-7db9-4828-aa99-35ac925e4afe | JanviMahajan14/Algorithms | Arrays/10.maximum_sum_of_subarray_2.cpp | /* We will find cummalative sum of the whole arary then find sum of the subaray. This
will reduce to O(n^2)*/
#include <iostream>
#include <climits>
using namespace std;
int main(){
int n, maxSum=INT_MIN, cumalative_sum[] = {0};
cin >> n;
int a[n], countSum;
cin >> a[0];
cumalative_sum[0] = a[0]... | ALGO | 0.999983 | 4.343136 |
0e6fc1e4-aeef-4f54-ba3f-26d88112a4f0 | prataprohit851/LeetCode | 0050-powx-n/0050-powx-n.cpp | class Solution {
public:
double myPow(double x, int n) {
if(n == 0) return 1;
if(n < 0){
n = abs(n);
x= 1/x;
}
if(n % 2 == 0){
return myPow(x*x, n/2);
}
else{
return x * myPow(x, n-1);
}
}
}; | ALGO | 0.999744 | 5.793633 |
e1e7b784-4e6c-4810-aec9-9af6fcb1b252 | Azzer8/parallel_programming_labs | MPI/Lab26.cpp | #include <mpi.h>
#include <iostream>
#include <string>
#include <vector>
int main(int argc, char** argv) {
MPI_Init(&argc, &argv);
int world_rank, world_size;
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
// Создаем группу для четных процессов
MPI_Gro... | ALGO | 0.98208 | 6.272331 |
c7fa3dae-990d-48cc-834a-a964ef13396c | vikas0799/CP | A.cpp | #include <iostream>
using namespace std;
int binarySearch(int array[], int x, int low, int high) {
while (low <= high) { // Repeat until low and high meet
int mid = low + (high - low) / 2;
if (array[mid] == x)
return mid;
if (array[mid] < x)
low = mid + 1;
else
high = mid - 1;
... | ALGO | 0.999586 | 5.367984 |
18ae2753-a592-4bb4-8e14-d4e8496a7716 | tobe2098/CodingExercises | Others/Others/reversePolishNotation.cpp | #include "reversePolishNotation.hpp"
int execOp(int num1, int num2, std::string& op) {
if (op == "+") {
return num1 + num2;
}
else if (op == "-") {
return num1 - num2;
}
else if (op == "*") {
return num1 * num2;
}
else {
return num1 / num2;
}
}
int evalR... | ALGO | 0.994802 | 5.392832 |
b437c64d-1502-4c27-ac2e-0ffed7923dd8 | aman0a/DSA | dsa6.cpp | #include <iostream>
using namespace std;
typedef struct node
{
int data;
int height;
node *left;
node *right;
} node;
node *root = NULL;
class tree
{
public:
int getheight(node *n)
{
if (n == NULL)
return 0;
return n->height;
}
int max(int a, int b)
{
... | ALGO | 0.999943 | 4.476815 |
f223ac0a-84b6-4e3e-b276-31d07a698ba1 | nixonyung/cses-solutions | src/introductory-problems/12-palindrome-reorder/main_scanning.cpp | #include <iostream>
#include <string>
#include <vector>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::string str;
{
std::cin >> str;
}
auto char_counter = std::vector<unsigned>(26, 0);
{
for (auto const &ch : str) {
char_counter[ch -... | ALGO | 0.999985 | 5.48385 |
fa48e2ae-36a6-4ac6-babe-810914949f71 | darren-moy/135 | proj2_1.cpp | /*
Author: Darren Moy
Course: CSCI-135
Instructor: Genady Maryash
Assignment: Project 2
Gradescope is my life
I will document every single line of my code
I will not shed tears while I write my code
I am currently working on trying to fix the problems I created when I tried to fix the problems
I created when I tried ... | TOOL | 0.929689 | 4.598057 |
c946ae3e-8b79-4c1f-8f87-60641efd9869 | Raghu128/AlldsaProblem | 1050-construct-binary-search-tree-from-preorder-traversal/construct-binary-search-tree-from-preorder-traversal.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.999994 | 6.208287 |
26e57784-5799-4e18-92a8-0c0250841061 | NielsHolst/UniSim | src/plugins/insecticide/riskindex.cpp | #include "riskindex.h"
#include "publish.h"
using namespace UniSim;
namespace insecticide {
PUBLISH (riskindex)
riskindex::riskindex(Identifier name, QObject *parent)
: Model(name, parent)
{
Input (double, NOAEL, 0.); //estimated lowest daily exposure level for animals (g per kg per day)
Inpu... | ALGO | 0.895347 | 5.627784 |
940f1579-d0ab-4942-9332-8fd62acc8d07 | eligere/eligere | FAHPcore-network/eigen/bench/sparse_trisolver.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL
// -I /home/gael/Coding/LinearAlgebra/CSparse/... | ALGO | 0.997626 | 4.874496 |
6ce12203-9df6-4686-af54-0b6cfb181abd | Aaryan2705/leetcode | 0443-string-compression/0443-string-compression.cpp | class Solution {
public:
int compress(vector<char>& chars) {
int n = chars.size();
int i = 0, j = 0;
while (i < n) {
int count = 1;
while (i + 1 < n && chars[i] == chars[i + 1]) {
i++;
count++;
}
... | ALGO | 0.999992 | 6.659863 |
6f2a01f5-0630-4a58-8913-fe2b9db13569 | rashmirekha99/image_editing_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
fd03ab51-d493-479c-af25-b52e2d620e3b | sonicdcer/MarioKart64Recomp | src/ui/util/hsv.cpp | #include "hsv.h"
#include <algorithm> // std::min, std::max and std::clamp
#include <math.h>
namespace recompui {
void HsvToRgb(HsvColor& hsv, RgbColor& rgb)
{
unsigned char region, remainder, p, q, t;
if (hsv.s == 0)
{
rgb.r = hsv.v;
rgb.g = hsv.v;
rgb.b = hsv.v;
retu... | ALGO | 0.98169 | 6.479494 |
7277d1e0-c720-460b-b8cd-56aeb41c28ff | myhaooo/code | D28/T3.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN=2e5+10,mod=998244353;
int n,k,a[MAXN],cnt[MAXN];ll ans=1,T=1,P=1;
inline int ksm(ll a,int b=mod-2)
{
ll ans=1;
for(;b;b>>=1,a=a*a%mod)
if(b&1) ans=ans*a%mod;
return ans;
}
int main()
{
// freopen("in.in","r",stdin);... | ALGO | 0.999968 | 4.399822 |
acfbacb1-bd9b-4f6c-a993-6b40a240f657 | Bradleydi/processing | processing/colloid/src/plot/traj_plot.cpp | #include "plot.h"
#include "io.h"
#include "miscellaneous.h"
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include "unistd.h"
// this is a virtual trajectory plot tool, since actually the
// program doesn't need the data being tracked.
//
//
// In this program, we choose binary image format
void traj_plot(c... | TOOL | 0.941724 | 4.605401 |
543a408c-2a21-471a-8542-0305ecb6eeed | Noodle-Dev/Java_HandLight_Control | libs/opencv/sources/modules/imgproc/src/resize.sse4_1.cpp | /* ////////////////////////////////////////////////////////////////////
//
// Geometrical transforms on images and matrices: rotation, zoom etc.
//
// */
#include "precomp.hpp"
#include "resize.hpp"
namespace cv
{
namespace opt_SSE4_1
{
class resizeNNInvokerSSE2 :
public ParallelLoopBody
{
public:
resizeNNI... | ALGO | 0.980035 | 7.044 |
cc8be713-47fa-4fcc-89d7-1a55fc20bb0c | metoo10987/Free-Download-Manager | Bittorrent/libtorrent/src/ed25519/sha512.cpp | /* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, <EMAIL>, http://libtom.org
*/... | ALGO | 0.999387 | 6.245595 |
7be97473-ba22-4e8c-9531-13c2e3cea213 | ZahariBakov/CPP | C++ Advanced/C++ Maps and Sets - Lab/01.CountSameValuesInArray/01.CountSameValuesInArray.cpp | #include <iostream>
#include <string>
#include <utility>
#include <map>
#include <sstream>
#include <iterator>
#include <queue>
std::queue<double> readInput() {
std::queue<double> values;
std::string input;
getline(std::cin, input);
std::istringstream istr(input);
double value;
while (istr >... | ALGO | 0.9982 | 5.39702 |
a081ad85-d735-4e96-b7ea-61e3fc08a090 | suzumiyayuhi/LeetCodeTrain | 面试经典150题/链表/K 个一组翻转链表.cpp | #include <iostream>
#include <string>
using namespace std;
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
{
public:
ListNode *reverseKGroup(List... | ALGO | 0.999996 | 5.365986 |
fd1ab32f-7659-45c6-a803-746a272c05d7 | rahul17081998/Data-Structure | code_cpp/Dynamic Programming/25_Matrix_chain_multiplication.cpp | /*
Out task is to findout minimum number of element multiplication
to multiply all the given matrix
*/
#include<bits/stdc++.h>
using namespace std;
// Method 1: Recursive solution
int mChain(int arr[], int i, int j)
{
// base case
// when you have single matrix
if(i+1 == j)
return 0;
int res =... | ALGO | 0.999996 | 4.889548 |
b1be5bd2-1259-455e-8c7d-1f44d49249ca | tejjhode/Data_Structure_Basics | BubbleSort.cpp | #include<iostream>
using namespace std;
void swap(int *a,int *b){
int temp;
temp =*a;
*a=*b;
*b=temp;
}
void Bubble_Sort(int arr[],int n){
for(int i=1;i<n;i++){
for (int j=0;j<n-i;j++){
if(arr[j]>arr[j+1])
swap(arr[j],arr[j+1]);
}
}
}
int main(){
int d... | ALGO | 0.999811 | 4.115932 |
ee51e402-3e97-4b37-978b-581a8f8bf0c3 | raincross7/code-similarity | codes/train_code/problem497/problem497_455.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e5+10;
int n,cnt,e,f[N],a[N],id[N],w[N],siz[N],res[N],head[N],link[N],to[N];
bool vis[111111];
bool cmp(int x,int y){return a[x]<a[y];}
void add(int u,int v){to[++e]=v,link[e]=head[u],head[u]=e;}
void dfs1(int u,int dep){
siz[u]=1,res[id[1... | ALGO | 0.99996 | 3.460734 |
f23e281b-3bb6-4fcb-bab9-7823bb8a1fed | nehaKhanduri124/Algorithm | Chapter- 12/FLOODFIL.CPP | #include<iostream.h>
#include<graphics.h>
#include<dos.h>
void Flood_Fill(int x,int y,int old_Color,int new_Color)
{
if(getpixel(x,y) == old_Color)
{
putpixel(x,y,new_Color);
Flood_Fill(x+1,y,old_Color,new_Color);
Flood_Fill(x,y+1,old_Color,new_Color);
Flood_Fill(x-1,y,old_Color,new_Color);
Flood_Fill(x,y-1,old_Color,... | ALGO | 0.995412 | 3.675322 |
638e3ec5-28ee-41e4-b0cd-9c7ea7cacb4d | Jikky1618/AtCoder | ABC/ABC100-149/ABC145/a.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int r;
cin >> r;
cout << r * r << endl;
return 0;
} | ALGO | 0.925613 | 3.251583 |
78d8f423-caad-4407-91a1-7f9551d22208 | ArenaCoinDev/Arena | arena-master/src/wallet/wallet_ismine.cpp | #include "wallet_ismine.h"
#include "key.h"
#include "keystore.h"
#include "script/script.h"
#include "script/standard.h"
#include "script/sign.h"
#include <boost/foreach.hpp>
using namespace std;
typedef vector<unsigned char> valtype;
unsigned int HaveKeys(const vector<valtype>& pubkeys, const CKeyStore& keystore... | ALGO | 0.99045 | 5.516846 |
c7f4b733-bb28-40e6-87fe-45b7a89d111a | jinclef/algorithm | sds/practices/11653.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
const ll NMAX = 10000000;
bool visited[NMAX+1];
vector<int> arrs; // 소수들
void eratos(int n) {
for (ll i = 2; i <= n; i++) {
if (visited[i]) continue;
arrs.push_back(i);
for (ll j = i * i; j <= n; j += i... | ALGO | 0.999981 | 4.687595 |
e0569cf1-cbf4-4239-b63b-88acd1920b0e | nini22P/fnps | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
a6e173a4-7831-43de-b2ce-914db593c905 | pronoglobe/pronokeep | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
56df33ed-4cdb-4496-a444-73115a78b907 | CuriousLearner/CompetitiveProgramming | HackerEarth/CodeMonk/Sorting/ChanduAndHisGirlFriend.cpp | #include <iostream>
using namespace std;
int partition(long int arr[], int start, int end) {
int j, i = start + 1;
int piv = arr[start];
for(j=start+1; j <= end; j++) {
if(arr[j] > piv) {
swap(arr[i], arr[j]);
i++;
}
}
swap(arr[start], arr[i-1]);
return i-1;
}
int quick_sort(long int arr[], int start... | ALGO | 0.999927 | 4.693878 |
f09cd244-fec1-46ae-96a6-4b1a3dfccd6c | MahbubHossainFaisal/Problem-Solving | Hashing/HashingWithChaining.cpp | #include<bits/stdc++.h>
using namespace std;
class Hash
{
private:
int box;
list <int> *Hashtable;
public:
Hash(int box)
{
this->box=box;
Hashtable=new list <int>[box];
}
int hashFunction(int x)
{
return x%box;
}
void insertItem(int key)
{
int i... | ALGO | 0.999715 | 4.933472 |
651ee462-73e8-4b3e-89ca-71b843107414 | jeremimucha/Cpp-Concurrency-In-Action-2nd-ed | Ch2_ManagingThreads/hardware_concurrency.cpp | #include <algorithm>
#include <iostream>
#include <thread>
#include <mutex>
#include <atomic>
#include <vector>
#include "joining_thread.hpp"
/**
* std::thread::hardware_concurrency returns a number of threads that can run truly concurrently
* on a particular system. This information might be unavailable in which ca... | TOOL | 0.889902 | 5.09353 |
8e19f790-23d4-41e1-ab85-10ca56ddb0cb | manikanta2901/ubuntu | .history/SRM/elab/OOPS/ExceptionHandling.cpp/ExceptionalOperationalChecking_20200928143619.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
double a,b,c;
char op;
cin >> a >> op >> b;
try{
if(op == '+'|| op == '-' || op == '*' || op =='/'){
}
return 0;
} | ALGO | 0.999747 | 3.142222 |
27d35b0a-a928-4c47-9e6a-0424f1e3bacf | ShinsuSenju/Practice-Questions | my-folder/0102-binary-tree-level-order-traversal/solution.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), ... | ALGO | 0.999981 | 6.202253 |
e94d643c-fae2-4765-bf43-8d560f7869cf | qazwsxedcrfv12/CPP | Sorting/Intersection-of-Array/c.cpp | //If Array is not sorted and also contains Duplicates
//Time Complexity O(n+m)
//Extra Auxilary Space O(min(n,m))
// Code
#include<bits/stdc++.h>
using namespace std;
#define f0 ios_base::sync_with_stdio(false); cin.tie(0)
int main()
{
f0;
int n,m;
cin>>n>>m;
int a[n],b[m];
for(int i=0; i... | ALGO | 0.999969 | 3.044467 |
3722976c-38dc-4ecb-8d81-838827cc1c99 | Bibolat2005/PP1 | Lab 2/K.cpp | #include <iostream> //библиотека
#include <cmath>
using namespace std;
int main(){
int n;
cin >> n;
int a;
double b;
for(int i=1;i<=n;i++){
a=sqrt(i);
b=sqrt(i);
if(a==b){
cout << i << endl;
}
}
} | ALGO | 0.999707 | 3.522222 |
d369a0bf-da0c-49d8-af8e-5280ff491985 | abhishekchandra2522k/CPPrograms | Arrays/Problems/min_max_2.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int miN(int a[], int n){
return (n==1)? a[0] : min(a[0], miN(a + 1, n-1));
}
int maX(int a[], int n){
return (n==1)? a[0] : max(a[0], maX(a+1, n-1));
}
int main(){
int a[50],size;
cout<<"Enter size of the array : ";
cin>>size;
i... | ALGO | 0.953297 | 4.056864 |
69870203-cc1f-44b6-9c94-785ce486338e | Eason20120229/Code | 2024.3.3/F.cpp | #include <cstdint>
#include <iostream>
using namespace std;
int64_t dp[1000001] = {0, 1, 1};
int64_t func(int iint)
{
if (iint <= 2)
{
return dp[iint];
}
if (dp[iint] != 0)
{
dp[iint] = func(iint - 1) + func(iint - 2);
}
return dp[iint];
}
int main()
{
int num;
ci... | ALGO | 0.999849 | 5.052895 |
a8cbc2b7-1a17-4617-a20d-52c1b128610f | Ishwarendra/CompetitiveProgramming | CodeForces/GNU C++20 (64)/1196E_Connected Component on a Chessboard/1196_E.cpp | #include "bits/stdc++.h"
#ifdef LOCAL
#include "F:\CPP\Debug\debug.h"
#else
#define print(...) 1;
#endif
using i64 = long long;
std::vector<std::array<int, 2>> dirs {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
void solve()
{
int b, w;
std::cin >> b >> w;
auto [min, max] = std::minmax(b, w);
if (max > 3 * m... | ALGO | 0.999853 | 4.428826 |
197da154-a115-4412-aeaf-7c7e9733f115 | raincross7/code-similarity | codes/train_code/problem339/problem339_404.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
const ll mod = 1000000007;
const ll INF = 9223372036854775807;
#define Sort(a) sort(a.begin(), a.end())
#define Bsort(a) sort(a.begin(), a.end(), greater<ll>())
#define Pi acos(-... | ALGO | 0.994134 | 4.018315 |
b559134b-bf88-4bca-9d33-2b64f47d83af | tareksoliman26072020/playing-with-flutter | strength_track/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.998557 | 6.76775 |
3745ba19-ff17-4efd-863a-12fbf8c8a1cc | vishal2005025/cp | A_Doremy_s_Paint_3.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
map<int,int> m;
for(int i=0;i<n;i++)
{
m[a[i]]... | ALGO | 0.999769 | 4.092183 |
06ee64e2-0683-4425-9c33-bc3cb05409b1 | DeepInMind12345/UEToonShading | Engine/Plugins/Runtime/EditableMesh/Source/EditableMesh/GeometryHitTest.cpp | #include "GeometryHitTest.h"
#include "EditableMesh.h"
#include "StaticMeshAttributes.h"
#include "MeshElement.h"
namespace GeometryTest
{
static FAutoConsoleVariable OverlayPerspectiveDistanceBias(TEXT("MeshEd.OverlayPerspectiveDistanceBias"), 0.05f, TEXT("How much to bias distance scale by in perspective views, reg... | ALGO | 0.856291 | 6.986794 |
fc9cccee-cb7e-4221-a837-d61e2474dd8b | richoux/LearningErrorFunctions | utils/random_draw.cpp | #include <iostream>
#include <random>
#include <cmath>
#include "latin.hpp"
#include "random_draw.hpp"
#include "../utils/randutils.hpp"
void random_draw( unique_ptr<Concept>& concept,
int nb_vars,
int max_value,
vector<int>& solutions,
vector<... | ALGO | 0.997933 | 5.421498 |
3cd68b18-8b7d-4d67-8b27-209a98f21b98 | checkoutb/LeetCodeCCpp | ge1200/LT1238_Circular_Permutation_in_Binary_Representation.cpp |
#include "../header/myheader.h"
class LT1238
{
public:
// n5 - start14 .. tle.
// 000 001 011 010 110 111 101 100
// 000 001 101 100 110 010 011 111
// 是不是 不可能 转换到一个数字,但是无法转换出来?
// 但是 首尾 可能不行。
// dfs?
vector<int> lt1238a(int n, int start)
{
vector<int> ans;
unordered_set<int> set2;
... | ALGO | 0.999958 | 4.700054 |
b2772ec5-8134-44f4-9284-d8740ae40e2f | alexandraback/datacollection | solutions_1483488_0/C++/csurfer/3.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
int tc;
cin>>tc;
int total = tc;
while(tc--)
{
int low,high;
cin>>low>>high;
int cnt = 0;
for(int i=low;i<=high;i++)
{
int num = i;
int dn = (int)log10((double)num);
int mul = (int)pow((double)10,dn);
num = (num%10)*mul+num/... | ALGO | 0.998722 | 4.142072 |
e87529e5-d1ea-43de-bf08-24bc5c4da132 | abhinavtiwari11/Crack-your-internship | 0049-group-anagrams/0049-group-anagrams.cpp | class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
unordered_map<string, vector<string>> mp;
for(auto x: strs){
string word = x;
sort(word.begin(), word.end());
mp[word].push_back(x);
}
vector<v... | ALGO | 0.999993 | 6.490946 |
355f0dd0-cd31-462a-9dba-28f62c1d9152 | adnan-nabil/my-CSES-submissions | 1666.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> graph(100000);
int visited[100000 + 2];
void dfs(int vertex)
{
visited[vertex] = 1;
for (auto child : graph[vertex])
{
if (visited[child] == 0)
{
dfs(child);
}
}
}
int main()
{
int n, m;
cin... | ALGO | 0.999975 | 4.691803 |
7db12d76-f8fb-453d-ac4a-0c536d4e02ac | inf0craw1/algorithm | archives/2591/20240302_000244_main.cpp | #include <bits/stdc++.h>
#define debug if constexpr (local) std::cout
#define endl '\n'
#define fi first
#define se second
#define INF 0x7fffffff
#define LINF 0x7fffffffffffffff
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
using namespace std;
#ifdef LOCAL
constexpr bool local = true;
#else
... | ALGO | 0.999894 | 4.590422 |
7c6e1d78-efcf-422d-ae90-0803492125cc | marcelozeballos/Codechef | Flooring/main.cpp | #include <cmath>
#include <iostream>
using namespace std;
int main()
{
int cases; cin >> cases;
while(cases--)
{
unsigned long long int num, mod, i = 1;
cin >> num >> mod;
unsigned long long int numaux, ans = 0;
numaux = num;
for(int j = 0; j < numaux; j++)
... | ALGO | 0.999877 | 4.409362 |
99dff999-ed24-4c2c-b9ef-496d5b974729 | Muratcansarii/JaimGame | Library/PackageCache/com.unity.ide.visualstudio@2.0.14/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.949674 | 6.969462 |
3beb4273-87f4-4763-80ac-4934d0157c53 | GuillerLT/programming-problems | solutions/codeforces/00600/b.cpp | /* Problemset 600 - Problem B
* https://codeforces.com/problemset/problem/600/B
*/
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> vi(n);
for (auto &a : vi) cin >> a;
sort(vi.begin(), vi.end());
while (--m >= 0) {
int... | ALGO | 0.999973 | 5.085695 |
0813b133-dca2-4b98-b04b-3a591592154f | nn-firc/source-engine | utils/vbsp/csg.cpp | #include "vbsp.h"
/*
tag all brushes with original contents
brushes may contain multiple contents
there will be no brush overlap after csg phase
each side has a count of the other sides it splits
the best split will be the one that minimizes the total split counts
of all remaining sides
precalc side on plane table... | ALGO | 0.993403 | 5.036877 |
6ca535c3-fb16-41bc-9c84-aa4ed3219e48 | ishandutta2007/codeforces | emthrm/normal/1263/F.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <numeric>
#include <queue... | ALGO | 0.999876 | 4.309016 |
636a6e90-77c7-4783-b576-216384e4f77c | PandeyAditya14/APS2020 | Competition/CodeChef/start2c/server.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
int main(){
fast_cin();
int t;
cin>>t;
while(t--){
double nodes , servers;
cin>>nodes>>servers;
double max_distance = floor(no... | ALGO | 0.999602 | 4.824687 |
0caccb86-51fd-4edc-b8ca-4ac96eb6115b | apoorv-codes/Leetcode-Problems | generateParentheses/gp.cpp | #include<iostream>
#include<vector>
#include<string.h>
using namespace std;
class Solution {
public:
vector<string> generateParenthesis(int n) {
}
};
int main(){
Solution s;
vector<string> nums;
nums = s.generateParenthesis(3);
for (auto &&i : nums)
{
cout<<i;
}
... | ALGO | 0.999989 | 5.600996 |
6abbd007-4124-41a9-9de8-4301db494d9c | zhangbw20/Des2Mod | symmetry_check/removeRepetition/removeRepetition3_LeftRight_test.cpp | #include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <string>
#include <vector>
#include <iostream>
using namespace std;
#define MAXN 545
char G[MAXN][MAXN][MAXN]={0};
char inSlice8[MAXN][9];
int N, Ne;
char tmpSlice[9][9];
//derivative global variables
int N_Check;
vector<ve... | ALGO | 0.999746 | 3.571147 |
ef04a288-37cc-417d-bf94-1a868b1f432d | importantboy/data-structures-in-cpp | bubbleSortOptimised.cpp | #include <iostream>
using namespace std;
void bubbleSort(int array[], int size)
{
for (int i = 0; i < size; i++)
{
int flag = 0;
for (int j = 0; j < size - 1 - i; j++)
{
if (array[j] > array[j + 1])
{
int temp;
temp = array[j];
... | ALGO | 0.999989 | 4.649818 |
ab89fbcd-109a-482c-a719-e1ebd2b50014 | noya2ruler/noya2_Library | test/math/SubsetConvolution.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/subset_convolution"
#include"../../template/template.hpp"
#include"../../math/bitwise_convolution.hpp"
#include"utility/modint.hpp"
using mint = modint998244353;
int main(){
int n; in(n);
vector<mint> a(1<<n), b(1<<n); in(a,b);
out(subset_convolution<mint,2... | ALGO | 0.999716 | 4.451614 |
c330ca79-9775-423c-b9cc-8f0a95a930ed | k7official/Kickstart | h_index.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> GetHIndexScore(vector<int> citations_per_paper) {
vector<int> h_index;
// TODO: Calculate and return h-index score for each paper.
vector<int> citations; //keep track for inserting papers one by one
for(int i=0; i<citations_per_paper.size(); i++){
c... | ALGO | 0.999844 | 5.752995 |
f4126589-783d-4758-821a-c16a35bef7b7 | tsksnhr/programming_contest | atcoder/abc177d.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
const ll INF = 1e16;
void solver(int N, int M, vector<P> &AB, int &ans){
vector<vector<int>> friends(N);
for(int i = 0; i != M; ++i){
friends.at(AB.at(i).first).push_back(AB.at... | ALGO | 0.999954 | 4.382882 |
8697397c-f444-45cd-98fd-2c2359813cff | yellowHatpro/Codes-Practice | AtCoder/Atcoder Beginner Contest 338/B.cpp | // yellowhatpro
#include <bits/stdc++.h>
using namespace std;
// Aliases
using ll = long long;
using ull = unsigned long long;
using ld = long double;
// Constants
constexpr ll INF = 2e18;
constexpr ld EPS = 1e-9;
constexpr ll MOD = 1e9 + 7;
// Macros
#define FIO ios_base::sync_with_stdio(false), cin.tie(NULL), cout... | ALGO | 0.999982 | 4.566162 |
c54636a2-4af7-4409-83e1-f1badc98f9e3 | QiMeng/CPlusPlus | MS_files/7/refret-ex.cpp | #include <iostream>
using std::cout; using std::endl;
int &get(int *arry, int index) { return arry[index]; }
int main() {
int ia[10];
for (int i = 0; i != 10; ++i)
get(ia, i) = 0;
for (int i = 0; i != 10; ++i)
get(ia, i) = i;
for (int i = 0; i != 10; ++i)
cout << ia[i] << " ";
... | ALGO | 0.973996 | 3.419921 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.